Brak opisu

edit-site.js 467KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821
  1. /******/ (function() { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ 6411:
  4. /***/ (function(module, exports) {
  5. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  6. autosize 4.0.4
  7. license: MIT
  8. http://www.jacklmoore.com/autosize
  9. */
  10. (function (global, factory) {
  11. if (true) {
  12. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  13. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  14. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  15. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  16. } else { var mod; }
  17. })(this, function (module, exports) {
  18. 'use strict';
  19. var map = typeof Map === "function" ? new Map() : function () {
  20. var keys = [];
  21. var values = [];
  22. return {
  23. has: function has(key) {
  24. return keys.indexOf(key) > -1;
  25. },
  26. get: function get(key) {
  27. return values[keys.indexOf(key)];
  28. },
  29. set: function set(key, value) {
  30. if (keys.indexOf(key) === -1) {
  31. keys.push(key);
  32. values.push(value);
  33. }
  34. },
  35. delete: function _delete(key) {
  36. var index = keys.indexOf(key);
  37. if (index > -1) {
  38. keys.splice(index, 1);
  39. values.splice(index, 1);
  40. }
  41. }
  42. };
  43. }();
  44. var createEvent = function createEvent(name) {
  45. return new Event(name, { bubbles: true });
  46. };
  47. try {
  48. new Event('test');
  49. } catch (e) {
  50. // IE does not support `new Event()`
  51. createEvent = function createEvent(name) {
  52. var evt = document.createEvent('Event');
  53. evt.initEvent(name, true, false);
  54. return evt;
  55. };
  56. }
  57. function assign(ta) {
  58. if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
  59. var heightOffset = null;
  60. var clientWidth = null;
  61. var cachedHeight = null;
  62. function init() {
  63. var style = window.getComputedStyle(ta, null);
  64. if (style.resize === 'vertical') {
  65. ta.style.resize = 'none';
  66. } else if (style.resize === 'both') {
  67. ta.style.resize = 'horizontal';
  68. }
  69. if (style.boxSizing === 'content-box') {
  70. heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
  71. } else {
  72. heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
  73. }
  74. // Fix when a textarea is not on document body and heightOffset is Not a Number
  75. if (isNaN(heightOffset)) {
  76. heightOffset = 0;
  77. }
  78. update();
  79. }
  80. function changeOverflow(value) {
  81. {
  82. // Chrome/Safari-specific fix:
  83. // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
  84. // made available by removing the scrollbar. The following forces the necessary text reflow.
  85. var width = ta.style.width;
  86. ta.style.width = '0px';
  87. // Force reflow:
  88. /* jshint ignore:start */
  89. ta.offsetWidth;
  90. /* jshint ignore:end */
  91. ta.style.width = width;
  92. }
  93. ta.style.overflowY = value;
  94. }
  95. function getParentOverflows(el) {
  96. var arr = [];
  97. while (el && el.parentNode && el.parentNode instanceof Element) {
  98. if (el.parentNode.scrollTop) {
  99. arr.push({
  100. node: el.parentNode,
  101. scrollTop: el.parentNode.scrollTop
  102. });
  103. }
  104. el = el.parentNode;
  105. }
  106. return arr;
  107. }
  108. function resize() {
  109. if (ta.scrollHeight === 0) {
  110. // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
  111. return;
  112. }
  113. var overflows = getParentOverflows(ta);
  114. var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
  115. ta.style.height = '';
  116. ta.style.height = ta.scrollHeight + heightOffset + 'px';
  117. // used to check if an update is actually necessary on window.resize
  118. clientWidth = ta.clientWidth;
  119. // prevents scroll-position jumping
  120. overflows.forEach(function (el) {
  121. el.node.scrollTop = el.scrollTop;
  122. });
  123. if (docTop) {
  124. document.documentElement.scrollTop = docTop;
  125. }
  126. }
  127. function update() {
  128. resize();
  129. var styleHeight = Math.round(parseFloat(ta.style.height));
  130. var computed = window.getComputedStyle(ta, null);
  131. // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
  132. var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
  133. // The actual height not matching the style height (set via the resize method) indicates that
  134. // the max-height has been exceeded, in which case the overflow should be allowed.
  135. if (actualHeight < styleHeight) {
  136. if (computed.overflowY === 'hidden') {
  137. changeOverflow('scroll');
  138. resize();
  139. actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
  140. }
  141. } else {
  142. // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
  143. if (computed.overflowY !== 'hidden') {
  144. changeOverflow('hidden');
  145. resize();
  146. actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
  147. }
  148. }
  149. if (cachedHeight !== actualHeight) {
  150. cachedHeight = actualHeight;
  151. var evt = createEvent('autosize:resized');
  152. try {
  153. ta.dispatchEvent(evt);
  154. } catch (err) {
  155. // Firefox will throw an error on dispatchEvent for a detached element
  156. // https://bugzilla.mozilla.org/show_bug.cgi?id=889376
  157. }
  158. }
  159. }
  160. var pageResize = function pageResize() {
  161. if (ta.clientWidth !== clientWidth) {
  162. update();
  163. }
  164. };
  165. var destroy = function (style) {
  166. window.removeEventListener('resize', pageResize, false);
  167. ta.removeEventListener('input', update, false);
  168. ta.removeEventListener('keyup', update, false);
  169. ta.removeEventListener('autosize:destroy', destroy, false);
  170. ta.removeEventListener('autosize:update', update, false);
  171. Object.keys(style).forEach(function (key) {
  172. ta.style[key] = style[key];
  173. });
  174. map.delete(ta);
  175. }.bind(ta, {
  176. height: ta.style.height,
  177. resize: ta.style.resize,
  178. overflowY: ta.style.overflowY,
  179. overflowX: ta.style.overflowX,
  180. wordWrap: ta.style.wordWrap
  181. });
  182. ta.addEventListener('autosize:destroy', destroy, false);
  183. // IE9 does not fire onpropertychange or oninput for deletions,
  184. // so binding to onkeyup to catch most of those events.
  185. // There is no way that I know of to detect something like 'cut' in IE9.
  186. if ('onpropertychange' in ta && 'oninput' in ta) {
  187. ta.addEventListener('keyup', update, false);
  188. }
  189. window.addEventListener('resize', pageResize, false);
  190. ta.addEventListener('input', update, false);
  191. ta.addEventListener('autosize:update', update, false);
  192. ta.style.overflowX = 'hidden';
  193. ta.style.wordWrap = 'break-word';
  194. map.set(ta, {
  195. destroy: destroy,
  196. update: update
  197. });
  198. init();
  199. }
  200. function destroy(ta) {
  201. var methods = map.get(ta);
  202. if (methods) {
  203. methods.destroy();
  204. }
  205. }
  206. function update(ta) {
  207. var methods = map.get(ta);
  208. if (methods) {
  209. methods.update();
  210. }
  211. }
  212. var autosize = null;
  213. // Do nothing in Node.js environment and IE8 (or lower)
  214. if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
  215. autosize = function autosize(el) {
  216. return el;
  217. };
  218. autosize.destroy = function (el) {
  219. return el;
  220. };
  221. autosize.update = function (el) {
  222. return el;
  223. };
  224. } else {
  225. autosize = function autosize(el, options) {
  226. if (el) {
  227. Array.prototype.forEach.call(el.length ? el : [el], function (x) {
  228. return assign(x, options);
  229. });
  230. }
  231. return el;
  232. };
  233. autosize.destroy = function (el) {
  234. if (el) {
  235. Array.prototype.forEach.call(el.length ? el : [el], destroy);
  236. }
  237. return el;
  238. };
  239. autosize.update = function (el) {
  240. if (el) {
  241. Array.prototype.forEach.call(el.length ? el : [el], update);
  242. }
  243. return el;
  244. };
  245. }
  246. exports.default = autosize;
  247. module.exports = exports['default'];
  248. });
  249. /***/ }),
  250. /***/ 4403:
  251. /***/ (function(module, exports) {
  252. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  253. Copyright (c) 2018 Jed Watson.
  254. Licensed under the MIT License (MIT), see
  255. http://jedwatson.github.io/classnames
  256. */
  257. /* global define */
  258. (function () {
  259. 'use strict';
  260. var hasOwn = {}.hasOwnProperty;
  261. function classNames() {
  262. var classes = [];
  263. for (var i = 0; i < arguments.length; i++) {
  264. var arg = arguments[i];
  265. if (!arg) continue;
  266. var argType = typeof arg;
  267. if (argType === 'string' || argType === 'number') {
  268. classes.push(arg);
  269. } else if (Array.isArray(arg)) {
  270. if (arg.length) {
  271. var inner = classNames.apply(null, arg);
  272. if (inner) {
  273. classes.push(inner);
  274. }
  275. }
  276. } else if (argType === 'object') {
  277. if (arg.toString === Object.prototype.toString) {
  278. for (var key in arg) {
  279. if (hasOwn.call(arg, key) && arg[key]) {
  280. classes.push(key);
  281. }
  282. }
  283. } else {
  284. classes.push(arg.toString());
  285. }
  286. }
  287. }
  288. return classes.join(' ');
  289. }
  290. if ( true && module.exports) {
  291. classNames.default = classNames;
  292. module.exports = classNames;
  293. } else if (true) {
  294. // register as 'classnames', consistent with npm package name
  295. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  296. return classNames;
  297. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  298. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  299. } else {}
  300. }());
  301. /***/ }),
  302. /***/ 4827:
  303. /***/ (function(module) {
  304. // This code has been refactored for 140 bytes
  305. // You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js
  306. var computedStyle = function (el, prop, getComputedStyle) {
  307. getComputedStyle = window.getComputedStyle;
  308. // In one fell swoop
  309. return (
  310. // If we have getComputedStyle
  311. getComputedStyle ?
  312. // Query it
  313. // TODO: From CSS-Query notes, we might need (node, null) for FF
  314. getComputedStyle(el) :
  315. // Otherwise, we are in IE and use currentStyle
  316. el.currentStyle
  317. )[
  318. // Switch to camelCase for CSSOM
  319. // DEV: Grabbed from jQuery
  320. // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194
  321. // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597
  322. prop.replace(/-(\w)/gi, function (word, letter) {
  323. return letter.toUpperCase();
  324. })
  325. ];
  326. };
  327. module.exports = computedStyle;
  328. /***/ }),
  329. /***/ 8981:
  330. /***/ (function(module, exports) {
  331. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;//download.js v4.2, by dandavis; 2008-2016. [MIT] see http://danml.com/download.html for tests/usage
  332. // v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime
  333. // v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs
  334. // v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support. 3.1 improved safari handling.
  335. // v4 adds AMD/UMD, commonJS, and plain browser support
  336. // v4.1 adds url download capability via solo URL argument (same domain/CORS only)
  337. // v4.2 adds semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors
  338. // https://github.com/rndme/download
  339. (function (root, factory) {
  340. if (true) {
  341. // AMD. Register as an anonymous module.
  342. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  343. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  344. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  345. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  346. } else {}
  347. }(this, function () {
  348. return function download(data, strFileName, strMimeType) {
  349. var self = window, // this script is only for browsers anyway...
  350. defaultMime = "application/octet-stream", // this default mime also triggers iframe downloads
  351. mimeType = strMimeType || defaultMime,
  352. payload = data,
  353. url = !strFileName && !strMimeType && payload,
  354. anchor = document.createElement("a"),
  355. toString = function(a){return String(a);},
  356. myBlob = (self.Blob || self.MozBlob || self.WebKitBlob || toString),
  357. fileName = strFileName || "download",
  358. blob,
  359. reader;
  360. myBlob= myBlob.call ? myBlob.bind(self) : Blob ;
  361. if(String(this)==="true"){ //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback
  362. payload=[payload, mimeType];
  363. mimeType=payload[0];
  364. payload=payload[1];
  365. }
  366. if(url && url.length< 2048){ // if no filename and no mime, assume a url was passed as the only argument
  367. fileName = url.split("/").pop().split("?")[0];
  368. anchor.href = url; // assign href prop to temp anchor
  369. if(anchor.href.indexOf(url) !== -1){ // if the browser determines that it's a potentially valid url path:
  370. var ajax=new XMLHttpRequest();
  371. ajax.open( "GET", url, true);
  372. ajax.responseType = 'blob';
  373. ajax.onload= function(e){
  374. download(e.target.response, fileName, defaultMime);
  375. };
  376. setTimeout(function(){ ajax.send();}, 0); // allows setting custom ajax headers using the return:
  377. return ajax;
  378. } // end if valid url?
  379. } // end if url?
  380. //go ahead and download dataURLs right away
  381. if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(payload)){
  382. if(payload.length > (1024*1024*1.999) && myBlob !== toString ){
  383. payload=dataUrlToBlob(payload);
  384. mimeType=payload.type || defaultMime;
  385. }else{
  386. return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs:
  387. navigator.msSaveBlob(dataUrlToBlob(payload), fileName) :
  388. saver(payload) ; // everyone else can save dataURLs un-processed
  389. }
  390. }else{//not data url, is it a string with special needs?
  391. if(/([\x80-\xff])/.test(payload)){
  392. var i=0, tempUiArr= new Uint8Array(payload.length), mx=tempUiArr.length;
  393. for(i;i<mx;++i) tempUiArr[i]= payload.charCodeAt(i);
  394. payload=new myBlob([tempUiArr], {type: mimeType});
  395. }
  396. }
  397. blob = payload instanceof myBlob ?
  398. payload :
  399. new myBlob([payload], {type: mimeType}) ;
  400. function dataUrlToBlob(strUrl) {
  401. var parts= strUrl.split(/[:;,]/),
  402. type= parts[1],
  403. decoder= parts[2] == "base64" ? atob : decodeURIComponent,
  404. binData= decoder( parts.pop() ),
  405. mx= binData.length,
  406. i= 0,
  407. uiArr= new Uint8Array(mx);
  408. for(i;i<mx;++i) uiArr[i]= binData.charCodeAt(i);
  409. return new myBlob([uiArr], {type: type});
  410. }
  411. function saver(url, winMode){
  412. if ('download' in anchor) { //html5 A[download]
  413. anchor.href = url;
  414. anchor.setAttribute("download", fileName);
  415. anchor.className = "download-js-link";
  416. anchor.innerHTML = "downloading...";
  417. anchor.style.display = "none";
  418. document.body.appendChild(anchor);
  419. setTimeout(function() {
  420. anchor.click();
  421. document.body.removeChild(anchor);
  422. if(winMode===true){setTimeout(function(){ self.URL.revokeObjectURL(anchor.href);}, 250 );}
  423. }, 66);
  424. return true;
  425. }
  426. // handle non-a[download] safari as best we can:
  427. if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent)) {
  428. if(/^data:/.test(url)) url="data:"+url.replace(/^data:([\w\/\-\+]+)/, defaultMime);
  429. if(!window.open(url)){ // popup blocked, offer direct download:
  430. if(confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")){ location.href=url; }
  431. }
  432. return true;
  433. }
  434. //do iframe dataURL download (old ch+FF):
  435. var f = document.createElement("iframe");
  436. document.body.appendChild(f);
  437. if(!winMode && /^data:/.test(url)){ // force a mime that will download:
  438. url="data:"+url.replace(/^data:([\w\/\-\+]+)/, defaultMime);
  439. }
  440. f.src=url;
  441. setTimeout(function(){ document.body.removeChild(f); }, 333);
  442. }//end saver
  443. if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
  444. return navigator.msSaveBlob(blob, fileName);
  445. }
  446. if(self.URL){ // simple fast and modern way using Blob and URL:
  447. saver(self.URL.createObjectURL(blob), true);
  448. }else{
  449. // handle non-Blob()+non-URL browsers:
  450. if(typeof blob === "string" || blob.constructor===toString ){
  451. try{
  452. return saver( "data:" + mimeType + ";base64," + self.btoa(blob) );
  453. }catch(y){
  454. return saver( "data:" + mimeType + "," + encodeURIComponent(blob) );
  455. }
  456. }
  457. // Blob but not URL support:
  458. reader=new FileReader();
  459. reader.onload=function(e){
  460. saver(this.result);
  461. };
  462. reader.readAsDataURL(blob);
  463. }
  464. return true;
  465. }; /* end download() */
  466. }));
  467. /***/ }),
  468. /***/ 9894:
  469. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  470. // Load in dependencies
  471. var computedStyle = __webpack_require__(4827);
  472. /**
  473. * Calculate the `line-height` of a given node
  474. * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM.
  475. * @returns {Number} `line-height` of the element in pixels
  476. */
  477. function lineHeight(node) {
  478. // Grab the line-height via style
  479. var lnHeightStr = computedStyle(node, 'line-height');
  480. var lnHeight = parseFloat(lnHeightStr, 10);
  481. // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em')
  482. if (lnHeightStr === lnHeight + '') {
  483. // Save the old lineHeight style and update the em unit to the element
  484. var _lnHeightStyle = node.style.lineHeight;
  485. node.style.lineHeight = lnHeightStr + 'em';
  486. // Calculate the em based height
  487. lnHeightStr = computedStyle(node, 'line-height');
  488. lnHeight = parseFloat(lnHeightStr, 10);
  489. // Revert the lineHeight style
  490. if (_lnHeightStyle) {
  491. node.style.lineHeight = _lnHeightStyle;
  492. } else {
  493. delete node.style.lineHeight;
  494. }
  495. }
  496. // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt)
  497. // DEV: `em` units are converted to `pt` in IE6
  498. // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length
  499. if (lnHeightStr.indexOf('pt') !== -1) {
  500. lnHeight *= 4;
  501. lnHeight /= 3;
  502. // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm)
  503. } else if (lnHeightStr.indexOf('mm') !== -1) {
  504. lnHeight *= 96;
  505. lnHeight /= 25.4;
  506. // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm)
  507. } else if (lnHeightStr.indexOf('cm') !== -1) {
  508. lnHeight *= 96;
  509. lnHeight /= 2.54;
  510. // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in)
  511. } else if (lnHeightStr.indexOf('in') !== -1) {
  512. lnHeight *= 96;
  513. // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc)
  514. } else if (lnHeightStr.indexOf('pc') !== -1) {
  515. lnHeight *= 16;
  516. }
  517. // Continue our computation
  518. lnHeight = Math.round(lnHeight);
  519. // If the line-height is "normal", calculate by font-size
  520. if (lnHeightStr === 'normal') {
  521. // Create a temporary node
  522. var nodeName = node.nodeName;
  523. var _node = document.createElement(nodeName);
  524. _node.innerHTML = '&nbsp;';
  525. // If we have a text area, reset it to only 1 row
  526. // https://github.com/twolfson/line-height/issues/4
  527. if (nodeName.toUpperCase() === 'TEXTAREA') {
  528. _node.setAttribute('rows', '1');
  529. }
  530. // Set the font-size of the element
  531. var fontSizeStr = computedStyle(node, 'font-size');
  532. _node.style.fontSize = fontSizeStr;
  533. // Remove default padding/border which can affect offset height
  534. // https://github.com/twolfson/line-height/issues/4
  535. // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight
  536. _node.style.padding = '0px';
  537. _node.style.border = '0px';
  538. // Append it to the body
  539. var body = document.body;
  540. body.appendChild(_node);
  541. // Assume the line height of the element is the height
  542. var height = _node.offsetHeight;
  543. lnHeight = height;
  544. // Remove our child from the DOM
  545. body.removeChild(_node);
  546. }
  547. // Return the calculated height
  548. return lnHeight;
  549. }
  550. // Export lineHeight
  551. module.exports = lineHeight;
  552. /***/ }),
  553. /***/ 5372:
  554. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  555. "use strict";
  556. /**
  557. * Copyright (c) 2013-present, Facebook, Inc.
  558. *
  559. * This source code is licensed under the MIT license found in the
  560. * LICENSE file in the root directory of this source tree.
  561. */
  562. var ReactPropTypesSecret = __webpack_require__(9567);
  563. function emptyFunction() {}
  564. function emptyFunctionWithReset() {}
  565. emptyFunctionWithReset.resetWarningCache = emptyFunction;
  566. module.exports = function() {
  567. function shim(props, propName, componentName, location, propFullName, secret) {
  568. if (secret === ReactPropTypesSecret) {
  569. // It is still safe when called from React.
  570. return;
  571. }
  572. var err = new Error(
  573. 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
  574. 'Use PropTypes.checkPropTypes() to call them. ' +
  575. 'Read more at http://fb.me/use-check-prop-types'
  576. );
  577. err.name = 'Invariant Violation';
  578. throw err;
  579. };
  580. shim.isRequired = shim;
  581. function getShim() {
  582. return shim;
  583. };
  584. // Important!
  585. // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
  586. var ReactPropTypes = {
  587. array: shim,
  588. bigint: shim,
  589. bool: shim,
  590. func: shim,
  591. number: shim,
  592. object: shim,
  593. string: shim,
  594. symbol: shim,
  595. any: shim,
  596. arrayOf: getShim,
  597. element: shim,
  598. elementType: shim,
  599. instanceOf: getShim,
  600. node: shim,
  601. objectOf: getShim,
  602. oneOf: getShim,
  603. oneOfType: getShim,
  604. shape: getShim,
  605. exact: getShim,
  606. checkPropTypes: emptyFunctionWithReset,
  607. resetWarningCache: emptyFunction
  608. };
  609. ReactPropTypes.PropTypes = ReactPropTypes;
  610. return ReactPropTypes;
  611. };
  612. /***/ }),
  613. /***/ 2652:
  614. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  615. /**
  616. * Copyright (c) 2013-present, Facebook, Inc.
  617. *
  618. * This source code is licensed under the MIT license found in the
  619. * LICENSE file in the root directory of this source tree.
  620. */
  621. if (false) { var throwOnDirectAccess, ReactIs; } else {
  622. // By explicitly using `prop-types` you are opting into new production behavior.
  623. // http://fb.me/prop-types-in-prod
  624. module.exports = __webpack_require__(5372)();
  625. }
  626. /***/ }),
  627. /***/ 9567:
  628. /***/ (function(module) {
  629. "use strict";
  630. /**
  631. * Copyright (c) 2013-present, Facebook, Inc.
  632. *
  633. * This source code is licensed under the MIT license found in the
  634. * LICENSE file in the root directory of this source tree.
  635. */
  636. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  637. module.exports = ReactPropTypesSecret;
  638. /***/ }),
  639. /***/ 5438:
  640. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  641. "use strict";
  642. var __extends = (this && this.__extends) || (function () {
  643. var extendStatics = Object.setPrototypeOf ||
  644. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  645. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  646. return function (d, b) {
  647. extendStatics(d, b);
  648. function __() { this.constructor = d; }
  649. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  650. };
  651. })();
  652. var __assign = (this && this.__assign) || Object.assign || function(t) {
  653. for (var s, i = 1, n = arguments.length; i < n; i++) {
  654. s = arguments[i];
  655. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  656. t[p] = s[p];
  657. }
  658. return t;
  659. };
  660. var __rest = (this && this.__rest) || function (s, e) {
  661. var t = {};
  662. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  663. t[p] = s[p];
  664. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  665. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  666. t[p[i]] = s[p[i]];
  667. return t;
  668. };
  669. exports.__esModule = true;
  670. var React = __webpack_require__(9196);
  671. var PropTypes = __webpack_require__(2652);
  672. var autosize = __webpack_require__(6411);
  673. var _getLineHeight = __webpack_require__(9894);
  674. var getLineHeight = _getLineHeight;
  675. var RESIZED = "autosize:resized";
  676. /**
  677. * A light replacement for built-in textarea component
  678. * which automaticaly adjusts its height to match the content
  679. */
  680. var TextareaAutosizeClass = /** @class */ (function (_super) {
  681. __extends(TextareaAutosizeClass, _super);
  682. function TextareaAutosizeClass() {
  683. var _this = _super !== null && _super.apply(this, arguments) || this;
  684. _this.state = {
  685. lineHeight: null
  686. };
  687. _this.textarea = null;
  688. _this.onResize = function (e) {
  689. if (_this.props.onResize) {
  690. _this.props.onResize(e);
  691. }
  692. };
  693. _this.updateLineHeight = function () {
  694. if (_this.textarea) {
  695. _this.setState({
  696. lineHeight: getLineHeight(_this.textarea)
  697. });
  698. }
  699. };
  700. _this.onChange = function (e) {
  701. var onChange = _this.props.onChange;
  702. _this.currentValue = e.currentTarget.value;
  703. onChange && onChange(e);
  704. };
  705. return _this;
  706. }
  707. TextareaAutosizeClass.prototype.componentDidMount = function () {
  708. var _this = this;
  709. var _a = this.props, maxRows = _a.maxRows, async = _a.async;
  710. if (typeof maxRows === "number") {
  711. this.updateLineHeight();
  712. }
  713. if (typeof maxRows === "number" || async) {
  714. /*
  715. the defer is needed to:
  716. - force "autosize" to activate the scrollbar when this.props.maxRows is passed
  717. - support StyledComponents (see #71)
  718. */
  719. setTimeout(function () { return _this.textarea && autosize(_this.textarea); });
  720. }
  721. else {
  722. this.textarea && autosize(this.textarea);
  723. }
  724. if (this.textarea) {
  725. this.textarea.addEventListener(RESIZED, this.onResize);
  726. }
  727. };
  728. TextareaAutosizeClass.prototype.componentWillUnmount = function () {
  729. if (this.textarea) {
  730. this.textarea.removeEventListener(RESIZED, this.onResize);
  731. autosize.destroy(this.textarea);
  732. }
  733. };
  734. TextareaAutosizeClass.prototype.render = function () {
  735. var _this = this;
  736. var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight;
  737. var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null;
  738. return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) {
  739. _this.textarea = element;
  740. if (typeof _this.props.innerRef === 'function') {
  741. _this.props.innerRef(element);
  742. }
  743. else if (_this.props.innerRef) {
  744. _this.props.innerRef.current = element;
  745. }
  746. } }), children));
  747. };
  748. TextareaAutosizeClass.prototype.componentDidUpdate = function () {
  749. this.textarea && autosize.update(this.textarea);
  750. };
  751. TextareaAutosizeClass.defaultProps = {
  752. rows: 1,
  753. async: false
  754. };
  755. TextareaAutosizeClass.propTypes = {
  756. rows: PropTypes.number,
  757. maxRows: PropTypes.number,
  758. onResize: PropTypes.func,
  759. innerRef: PropTypes.any,
  760. async: PropTypes.bool
  761. };
  762. return TextareaAutosizeClass;
  763. }(React.Component));
  764. exports.TextareaAutosize = React.forwardRef(function (props, ref) {
  765. return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref }));
  766. });
  767. /***/ }),
  768. /***/ 773:
  769. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  770. "use strict";
  771. var __webpack_unused_export__;
  772. __webpack_unused_export__ = true;
  773. var TextareaAutosize_1 = __webpack_require__(5438);
  774. exports.Z = TextareaAutosize_1.TextareaAutosize;
  775. /***/ }),
  776. /***/ 9196:
  777. /***/ (function(module) {
  778. "use strict";
  779. module.exports = window["React"];
  780. /***/ })
  781. /******/ });
  782. /************************************************************************/
  783. /******/ // The module cache
  784. /******/ var __webpack_module_cache__ = {};
  785. /******/
  786. /******/ // The require function
  787. /******/ function __webpack_require__(moduleId) {
  788. /******/ // Check if module is in cache
  789. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  790. /******/ if (cachedModule !== undefined) {
  791. /******/ return cachedModule.exports;
  792. /******/ }
  793. /******/ // Create a new module (and put it into the cache)
  794. /******/ var module = __webpack_module_cache__[moduleId] = {
  795. /******/ // no module.id needed
  796. /******/ // no module.loaded needed
  797. /******/ exports: {}
  798. /******/ };
  799. /******/
  800. /******/ // Execute the module function
  801. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  802. /******/
  803. /******/ // Return the exports of the module
  804. /******/ return module.exports;
  805. /******/ }
  806. /******/
  807. /************************************************************************/
  808. /******/ /* webpack/runtime/compat get default export */
  809. /******/ !function() {
  810. /******/ // getDefaultExport function for compatibility with non-harmony modules
  811. /******/ __webpack_require__.n = function(module) {
  812. /******/ var getter = module && module.__esModule ?
  813. /******/ function() { return module['default']; } :
  814. /******/ function() { return module; };
  815. /******/ __webpack_require__.d(getter, { a: getter });
  816. /******/ return getter;
  817. /******/ };
  818. /******/ }();
  819. /******/
  820. /******/ /* webpack/runtime/define property getters */
  821. /******/ !function() {
  822. /******/ // define getter functions for harmony exports
  823. /******/ __webpack_require__.d = function(exports, definition) {
  824. /******/ for(var key in definition) {
  825. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  826. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  827. /******/ }
  828. /******/ }
  829. /******/ };
  830. /******/ }();
  831. /******/
  832. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  833. /******/ !function() {
  834. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  835. /******/ }();
  836. /******/
  837. /******/ /* webpack/runtime/make namespace object */
  838. /******/ !function() {
  839. /******/ // define __esModule on exports
  840. /******/ __webpack_require__.r = function(exports) {
  841. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  842. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  843. /******/ }
  844. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  845. /******/ };
  846. /******/ }();
  847. /******/
  848. /************************************************************************/
  849. var __webpack_exports__ = {};
  850. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  851. !function() {
  852. "use strict";
  853. // ESM COMPAT FLAG
  854. __webpack_require__.r(__webpack_exports__);
  855. // EXPORTS
  856. __webpack_require__.d(__webpack_exports__, {
  857. "PluginMoreMenuItem": function() { return /* reexport */ plugin_more_menu_item; },
  858. "PluginSidebar": function() { return /* reexport */ PluginSidebarEditSite; },
  859. "PluginSidebarMoreMenuItem": function() { return /* reexport */ PluginSidebarMoreMenuItem; },
  860. "__experimentalMainDashboardButton": function() { return /* reexport */ main_dashboard_button; },
  861. "__experimentalNavigationToggle": function() { return /* reexport */ navigation_toggle; },
  862. "initializeEditor": function() { return /* binding */ initializeEditor; },
  863. "reinitializeEditor": function() { return /* binding */ reinitializeEditor; }
  864. });
  865. // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
  866. var actions_namespaceObject = {};
  867. __webpack_require__.r(actions_namespaceObject);
  868. __webpack_require__.d(actions_namespaceObject, {
  869. "disableComplementaryArea": function() { return disableComplementaryArea; },
  870. "enableComplementaryArea": function() { return enableComplementaryArea; },
  871. "pinItem": function() { return pinItem; },
  872. "setFeatureDefaults": function() { return setFeatureDefaults; },
  873. "setFeatureValue": function() { return setFeatureValue; },
  874. "toggleFeature": function() { return toggleFeature; },
  875. "unpinItem": function() { return unpinItem; }
  876. });
  877. // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js
  878. var selectors_namespaceObject = {};
  879. __webpack_require__.r(selectors_namespaceObject);
  880. __webpack_require__.d(selectors_namespaceObject, {
  881. "getActiveComplementaryArea": function() { return getActiveComplementaryArea; },
  882. "isFeatureActive": function() { return isFeatureActive; },
  883. "isItemPinned": function() { return isItemPinned; }
  884. });
  885. // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/actions.js
  886. var store_actions_namespaceObject = {};
  887. __webpack_require__.r(store_actions_namespaceObject);
  888. __webpack_require__.d(store_actions_namespaceObject, {
  889. "__experimentalSetPreviewDeviceType": function() { return __experimentalSetPreviewDeviceType; },
  890. "addTemplate": function() { return addTemplate; },
  891. "closeGeneralSidebar": function() { return closeGeneralSidebar; },
  892. "openGeneralSidebar": function() { return openGeneralSidebar; },
  893. "openNavigationPanelToMenu": function() { return openNavigationPanelToMenu; },
  894. "removeTemplate": function() { return removeTemplate; },
  895. "revertTemplate": function() { return revertTemplate; },
  896. "setHomeTemplateId": function() { return setHomeTemplateId; },
  897. "setIsInserterOpened": function() { return setIsInserterOpened; },
  898. "setIsListViewOpened": function() { return setIsListViewOpened; },
  899. "setIsNavigationPanelOpened": function() { return setIsNavigationPanelOpened; },
  900. "setNavigationPanelActiveMenu": function() { return setNavigationPanelActiveMenu; },
  901. "setPage": function() { return setPage; },
  902. "setTemplate": function() { return setTemplate; },
  903. "setTemplatePart": function() { return setTemplatePart; },
  904. "switchEditorMode": function() { return switchEditorMode; },
  905. "toggleFeature": function() { return actions_toggleFeature; },
  906. "updateSettings": function() { return updateSettings; }
  907. });
  908. // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/selectors.js
  909. var store_selectors_namespaceObject = {};
  910. __webpack_require__.r(store_selectors_namespaceObject);
  911. __webpack_require__.d(store_selectors_namespaceObject, {
  912. "__experimentalGetInsertionPoint": function() { return __experimentalGetInsertionPoint; },
  913. "__experimentalGetPreviewDeviceType": function() { return __experimentalGetPreviewDeviceType; },
  914. "__unstableGetPreference": function() { return __unstableGetPreference; },
  915. "getCanUserCreateMedia": function() { return getCanUserCreateMedia; },
  916. "getCurrentTemplateNavigationPanelSubMenu": function() { return getCurrentTemplateNavigationPanelSubMenu; },
  917. "getCurrentTemplateTemplateParts": function() { return getCurrentTemplateTemplateParts; },
  918. "getEditedPostId": function() { return getEditedPostId; },
  919. "getEditedPostType": function() { return getEditedPostType; },
  920. "getEditorMode": function() { return getEditorMode; },
  921. "getHomeTemplateId": function() { return getHomeTemplateId; },
  922. "getNavigationPanelActiveMenu": function() { return getNavigationPanelActiveMenu; },
  923. "getPage": function() { return getPage; },
  924. "getReusableBlocks": function() { return getReusableBlocks; },
  925. "getSettings": function() { return getSettings; },
  926. "isFeatureActive": function() { return selectors_isFeatureActive; },
  927. "isInserterOpened": function() { return isInserterOpened; },
  928. "isListViewOpened": function() { return isListViewOpened; },
  929. "isNavigationOpened": function() { return isNavigationOpened; }
  930. });
  931. ;// CONCATENATED MODULE: external ["wp","element"]
  932. var external_wp_element_namespaceObject = window["wp"]["element"];
  933. ;// CONCATENATED MODULE: external ["wp","blocks"]
  934. var external_wp_blocks_namespaceObject = window["wp"]["blocks"];
  935. ;// CONCATENATED MODULE: external ["wp","blockLibrary"]
  936. var external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
  937. ;// CONCATENATED MODULE: external ["wp","data"]
  938. var external_wp_data_namespaceObject = window["wp"]["data"];
  939. ;// CONCATENATED MODULE: external ["wp","coreData"]
  940. var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
  941. ;// CONCATENATED MODULE: external ["wp","editor"]
  942. var external_wp_editor_namespaceObject = window["wp"]["editor"];
  943. ;// CONCATENATED MODULE: external ["wp","preferences"]
  944. var external_wp_preferences_namespaceObject = window["wp"]["preferences"];
  945. ;// CONCATENATED MODULE: external ["wp","i18n"]
  946. var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
  947. ;// CONCATENATED MODULE: external ["wp","viewport"]
  948. var external_wp_viewport_namespaceObject = window["wp"]["viewport"];
  949. ;// CONCATENATED MODULE: external ["wp","url"]
  950. var external_wp_url_namespaceObject = window["wp"]["url"];
  951. ;// CONCATENATED MODULE: external ["wp","hooks"]
  952. var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
  953. ;// CONCATENATED MODULE: external ["wp","mediaUtils"]
  954. var external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
  955. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/components.js
  956. /**
  957. * WordPress dependencies
  958. */
  959. (0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/edit-site/components/media-upload', () => external_wp_mediaUtils_namespaceObject.MediaUpload);
  960. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/index.js
  961. /**
  962. * Internal dependencies
  963. */
  964. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/constants.js
  965. /**
  966. * The identifier for the data store.
  967. *
  968. * @type {string}
  969. */
  970. const STORE_NAME = 'core/edit-site';
  971. const TEMPLATE_PART_AREA_HEADER = 'header';
  972. const TEMPLATE_PART_AREA_FOOTER = 'footer';
  973. const TEMPLATE_PART_AREA_SIDEBAR = 'sidebar';
  974. const TEMPLATE_PART_AREA_GENERAL = 'uncategorized';
  975. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-sidebar/navigation-panel/constants.js
  976. /**
  977. * WordPress dependencies
  978. */
  979. /**
  980. * Internal dependencies
  981. */
  982. const TEMPLATES_PRIMARY = ['index', 'singular', 'archive', 'single', 'page', 'home', '404', 'search'];
  983. const TEMPLATES_SECONDARY = ['author', 'category', 'taxonomy', 'date', 'tag', 'attachment', 'single-post', 'front-page'];
  984. const TEMPLATES_TOP_LEVEL = [...TEMPLATES_PRIMARY, ...TEMPLATES_SECONDARY];
  985. const TEMPLATES_GENERAL = ['page-home'];
  986. const TEMPLATES_POSTS_PREFIXES = ['post-', 'author-', 'single-post-', 'tag-'];
  987. const TEMPLATES_PAGES_PREFIXES = ['page-'];
  988. const TEMPLATE_OVERRIDES = {
  989. singular: ['single', 'page'],
  990. index: ['archive', '404', 'search', 'singular', 'home'],
  991. home: ['front-page']
  992. };
  993. const MENU_ROOT = 'root';
  994. const MENU_TEMPLATE_PARTS = 'template-parts';
  995. const MENU_TEMPLATES = 'templates';
  996. const MENU_TEMPLATES_GENERAL = 'templates-general';
  997. const MENU_TEMPLATES_PAGES = 'templates-pages';
  998. const MENU_TEMPLATES_POSTS = 'templates-posts';
  999. const MENU_TEMPLATES_UNUSED = 'templates-unused';
  1000. const MENU_TEMPLATE_PARTS_HEADERS = 'template-parts-headers';
  1001. const MENU_TEMPLATE_PARTS_FOOTERS = 'template-parts-footers';
  1002. const MENU_TEMPLATE_PARTS_SIDEBARS = 'template-parts-sidebars';
  1003. const MENU_TEMPLATE_PARTS_GENERAL = 'template-parts-general';
  1004. const TEMPLATE_PARTS_SUB_MENUS = [{
  1005. area: TEMPLATE_PART_AREA_HEADER,
  1006. menu: MENU_TEMPLATE_PARTS_HEADERS,
  1007. title: (0,external_wp_i18n_namespaceObject.__)('headers')
  1008. }, {
  1009. area: TEMPLATE_PART_AREA_FOOTER,
  1010. menu: MENU_TEMPLATE_PARTS_FOOTERS,
  1011. title: (0,external_wp_i18n_namespaceObject.__)('footers')
  1012. }, {
  1013. area: TEMPLATE_PART_AREA_SIDEBAR,
  1014. menu: MENU_TEMPLATE_PARTS_SIDEBARS,
  1015. title: (0,external_wp_i18n_namespaceObject.__)('sidebars')
  1016. }, {
  1017. area: TEMPLATE_PART_AREA_GENERAL,
  1018. menu: MENU_TEMPLATE_PARTS_GENERAL,
  1019. title: (0,external_wp_i18n_namespaceObject.__)('general')
  1020. }];
  1021. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/reducer.js
  1022. /**
  1023. * WordPress dependencies
  1024. */
  1025. /**
  1026. * Internal dependencies
  1027. */
  1028. /**
  1029. * Reducer returning the editing canvas device type.
  1030. *
  1031. * @param {Object} state Current state.
  1032. * @param {Object} action Dispatched action.
  1033. *
  1034. * @return {Object} Updated state.
  1035. */
  1036. function deviceType() {
  1037. let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Desktop';
  1038. let action = arguments.length > 1 ? arguments[1] : undefined;
  1039. switch (action.type) {
  1040. case 'SET_PREVIEW_DEVICE_TYPE':
  1041. return action.deviceType;
  1042. }
  1043. return state;
  1044. }
  1045. /**
  1046. * Reducer returning the settings.
  1047. *
  1048. * @param {Object} state Current state.
  1049. * @param {Object} action Dispatched action.
  1050. *
  1051. * @return {Object} Updated state.
  1052. */
  1053. function settings() {
  1054. let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1055. let action = arguments.length > 1 ? arguments[1] : undefined;
  1056. switch (action.type) {
  1057. case 'UPDATE_SETTINGS':
  1058. return { ...state,
  1059. ...action.settings
  1060. };
  1061. }
  1062. return state;
  1063. }
  1064. /**
  1065. * Reducer keeping track of the currently edited Post Type,
  1066. * Post Id and the context provided to fill the content of the block editor.
  1067. *
  1068. * @param {Object} state Current edited post.
  1069. * @param {Object} action Dispatched action.
  1070. *
  1071. * @return {Object} Updated state.
  1072. */
  1073. function editedPost() {
  1074. let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1075. let action = arguments.length > 1 ? arguments[1] : undefined;
  1076. switch (action.type) {
  1077. case 'SET_TEMPLATE':
  1078. case 'SET_PAGE':
  1079. return {
  1080. type: 'wp_template',
  1081. id: action.templateId,
  1082. page: action.page
  1083. };
  1084. case 'SET_TEMPLATE_PART':
  1085. return {
  1086. type: 'wp_template_part',
  1087. id: action.templatePartId
  1088. };
  1089. }
  1090. return state;
  1091. }
  1092. /**
  1093. * Reducer for information about the site's homepage.
  1094. *
  1095. * @param {Object} state Current state.
  1096. * @param {Object} action Dispatched action.
  1097. *
  1098. * @return {Object} Updated state.
  1099. */
  1100. function homeTemplateId(state, action) {
  1101. switch (action.type) {
  1102. case 'SET_HOME_TEMPLATE':
  1103. return action.homeTemplateId;
  1104. }
  1105. return state;
  1106. }
  1107. /**
  1108. * Reducer for information about the navigation panel, such as its active menu
  1109. * and whether it should be opened or closed.
  1110. *
  1111. * Note: this reducer interacts with the inserter and list view panels reducers
  1112. * to make sure that only one of the three panels is open at the same time.
  1113. *
  1114. * @param {Object} state Current state.
  1115. * @param {Object} action Dispatched action.
  1116. */
  1117. function navigationPanel() {
  1118. let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  1119. menu: MENU_ROOT,
  1120. isOpen: false
  1121. };
  1122. let action = arguments.length > 1 ? arguments[1] : undefined;
  1123. switch (action.type) {
  1124. case 'SET_NAVIGATION_PANEL_ACTIVE_MENU':
  1125. return { ...state,
  1126. menu: action.menu
  1127. };
  1128. case 'OPEN_NAVIGATION_PANEL_TO_MENU':
  1129. return { ...state,
  1130. isOpen: true,
  1131. menu: action.menu
  1132. };
  1133. case 'SET_IS_NAVIGATION_PANEL_OPENED':
  1134. return { ...state,
  1135. menu: !action.isOpen ? MENU_ROOT : state.menu,
  1136. // Set menu to root when closing panel.
  1137. isOpen: action.isOpen
  1138. };
  1139. case 'SET_IS_LIST_VIEW_OPENED':
  1140. return { ...state,
  1141. menu: state.isOpen && action.isOpen ? MENU_ROOT : state.menu,
  1142. // Set menu to root when closing panel.
  1143. isOpen: action.isOpen ? false : state.isOpen
  1144. };
  1145. case 'SET_IS_INSERTER_OPENED':
  1146. return { ...state,
  1147. menu: state.isOpen && action.value ? MENU_ROOT : state.menu,
  1148. // Set menu to root when closing panel.
  1149. isOpen: action.value ? false : state.isOpen
  1150. };
  1151. }
  1152. return state;
  1153. }
  1154. /**
  1155. * Reducer to set the block inserter panel open or closed.
  1156. *
  1157. * Note: this reducer interacts with the navigation and list view panels reducers
  1158. * to make sure that only one of the three panels is open at the same time.
  1159. *
  1160. * @param {boolean|Object} state Current state.
  1161. * @param {Object} action Dispatched action.
  1162. */
  1163. function blockInserterPanel() {
  1164. let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  1165. let action = arguments.length > 1 ? arguments[1] : undefined;
  1166. switch (action.type) {
  1167. case 'OPEN_NAVIGATION_PANEL_TO_MENU':
  1168. return false;
  1169. case 'SET_IS_NAVIGATION_PANEL_OPENED':
  1170. case 'SET_IS_LIST_VIEW_OPENED':
  1171. return action.isOpen ? false : state;
  1172. case 'SET_IS_INSERTER_OPENED':
  1173. return action.value;
  1174. }
  1175. return state;
  1176. }
  1177. /**
  1178. * Reducer to set the list view panel open or closed.
  1179. *
  1180. * Note: this reducer interacts with the navigation and inserter panels reducers
  1181. * to make sure that only one of the three panels is open at the same time.
  1182. *
  1183. * @param {Object} state Current state.
  1184. * @param {Object} action Dispatched action.
  1185. */
  1186. function listViewPanel() {
  1187. let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  1188. let action = arguments.length > 1 ? arguments[1] : undefined;
  1189. switch (action.type) {
  1190. case 'OPEN_NAVIGATION_PANEL_TO_MENU':
  1191. return false;
  1192. case 'SET_IS_NAVIGATION_PANEL_OPENED':
  1193. return action.isOpen ? false : state;
  1194. case 'SET_IS_INSERTER_OPENED':
  1195. return action.value ? false : state;
  1196. case 'SET_IS_LIST_VIEW_OPENED':
  1197. return action.isOpen;
  1198. }
  1199. return state;
  1200. }
  1201. /* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
  1202. deviceType,
  1203. settings,
  1204. editedPost,
  1205. homeTemplateId,
  1206. navigationPanel,
  1207. blockInserterPanel,
  1208. listViewPanel
  1209. }));
  1210. ;// CONCATENATED MODULE: external ["wp","apiFetch"]
  1211. var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
  1212. var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
  1213. ;// CONCATENATED MODULE: external ["wp","deprecated"]
  1214. var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
  1215. var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
  1216. ;// CONCATENATED MODULE: external ["wp","notices"]
  1217. var external_wp_notices_namespaceObject = window["wp"]["notices"];
  1218. ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  1219. function extends_extends() {
  1220. extends_extends = Object.assign || function (target) {
  1221. for (var i = 1; i < arguments.length; i++) {
  1222. var source = arguments[i];
  1223. for (var key in source) {
  1224. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1225. target[key] = source[key];
  1226. }
  1227. }
  1228. }
  1229. return target;
  1230. };
  1231. return extends_extends.apply(this, arguments);
  1232. }
  1233. // EXTERNAL MODULE: ./node_modules/classnames/index.js
  1234. var classnames = __webpack_require__(4403);
  1235. var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
  1236. ;// CONCATENATED MODULE: external ["wp","components"]
  1237. var external_wp_components_namespaceObject = window["wp"]["components"];
  1238. ;// CONCATENATED MODULE: external ["wp","primitives"]
  1239. var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
  1240. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
  1241. /**
  1242. * WordPress dependencies
  1243. */
  1244. const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1245. xmlns: "http://www.w3.org/2000/svg",
  1246. viewBox: "0 0 24 24"
  1247. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1248. d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
  1249. }));
  1250. /* harmony default export */ var library_check = (check);
  1251. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
  1252. /**
  1253. * WordPress dependencies
  1254. */
  1255. const starFilled = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1256. xmlns: "http://www.w3.org/2000/svg",
  1257. viewBox: "0 0 24 24"
  1258. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1259. d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
  1260. }));
  1261. /* harmony default export */ var star_filled = (starFilled);
  1262. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
  1263. /**
  1264. * WordPress dependencies
  1265. */
  1266. const starEmpty = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1267. xmlns: "http://www.w3.org/2000/svg",
  1268. viewBox: "0 0 24 24"
  1269. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1270. fillRule: "evenodd",
  1271. d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",
  1272. clipRule: "evenodd"
  1273. }));
  1274. /* harmony default export */ var star_empty = (starEmpty);
  1275. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
  1276. /**
  1277. * WordPress dependencies
  1278. */
  1279. const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1280. xmlns: "http://www.w3.org/2000/svg",
  1281. viewBox: "0 0 24 24"
  1282. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1283. d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
  1284. }));
  1285. /* harmony default export */ var close_small = (closeSmall);
  1286. ;// CONCATENATED MODULE: external "lodash"
  1287. var external_lodash_namespaceObject = window["lodash"];
  1288. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js
  1289. /**
  1290. * WordPress dependencies
  1291. */
  1292. /**
  1293. * Enable the complementary area.
  1294. *
  1295. * @param {string} scope Complementary area scope.
  1296. * @param {string} area Area identifier.
  1297. */
  1298. const enableComplementaryArea = (scope, area) => _ref => {
  1299. let {
  1300. registry
  1301. } = _ref;
  1302. // Return early if there's no area.
  1303. if (!area) {
  1304. return;
  1305. }
  1306. registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'complementaryArea', area);
  1307. };
  1308. /**
  1309. * Disable the complementary area.
  1310. *
  1311. * @param {string} scope Complementary area scope.
  1312. */
  1313. const disableComplementaryArea = scope => _ref2 => {
  1314. let {
  1315. registry
  1316. } = _ref2;
  1317. registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'complementaryArea', null);
  1318. };
  1319. /**
  1320. * Pins an item.
  1321. *
  1322. * @param {string} scope Item scope.
  1323. * @param {string} item Item identifier.
  1324. *
  1325. * @return {Object} Action object.
  1326. */
  1327. const pinItem = (scope, item) => _ref3 => {
  1328. let {
  1329. registry
  1330. } = _ref3;
  1331. // Return early if there's no item.
  1332. if (!item) {
  1333. return;
  1334. }
  1335. const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); // The item is already pinned, there's nothing to do.
  1336. if ((pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) === true) {
  1337. return;
  1338. }
  1339. registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems,
  1340. [item]: true
  1341. });
  1342. };
  1343. /**
  1344. * Unpins an item.
  1345. *
  1346. * @param {string} scope Item scope.
  1347. * @param {string} item Item identifier.
  1348. */
  1349. const unpinItem = (scope, item) => _ref4 => {
  1350. let {
  1351. registry
  1352. } = _ref4;
  1353. // Return early if there's no item.
  1354. if (!item) {
  1355. return;
  1356. }
  1357. const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
  1358. registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems,
  1359. [item]: false
  1360. });
  1361. };
  1362. /**
  1363. * Returns an action object used in signalling that a feature should be toggled.
  1364. *
  1365. * @param {string} scope The feature scope (e.g. core/edit-post).
  1366. * @param {string} featureName The feature name.
  1367. */
  1368. function toggleFeature(scope, featureName) {
  1369. return function (_ref5) {
  1370. let {
  1371. registry
  1372. } = _ref5;
  1373. external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
  1374. since: '6.0',
  1375. alternative: `dispatch( 'core/preferences' ).toggle`
  1376. });
  1377. registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
  1378. };
  1379. }
  1380. /**
  1381. * Returns an action object used in signalling that a feature should be set to
  1382. * a true or false value
  1383. *
  1384. * @param {string} scope The feature scope (e.g. core/edit-post).
  1385. * @param {string} featureName The feature name.
  1386. * @param {boolean} value The value to set.
  1387. *
  1388. * @return {Object} Action object.
  1389. */
  1390. function setFeatureValue(scope, featureName, value) {
  1391. return function (_ref6) {
  1392. let {
  1393. registry
  1394. } = _ref6;
  1395. external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
  1396. since: '6.0',
  1397. alternative: `dispatch( 'core/preferences' ).set`
  1398. });
  1399. registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
  1400. };
  1401. }
  1402. /**
  1403. * Returns an action object used in signalling that defaults should be set for features.
  1404. *
  1405. * @param {string} scope The feature scope (e.g. core/edit-post).
  1406. * @param {Object<string, boolean>} defaults A key/value map of feature names to values.
  1407. *
  1408. * @return {Object} Action object.
  1409. */
  1410. function setFeatureDefaults(scope, defaults) {
  1411. return function (_ref7) {
  1412. let {
  1413. registry
  1414. } = _ref7;
  1415. external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
  1416. since: '6.0',
  1417. alternative: `dispatch( 'core/preferences' ).setDefaults`
  1418. });
  1419. registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
  1420. };
  1421. }
  1422. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js
  1423. /**
  1424. * WordPress dependencies
  1425. */
  1426. /**
  1427. * Returns the complementary area that is active in a given scope.
  1428. *
  1429. * @param {Object} state Global application state.
  1430. * @param {string} scope Item scope.
  1431. *
  1432. * @return {string} The complementary area that is active in the given scope.
  1433. */
  1434. const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => {
  1435. return select(external_wp_preferences_namespaceObject.store).get(scope, 'complementaryArea');
  1436. });
  1437. /**
  1438. * Returns a boolean indicating if an item is pinned or not.
  1439. *
  1440. * @param {Object} state Global application state.
  1441. * @param {string} scope Scope.
  1442. * @param {string} item Item to check.
  1443. *
  1444. * @return {boolean} True if the item is pinned and false otherwise.
  1445. */
  1446. const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, item) => {
  1447. var _pinnedItems$item;
  1448. const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
  1449. return (_pinnedItems$item = pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true;
  1450. });
  1451. /**
  1452. * Returns a boolean indicating whether a feature is active for a particular
  1453. * scope.
  1454. *
  1455. * @param {Object} state The store state.
  1456. * @param {string} scope The scope of the feature (e.g. core/edit-post).
  1457. * @param {string} featureName The name of the feature.
  1458. *
  1459. * @return {boolean} Is the feature enabled?
  1460. */
  1461. const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => {
  1462. external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
  1463. since: '6.0',
  1464. alternative: `select( 'core/preferences' ).get( scope, featureName )`
  1465. });
  1466. return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
  1467. });
  1468. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/constants.js
  1469. /**
  1470. * The identifier for the data store.
  1471. *
  1472. * @type {string}
  1473. */
  1474. const constants_STORE_NAME = 'core/interface';
  1475. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/index.js
  1476. /**
  1477. * WordPress dependencies
  1478. */
  1479. /**
  1480. * Internal dependencies
  1481. */
  1482. /**
  1483. * Store definition for the interface namespace.
  1484. *
  1485. * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
  1486. *
  1487. * @type {Object}
  1488. */
  1489. const store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, {
  1490. reducer: () => {},
  1491. actions: actions_namespaceObject,
  1492. selectors: selectors_namespaceObject
  1493. }); // Once we build a more generic persistence plugin that works across types of stores
  1494. // we'd be able to replace this with a register call.
  1495. (0,external_wp_data_namespaceObject.register)(store);
  1496. ;// CONCATENATED MODULE: external ["wp","plugins"]
  1497. var external_wp_plugins_namespaceObject = window["wp"]["plugins"];
  1498. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-context/index.js
  1499. /**
  1500. * WordPress dependencies
  1501. */
  1502. /* harmony default export */ var complementary_area_context = ((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => {
  1503. return {
  1504. icon: ownProps.icon || context.icon,
  1505. identifier: ownProps.identifier || `${context.name}/${ownProps.name}`
  1506. };
  1507. }));
  1508. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js
  1509. /**
  1510. * External dependencies
  1511. */
  1512. /**
  1513. * WordPress dependencies
  1514. */
  1515. /**
  1516. * Internal dependencies
  1517. */
  1518. function ComplementaryAreaToggle(_ref) {
  1519. let {
  1520. as = external_wp_components_namespaceObject.Button,
  1521. scope,
  1522. identifier,
  1523. icon,
  1524. selectedIcon,
  1525. ...props
  1526. } = _ref;
  1527. const ComponentToUse = as;
  1528. const isSelected = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier]);
  1529. const {
  1530. enableComplementaryArea,
  1531. disableComplementaryArea
  1532. } = (0,external_wp_data_namespaceObject.useDispatch)(store);
  1533. return (0,external_wp_element_namespaceObject.createElement)(ComponentToUse, extends_extends({
  1534. icon: selectedIcon && isSelected ? selectedIcon : icon,
  1535. onClick: () => {
  1536. if (isSelected) {
  1537. disableComplementaryArea(scope);
  1538. } else {
  1539. enableComplementaryArea(scope, identifier);
  1540. }
  1541. }
  1542. }, (0,external_lodash_namespaceObject.omit)(props, ['name'])));
  1543. }
  1544. /* harmony default export */ var complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle));
  1545. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
  1546. /**
  1547. * External dependencies
  1548. */
  1549. /**
  1550. * WordPress dependencies
  1551. */
  1552. /**
  1553. * Internal dependencies
  1554. */
  1555. const ComplementaryAreaHeader = _ref => {
  1556. let {
  1557. smallScreenTitle,
  1558. children,
  1559. className,
  1560. toggleButtonProps
  1561. } = _ref;
  1562. const toggleButton = (0,external_wp_element_namespaceObject.createElement)(complementary_area_toggle, extends_extends({
  1563. icon: close_small
  1564. }, toggleButtonProps));
  1565. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
  1566. className: "components-panel__header interface-complementary-area-header__small"
  1567. }, smallScreenTitle && (0,external_wp_element_namespaceObject.createElement)("span", {
  1568. className: "interface-complementary-area-header__small-title"
  1569. }, smallScreenTitle), toggleButton), (0,external_wp_element_namespaceObject.createElement)("div", {
  1570. className: classnames_default()('components-panel__header', 'interface-complementary-area-header', className),
  1571. tabIndex: -1
  1572. }, children, toggleButton));
  1573. };
  1574. /* harmony default export */ var complementary_area_header = (ComplementaryAreaHeader);
  1575. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
  1576. /**
  1577. * External dependencies
  1578. */
  1579. /**
  1580. * WordPress dependencies
  1581. */
  1582. function ActionItemSlot(_ref) {
  1583. let {
  1584. name,
  1585. as: Component = external_wp_components_namespaceObject.ButtonGroup,
  1586. fillProps = {},
  1587. bubblesVirtually,
  1588. ...props
  1589. } = _ref;
  1590. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, {
  1591. name: name,
  1592. bubblesVirtually: bubblesVirtually,
  1593. fillProps: fillProps
  1594. }, fills => {
  1595. if ((0,external_lodash_namespaceObject.isEmpty)(external_wp_element_namespaceObject.Children.toArray(fills))) {
  1596. return null;
  1597. } // Special handling exists for backward compatibility.
  1598. // It ensures that menu items created by plugin authors aren't
  1599. // duplicated with automatically injected menu items coming
  1600. // from pinnable plugin sidebars.
  1601. // @see https://github.com/WordPress/gutenberg/issues/14457
  1602. const initializedByPlugins = [];
  1603. external_wp_element_namespaceObject.Children.forEach(fills, _ref2 => {
  1604. let {
  1605. props: {
  1606. __unstableExplicitMenuItem,
  1607. __unstableTarget
  1608. }
  1609. } = _ref2;
  1610. if (__unstableTarget && __unstableExplicitMenuItem) {
  1611. initializedByPlugins.push(__unstableTarget);
  1612. }
  1613. });
  1614. const children = external_wp_element_namespaceObject.Children.map(fills, child => {
  1615. if (!child.props.__unstableExplicitMenuItem && initializedByPlugins.includes(child.props.__unstableTarget)) {
  1616. return null;
  1617. }
  1618. return child;
  1619. });
  1620. return (0,external_wp_element_namespaceObject.createElement)(Component, props, children);
  1621. });
  1622. }
  1623. function ActionItem(_ref3) {
  1624. let {
  1625. name,
  1626. as: Component = external_wp_components_namespaceObject.Button,
  1627. onClick,
  1628. ...props
  1629. } = _ref3;
  1630. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
  1631. name: name
  1632. }, _ref4 => {
  1633. let {
  1634. onClick: fpOnClick
  1635. } = _ref4;
  1636. return (0,external_wp_element_namespaceObject.createElement)(Component, extends_extends({
  1637. onClick: onClick || fpOnClick ? function () {
  1638. (onClick || external_lodash_namespaceObject.noop)(...arguments);
  1639. (fpOnClick || external_lodash_namespaceObject.noop)(...arguments);
  1640. } : undefined
  1641. }, props));
  1642. });
  1643. }
  1644. ActionItem.Slot = ActionItemSlot;
  1645. /* harmony default export */ var action_item = (ActionItem);
  1646. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
  1647. /**
  1648. * External dependencies
  1649. */
  1650. /**
  1651. * WordPress dependencies
  1652. */
  1653. /**
  1654. * Internal dependencies
  1655. */
  1656. const PluginsMenuItem = props => // Menu item is marked with unstable prop for backward compatibility.
  1657. // They are removed so they don't leak to DOM elements.
  1658. // @see https://github.com/WordPress/gutenberg/issues/14457
  1659. (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, (0,external_lodash_namespaceObject.omit)(props, ['__unstableExplicitMenuItem', '__unstableTarget']));
  1660. function ComplementaryAreaMoreMenuItem(_ref) {
  1661. let {
  1662. scope,
  1663. target,
  1664. __unstableExplicitMenuItem,
  1665. ...props
  1666. } = _ref;
  1667. return (0,external_wp_element_namespaceObject.createElement)(complementary_area_toggle, extends_extends({
  1668. as: toggleProps => {
  1669. return (0,external_wp_element_namespaceObject.createElement)(action_item, extends_extends({
  1670. __unstableExplicitMenuItem: __unstableExplicitMenuItem,
  1671. __unstableTarget: `${scope}/${target}`,
  1672. as: PluginsMenuItem,
  1673. name: `${scope}/plugin-more-menu`
  1674. }, toggleProps));
  1675. },
  1676. role: "menuitemcheckbox",
  1677. selectedIcon: library_check,
  1678. name: target,
  1679. scope: scope
  1680. }, props));
  1681. }
  1682. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js
  1683. /**
  1684. * External dependencies
  1685. */
  1686. /**
  1687. * WordPress dependencies
  1688. */
  1689. function PinnedItems(_ref) {
  1690. let {
  1691. scope,
  1692. ...props
  1693. } = _ref;
  1694. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, extends_extends({
  1695. name: `PinnedItems/${scope}`
  1696. }, props));
  1697. }
  1698. function PinnedItemsSlot(_ref2) {
  1699. let {
  1700. scope,
  1701. className,
  1702. ...props
  1703. } = _ref2;
  1704. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, extends_extends({
  1705. name: `PinnedItems/${scope}`
  1706. }, props), fills => !(0,external_lodash_namespaceObject.isEmpty)(fills) && (0,external_wp_element_namespaceObject.createElement)("div", {
  1707. className: classnames_default()(className, 'interface-pinned-items')
  1708. }, fills));
  1709. }
  1710. PinnedItems.Slot = PinnedItemsSlot;
  1711. /* harmony default export */ var pinned_items = (PinnedItems);
  1712. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
  1713. /**
  1714. * External dependencies
  1715. */
  1716. /**
  1717. * WordPress dependencies
  1718. */
  1719. /**
  1720. * Internal dependencies
  1721. */
  1722. function ComplementaryAreaSlot(_ref) {
  1723. let {
  1724. scope,
  1725. ...props
  1726. } = _ref;
  1727. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, extends_extends({
  1728. name: `ComplementaryArea/${scope}`
  1729. }, props));
  1730. }
  1731. function ComplementaryAreaFill(_ref2) {
  1732. let {
  1733. scope,
  1734. children,
  1735. className
  1736. } = _ref2;
  1737. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
  1738. name: `ComplementaryArea/${scope}`
  1739. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  1740. className: className
  1741. }, children));
  1742. }
  1743. function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) {
  1744. const previousIsSmall = (0,external_wp_element_namespaceObject.useRef)(false);
  1745. const shouldOpenWhenNotSmall = (0,external_wp_element_namespaceObject.useRef)(false);
  1746. const {
  1747. enableComplementaryArea,
  1748. disableComplementaryArea
  1749. } = (0,external_wp_data_namespaceObject.useDispatch)(store);
  1750. (0,external_wp_element_namespaceObject.useEffect)(() => {
  1751. // If the complementary area is active and the editor is switching from a big to a small window size.
  1752. if (isActive && isSmall && !previousIsSmall.current) {
  1753. // Disable the complementary area.
  1754. disableComplementaryArea(scope); // Flag the complementary area to be reopened when the window size goes from small to big.
  1755. shouldOpenWhenNotSmall.current = true;
  1756. } else if ( // If there is a flag indicating the complementary area should be enabled when we go from small to big window size
  1757. // and we are going from a small to big window size.
  1758. shouldOpenWhenNotSmall.current && !isSmall && previousIsSmall.current) {
  1759. // Remove the flag indicating the complementary area should be enabled.
  1760. shouldOpenWhenNotSmall.current = false; // Enable the complementary area.
  1761. enableComplementaryArea(scope, identifier);
  1762. } else if ( // If the flag is indicating the current complementary should be reopened but another complementary area becomes active,
  1763. // remove the flag.
  1764. shouldOpenWhenNotSmall.current && activeArea && activeArea !== identifier) {
  1765. shouldOpenWhenNotSmall.current = false;
  1766. }
  1767. if (isSmall !== previousIsSmall.current) {
  1768. previousIsSmall.current = isSmall;
  1769. }
  1770. }, [isActive, isSmall, scope, identifier, activeArea]);
  1771. }
  1772. function ComplementaryArea(_ref3) {
  1773. let {
  1774. children,
  1775. className,
  1776. closeLabel = (0,external_wp_i18n_namespaceObject.__)('Close plugin'),
  1777. identifier,
  1778. header,
  1779. headerClassName,
  1780. icon,
  1781. isPinnable = true,
  1782. panelClassName,
  1783. scope,
  1784. name,
  1785. smallScreenTitle,
  1786. title,
  1787. toggleShortcut,
  1788. isActiveByDefault,
  1789. showIconLabels = false
  1790. } = _ref3;
  1791. const {
  1792. isActive,
  1793. isPinned,
  1794. activeArea,
  1795. isSmall,
  1796. isLarge
  1797. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  1798. const {
  1799. getActiveComplementaryArea,
  1800. isItemPinned
  1801. } = select(store);
  1802. const _activeArea = getActiveComplementaryArea(scope);
  1803. return {
  1804. isActive: _activeArea === identifier,
  1805. isPinned: isItemPinned(scope, identifier),
  1806. activeArea: _activeArea,
  1807. isSmall: select(external_wp_viewport_namespaceObject.store).isViewportMatch('< medium'),
  1808. isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch('large')
  1809. };
  1810. }, [identifier, scope]);
  1811. useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall);
  1812. const {
  1813. enableComplementaryArea,
  1814. disableComplementaryArea,
  1815. pinItem,
  1816. unpinItem
  1817. } = (0,external_wp_data_namespaceObject.useDispatch)(store);
  1818. (0,external_wp_element_namespaceObject.useEffect)(() => {
  1819. if (isActiveByDefault && activeArea === undefined && !isSmall) {
  1820. enableComplementaryArea(scope, identifier);
  1821. }
  1822. }, [activeArea, isActiveByDefault, scope, identifier, isSmall]);
  1823. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isPinnable && (0,external_wp_element_namespaceObject.createElement)(pinned_items, {
  1824. scope: scope
  1825. }, isPinned && (0,external_wp_element_namespaceObject.createElement)(complementary_area_toggle, {
  1826. scope: scope,
  1827. identifier: identifier,
  1828. isPressed: isActive && (!showIconLabels || isLarge),
  1829. "aria-expanded": isActive,
  1830. label: title,
  1831. icon: showIconLabels ? library_check : icon,
  1832. showTooltip: !showIconLabels,
  1833. variant: showIconLabels ? 'tertiary' : undefined
  1834. })), name && isPinnable && (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaMoreMenuItem, {
  1835. target: name,
  1836. scope: scope,
  1837. icon: icon
  1838. }, title), isActive && (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaFill, {
  1839. className: classnames_default()('interface-complementary-area', className),
  1840. scope: scope
  1841. }, (0,external_wp_element_namespaceObject.createElement)(complementary_area_header, {
  1842. className: headerClassName,
  1843. closeLabel: closeLabel,
  1844. onClose: () => disableComplementaryArea(scope),
  1845. smallScreenTitle: smallScreenTitle,
  1846. toggleButtonProps: {
  1847. label: closeLabel,
  1848. shortcut: toggleShortcut,
  1849. scope,
  1850. identifier
  1851. }
  1852. }, header || (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("strong", null, title), isPinnable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  1853. className: "interface-complementary-area__pin-unpin-item",
  1854. icon: isPinned ? star_filled : star_empty,
  1855. label: isPinned ? (0,external_wp_i18n_namespaceObject.__)('Unpin from toolbar') : (0,external_wp_i18n_namespaceObject.__)('Pin to toolbar'),
  1856. onClick: () => (isPinned ? unpinItem : pinItem)(scope, identifier),
  1857. isPressed: isPinned,
  1858. "aria-expanded": isPinned
  1859. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Panel, {
  1860. className: panelClassName
  1861. }, children)));
  1862. }
  1863. const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea);
  1864. ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;
  1865. /* harmony default export */ var complementary_area = (ComplementaryAreaWrapped);
  1866. ;// CONCATENATED MODULE: external ["wp","compose"]
  1867. var external_wp_compose_namespaceObject = window["wp"]["compose"];
  1868. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
  1869. /**
  1870. * External dependencies
  1871. */
  1872. /**
  1873. * WordPress dependencies
  1874. */
  1875. /**
  1876. * WordPress dependencies
  1877. */
  1878. function useHTMLClass(className) {
  1879. (0,external_wp_element_namespaceObject.useEffect)(() => {
  1880. const element = document && document.querySelector(`html:not(.${className})`);
  1881. if (!element) {
  1882. return;
  1883. }
  1884. element.classList.toggle(className);
  1885. return () => {
  1886. element.classList.toggle(className);
  1887. };
  1888. }, [className]);
  1889. }
  1890. function InterfaceSkeleton(_ref, ref) {
  1891. let {
  1892. footer,
  1893. header,
  1894. sidebar,
  1895. secondarySidebar,
  1896. notices,
  1897. content,
  1898. drawer,
  1899. actions,
  1900. labels,
  1901. className,
  1902. shortcuts
  1903. } = _ref;
  1904. const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(shortcuts);
  1905. useHTMLClass('interface-interface-skeleton__html-container');
  1906. const defaultLabels = {
  1907. /* translators: accessibility text for the nav bar landmark region. */
  1908. drawer: (0,external_wp_i18n_namespaceObject.__)('Drawer'),
  1909. /* translators: accessibility text for the top bar landmark region. */
  1910. header: (0,external_wp_i18n_namespaceObject.__)('Header'),
  1911. /* translators: accessibility text for the content landmark region. */
  1912. body: (0,external_wp_i18n_namespaceObject.__)('Content'),
  1913. /* translators: accessibility text for the secondary sidebar landmark region. */
  1914. secondarySidebar: (0,external_wp_i18n_namespaceObject.__)('Block Library'),
  1915. /* translators: accessibility text for the settings landmark region. */
  1916. sidebar: (0,external_wp_i18n_namespaceObject.__)('Settings'),
  1917. /* translators: accessibility text for the publish landmark region. */
  1918. actions: (0,external_wp_i18n_namespaceObject.__)('Publish'),
  1919. /* translators: accessibility text for the footer landmark region. */
  1920. footer: (0,external_wp_i18n_namespaceObject.__)('Footer')
  1921. };
  1922. const mergedLabels = { ...defaultLabels,
  1923. ...labels
  1924. };
  1925. return (0,external_wp_element_namespaceObject.createElement)("div", extends_extends({}, navigateRegionsProps, {
  1926. ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, navigateRegionsProps.ref]),
  1927. className: classnames_default()(className, 'interface-interface-skeleton', navigateRegionsProps.className, !!footer && 'has-footer')
  1928. }), !!drawer && (0,external_wp_element_namespaceObject.createElement)("div", {
  1929. className: "interface-interface-skeleton__drawer",
  1930. role: "region",
  1931. "aria-label": mergedLabels.drawer,
  1932. tabIndex: "-1"
  1933. }, drawer), (0,external_wp_element_namespaceObject.createElement)("div", {
  1934. className: "interface-interface-skeleton__editor"
  1935. }, !!header && (0,external_wp_element_namespaceObject.createElement)("div", {
  1936. className: "interface-interface-skeleton__header",
  1937. role: "region",
  1938. "aria-label": mergedLabels.header,
  1939. tabIndex: "-1"
  1940. }, header), (0,external_wp_element_namespaceObject.createElement)("div", {
  1941. className: "interface-interface-skeleton__body"
  1942. }, !!secondarySidebar && (0,external_wp_element_namespaceObject.createElement)("div", {
  1943. className: "interface-interface-skeleton__secondary-sidebar",
  1944. role: "region",
  1945. "aria-label": mergedLabels.secondarySidebar,
  1946. tabIndex: "-1"
  1947. }, secondarySidebar), !!notices && (0,external_wp_element_namespaceObject.createElement)("div", {
  1948. className: "interface-interface-skeleton__notices"
  1949. }, notices), (0,external_wp_element_namespaceObject.createElement)("div", {
  1950. className: "interface-interface-skeleton__content",
  1951. role: "region",
  1952. "aria-label": mergedLabels.body,
  1953. tabIndex: "-1"
  1954. }, content), !!sidebar && (0,external_wp_element_namespaceObject.createElement)("div", {
  1955. className: "interface-interface-skeleton__sidebar",
  1956. role: "region",
  1957. "aria-label": mergedLabels.sidebar,
  1958. tabIndex: "-1"
  1959. }, sidebar), !!actions && (0,external_wp_element_namespaceObject.createElement)("div", {
  1960. className: "interface-interface-skeleton__actions",
  1961. role: "region",
  1962. "aria-label": mergedLabels.actions,
  1963. tabIndex: "-1"
  1964. }, actions))), !!footer && (0,external_wp_element_namespaceObject.createElement)("div", {
  1965. className: "interface-interface-skeleton__footer",
  1966. role: "region",
  1967. "aria-label": mergedLabels.footer,
  1968. tabIndex: "-1"
  1969. }, footer));
  1970. }
  1971. /* harmony default export */ var interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton));
  1972. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
  1973. /**
  1974. * WordPress dependencies
  1975. */
  1976. const moreVertical = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1977. xmlns: "http://www.w3.org/2000/svg",
  1978. viewBox: "0 0 24 24"
  1979. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1980. d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
  1981. }));
  1982. /* harmony default export */ var more_vertical = (moreVertical);
  1983. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/more-menu-dropdown/index.js
  1984. /**
  1985. * External dependencies
  1986. */
  1987. /**
  1988. * WordPress dependencies
  1989. */
  1990. function MoreMenuDropdown(_ref) {
  1991. let {
  1992. as: DropdownComponent = external_wp_components_namespaceObject.DropdownMenu,
  1993. className,
  1994. /* translators: button label text should, if possible, be under 16 characters. */
  1995. label = (0,external_wp_i18n_namespaceObject.__)('Options'),
  1996. popoverProps,
  1997. toggleProps,
  1998. children
  1999. } = _ref;
  2000. return (0,external_wp_element_namespaceObject.createElement)(DropdownComponent, {
  2001. className: classnames_default()('interface-more-menu-dropdown', className),
  2002. icon: more_vertical,
  2003. label: label,
  2004. popoverProps: {
  2005. position: 'bottom left',
  2006. ...popoverProps,
  2007. className: classnames_default()('interface-more-menu-dropdown__content', popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.className)
  2008. },
  2009. toggleProps: {
  2010. tooltipPosition: 'bottom',
  2011. ...toggleProps
  2012. }
  2013. }, onClose => children(onClose));
  2014. }
  2015. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/preferences-modal/index.js
  2016. /**
  2017. * WordPress dependencies
  2018. */
  2019. function PreferencesModal(_ref) {
  2020. let {
  2021. closeModal,
  2022. children
  2023. } = _ref;
  2024. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  2025. className: "interface-preferences-modal",
  2026. title: (0,external_wp_i18n_namespaceObject.__)('Preferences'),
  2027. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
  2028. onRequestClose: closeModal
  2029. }, children);
  2030. }
  2031. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
  2032. /**
  2033. * WordPress dependencies
  2034. */
  2035. /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
  2036. /**
  2037. * Return an SVG icon.
  2038. *
  2039. * @param {IconProps} props icon is the SVG component to render
  2040. * size is a number specifiying the icon size in pixels
  2041. * Other props will be passed to wrapped SVG component
  2042. *
  2043. * @return {JSX.Element} Icon component
  2044. */
  2045. function Icon(_ref) {
  2046. let {
  2047. icon,
  2048. size = 24,
  2049. ...props
  2050. } = _ref;
  2051. return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
  2052. width: size,
  2053. height: size,
  2054. ...props
  2055. });
  2056. }
  2057. /* harmony default export */ var icon = (Icon);
  2058. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
  2059. /**
  2060. * WordPress dependencies
  2061. */
  2062. const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  2063. xmlns: "http://www.w3.org/2000/svg",
  2064. viewBox: "0 0 24 24"
  2065. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  2066. d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
  2067. }));
  2068. /* harmony default export */ var chevron_left = (chevronLeft);
  2069. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
  2070. /**
  2071. * WordPress dependencies
  2072. */
  2073. const chevronRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  2074. xmlns: "http://www.w3.org/2000/svg",
  2075. viewBox: "0 0 24 24"
  2076. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  2077. d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
  2078. }));
  2079. /* harmony default export */ var chevron_right = (chevronRight);
  2080. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/preferences-modal-tabs/index.js
  2081. /**
  2082. * WordPress dependencies
  2083. */
  2084. const PREFERENCES_MENU = 'preferences-menu';
  2085. function PreferencesModalTabs(_ref) {
  2086. let {
  2087. sections
  2088. } = _ref;
  2089. const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); // This is also used to sync the two different rendered components
  2090. // between small and large viewports.
  2091. const [activeMenu, setActiveMenu] = (0,external_wp_element_namespaceObject.useState)(PREFERENCES_MENU);
  2092. /**
  2093. * Create helper objects from `sections` for easier data handling.
  2094. * `tabs` is used for creating the `TabPanel` and `sectionsContentMap`
  2095. * is used for easier access to active tab's content.
  2096. */
  2097. const {
  2098. tabs,
  2099. sectionsContentMap
  2100. } = (0,external_wp_element_namespaceObject.useMemo)(() => {
  2101. let mappedTabs = {
  2102. tabs: [],
  2103. sectionsContentMap: {}
  2104. };
  2105. if (sections.length) {
  2106. mappedTabs = sections.reduce((accumulator, _ref2) => {
  2107. let {
  2108. name,
  2109. tabLabel: title,
  2110. content
  2111. } = _ref2;
  2112. accumulator.tabs.push({
  2113. name,
  2114. title
  2115. });
  2116. accumulator.sectionsContentMap[name] = content;
  2117. return accumulator;
  2118. }, {
  2119. tabs: [],
  2120. sectionsContentMap: {}
  2121. });
  2122. }
  2123. return mappedTabs;
  2124. }, [sections]);
  2125. const getCurrentTab = (0,external_wp_element_namespaceObject.useCallback)(tab => sectionsContentMap[tab.name] || null, [sectionsContentMap]);
  2126. let modalContent; // We render different components based on the viewport size.
  2127. if (isLargeViewport) {
  2128. modalContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TabPanel, {
  2129. className: "interface-preferences__tabs",
  2130. tabs: tabs,
  2131. initialTabName: activeMenu !== PREFERENCES_MENU ? activeMenu : undefined,
  2132. onSelect: setActiveMenu,
  2133. orientation: "vertical"
  2134. }, getCurrentTab);
  2135. } else {
  2136. modalContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, {
  2137. initialPath: "/",
  2138. className: "interface-preferences__provider"
  2139. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
  2140. path: "/"
  2141. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Card, {
  2142. isBorderless: true,
  2143. size: "small"
  2144. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CardBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, tabs.map(tab => {
  2145. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, {
  2146. key: tab.name,
  2147. path: tab.name,
  2148. as: external_wp_components_namespaceObject.__experimentalItem,
  2149. isAction: true
  2150. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  2151. justify: "space-between"
  2152. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, null, tab.title)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(icon, {
  2153. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right
  2154. }))));
  2155. }))))), sections.length && sections.map(section => {
  2156. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
  2157. key: `${section.name}-menu`,
  2158. path: section.name
  2159. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Card, {
  2160. isBorderless: true,
  2161. size: "large"
  2162. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CardHeader, {
  2163. isBorderless: false,
  2164. justify: "left",
  2165. size: "small",
  2166. gap: "6"
  2167. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorBackButton, {
  2168. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left,
  2169. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous view')
  2170. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
  2171. size: "16"
  2172. }, section.tabLabel)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CardBody, null, section.content)));
  2173. }));
  2174. }
  2175. return modalContent;
  2176. }
  2177. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/preferences-modal-section/index.js
  2178. const Section = _ref => {
  2179. let {
  2180. description,
  2181. title,
  2182. children
  2183. } = _ref;
  2184. return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
  2185. className: "interface-preferences-modal__section"
  2186. }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_element_namespaceObject.createElement)("h2", {
  2187. className: "interface-preferences-modal__section-title"
  2188. }, title), description && (0,external_wp_element_namespaceObject.createElement)("p", {
  2189. className: "interface-preferences-modal__section-description"
  2190. }, description)), children);
  2191. };
  2192. /* harmony default export */ var preferences_modal_section = (Section);
  2193. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/preferences-modal-base-option/index.js
  2194. /**
  2195. * WordPress dependencies
  2196. */
  2197. function BaseOption(_ref) {
  2198. let {
  2199. help,
  2200. label,
  2201. isChecked,
  2202. onChange,
  2203. children
  2204. } = _ref;
  2205. return (0,external_wp_element_namespaceObject.createElement)("div", {
  2206. className: "interface-preferences-modal__option"
  2207. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  2208. help: help,
  2209. label: label,
  2210. checked: isChecked,
  2211. onChange: onChange
  2212. }), children);
  2213. }
  2214. /* harmony default export */ var preferences_modal_base_option = (BaseOption);
  2215. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js
  2216. ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js
  2217. ;// CONCATENATED MODULE: external ["wp","blockEditor"]
  2218. var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
  2219. ;// CONCATENATED MODULE: external ["wp","a11y"]
  2220. var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
  2221. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/is-template-revertable.js
  2222. /**
  2223. * Check if a template is revertable to its original theme-provided template file.
  2224. *
  2225. * @param {Object} template The template entity to check.
  2226. * @return {boolean} Whether the template is revertable.
  2227. */
  2228. function isTemplateRevertable(template) {
  2229. if (!template) {
  2230. return false;
  2231. }
  2232. /* eslint-disable camelcase */
  2233. return (template === null || template === void 0 ? void 0 : template.source) === 'custom' && (template === null || template === void 0 ? void 0 : template.has_theme_file);
  2234. /* eslint-enable camelcase */
  2235. }
  2236. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/actions.js
  2237. /**
  2238. * WordPress dependencies
  2239. */
  2240. /**
  2241. * Internal dependencies
  2242. */
  2243. /**
  2244. * Dispatches an action that toggles a feature flag.
  2245. *
  2246. * @param {string} featureName Feature name.
  2247. */
  2248. function actions_toggleFeature(featureName) {
  2249. return function (_ref) {
  2250. let {
  2251. registry
  2252. } = _ref;
  2253. external_wp_deprecated_default()("select( 'core/edit-site' ).toggleFeature( featureName )", {
  2254. since: '6.0',
  2255. alternative: "select( 'core/preferences').toggle( 'core/edit-site', featureName )"
  2256. });
  2257. registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-site', featureName);
  2258. };
  2259. }
  2260. /**
  2261. * Action that changes the width of the editing canvas.
  2262. *
  2263. * @param {string} deviceType
  2264. *
  2265. * @return {Object} Action object.
  2266. */
  2267. function __experimentalSetPreviewDeviceType(deviceType) {
  2268. return {
  2269. type: 'SET_PREVIEW_DEVICE_TYPE',
  2270. deviceType
  2271. };
  2272. }
  2273. /**
  2274. * Action that sets a template, optionally fetching it from REST API.
  2275. *
  2276. * @param {number} templateId The template ID.
  2277. * @param {string} templateSlug The template slug.
  2278. * @return {Object} Action object.
  2279. */
  2280. const setTemplate = (templateId, templateSlug) => async _ref2 => {
  2281. let {
  2282. dispatch,
  2283. registry
  2284. } = _ref2;
  2285. if (!templateSlug) {
  2286. const template = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template', templateId);
  2287. templateSlug = template === null || template === void 0 ? void 0 : template.slug;
  2288. }
  2289. dispatch({
  2290. type: 'SET_TEMPLATE',
  2291. templateId,
  2292. page: {
  2293. context: {
  2294. templateSlug
  2295. }
  2296. }
  2297. });
  2298. };
  2299. /**
  2300. * Action that adds a new template and sets it as the current template.
  2301. *
  2302. * @param {Object} template The template.
  2303. *
  2304. * @return {Object} Action object used to set the current template.
  2305. */
  2306. const addTemplate = template => async _ref3 => {
  2307. let {
  2308. dispatch,
  2309. registry
  2310. } = _ref3;
  2311. const newTemplate = await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord('postType', 'wp_template', template);
  2312. if (template.content) {
  2313. registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', 'wp_template', newTemplate.id, {
  2314. blocks: (0,external_wp_blocks_namespaceObject.parse)(template.content)
  2315. }, {
  2316. undoIgnore: true
  2317. });
  2318. }
  2319. dispatch({
  2320. type: 'SET_TEMPLATE',
  2321. templateId: newTemplate.id,
  2322. page: {
  2323. context: {
  2324. templateSlug: newTemplate.slug
  2325. }
  2326. }
  2327. });
  2328. };
  2329. /**
  2330. * Action that removes a template.
  2331. *
  2332. * @param {Object} template The template object.
  2333. */
  2334. const removeTemplate = template => async _ref4 => {
  2335. let {
  2336. registry
  2337. } = _ref4;
  2338. try {
  2339. await registry.dispatch(external_wp_coreData_namespaceObject.store).deleteEntityRecord('postType', template.type, template.id, {
  2340. force: true
  2341. });
  2342. const lastError = registry.select(external_wp_coreData_namespaceObject.store).getLastEntityDeleteError('postType', template.type, template.id);
  2343. if (lastError) {
  2344. throw lastError;
  2345. }
  2346. registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  2347. /* translators: The template/part's name. */
  2348. (0,external_wp_i18n_namespaceObject.__)('"%s" deleted.'), template.title.rendered), {
  2349. type: 'snackbar'
  2350. });
  2351. } catch (error) {
  2352. const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the template.');
  2353. registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, {
  2354. type: 'snackbar'
  2355. });
  2356. }
  2357. };
  2358. /**
  2359. * Action that sets a template part.
  2360. *
  2361. * @param {string} templatePartId The template part ID.
  2362. *
  2363. * @return {Object} Action object.
  2364. */
  2365. function setTemplatePart(templatePartId) {
  2366. return {
  2367. type: 'SET_TEMPLATE_PART',
  2368. templatePartId
  2369. };
  2370. }
  2371. /**
  2372. * Action that sets the home template ID to the template ID of the page resolved
  2373. * from a given path.
  2374. *
  2375. * @param {number} homeTemplateId The template ID for the homepage.
  2376. */
  2377. function setHomeTemplateId(homeTemplateId) {
  2378. return {
  2379. type: 'SET_HOME_TEMPLATE',
  2380. homeTemplateId
  2381. };
  2382. }
  2383. /**
  2384. * Resolves the template for a page and displays both. If no path is given, attempts
  2385. * to use the postId to generate a path like `?p=${ postId }`.
  2386. *
  2387. * @param {Object} page The page object.
  2388. * @param {string} page.type The page type.
  2389. * @param {string} page.slug The page slug.
  2390. * @param {string} page.path The page path.
  2391. * @param {Object} page.context The page context.
  2392. *
  2393. * @return {number} The resolved template ID for the page route.
  2394. */
  2395. const setPage = page => async _ref5 => {
  2396. var _page$context;
  2397. let {
  2398. dispatch,
  2399. registry
  2400. } = _ref5;
  2401. if (!page.path && (_page$context = page.context) !== null && _page$context !== void 0 && _page$context.postId) {
  2402. const entity = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', page.context.postType || 'post', page.context.postId); // If the entity is undefined for some reason, path will resolve to "/"
  2403. page.path = (0,external_wp_url_namespaceObject.getPathAndQueryString)(entity === null || entity === void 0 ? void 0 : entity.link);
  2404. }
  2405. const template = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).__experimentalGetTemplateForLink(page.path);
  2406. if (!template) {
  2407. return;
  2408. }
  2409. dispatch({
  2410. type: 'SET_PAGE',
  2411. page: template.slug ? { ...page,
  2412. context: { ...page.context,
  2413. templateSlug: template.slug
  2414. }
  2415. } : page,
  2416. templateId: template.id
  2417. });
  2418. return template.id;
  2419. };
  2420. /**
  2421. * Action that sets the active navigation panel menu.
  2422. *
  2423. * @param {string} menu Menu prop of active menu.
  2424. *
  2425. * @return {Object} Action object.
  2426. */
  2427. function setNavigationPanelActiveMenu(menu) {
  2428. return {
  2429. type: 'SET_NAVIGATION_PANEL_ACTIVE_MENU',
  2430. menu
  2431. };
  2432. }
  2433. /**
  2434. * Opens the navigation panel and sets its active menu at the same time.
  2435. *
  2436. * @param {string} menu Identifies the menu to open.
  2437. */
  2438. function openNavigationPanelToMenu(menu) {
  2439. return {
  2440. type: 'OPEN_NAVIGATION_PANEL_TO_MENU',
  2441. menu
  2442. };
  2443. }
  2444. /**
  2445. * Sets whether the navigation panel should be open.
  2446. *
  2447. * @param {boolean} isOpen If true, opens the nav panel. If false, closes it. It
  2448. * does not toggle the state, but sets it directly.
  2449. */
  2450. function setIsNavigationPanelOpened(isOpen) {
  2451. return {
  2452. type: 'SET_IS_NAVIGATION_PANEL_OPENED',
  2453. isOpen
  2454. };
  2455. }
  2456. /**
  2457. * Opens or closes the inserter.
  2458. *
  2459. * @param {boolean|Object} value Whether the inserter should be
  2460. * opened (true) or closed (false).
  2461. * To specify an insertion point,
  2462. * use an object.
  2463. * @param {string} value.rootClientId The root client ID to insert at.
  2464. * @param {number} value.insertionIndex The index to insert at.
  2465. *
  2466. * @return {Object} Action object.
  2467. */
  2468. function setIsInserterOpened(value) {
  2469. return {
  2470. type: 'SET_IS_INSERTER_OPENED',
  2471. value
  2472. };
  2473. }
  2474. /**
  2475. * Returns an action object used to update the settings.
  2476. *
  2477. * @param {Object} settings New settings.
  2478. *
  2479. * @return {Object} Action object.
  2480. */
  2481. function updateSettings(settings) {
  2482. return {
  2483. type: 'UPDATE_SETTINGS',
  2484. settings
  2485. };
  2486. }
  2487. /**
  2488. * Sets whether the list view panel should be open.
  2489. *
  2490. * @param {boolean} isOpen If true, opens the list view. If false, closes it.
  2491. * It does not toggle the state, but sets it directly.
  2492. */
  2493. function setIsListViewOpened(isOpen) {
  2494. return {
  2495. type: 'SET_IS_LIST_VIEW_OPENED',
  2496. isOpen
  2497. };
  2498. }
  2499. /**
  2500. * Reverts a template to its original theme-provided file.
  2501. *
  2502. * @param {Object} template The template to revert.
  2503. * @param {Object} [options]
  2504. * @param {boolean} [options.allowUndo] Whether to allow the user to undo
  2505. * reverting the template. Default true.
  2506. */
  2507. const revertTemplate = function (template) {
  2508. let {
  2509. allowUndo = true
  2510. } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2511. return async _ref6 => {
  2512. let {
  2513. registry
  2514. } = _ref6;
  2515. if (!isTemplateRevertable(template)) {
  2516. registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('This template is not revertable.'), {
  2517. type: 'snackbar'
  2518. });
  2519. return;
  2520. }
  2521. try {
  2522. var _fileTemplate$content;
  2523. const templateEntityConfig = registry.select(external_wp_coreData_namespaceObject.store).getEntityConfig('postType', template.type);
  2524. if (!templateEntityConfig) {
  2525. registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), {
  2526. type: 'snackbar'
  2527. });
  2528. return;
  2529. }
  2530. const fileTemplatePath = (0,external_wp_url_namespaceObject.addQueryArgs)(`${templateEntityConfig.baseURL}/${template.id}`, {
  2531. context: 'edit',
  2532. source: 'theme'
  2533. });
  2534. const fileTemplate = await external_wp_apiFetch_default()({
  2535. path: fileTemplatePath
  2536. });
  2537. if (!fileTemplate) {
  2538. registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), {
  2539. type: 'snackbar'
  2540. });
  2541. return;
  2542. }
  2543. const serializeBlocks = _ref7 => {
  2544. let {
  2545. blocks: blocksForSerialization = []
  2546. } = _ref7;
  2547. return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization);
  2548. };
  2549. const edited = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', template.type, template.id); // We are fixing up the undo level here to make sure we can undo
  2550. // the revert in the header toolbar correctly.
  2551. registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, template.id, {
  2552. content: serializeBlocks,
  2553. // Required to make the `undo` behave correctly.
  2554. blocks: edited.blocks,
  2555. // Required to revert the blocks in the editor.
  2556. source: 'custom' // required to avoid turning the editor into a dirty state
  2557. }, {
  2558. undoIgnore: true // Required to merge this edit with the last undo level.
  2559. });
  2560. const blocks = (0,external_wp_blocks_namespaceObject.parse)(fileTemplate === null || fileTemplate === void 0 ? void 0 : (_fileTemplate$content = fileTemplate.content) === null || _fileTemplate$content === void 0 ? void 0 : _fileTemplate$content.raw);
  2561. registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, fileTemplate.id, {
  2562. content: serializeBlocks,
  2563. blocks,
  2564. source: 'theme'
  2565. });
  2566. if (allowUndo) {
  2567. const undoRevert = () => {
  2568. registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, edited.id, {
  2569. content: serializeBlocks,
  2570. blocks: edited.blocks,
  2571. source: 'custom'
  2572. });
  2573. };
  2574. registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template reverted.'), {
  2575. type: 'snackbar',
  2576. actions: [{
  2577. label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
  2578. onClick: undoRevert
  2579. }]
  2580. });
  2581. } else {
  2582. registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template reverted.'));
  2583. }
  2584. } catch (error) {
  2585. const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('Template revert failed. Please reload.');
  2586. registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, {
  2587. type: 'snackbar'
  2588. });
  2589. }
  2590. };
  2591. };
  2592. /**
  2593. * Action that opens an editor sidebar.
  2594. *
  2595. * @param {?string} name Sidebar name to be opened.
  2596. */
  2597. const openGeneralSidebar = name => _ref8 => {
  2598. let {
  2599. registry
  2600. } = _ref8;
  2601. registry.dispatch(store).enableComplementaryArea(STORE_NAME, name);
  2602. };
  2603. /**
  2604. * Action that closes the sidebar.
  2605. */
  2606. const closeGeneralSidebar = () => _ref9 => {
  2607. let {
  2608. registry
  2609. } = _ref9;
  2610. registry.dispatch(store).disableComplementaryArea(STORE_NAME);
  2611. };
  2612. const switchEditorMode = mode => _ref10 => {
  2613. let {
  2614. registry
  2615. } = _ref10;
  2616. registry.dispatch('core/preferences').set('core/edit-site', 'editorMode', mode); // Unselect blocks when we switch to a non visual mode.
  2617. if (mode !== 'visual') {
  2618. registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock();
  2619. }
  2620. if (mode === 'visual') {
  2621. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Visual editor selected'), 'assertive');
  2622. } else if (mode === 'mosaic') {
  2623. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Mosaic view selected'), 'assertive');
  2624. }
  2625. };
  2626. ;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js
  2627. var LEAF_KEY, hasWeakMap;
  2628. /**
  2629. * Arbitrary value used as key for referencing cache object in WeakMap tree.
  2630. *
  2631. * @type {Object}
  2632. */
  2633. LEAF_KEY = {};
  2634. /**
  2635. * Whether environment supports WeakMap.
  2636. *
  2637. * @type {boolean}
  2638. */
  2639. hasWeakMap = typeof WeakMap !== 'undefined';
  2640. /**
  2641. * Returns the first argument as the sole entry in an array.
  2642. *
  2643. * @param {*} value Value to return.
  2644. *
  2645. * @return {Array} Value returned as entry in array.
  2646. */
  2647. function arrayOf( value ) {
  2648. return [ value ];
  2649. }
  2650. /**
  2651. * Returns true if the value passed is object-like, or false otherwise. A value
  2652. * is object-like if it can support property assignment, e.g. object or array.
  2653. *
  2654. * @param {*} value Value to test.
  2655. *
  2656. * @return {boolean} Whether value is object-like.
  2657. */
  2658. function isObjectLike( value ) {
  2659. return !! value && 'object' === typeof value;
  2660. }
  2661. /**
  2662. * Creates and returns a new cache object.
  2663. *
  2664. * @return {Object} Cache object.
  2665. */
  2666. function createCache() {
  2667. var cache = {
  2668. clear: function() {
  2669. cache.head = null;
  2670. },
  2671. };
  2672. return cache;
  2673. }
  2674. /**
  2675. * Returns true if entries within the two arrays are strictly equal by
  2676. * reference from a starting index.
  2677. *
  2678. * @param {Array} a First array.
  2679. * @param {Array} b Second array.
  2680. * @param {number} fromIndex Index from which to start comparison.
  2681. *
  2682. * @return {boolean} Whether arrays are shallowly equal.
  2683. */
  2684. function isShallowEqual( a, b, fromIndex ) {
  2685. var i;
  2686. if ( a.length !== b.length ) {
  2687. return false;
  2688. }
  2689. for ( i = fromIndex; i < a.length; i++ ) {
  2690. if ( a[ i ] !== b[ i ] ) {
  2691. return false;
  2692. }
  2693. }
  2694. return true;
  2695. }
  2696. /**
  2697. * Returns a memoized selector function. The getDependants function argument is
  2698. * called before the memoized selector and is expected to return an immutable
  2699. * reference or array of references on which the selector depends for computing
  2700. * its own return value. The memoize cache is preserved only as long as those
  2701. * dependant references remain the same. If getDependants returns a different
  2702. * reference(s), the cache is cleared and the selector value regenerated.
  2703. *
  2704. * @param {Function} selector Selector function.
  2705. * @param {Function} getDependants Dependant getter returning an immutable
  2706. * reference or array of reference used in
  2707. * cache bust consideration.
  2708. *
  2709. * @return {Function} Memoized selector.
  2710. */
  2711. /* harmony default export */ function rememo(selector, getDependants ) {
  2712. var rootCache, getCache;
  2713. // Use object source as dependant if getter not provided
  2714. if ( ! getDependants ) {
  2715. getDependants = arrayOf;
  2716. }
  2717. /**
  2718. * Returns the root cache. If WeakMap is supported, this is assigned to the
  2719. * root WeakMap cache set, otherwise it is a shared instance of the default
  2720. * cache object.
  2721. *
  2722. * @return {(WeakMap|Object)} Root cache object.
  2723. */
  2724. function getRootCache() {
  2725. return rootCache;
  2726. }
  2727. /**
  2728. * Returns the cache for a given dependants array. When possible, a WeakMap
  2729. * will be used to create a unique cache for each set of dependants. This
  2730. * is feasible due to the nature of WeakMap in allowing garbage collection
  2731. * to occur on entries where the key object is no longer referenced. Since
  2732. * WeakMap requires the key to be an object, this is only possible when the
  2733. * dependant is object-like. The root cache is created as a hierarchy where
  2734. * each top-level key is the first entry in a dependants set, the value a
  2735. * WeakMap where each key is the next dependant, and so on. This continues
  2736. * so long as the dependants are object-like. If no dependants are object-
  2737. * like, then the cache is shared across all invocations.
  2738. *
  2739. * @see isObjectLike
  2740. *
  2741. * @param {Array} dependants Selector dependants.
  2742. *
  2743. * @return {Object} Cache object.
  2744. */
  2745. function getWeakMapCache( dependants ) {
  2746. var caches = rootCache,
  2747. isUniqueByDependants = true,
  2748. i, dependant, map, cache;
  2749. for ( i = 0; i < dependants.length; i++ ) {
  2750. dependant = dependants[ i ];
  2751. // Can only compose WeakMap from object-like key.
  2752. if ( ! isObjectLike( dependant ) ) {
  2753. isUniqueByDependants = false;
  2754. break;
  2755. }
  2756. // Does current segment of cache already have a WeakMap?
  2757. if ( caches.has( dependant ) ) {
  2758. // Traverse into nested WeakMap.
  2759. caches = caches.get( dependant );
  2760. } else {
  2761. // Create, set, and traverse into a new one.
  2762. map = new WeakMap();
  2763. caches.set( dependant, map );
  2764. caches = map;
  2765. }
  2766. }
  2767. // We use an arbitrary (but consistent) object as key for the last item
  2768. // in the WeakMap to serve as our running cache.
  2769. if ( ! caches.has( LEAF_KEY ) ) {
  2770. cache = createCache();
  2771. cache.isUniqueByDependants = isUniqueByDependants;
  2772. caches.set( LEAF_KEY, cache );
  2773. }
  2774. return caches.get( LEAF_KEY );
  2775. }
  2776. // Assign cache handler by availability of WeakMap
  2777. getCache = hasWeakMap ? getWeakMapCache : getRootCache;
  2778. /**
  2779. * Resets root memoization cache.
  2780. */
  2781. function clear() {
  2782. rootCache = hasWeakMap ? new WeakMap() : createCache();
  2783. }
  2784. // eslint-disable-next-line jsdoc/check-param-names
  2785. /**
  2786. * The augmented selector call, considering first whether dependants have
  2787. * changed before passing it to underlying memoize function.
  2788. *
  2789. * @param {Object} source Source object for derivation.
  2790. * @param {...*} extraArgs Additional arguments to pass to selector.
  2791. *
  2792. * @return {*} Selector result.
  2793. */
  2794. function callSelector( /* source, ...extraArgs */ ) {
  2795. var len = arguments.length,
  2796. cache, node, i, args, dependants;
  2797. // Create copy of arguments (avoid leaking deoptimization).
  2798. args = new Array( len );
  2799. for ( i = 0; i < len; i++ ) {
  2800. args[ i ] = arguments[ i ];
  2801. }
  2802. dependants = getDependants.apply( null, args );
  2803. cache = getCache( dependants );
  2804. // If not guaranteed uniqueness by dependants (primitive type or lack
  2805. // of WeakMap support), shallow compare against last dependants and, if
  2806. // references have changed, destroy cache to recalculate result.
  2807. if ( ! cache.isUniqueByDependants ) {
  2808. if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
  2809. cache.clear();
  2810. }
  2811. cache.lastDependants = dependants;
  2812. }
  2813. node = cache.head;
  2814. while ( node ) {
  2815. // Check whether node arguments match arguments
  2816. if ( ! isShallowEqual( node.args, args, 1 ) ) {
  2817. node = node.next;
  2818. continue;
  2819. }
  2820. // At this point we can assume we've found a match
  2821. // Surface matched node to head if not already
  2822. if ( node !== cache.head ) {
  2823. // Adjust siblings to point to each other.
  2824. node.prev.next = node.next;
  2825. if ( node.next ) {
  2826. node.next.prev = node.prev;
  2827. }
  2828. node.next = cache.head;
  2829. node.prev = null;
  2830. cache.head.prev = node;
  2831. cache.head = node;
  2832. }
  2833. // Return immediately
  2834. return node.val;
  2835. }
  2836. // No cached value found. Continue to insertion phase:
  2837. node = {
  2838. // Generate the result from original function
  2839. val: selector.apply( null, args ),
  2840. };
  2841. // Avoid including the source object in the cache.
  2842. args[ 0 ] = null;
  2843. node.args = args;
  2844. // Don't need to check whether node is already head, since it would
  2845. // have been returned above already if it was
  2846. // Shift existing head down list
  2847. if ( cache.head ) {
  2848. cache.head.prev = node;
  2849. node.next = cache.head;
  2850. }
  2851. cache.head = node;
  2852. return node.val;
  2853. }
  2854. callSelector.getDependants = getDependants;
  2855. callSelector.clear = clear;
  2856. clear();
  2857. return callSelector;
  2858. }
  2859. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js
  2860. /**
  2861. * External dependencies
  2862. */
  2863. /**
  2864. * Internal dependencies
  2865. */
  2866. function isTemplateSuperseded(slug, existingSlugs, showOnFront) {
  2867. if (!TEMPLATE_OVERRIDES[slug]) {
  2868. return false;
  2869. } // `home` template is unused if it is superseded by `front-page`
  2870. // or "show on front" is set to show a page rather than blog posts.
  2871. if (slug === 'home' && showOnFront !== 'posts') {
  2872. return true;
  2873. }
  2874. return TEMPLATE_OVERRIDES[slug].every(overrideSlug => existingSlugs.includes(overrideSlug) || isTemplateSuperseded(overrideSlug, existingSlugs, showOnFront));
  2875. }
  2876. function getTemplateLocation(slug) {
  2877. const isTopLevelTemplate = TEMPLATES_TOP_LEVEL.includes(slug);
  2878. if (isTopLevelTemplate) {
  2879. return MENU_TEMPLATES;
  2880. }
  2881. const isGeneralTemplate = TEMPLATES_GENERAL.includes(slug);
  2882. if (isGeneralTemplate) {
  2883. return MENU_TEMPLATES_GENERAL;
  2884. }
  2885. const isPostsTemplate = TEMPLATES_POSTS_PREFIXES.some(prefix => slug.startsWith(prefix));
  2886. if (isPostsTemplate) {
  2887. return MENU_TEMPLATES_POSTS;
  2888. }
  2889. const isPagesTemplate = TEMPLATES_PAGES_PREFIXES.some(prefix => slug.startsWith(prefix));
  2890. if (isPagesTemplate) {
  2891. return MENU_TEMPLATES_PAGES;
  2892. }
  2893. return MENU_TEMPLATES_GENERAL;
  2894. }
  2895. function getUnusedTemplates(templates, showOnFront) {
  2896. const templateSlugs = map(templates, 'slug');
  2897. const supersededTemplates = templates.filter(_ref => {
  2898. let {
  2899. slug
  2900. } = _ref;
  2901. return isTemplateSuperseded(slug, templateSlugs, showOnFront);
  2902. });
  2903. return supersededTemplates;
  2904. }
  2905. function getTemplatesLocationMap(templates) {
  2906. return templates.reduce((obj, template) => {
  2907. obj[template.slug] = getTemplateLocation(template.slug);
  2908. return obj;
  2909. }, {});
  2910. }
  2911. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/selectors.js
  2912. /**
  2913. * External dependencies
  2914. */
  2915. /**
  2916. * WordPress dependencies
  2917. */
  2918. /**
  2919. * Internal dependencies
  2920. */
  2921. /**
  2922. * @typedef {'template'|'template_type'} TemplateType Template type.
  2923. */
  2924. /**
  2925. * Helper for getting a preference from the preferences store.
  2926. *
  2927. * This is only present so that `getSettings` doesn't need to be made a
  2928. * registry selector.
  2929. *
  2930. * It's unstable because the selector needs to be exported and so part of the
  2931. * public API to work.
  2932. */
  2933. const __unstableGetPreference = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, name) => select(external_wp_preferences_namespaceObject.store).get('core/edit-site', name));
  2934. /**
  2935. * Returns whether the given feature is enabled or not.
  2936. *
  2937. * @param {Object} state Global application state.
  2938. * @param {string} featureName Feature slug.
  2939. *
  2940. * @return {boolean} Is active.
  2941. */
  2942. function selectors_isFeatureActive(state, featureName) {
  2943. external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive`, {
  2944. since: '6.0',
  2945. alternative: `select( 'core/preferences' ).get`
  2946. });
  2947. return !!__unstableGetPreference(state, featureName);
  2948. }
  2949. /**
  2950. * Returns the current editing canvas device type.
  2951. *
  2952. * @param {Object} state Global application state.
  2953. *
  2954. * @return {string} Device type.
  2955. */
  2956. function __experimentalGetPreviewDeviceType(state) {
  2957. return state.deviceType;
  2958. }
  2959. /**
  2960. * Returns whether the current user can create media or not.
  2961. *
  2962. * @param {Object} state Global application state.
  2963. *
  2964. * @return {Object} Whether the current user can create media or not.
  2965. */
  2966. const getCanUserCreateMedia = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => select(external_wp_coreData_namespaceObject.store).canUser('create', 'media'));
  2967. /**
  2968. * Returns any available Reusable blocks.
  2969. *
  2970. * @param {Object} state Global application state.
  2971. *
  2972. * @return {Array} The available reusable blocks.
  2973. */
  2974. const getReusableBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
  2975. const isWeb = external_wp_element_namespaceObject.Platform.OS === 'web';
  2976. return isWeb ? select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_block', {
  2977. per_page: -1
  2978. }) : [];
  2979. });
  2980. /**
  2981. * Returns the settings, taking into account active features and permissions.
  2982. *
  2983. * @param {Object} state Global application state.
  2984. * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.
  2985. *
  2986. * @return {Object} Settings.
  2987. */
  2988. const getSettings = rememo((state, setIsInserterOpen) => {
  2989. const settings = { ...state.settings,
  2990. outlineMode: true,
  2991. focusMode: !!__unstableGetPreference(state, 'focusMode'),
  2992. hasFixedToolbar: !!__unstableGetPreference(state, 'fixedToolbar'),
  2993. keepCaretInsideBlock: !!__unstableGetPreference(state, 'keepCaretInsideBlock'),
  2994. showIconLabels: !!__unstableGetPreference(state, 'showIconLabels'),
  2995. __experimentalSetIsInserterOpened: setIsInserterOpen,
  2996. __experimentalReusableBlocks: getReusableBlocks(state),
  2997. __experimentalPreferPatternsOnRoot: 'wp_template' === getEditedPostType(state)
  2998. };
  2999. const canUserCreateMedia = getCanUserCreateMedia(state);
  3000. if (!canUserCreateMedia) {
  3001. return settings;
  3002. }
  3003. settings.mediaUpload = _ref => {
  3004. let {
  3005. onError,
  3006. ...rest
  3007. } = _ref;
  3008. (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({
  3009. wpAllowedMimeTypes: state.settings.allowedMimeTypes,
  3010. onError: _ref2 => {
  3011. let {
  3012. message
  3013. } = _ref2;
  3014. return onError(message);
  3015. },
  3016. ...rest
  3017. });
  3018. };
  3019. return settings;
  3020. }, state => [getCanUserCreateMedia(state), state.settings, __unstableGetPreference(state, 'focusMode'), __unstableGetPreference(state, 'fixedToolbar'), __unstableGetPreference(state, 'keepCaretInsideBlock'), __unstableGetPreference(state, 'showIconLabels'), getReusableBlocks(state), getEditedPostType(state)]);
  3021. /**
  3022. * Returns the current home template ID.
  3023. *
  3024. * @param {Object} state Global application state.
  3025. *
  3026. * @return {number?} Home template ID.
  3027. */
  3028. function getHomeTemplateId(state) {
  3029. return state.homeTemplateId;
  3030. }
  3031. function getCurrentEditedPost(state) {
  3032. return state.editedPost;
  3033. }
  3034. /**
  3035. * Returns the current edited post type (wp_template or wp_template_part).
  3036. *
  3037. * @param {Object} state Global application state.
  3038. *
  3039. * @return {TemplateType?} Template type.
  3040. */
  3041. function getEditedPostType(state) {
  3042. return getCurrentEditedPost(state).type;
  3043. }
  3044. /**
  3045. * Returns the ID of the currently edited template or template part.
  3046. *
  3047. * @param {Object} state Global application state.
  3048. *
  3049. * @return {string?} Post ID.
  3050. */
  3051. function getEditedPostId(state) {
  3052. return getCurrentEditedPost(state).id;
  3053. }
  3054. /**
  3055. * Returns the current page object.
  3056. *
  3057. * @param {Object} state Global application state.
  3058. *
  3059. * @return {Object} Page.
  3060. */
  3061. function getPage(state) {
  3062. return getCurrentEditedPost(state).page;
  3063. }
  3064. /**
  3065. * Returns the active menu in the navigation panel.
  3066. *
  3067. * @param {Object} state Global application state.
  3068. *
  3069. * @return {string} Active menu.
  3070. */
  3071. function getNavigationPanelActiveMenu(state) {
  3072. return state.navigationPanel.menu;
  3073. }
  3074. /**
  3075. * Returns the current template or template part's corresponding
  3076. * navigation panel's sub menu, to be used with `openNavigationPanelToMenu`.
  3077. *
  3078. * @param {Object} state Global application state.
  3079. *
  3080. * @return {string} The current template or template part's sub menu.
  3081. */
  3082. const getCurrentTemplateNavigationPanelSubMenu = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
  3083. const templateType = getEditedPostType(state);
  3084. const templateId = getEditedPostId(state);
  3085. const template = templateId ? select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', templateType, templateId) : null;
  3086. if (!template) {
  3087. return MENU_ROOT;
  3088. }
  3089. if ('wp_template_part' === templateType) {
  3090. var _TEMPLATE_PARTS_SUB_M;
  3091. return ((_TEMPLATE_PARTS_SUB_M = TEMPLATE_PARTS_SUB_MENUS.find(submenu => submenu.area === (template === null || template === void 0 ? void 0 : template.area))) === null || _TEMPLATE_PARTS_SUB_M === void 0 ? void 0 : _TEMPLATE_PARTS_SUB_M.menu) || MENU_TEMPLATE_PARTS;
  3092. }
  3093. const templates = select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_template');
  3094. const showOnFront = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('root', 'site').show_on_front;
  3095. if (isTemplateSuperseded(template.slug, (0,external_lodash_namespaceObject.map)(templates, 'slug'), showOnFront)) {
  3096. return MENU_TEMPLATES_UNUSED;
  3097. }
  3098. return getTemplateLocation(template.slug);
  3099. });
  3100. /**
  3101. * Returns the current opened/closed state of the navigation panel.
  3102. *
  3103. * @param {Object} state Global application state.
  3104. *
  3105. * @return {boolean} True if the navigation panel should be open; false if closed.
  3106. */
  3107. function isNavigationOpened(state) {
  3108. return state.navigationPanel.isOpen;
  3109. }
  3110. /**
  3111. * Returns the current opened/closed state of the inserter panel.
  3112. *
  3113. * @param {Object} state Global application state.
  3114. *
  3115. * @return {boolean} True if the inserter panel should be open; false if closed.
  3116. */
  3117. function isInserterOpened(state) {
  3118. return !!state.blockInserterPanel;
  3119. }
  3120. /**
  3121. * Get the insertion point for the inserter.
  3122. *
  3123. * @param {Object} state Global application state.
  3124. *
  3125. * @return {Object} The root client ID, index to insert at and starting filter value.
  3126. */
  3127. function __experimentalGetInsertionPoint(state) {
  3128. const {
  3129. rootClientId,
  3130. insertionIndex,
  3131. filterValue
  3132. } = state.blockInserterPanel;
  3133. return {
  3134. rootClientId,
  3135. insertionIndex,
  3136. filterValue
  3137. };
  3138. }
  3139. /**
  3140. * Returns the current opened/closed state of the list view panel.
  3141. *
  3142. * @param {Object} state Global application state.
  3143. *
  3144. * @return {boolean} True if the list view panel should be open; false if closed.
  3145. */
  3146. function isListViewOpened(state) {
  3147. return state.listViewPanel;
  3148. }
  3149. /**
  3150. * Returns the template parts and their blocks for the current edited template.
  3151. *
  3152. * @param {Object} state Global application state.
  3153. * @return {Array} Template parts and their blocks in an array.
  3154. */
  3155. const getCurrentTemplateTemplateParts = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
  3156. var _template$blocks;
  3157. const templateType = getEditedPostType(state);
  3158. const templateId = getEditedPostId(state);
  3159. const template = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', templateType, templateId);
  3160. const templateParts = select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_template_part', {
  3161. per_page: -1
  3162. });
  3163. const templatePartsById = (0,external_lodash_namespaceObject.keyBy)(templateParts, templatePart => templatePart.id);
  3164. return ((_template$blocks = template.blocks) !== null && _template$blocks !== void 0 ? _template$blocks : []).filter(block => (0,external_wp_blocks_namespaceObject.isTemplatePart)(block)).map(block => {
  3165. const {
  3166. attributes: {
  3167. theme,
  3168. slug
  3169. }
  3170. } = block;
  3171. const templatePartId = `${theme}//${slug}`;
  3172. const templatePart = templatePartsById[templatePartId];
  3173. return {
  3174. templatePart,
  3175. block
  3176. };
  3177. }).filter(_ref3 => {
  3178. let {
  3179. templatePart
  3180. } = _ref3;
  3181. return !!templatePart;
  3182. });
  3183. });
  3184. /**
  3185. * Returns the current editing mode.
  3186. *
  3187. * @param {Object} state Global application state.
  3188. *
  3189. * @return {string} Editing mode.
  3190. */
  3191. function getEditorMode(state) {
  3192. return __unstableGetPreference(state, 'editorMode');
  3193. }
  3194. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/index.js
  3195. /**
  3196. * WordPress dependencies
  3197. */
  3198. /**
  3199. * Internal dependencies
  3200. */
  3201. const storeConfig = {
  3202. reducer: reducer,
  3203. actions: store_actions_namespaceObject,
  3204. selectors: store_selectors_namespaceObject
  3205. };
  3206. const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, storeConfig);
  3207. (0,external_wp_data_namespaceObject.register)(store_store);
  3208. ;// CONCATENATED MODULE: ./node_modules/history/index.js
  3209. /**
  3210. * Actions represent the type of change to a location value.
  3211. *
  3212. * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#action
  3213. */
  3214. var Action;
  3215. (function (Action) {
  3216. /**
  3217. * A POP indicates a change to an arbitrary index in the history stack, such
  3218. * as a back or forward navigation. It does not describe the direction of the
  3219. * navigation, only that the current index changed.
  3220. *
  3221. * Note: This is the default action for newly created history objects.
  3222. */
  3223. Action["Pop"] = "POP";
  3224. /**
  3225. * A PUSH indicates a new entry being added to the history stack, such as when
  3226. * a link is clicked and a new page loads. When this happens, all subsequent
  3227. * entries in the stack are lost.
  3228. */
  3229. Action["Push"] = "PUSH";
  3230. /**
  3231. * A REPLACE indicates the entry at the current index in the history stack
  3232. * being replaced by a new one.
  3233. */
  3234. Action["Replace"] = "REPLACE";
  3235. })(Action || (Action = {}));
  3236. var readOnly = false ? 0 : function (obj) {
  3237. return obj;
  3238. };
  3239. function warning(cond, message) {
  3240. if (!cond) {
  3241. // eslint-disable-next-line no-console
  3242. if (typeof console !== 'undefined') console.warn(message);
  3243. try {
  3244. // Welcome to debugging history!
  3245. //
  3246. // This error is thrown as a convenience so you can more easily
  3247. // find the source for a warning that appears in the console by
  3248. // enabling "pause on exceptions" in your JavaScript debugger.
  3249. throw new Error(message); // eslint-disable-next-line no-empty
  3250. } catch (e) {}
  3251. }
  3252. }
  3253. var BeforeUnloadEventType = 'beforeunload';
  3254. var HashChangeEventType = 'hashchange';
  3255. var PopStateEventType = 'popstate';
  3256. /**
  3257. * Browser history stores the location in regular URLs. This is the standard for
  3258. * most web apps, but it requires some configuration on the server to ensure you
  3259. * serve the same app at multiple URLs.
  3260. *
  3261. * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory
  3262. */
  3263. function createBrowserHistory(options) {
  3264. if (options === void 0) {
  3265. options = {};
  3266. }
  3267. var _options = options,
  3268. _options$window = _options.window,
  3269. window = _options$window === void 0 ? document.defaultView : _options$window;
  3270. var globalHistory = window.history;
  3271. function getIndexAndLocation() {
  3272. var _window$location = window.location,
  3273. pathname = _window$location.pathname,
  3274. search = _window$location.search,
  3275. hash = _window$location.hash;
  3276. var state = globalHistory.state || {};
  3277. return [state.idx, readOnly({
  3278. pathname: pathname,
  3279. search: search,
  3280. hash: hash,
  3281. state: state.usr || null,
  3282. key: state.key || 'default'
  3283. })];
  3284. }
  3285. var blockedPopTx = null;
  3286. function handlePop() {
  3287. if (blockedPopTx) {
  3288. blockers.call(blockedPopTx);
  3289. blockedPopTx = null;
  3290. } else {
  3291. var nextAction = Action.Pop;
  3292. var _getIndexAndLocation = getIndexAndLocation(),
  3293. nextIndex = _getIndexAndLocation[0],
  3294. nextLocation = _getIndexAndLocation[1];
  3295. if (blockers.length) {
  3296. if (nextIndex != null) {
  3297. var delta = index - nextIndex;
  3298. if (delta) {
  3299. // Revert the POP
  3300. blockedPopTx = {
  3301. action: nextAction,
  3302. location: nextLocation,
  3303. retry: function retry() {
  3304. go(delta * -1);
  3305. }
  3306. };
  3307. go(delta);
  3308. }
  3309. } else {
  3310. // Trying to POP to a location with no index. We did not create
  3311. // this location, so we can't effectively block the navigation.
  3312. false ? 0 : void 0;
  3313. }
  3314. } else {
  3315. applyTx(nextAction);
  3316. }
  3317. }
  3318. }
  3319. window.addEventListener(PopStateEventType, handlePop);
  3320. var action = Action.Pop;
  3321. var _getIndexAndLocation2 = getIndexAndLocation(),
  3322. index = _getIndexAndLocation2[0],
  3323. location = _getIndexAndLocation2[1];
  3324. var listeners = createEvents();
  3325. var blockers = createEvents();
  3326. if (index == null) {
  3327. index = 0;
  3328. globalHistory.replaceState(extends_extends({}, globalHistory.state, {
  3329. idx: index
  3330. }), '');
  3331. }
  3332. function createHref(to) {
  3333. return typeof to === 'string' ? to : createPath(to);
  3334. } // state defaults to `null` because `window.history.state` does
  3335. function getNextLocation(to, state) {
  3336. if (state === void 0) {
  3337. state = null;
  3338. }
  3339. return readOnly(extends_extends({
  3340. pathname: location.pathname,
  3341. hash: '',
  3342. search: ''
  3343. }, typeof to === 'string' ? parsePath(to) : to, {
  3344. state: state,
  3345. key: createKey()
  3346. }));
  3347. }
  3348. function getHistoryStateAndUrl(nextLocation, index) {
  3349. return [{
  3350. usr: nextLocation.state,
  3351. key: nextLocation.key,
  3352. idx: index
  3353. }, createHref(nextLocation)];
  3354. }
  3355. function allowTx(action, location, retry) {
  3356. return !blockers.length || (blockers.call({
  3357. action: action,
  3358. location: location,
  3359. retry: retry
  3360. }), false);
  3361. }
  3362. function applyTx(nextAction) {
  3363. action = nextAction;
  3364. var _getIndexAndLocation3 = getIndexAndLocation();
  3365. index = _getIndexAndLocation3[0];
  3366. location = _getIndexAndLocation3[1];
  3367. listeners.call({
  3368. action: action,
  3369. location: location
  3370. });
  3371. }
  3372. function push(to, state) {
  3373. var nextAction = Action.Push;
  3374. var nextLocation = getNextLocation(to, state);
  3375. function retry() {
  3376. push(to, state);
  3377. }
  3378. if (allowTx(nextAction, nextLocation, retry)) {
  3379. var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index + 1),
  3380. historyState = _getHistoryStateAndUr[0],
  3381. url = _getHistoryStateAndUr[1]; // TODO: Support forced reloading
  3382. // try...catch because iOS limits us to 100 pushState calls :/
  3383. try {
  3384. globalHistory.pushState(historyState, '', url);
  3385. } catch (error) {
  3386. // They are going to lose state here, but there is no real
  3387. // way to warn them about it since the page will refresh...
  3388. window.location.assign(url);
  3389. }
  3390. applyTx(nextAction);
  3391. }
  3392. }
  3393. function replace(to, state) {
  3394. var nextAction = Action.Replace;
  3395. var nextLocation = getNextLocation(to, state);
  3396. function retry() {
  3397. replace(to, state);
  3398. }
  3399. if (allowTx(nextAction, nextLocation, retry)) {
  3400. var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index),
  3401. historyState = _getHistoryStateAndUr2[0],
  3402. url = _getHistoryStateAndUr2[1]; // TODO: Support forced reloading
  3403. globalHistory.replaceState(historyState, '', url);
  3404. applyTx(nextAction);
  3405. }
  3406. }
  3407. function go(delta) {
  3408. globalHistory.go(delta);
  3409. }
  3410. var history = {
  3411. get action() {
  3412. return action;
  3413. },
  3414. get location() {
  3415. return location;
  3416. },
  3417. createHref: createHref,
  3418. push: push,
  3419. replace: replace,
  3420. go: go,
  3421. back: function back() {
  3422. go(-1);
  3423. },
  3424. forward: function forward() {
  3425. go(1);
  3426. },
  3427. listen: function listen(listener) {
  3428. return listeners.push(listener);
  3429. },
  3430. block: function block(blocker) {
  3431. var unblock = blockers.push(blocker);
  3432. if (blockers.length === 1) {
  3433. window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);
  3434. }
  3435. return function () {
  3436. unblock(); // Remove the beforeunload listener so the document may
  3437. // still be salvageable in the pagehide event.
  3438. // See https://html.spec.whatwg.org/#unloading-documents
  3439. if (!blockers.length) {
  3440. window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);
  3441. }
  3442. };
  3443. }
  3444. };
  3445. return history;
  3446. }
  3447. /**
  3448. * Hash history stores the location in window.location.hash. This makes it ideal
  3449. * for situations where you don't want to send the location to the server for
  3450. * some reason, either because you do cannot configure it or the URL space is
  3451. * reserved for something else.
  3452. *
  3453. * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory
  3454. */
  3455. function createHashHistory(options) {
  3456. if (options === void 0) {
  3457. options = {};
  3458. }
  3459. var _options2 = options,
  3460. _options2$window = _options2.window,
  3461. window = _options2$window === void 0 ? document.defaultView : _options2$window;
  3462. var globalHistory = window.history;
  3463. function getIndexAndLocation() {
  3464. var _parsePath = parsePath(window.location.hash.substr(1)),
  3465. _parsePath$pathname = _parsePath.pathname,
  3466. pathname = _parsePath$pathname === void 0 ? '/' : _parsePath$pathname,
  3467. _parsePath$search = _parsePath.search,
  3468. search = _parsePath$search === void 0 ? '' : _parsePath$search,
  3469. _parsePath$hash = _parsePath.hash,
  3470. hash = _parsePath$hash === void 0 ? '' : _parsePath$hash;
  3471. var state = globalHistory.state || {};
  3472. return [state.idx, readOnly({
  3473. pathname: pathname,
  3474. search: search,
  3475. hash: hash,
  3476. state: state.usr || null,
  3477. key: state.key || 'default'
  3478. })];
  3479. }
  3480. var blockedPopTx = null;
  3481. function handlePop() {
  3482. if (blockedPopTx) {
  3483. blockers.call(blockedPopTx);
  3484. blockedPopTx = null;
  3485. } else {
  3486. var nextAction = Action.Pop;
  3487. var _getIndexAndLocation4 = getIndexAndLocation(),
  3488. nextIndex = _getIndexAndLocation4[0],
  3489. nextLocation = _getIndexAndLocation4[1];
  3490. if (blockers.length) {
  3491. if (nextIndex != null) {
  3492. var delta = index - nextIndex;
  3493. if (delta) {
  3494. // Revert the POP
  3495. blockedPopTx = {
  3496. action: nextAction,
  3497. location: nextLocation,
  3498. retry: function retry() {
  3499. go(delta * -1);
  3500. }
  3501. };
  3502. go(delta);
  3503. }
  3504. } else {
  3505. // Trying to POP to a location with no index. We did not create
  3506. // this location, so we can't effectively block the navigation.
  3507. false ? 0 : void 0;
  3508. }
  3509. } else {
  3510. applyTx(nextAction);
  3511. }
  3512. }
  3513. }
  3514. window.addEventListener(PopStateEventType, handlePop); // popstate does not fire on hashchange in IE 11 and old (trident) Edge
  3515. // https://developer.mozilla.org/de/docs/Web/API/Window/popstate_event
  3516. window.addEventListener(HashChangeEventType, function () {
  3517. var _getIndexAndLocation5 = getIndexAndLocation(),
  3518. nextLocation = _getIndexAndLocation5[1]; // Ignore extraneous hashchange events.
  3519. if (createPath(nextLocation) !== createPath(location)) {
  3520. handlePop();
  3521. }
  3522. });
  3523. var action = Action.Pop;
  3524. var _getIndexAndLocation6 = getIndexAndLocation(),
  3525. index = _getIndexAndLocation6[0],
  3526. location = _getIndexAndLocation6[1];
  3527. var listeners = createEvents();
  3528. var blockers = createEvents();
  3529. if (index == null) {
  3530. index = 0;
  3531. globalHistory.replaceState(_extends({}, globalHistory.state, {
  3532. idx: index
  3533. }), '');
  3534. }
  3535. function getBaseHref() {
  3536. var base = document.querySelector('base');
  3537. var href = '';
  3538. if (base && base.getAttribute('href')) {
  3539. var url = window.location.href;
  3540. var hashIndex = url.indexOf('#');
  3541. href = hashIndex === -1 ? url : url.slice(0, hashIndex);
  3542. }
  3543. return href;
  3544. }
  3545. function createHref(to) {
  3546. return getBaseHref() + '#' + (typeof to === 'string' ? to : createPath(to));
  3547. }
  3548. function getNextLocation(to, state) {
  3549. if (state === void 0) {
  3550. state = null;
  3551. }
  3552. return readOnly(_extends({
  3553. pathname: location.pathname,
  3554. hash: '',
  3555. search: ''
  3556. }, typeof to === 'string' ? parsePath(to) : to, {
  3557. state: state,
  3558. key: createKey()
  3559. }));
  3560. }
  3561. function getHistoryStateAndUrl(nextLocation, index) {
  3562. return [{
  3563. usr: nextLocation.state,
  3564. key: nextLocation.key,
  3565. idx: index
  3566. }, createHref(nextLocation)];
  3567. }
  3568. function allowTx(action, location, retry) {
  3569. return !blockers.length || (blockers.call({
  3570. action: action,
  3571. location: location,
  3572. retry: retry
  3573. }), false);
  3574. }
  3575. function applyTx(nextAction) {
  3576. action = nextAction;
  3577. var _getIndexAndLocation7 = getIndexAndLocation();
  3578. index = _getIndexAndLocation7[0];
  3579. location = _getIndexAndLocation7[1];
  3580. listeners.call({
  3581. action: action,
  3582. location: location
  3583. });
  3584. }
  3585. function push(to, state) {
  3586. var nextAction = Action.Push;
  3587. var nextLocation = getNextLocation(to, state);
  3588. function retry() {
  3589. push(to, state);
  3590. }
  3591. false ? 0 : void 0;
  3592. if (allowTx(nextAction, nextLocation, retry)) {
  3593. var _getHistoryStateAndUr3 = getHistoryStateAndUrl(nextLocation, index + 1),
  3594. historyState = _getHistoryStateAndUr3[0],
  3595. url = _getHistoryStateAndUr3[1]; // TODO: Support forced reloading
  3596. // try...catch because iOS limits us to 100 pushState calls :/
  3597. try {
  3598. globalHistory.pushState(historyState, '', url);
  3599. } catch (error) {
  3600. // They are going to lose state here, but there is no real
  3601. // way to warn them about it since the page will refresh...
  3602. window.location.assign(url);
  3603. }
  3604. applyTx(nextAction);
  3605. }
  3606. }
  3607. function replace(to, state) {
  3608. var nextAction = Action.Replace;
  3609. var nextLocation = getNextLocation(to, state);
  3610. function retry() {
  3611. replace(to, state);
  3612. }
  3613. false ? 0 : void 0;
  3614. if (allowTx(nextAction, nextLocation, retry)) {
  3615. var _getHistoryStateAndUr4 = getHistoryStateAndUrl(nextLocation, index),
  3616. historyState = _getHistoryStateAndUr4[0],
  3617. url = _getHistoryStateAndUr4[1]; // TODO: Support forced reloading
  3618. globalHistory.replaceState(historyState, '', url);
  3619. applyTx(nextAction);
  3620. }
  3621. }
  3622. function go(delta) {
  3623. globalHistory.go(delta);
  3624. }
  3625. var history = {
  3626. get action() {
  3627. return action;
  3628. },
  3629. get location() {
  3630. return location;
  3631. },
  3632. createHref: createHref,
  3633. push: push,
  3634. replace: replace,
  3635. go: go,
  3636. back: function back() {
  3637. go(-1);
  3638. },
  3639. forward: function forward() {
  3640. go(1);
  3641. },
  3642. listen: function listen(listener) {
  3643. return listeners.push(listener);
  3644. },
  3645. block: function block(blocker) {
  3646. var unblock = blockers.push(blocker);
  3647. if (blockers.length === 1) {
  3648. window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);
  3649. }
  3650. return function () {
  3651. unblock(); // Remove the beforeunload listener so the document may
  3652. // still be salvageable in the pagehide event.
  3653. // See https://html.spec.whatwg.org/#unloading-documents
  3654. if (!blockers.length) {
  3655. window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);
  3656. }
  3657. };
  3658. }
  3659. };
  3660. return history;
  3661. }
  3662. /**
  3663. * Memory history stores the current location in memory. It is designed for use
  3664. * in stateful non-browser environments like tests and React Native.
  3665. *
  3666. * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#creatememoryhistory
  3667. */
  3668. function createMemoryHistory(options) {
  3669. if (options === void 0) {
  3670. options = {};
  3671. }
  3672. var _options3 = options,
  3673. _options3$initialEntr = _options3.initialEntries,
  3674. initialEntries = _options3$initialEntr === void 0 ? ['/'] : _options3$initialEntr,
  3675. initialIndex = _options3.initialIndex;
  3676. var entries = initialEntries.map(function (entry) {
  3677. var location = readOnly(_extends({
  3678. pathname: '/',
  3679. search: '',
  3680. hash: '',
  3681. state: null,
  3682. key: createKey()
  3683. }, typeof entry === 'string' ? parsePath(entry) : entry));
  3684. false ? 0 : void 0;
  3685. return location;
  3686. });
  3687. var index = clamp(initialIndex == null ? entries.length - 1 : initialIndex, 0, entries.length - 1);
  3688. var action = Action.Pop;
  3689. var location = entries[index];
  3690. var listeners = createEvents();
  3691. var blockers = createEvents();
  3692. function createHref(to) {
  3693. return typeof to === 'string' ? to : createPath(to);
  3694. }
  3695. function getNextLocation(to, state) {
  3696. if (state === void 0) {
  3697. state = null;
  3698. }
  3699. return readOnly(_extends({
  3700. pathname: location.pathname,
  3701. search: '',
  3702. hash: ''
  3703. }, typeof to === 'string' ? parsePath(to) : to, {
  3704. state: state,
  3705. key: createKey()
  3706. }));
  3707. }
  3708. function allowTx(action, location, retry) {
  3709. return !blockers.length || (blockers.call({
  3710. action: action,
  3711. location: location,
  3712. retry: retry
  3713. }), false);
  3714. }
  3715. function applyTx(nextAction, nextLocation) {
  3716. action = nextAction;
  3717. location = nextLocation;
  3718. listeners.call({
  3719. action: action,
  3720. location: location
  3721. });
  3722. }
  3723. function push(to, state) {
  3724. var nextAction = Action.Push;
  3725. var nextLocation = getNextLocation(to, state);
  3726. function retry() {
  3727. push(to, state);
  3728. }
  3729. false ? 0 : void 0;
  3730. if (allowTx(nextAction, nextLocation, retry)) {
  3731. index += 1;
  3732. entries.splice(index, entries.length, nextLocation);
  3733. applyTx(nextAction, nextLocation);
  3734. }
  3735. }
  3736. function replace(to, state) {
  3737. var nextAction = Action.Replace;
  3738. var nextLocation = getNextLocation(to, state);
  3739. function retry() {
  3740. replace(to, state);
  3741. }
  3742. false ? 0 : void 0;
  3743. if (allowTx(nextAction, nextLocation, retry)) {
  3744. entries[index] = nextLocation;
  3745. applyTx(nextAction, nextLocation);
  3746. }
  3747. }
  3748. function go(delta) {
  3749. var nextIndex = clamp(index + delta, 0, entries.length - 1);
  3750. var nextAction = Action.Pop;
  3751. var nextLocation = entries[nextIndex];
  3752. function retry() {
  3753. go(delta);
  3754. }
  3755. if (allowTx(nextAction, nextLocation, retry)) {
  3756. index = nextIndex;
  3757. applyTx(nextAction, nextLocation);
  3758. }
  3759. }
  3760. var history = {
  3761. get index() {
  3762. return index;
  3763. },
  3764. get action() {
  3765. return action;
  3766. },
  3767. get location() {
  3768. return location;
  3769. },
  3770. createHref: createHref,
  3771. push: push,
  3772. replace: replace,
  3773. go: go,
  3774. back: function back() {
  3775. go(-1);
  3776. },
  3777. forward: function forward() {
  3778. go(1);
  3779. },
  3780. listen: function listen(listener) {
  3781. return listeners.push(listener);
  3782. },
  3783. block: function block(blocker) {
  3784. return blockers.push(blocker);
  3785. }
  3786. };
  3787. return history;
  3788. } ////////////////////////////////////////////////////////////////////////////////
  3789. // UTILS
  3790. ////////////////////////////////////////////////////////////////////////////////
  3791. function clamp(n, lowerBound, upperBound) {
  3792. return Math.min(Math.max(n, lowerBound), upperBound);
  3793. }
  3794. function promptBeforeUnload(event) {
  3795. // Cancel the event.
  3796. event.preventDefault(); // Chrome (and legacy IE) requires returnValue to be set.
  3797. event.returnValue = '';
  3798. }
  3799. function createEvents() {
  3800. var handlers = [];
  3801. return {
  3802. get length() {
  3803. return handlers.length;
  3804. },
  3805. push: function push(fn) {
  3806. handlers.push(fn);
  3807. return function () {
  3808. handlers = handlers.filter(function (handler) {
  3809. return handler !== fn;
  3810. });
  3811. };
  3812. },
  3813. call: function call(arg) {
  3814. handlers.forEach(function (fn) {
  3815. return fn && fn(arg);
  3816. });
  3817. }
  3818. };
  3819. }
  3820. function createKey() {
  3821. return Math.random().toString(36).substr(2, 8);
  3822. }
  3823. /**
  3824. * Creates a string URL path from the given pathname, search, and hash components.
  3825. *
  3826. * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createpath
  3827. */
  3828. function createPath(_ref) {
  3829. var _ref$pathname = _ref.pathname,
  3830. pathname = _ref$pathname === void 0 ? '/' : _ref$pathname,
  3831. _ref$search = _ref.search,
  3832. search = _ref$search === void 0 ? '' : _ref$search,
  3833. _ref$hash = _ref.hash,
  3834. hash = _ref$hash === void 0 ? '' : _ref$hash;
  3835. if (search && search !== '?') pathname += search.charAt(0) === '?' ? search : '?' + search;
  3836. if (hash && hash !== '#') pathname += hash.charAt(0) === '#' ? hash : '#' + hash;
  3837. return pathname;
  3838. }
  3839. /**
  3840. * Parses a string URL path into its separate pathname, search, and hash components.
  3841. *
  3842. * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#parsepath
  3843. */
  3844. function parsePath(path) {
  3845. var parsedPath = {};
  3846. if (path) {
  3847. var hashIndex = path.indexOf('#');
  3848. if (hashIndex >= 0) {
  3849. parsedPath.hash = path.substr(hashIndex);
  3850. path = path.substr(0, hashIndex);
  3851. }
  3852. var searchIndex = path.indexOf('?');
  3853. if (searchIndex >= 0) {
  3854. parsedPath.search = path.substr(searchIndex);
  3855. path = path.substr(0, searchIndex);
  3856. }
  3857. if (path) {
  3858. parsedPath.pathname = path;
  3859. }
  3860. }
  3861. return parsedPath;
  3862. }
  3863. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/history.js
  3864. /**
  3865. * External dependencies
  3866. */
  3867. /**
  3868. * WordPress dependencies
  3869. */
  3870. const history_history = createBrowserHistory();
  3871. const originalHistoryPush = history_history.push;
  3872. const originalHistoryReplace = history_history.replace;
  3873. function push(params, state) {
  3874. return originalHistoryPush.call(history_history, (0,external_wp_url_namespaceObject.addQueryArgs)(window.location.href, params), state);
  3875. }
  3876. function replace(params, state) {
  3877. return originalHistoryReplace.call(history_history, (0,external_wp_url_namespaceObject.addQueryArgs)(window.location.href, params), state);
  3878. }
  3879. history_history.push = push;
  3880. history_history.replace = replace;
  3881. /* harmony default export */ var utils_history = (history_history);
  3882. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/routes/index.js
  3883. /**
  3884. * WordPress dependencies
  3885. */
  3886. /**
  3887. * Internal dependencies
  3888. */
  3889. const RoutesContext = (0,external_wp_element_namespaceObject.createContext)();
  3890. const HistoryContext = (0,external_wp_element_namespaceObject.createContext)();
  3891. function useLocation() {
  3892. return (0,external_wp_element_namespaceObject.useContext)(RoutesContext);
  3893. }
  3894. function useHistory() {
  3895. return (0,external_wp_element_namespaceObject.useContext)(HistoryContext);
  3896. }
  3897. function getLocationWithParams(location) {
  3898. const searchParams = new URLSearchParams(location.search);
  3899. return { ...location,
  3900. params: Object.fromEntries(searchParams.entries())
  3901. };
  3902. }
  3903. function Routes(_ref) {
  3904. let {
  3905. children
  3906. } = _ref;
  3907. const [location, setLocation] = (0,external_wp_element_namespaceObject.useState)(() => getLocationWithParams(utils_history.location));
  3908. (0,external_wp_element_namespaceObject.useEffect)(() => {
  3909. return utils_history.listen(_ref2 => {
  3910. let {
  3911. location: updatedLocation
  3912. } = _ref2;
  3913. setLocation(getLocationWithParams(updatedLocation));
  3914. });
  3915. }, []);
  3916. return (0,external_wp_element_namespaceObject.createElement)(HistoryContext.Provider, {
  3917. value: utils_history
  3918. }, (0,external_wp_element_namespaceObject.createElement)(RoutesContext.Provider, {
  3919. value: location
  3920. }, children(location)));
  3921. }
  3922. ;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
  3923. var external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
  3924. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
  3925. /**
  3926. * WordPress dependencies
  3927. */
  3928. const plus = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  3929. xmlns: "http://www.w3.org/2000/svg",
  3930. viewBox: "0 0 24 24"
  3931. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  3932. d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"
  3933. }));
  3934. /* harmony default export */ var library_plus = (plus);
  3935. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
  3936. /**
  3937. * WordPress dependencies
  3938. */
  3939. const listView = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  3940. viewBox: "0 0 24 24",
  3941. xmlns: "http://www.w3.org/2000/svg"
  3942. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  3943. d: "M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"
  3944. }));
  3945. /* harmony default export */ var list_view = (listView);
  3946. ;// CONCATENATED MODULE: external ["wp","keycodes"]
  3947. var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
  3948. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
  3949. /**
  3950. * WordPress dependencies
  3951. */
  3952. const external = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  3953. xmlns: "http://www.w3.org/2000/svg",
  3954. viewBox: "0 0 24 24"
  3955. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  3956. d: "M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"
  3957. }));
  3958. /* harmony default export */ var library_external = (external);
  3959. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/config.js
  3960. /**
  3961. * WordPress dependencies
  3962. */
  3963. const textFormattingShortcuts = [{
  3964. keyCombination: {
  3965. modifier: 'primary',
  3966. character: 'b'
  3967. },
  3968. description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text bold.')
  3969. }, {
  3970. keyCombination: {
  3971. modifier: 'primary',
  3972. character: 'i'
  3973. },
  3974. description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text italic.')
  3975. }, {
  3976. keyCombination: {
  3977. modifier: 'primary',
  3978. character: 'k'
  3979. },
  3980. description: (0,external_wp_i18n_namespaceObject.__)('Convert the selected text into a link.')
  3981. }, {
  3982. keyCombination: {
  3983. modifier: 'primaryShift',
  3984. character: 'k'
  3985. },
  3986. description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.')
  3987. }, {
  3988. keyCombination: {
  3989. modifier: 'primary',
  3990. character: 'u'
  3991. },
  3992. description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.')
  3993. }];
  3994. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/shortcut.js
  3995. /**
  3996. * External dependencies
  3997. */
  3998. /**
  3999. * WordPress dependencies
  4000. */
  4001. function KeyCombination(_ref) {
  4002. let {
  4003. keyCombination,
  4004. forceAriaLabel
  4005. } = _ref;
  4006. const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
  4007. const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
  4008. return (0,external_wp_element_namespaceObject.createElement)("kbd", {
  4009. className: "edit-site-keyboard-shortcut-help-modal__shortcut-key-combination",
  4010. "aria-label": forceAriaLabel || ariaLabel
  4011. }, (0,external_lodash_namespaceObject.castArray)(shortcut).map((character, index) => {
  4012. if (character === '+') {
  4013. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, {
  4014. key: index
  4015. }, character);
  4016. }
  4017. return (0,external_wp_element_namespaceObject.createElement)("kbd", {
  4018. key: index,
  4019. className: "edit-site-keyboard-shortcut-help-modal__shortcut-key"
  4020. }, character);
  4021. }));
  4022. }
  4023. function Shortcut(_ref2) {
  4024. let {
  4025. description,
  4026. keyCombination,
  4027. aliases = [],
  4028. ariaLabel
  4029. } = _ref2;
  4030. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
  4031. className: "edit-site-keyboard-shortcut-help-modal__shortcut-description"
  4032. }, description), (0,external_wp_element_namespaceObject.createElement)("div", {
  4033. className: "edit-site-keyboard-shortcut-help-modal__shortcut-term"
  4034. }, (0,external_wp_element_namespaceObject.createElement)(KeyCombination, {
  4035. keyCombination: keyCombination,
  4036. forceAriaLabel: ariaLabel
  4037. }), aliases.map((alias, index) => (0,external_wp_element_namespaceObject.createElement)(KeyCombination, {
  4038. keyCombination: alias,
  4039. forceAriaLabel: ariaLabel,
  4040. key: index
  4041. }))));
  4042. }
  4043. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
  4044. /**
  4045. * WordPress dependencies
  4046. */
  4047. /**
  4048. * Internal dependencies
  4049. */
  4050. function DynamicShortcut(_ref) {
  4051. let {
  4052. name
  4053. } = _ref;
  4054. const {
  4055. keyCombination,
  4056. description,
  4057. aliases
  4058. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4059. const {
  4060. getShortcutKeyCombination,
  4061. getShortcutDescription,
  4062. getShortcutAliases
  4063. } = select(external_wp_keyboardShortcuts_namespaceObject.store);
  4064. return {
  4065. keyCombination: getShortcutKeyCombination(name),
  4066. aliases: getShortcutAliases(name),
  4067. description: getShortcutDescription(name)
  4068. };
  4069. }, [name]);
  4070. if (!keyCombination) {
  4071. return null;
  4072. }
  4073. return (0,external_wp_element_namespaceObject.createElement)(Shortcut, {
  4074. keyCombination: keyCombination,
  4075. description: description,
  4076. aliases: aliases
  4077. });
  4078. }
  4079. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/index.js
  4080. /**
  4081. * External dependencies
  4082. */
  4083. /**
  4084. * WordPress dependencies
  4085. */
  4086. /**
  4087. * Internal dependencies
  4088. */
  4089. const ShortcutList = _ref => {
  4090. let {
  4091. shortcuts
  4092. } = _ref;
  4093. return (
  4094. /*
  4095. * Disable reason: The `list` ARIA role is redundant but
  4096. * Safari+VoiceOver won't announce the list otherwise.
  4097. */
  4098. /* eslint-disable jsx-a11y/no-redundant-roles */
  4099. (0,external_wp_element_namespaceObject.createElement)("ul", {
  4100. className: "edit-site-keyboard-shortcut-help-modal__shortcut-list",
  4101. role: "list"
  4102. }, shortcuts.map((shortcut, index) => (0,external_wp_element_namespaceObject.createElement)("li", {
  4103. className: "edit-site-keyboard-shortcut-help-modal__shortcut",
  4104. key: index
  4105. }, (0,external_lodash_namespaceObject.isString)(shortcut) ? (0,external_wp_element_namespaceObject.createElement)(DynamicShortcut, {
  4106. name: shortcut
  4107. }) : (0,external_wp_element_namespaceObject.createElement)(Shortcut, shortcut))))
  4108. /* eslint-enable jsx-a11y/no-redundant-roles */
  4109. );
  4110. };
  4111. const ShortcutSection = _ref2 => {
  4112. let {
  4113. title,
  4114. shortcuts,
  4115. className
  4116. } = _ref2;
  4117. return (0,external_wp_element_namespaceObject.createElement)("section", {
  4118. className: classnames_default()('edit-site-keyboard-shortcut-help-modal__section', className)
  4119. }, !!title && (0,external_wp_element_namespaceObject.createElement)("h2", {
  4120. className: "edit-site-keyboard-shortcut-help-modal__section-title"
  4121. }, title), (0,external_wp_element_namespaceObject.createElement)(ShortcutList, {
  4122. shortcuts: shortcuts
  4123. }));
  4124. };
  4125. const ShortcutCategorySection = _ref3 => {
  4126. let {
  4127. title,
  4128. categoryName,
  4129. additionalShortcuts = []
  4130. } = _ref3;
  4131. const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4132. return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(categoryName);
  4133. }, [categoryName]);
  4134. return (0,external_wp_element_namespaceObject.createElement)(ShortcutSection, {
  4135. title: title,
  4136. shortcuts: categoryShortcuts.concat(additionalShortcuts)
  4137. });
  4138. };
  4139. function KeyboardShortcutHelpModal(_ref4) {
  4140. let {
  4141. isModalActive,
  4142. toggleModal
  4143. } = _ref4;
  4144. if (!isModalActive) {
  4145. return null;
  4146. }
  4147. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  4148. className: "edit-site-keyboard-shortcut-help-modal",
  4149. title: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'),
  4150. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
  4151. onRequestClose: toggleModal
  4152. }, (0,external_wp_element_namespaceObject.createElement)(ShortcutSection, {
  4153. className: "edit-site-keyboard-shortcut-help-modal__main-shortcuts",
  4154. shortcuts: ['core/edit-site/keyboard-shortcuts']
  4155. }), (0,external_wp_element_namespaceObject.createElement)(ShortcutCategorySection, {
  4156. title: (0,external_wp_i18n_namespaceObject.__)('Global shortcuts'),
  4157. categoryName: "global"
  4158. }), (0,external_wp_element_namespaceObject.createElement)(ShortcutCategorySection, {
  4159. title: (0,external_wp_i18n_namespaceObject.__)('Selection shortcuts'),
  4160. categoryName: "selection"
  4161. }), (0,external_wp_element_namespaceObject.createElement)(ShortcutCategorySection, {
  4162. title: (0,external_wp_i18n_namespaceObject.__)('Block shortcuts'),
  4163. categoryName: "block",
  4164. additionalShortcuts: [{
  4165. keyCombination: {
  4166. character: '/'
  4167. },
  4168. description: (0,external_wp_i18n_namespaceObject.__)('Change the block type after adding a new paragraph.'),
  4169. /* translators: The forward-slash character. e.g. '/'. */
  4170. ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Forward-slash')
  4171. }]
  4172. }), (0,external_wp_element_namespaceObject.createElement)(ShortcutSection, {
  4173. title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'),
  4174. shortcuts: textFormattingShortcuts
  4175. }));
  4176. }
  4177. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/preferences-modal/enable-feature.js
  4178. /**
  4179. * WordPress dependencies
  4180. */
  4181. function EnableFeature(props) {
  4182. const {
  4183. featureName,
  4184. ...remainingProps
  4185. } = props;
  4186. const isChecked = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-site', featureName), [featureName]);
  4187. const {
  4188. toggle
  4189. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
  4190. const onChange = () => toggle('core/edit-site', featureName);
  4191. return (0,external_wp_element_namespaceObject.createElement)(preferences_modal_base_option, extends_extends({
  4192. onChange: onChange,
  4193. isChecked: isChecked
  4194. }, remainingProps));
  4195. }
  4196. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/preferences-modal/index.js
  4197. /**
  4198. * WordPress dependencies
  4199. */
  4200. /**
  4201. * Internal dependencies
  4202. */
  4203. function EditSitePreferencesModal(_ref) {
  4204. let {
  4205. isModalActive,
  4206. toggleModal
  4207. } = _ref;
  4208. const sections = (0,external_wp_element_namespaceObject.useMemo)(() => [{
  4209. name: 'general',
  4210. tabLabel: (0,external_wp_i18n_namespaceObject.__)('General'),
  4211. content: (0,external_wp_element_namespaceObject.createElement)(preferences_modal_section, {
  4212. title: (0,external_wp_i18n_namespaceObject.__)('Appearance'),
  4213. description: (0,external_wp_i18n_namespaceObject.__)('Customize options related to the block editor interface and editing flow.')
  4214. }, (0,external_wp_element_namespaceObject.createElement)(EnableFeature, {
  4215. featureName: "focusMode",
  4216. help: (0,external_wp_i18n_namespaceObject.__)('Highlights the current block and fades other content.'),
  4217. label: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode')
  4218. }), (0,external_wp_element_namespaceObject.createElement)(EnableFeature, {
  4219. featureName: "showIconLabels",
  4220. label: (0,external_wp_i18n_namespaceObject.__)('Show button text labels'),
  4221. help: (0,external_wp_i18n_namespaceObject.__)('Show text instead of icons on buttons')
  4222. }))
  4223. }, {
  4224. name: 'blocks',
  4225. tabLabel: (0,external_wp_i18n_namespaceObject.__)('Blocks'),
  4226. content: (0,external_wp_element_namespaceObject.createElement)(preferences_modal_section, {
  4227. title: (0,external_wp_i18n_namespaceObject.__)('Block interactions'),
  4228. description: (0,external_wp_i18n_namespaceObject.__)('Customize how you interact with blocks in the block library and editing canvas.')
  4229. }, (0,external_wp_element_namespaceObject.createElement)(EnableFeature, {
  4230. featureName: "keepCaretInsideBlock",
  4231. help: (0,external_wp_i18n_namespaceObject.__)('Aids screen readers by stopping text caret from leaving blocks.'),
  4232. label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block')
  4233. }))
  4234. }]);
  4235. if (!isModalActive) {
  4236. return null;
  4237. }
  4238. return (0,external_wp_element_namespaceObject.createElement)(PreferencesModal, {
  4239. closeModal: toggleModal
  4240. }, (0,external_wp_element_namespaceObject.createElement)(PreferencesModalTabs, {
  4241. sections: sections
  4242. }));
  4243. }
  4244. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/tools-more-menu-group/index.js
  4245. /**
  4246. * External dependencies
  4247. */
  4248. /**
  4249. * WordPress dependencies
  4250. */
  4251. const {
  4252. Fill: ToolsMoreMenuGroup,
  4253. Slot
  4254. } = (0,external_wp_components_namespaceObject.createSlotFill)('EditSiteToolsMoreMenuGroup');
  4255. ToolsMoreMenuGroup.Slot = _ref => {
  4256. let {
  4257. fillProps
  4258. } = _ref;
  4259. return (0,external_wp_element_namespaceObject.createElement)(Slot, {
  4260. fillProps: fillProps
  4261. }, fills => !(0,external_lodash_namespaceObject.isEmpty)(fills) && fills);
  4262. };
  4263. /* harmony default export */ var tools_more_menu_group = (ToolsMoreMenuGroup);
  4264. // EXTERNAL MODULE: ./node_modules/downloadjs/download.js
  4265. var download = __webpack_require__(8981);
  4266. var download_default = /*#__PURE__*/__webpack_require__.n(download);
  4267. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/download.js
  4268. /**
  4269. * WordPress dependencies
  4270. */
  4271. const download_download = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4272. xmlns: "http://www.w3.org/2000/svg",
  4273. viewBox: "0 0 24 24"
  4274. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4275. d: "M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"
  4276. }));
  4277. /* harmony default export */ var library_download = (download_download);
  4278. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/more-menu/site-export.js
  4279. /**
  4280. * External dependencies
  4281. */
  4282. /**
  4283. * WordPress dependencies
  4284. */
  4285. function SiteExport() {
  4286. const {
  4287. createErrorNotice
  4288. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  4289. async function handleExport() {
  4290. try {
  4291. const response = await external_wp_apiFetch_default()({
  4292. path: '/wp-block-editor/v1/export',
  4293. parse: false
  4294. });
  4295. const blob = await response.blob();
  4296. const contentDisposition = response.headers.get('content-disposition');
  4297. const contentDispositionMatches = contentDisposition.match(/=(.+)\.zip/);
  4298. const fileName = contentDispositionMatches[1] ? contentDispositionMatches[1] : 'edit-site-export';
  4299. download_default()(blob, fileName + '.zip', 'application/zip');
  4300. } catch (errorResponse) {
  4301. let error = {};
  4302. try {
  4303. error = await errorResponse.json();
  4304. } catch (e) {}
  4305. const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the site export.');
  4306. createErrorNotice(errorMessage, {
  4307. type: 'snackbar'
  4308. });
  4309. }
  4310. }
  4311. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  4312. role: "menuitem",
  4313. icon: library_download,
  4314. onClick: handleExport,
  4315. info: (0,external_wp_i18n_namespaceObject.__)('Download your theme with updated templates and styles.')
  4316. }, (0,external_wp_i18n_namespaceObject._x)('Export', 'site exporter menu item'));
  4317. }
  4318. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/more-menu/welcome-guide-menu-item.js
  4319. /**
  4320. * WordPress dependencies
  4321. */
  4322. function WelcomeGuideMenuItem() {
  4323. const {
  4324. toggle
  4325. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
  4326. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  4327. onClick: () => toggle('core/edit-site', 'welcomeGuide')
  4328. }, (0,external_wp_i18n_namespaceObject.__)('Welcome Guide'));
  4329. }
  4330. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/more-menu/copy-content-menu-item.js
  4331. /**
  4332. * WordPress dependencies
  4333. */
  4334. /**
  4335. * Internal dependencies
  4336. */
  4337. function CopyContentMenuItem() {
  4338. const {
  4339. createNotice
  4340. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  4341. const getText = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4342. return () => {
  4343. const {
  4344. getEditedPostId,
  4345. getEditedPostType
  4346. } = select(store_store);
  4347. const {
  4348. getEditedEntityRecord
  4349. } = select(external_wp_coreData_namespaceObject.store);
  4350. const record = getEditedEntityRecord('postType', getEditedPostType(), getEditedPostId());
  4351. if (record) {
  4352. if (typeof record.content === 'function') {
  4353. return record.content(record);
  4354. } else if (record.blocks) {
  4355. return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(record.blocks);
  4356. } else if (record.content) {
  4357. return record.content;
  4358. }
  4359. }
  4360. return '';
  4361. };
  4362. }, []);
  4363. function onSuccess() {
  4364. createNotice('info', (0,external_wp_i18n_namespaceObject.__)('All content copied.'), {
  4365. isDismissible: true,
  4366. type: 'snackbar'
  4367. });
  4368. }
  4369. const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(getText, onSuccess);
  4370. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  4371. ref: ref
  4372. }, (0,external_wp_i18n_namespaceObject.__)('Copy all content'));
  4373. }
  4374. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/mode-switcher/index.js
  4375. /**
  4376. * WordPress dependencies
  4377. */
  4378. /**
  4379. * Internal dependencies
  4380. */
  4381. /**
  4382. * Internal dependencies
  4383. */
  4384. /**
  4385. * Set of available mode options.
  4386. *
  4387. * @type {Array}
  4388. */
  4389. const MODES = [{
  4390. value: 'visual',
  4391. label: (0,external_wp_i18n_namespaceObject.__)('Visual editor')
  4392. }, {
  4393. value: 'text',
  4394. label: (0,external_wp_i18n_namespaceObject.__)('Code editor')
  4395. }];
  4396. function ModeSwitcher() {
  4397. const {
  4398. shortcut,
  4399. mode
  4400. } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
  4401. shortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getShortcutRepresentation('core/edit-site/toggle-mode'),
  4402. isRichEditingEnabled: select(store_store).getSettings().richEditingEnabled,
  4403. isCodeEditingEnabled: select(store_store).getSettings().codeEditingEnabled,
  4404. mode: select(store_store).getEditorMode()
  4405. }), []);
  4406. const {
  4407. switchEditorMode
  4408. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  4409. const choices = MODES.map(choice => {
  4410. if (choice.value !== mode) {
  4411. return { ...choice,
  4412. shortcut
  4413. };
  4414. }
  4415. return choice;
  4416. });
  4417. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  4418. label: (0,external_wp_i18n_namespaceObject.__)('Editor')
  4419. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, {
  4420. choices: choices,
  4421. value: mode,
  4422. onSelect: switchEditorMode
  4423. }));
  4424. }
  4425. /* harmony default export */ var mode_switcher = (ModeSwitcher);
  4426. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/more-menu/index.js
  4427. /**
  4428. * WordPress dependencies
  4429. */
  4430. /**
  4431. * Internal dependencies
  4432. */
  4433. function MoreMenu() {
  4434. const [isModalActive, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
  4435. const [isPreferencesModalActive, togglePreferencesModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
  4436. (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-site/keyboard-shortcuts', toggleModal);
  4437. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(MoreMenuDropdown, null, _ref => {
  4438. let {
  4439. onClose
  4440. } = _ref;
  4441. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  4442. label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun')
  4443. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
  4444. scope: "core/edit-site",
  4445. name: "fixedToolbar",
  4446. label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'),
  4447. info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'),
  4448. messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'),
  4449. messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated')
  4450. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
  4451. scope: "core/edit-site",
  4452. name: "focusMode",
  4453. label: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode'),
  4454. info: (0,external_wp_i18n_namespaceObject.__)('Focus on one block at a time'),
  4455. messageActivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode activated'),
  4456. messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode deactivated')
  4457. }), (0,external_wp_element_namespaceObject.createElement)(mode_switcher, null), (0,external_wp_element_namespaceObject.createElement)(action_item.Slot, {
  4458. name: "core/edit-site/plugin-more-menu",
  4459. label: (0,external_wp_i18n_namespaceObject.__)('Plugins'),
  4460. as: external_wp_components_namespaceObject.MenuGroup,
  4461. fillProps: {
  4462. onClick: onClose
  4463. }
  4464. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  4465. label: (0,external_wp_i18n_namespaceObject.__)('Tools')
  4466. }, (0,external_wp_element_namespaceObject.createElement)(SiteExport, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  4467. onClick: toggleModal,
  4468. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h')
  4469. }, (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')), (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideMenuItem, null), (0,external_wp_element_namespaceObject.createElement)(CopyContentMenuItem, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  4470. icon: library_external,
  4471. role: "menuitem",
  4472. href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/site-editor/'),
  4473. target: "_blank",
  4474. rel: "noopener noreferrer"
  4475. }, (0,external_wp_i18n_namespaceObject.__)('Help'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
  4476. as: "span"
  4477. },
  4478. /* translators: accessibility text */
  4479. (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)'))), (0,external_wp_element_namespaceObject.createElement)(tools_more_menu_group.Slot, {
  4480. fillProps: {
  4481. onClose
  4482. }
  4483. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  4484. onClick: togglePreferencesModal
  4485. }, (0,external_wp_i18n_namespaceObject.__)('Preferences'))));
  4486. }), (0,external_wp_element_namespaceObject.createElement)(KeyboardShortcutHelpModal, {
  4487. isModalActive: isModalActive,
  4488. toggleModal: toggleModal
  4489. }), (0,external_wp_element_namespaceObject.createElement)(EditSitePreferencesModal, {
  4490. isModalActive: isPreferencesModalActive,
  4491. toggleModal: togglePreferencesModal
  4492. }));
  4493. }
  4494. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js
  4495. /**
  4496. * External dependencies
  4497. */
  4498. /**
  4499. * WordPress dependencies
  4500. */
  4501. function SaveButton(_ref) {
  4502. let {
  4503. openEntitiesSavedStates,
  4504. isEntitiesSavedStatesOpen
  4505. } = _ref;
  4506. const {
  4507. isDirty,
  4508. isSaving
  4509. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4510. const {
  4511. __experimentalGetDirtyEntityRecords,
  4512. isSavingEntityRecord
  4513. } = select(external_wp_coreData_namespaceObject.store);
  4514. const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
  4515. return {
  4516. isDirty: dirtyEntityRecords.length > 0,
  4517. isSaving: (0,external_lodash_namespaceObject.some)(dirtyEntityRecords, record => isSavingEntityRecord(record.kind, record.name, record.key))
  4518. };
  4519. }, []);
  4520. const disabled = !isDirty || isSaving;
  4521. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  4522. variant: "primary",
  4523. className: "edit-site-save-button__button",
  4524. "aria-disabled": disabled,
  4525. "aria-expanded": isEntitiesSavedStatesOpen,
  4526. disabled: disabled,
  4527. isBusy: isSaving,
  4528. onClick: disabled ? undefined : openEntitiesSavedStates
  4529. }, (0,external_wp_i18n_namespaceObject.__)('Save')));
  4530. }
  4531. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js
  4532. /**
  4533. * WordPress dependencies
  4534. */
  4535. const undo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4536. xmlns: "http://www.w3.org/2000/svg",
  4537. viewBox: "0 0 24 24"
  4538. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4539. d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"
  4540. }));
  4541. /* harmony default export */ var library_undo = (undo);
  4542. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js
  4543. /**
  4544. * WordPress dependencies
  4545. */
  4546. const redo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4547. xmlns: "http://www.w3.org/2000/svg",
  4548. viewBox: "0 0 24 24"
  4549. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4550. d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"
  4551. }));
  4552. /* harmony default export */ var library_redo = (redo);
  4553. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/undo-redo/undo.js
  4554. /**
  4555. * WordPress dependencies
  4556. */
  4557. function UndoButton() {
  4558. const hasUndo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasUndo(), []);
  4559. const {
  4560. undo
  4561. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  4562. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  4563. icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_undo : library_redo,
  4564. label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
  4565. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('z') // If there are no undo levels we don't want to actually disable this
  4566. // button, because it will remove focus for keyboard users.
  4567. // See: https://github.com/WordPress/gutenberg/issues/3486
  4568. ,
  4569. "aria-disabled": !hasUndo,
  4570. onClick: hasUndo ? undo : undefined
  4571. });
  4572. }
  4573. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/undo-redo/redo.js
  4574. /**
  4575. * WordPress dependencies
  4576. */
  4577. function RedoButton() {
  4578. const hasRedo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasRedo(), []);
  4579. const {
  4580. redo
  4581. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  4582. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  4583. icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo,
  4584. label: (0,external_wp_i18n_namespaceObject.__)('Redo'),
  4585. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') // If there are no undo levels we don't want to actually disable this
  4586. // button, because it will remove focus for keyboard users.
  4587. // See: https://github.com/WordPress/gutenberg/issues/3486
  4588. ,
  4589. "aria-disabled": !hasRedo,
  4590. onClick: hasRedo ? redo : undefined
  4591. });
  4592. }
  4593. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
  4594. /**
  4595. * WordPress dependencies
  4596. */
  4597. const chevronDown = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4598. viewBox: "0 0 24 24",
  4599. xmlns: "http://www.w3.org/2000/svg"
  4600. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4601. d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
  4602. }));
  4603. /* harmony default export */ var chevron_down = (chevronDown);
  4604. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/document-actions/index.js
  4605. /**
  4606. * External dependencies
  4607. */
  4608. /**
  4609. * WordPress dependencies
  4610. */
  4611. function getBlockDisplayText(block) {
  4612. if (block) {
  4613. const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name);
  4614. return blockType ? (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, block.attributes) : null;
  4615. }
  4616. return null;
  4617. }
  4618. function useSecondaryText() {
  4619. const {
  4620. getBlock
  4621. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  4622. const activeEntityBlockId = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__experimentalGetActiveBlockIdByBlockNames(['core/template-part']), []);
  4623. if (activeEntityBlockId) {
  4624. return {
  4625. label: getBlockDisplayText(getBlock(activeEntityBlockId)),
  4626. isActive: true
  4627. };
  4628. }
  4629. return {};
  4630. }
  4631. /**
  4632. * @param {Object} props Props for the DocumentActions component.
  4633. * @param {string} props.entityTitle The title to display.
  4634. * @param {string} props.entityLabel A label to use for entity-related options.
  4635. * E.g. "template" would be used for "edit
  4636. * template" and "show template details".
  4637. * @param {boolean} props.isLoaded Whether the data is available.
  4638. * @param {Function} props.children React component to use for the
  4639. * information dropdown area. Should be a
  4640. * function which accepts dropdown props.
  4641. * @param {boolean} props.showIconLabels Whether buttons display icons or text labels.
  4642. */
  4643. function DocumentActions(_ref) {
  4644. let {
  4645. entityTitle,
  4646. entityLabel,
  4647. isLoaded,
  4648. children: dropdownContent,
  4649. showIconLabels
  4650. } = _ref;
  4651. const {
  4652. label
  4653. } = useSecondaryText(); // The title ref is passed to the popover as the anchorRef so that the
  4654. // dropdown is centered over the whole title area rather than just one
  4655. // part of it.
  4656. const titleRef = (0,external_wp_element_namespaceObject.useRef)(); // Return a simple loading indicator until we have information to show.
  4657. if (!isLoaded) {
  4658. return (0,external_wp_element_namespaceObject.createElement)("div", {
  4659. className: "edit-site-document-actions"
  4660. }, (0,external_wp_i18n_namespaceObject.__)('Loading…'));
  4661. } // Return feedback that the template does not seem to exist.
  4662. if (!entityTitle) {
  4663. return (0,external_wp_element_namespaceObject.createElement)("div", {
  4664. className: "edit-site-document-actions"
  4665. }, (0,external_wp_i18n_namespaceObject.__)('Template not found'));
  4666. }
  4667. return (0,external_wp_element_namespaceObject.createElement)("div", {
  4668. className: classnames_default()('edit-site-document-actions', {
  4669. 'has-secondary-label': !!label
  4670. })
  4671. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  4672. ref: titleRef,
  4673. className: "edit-site-document-actions__title-wrapper"
  4674. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
  4675. size: "body",
  4676. className: "edit-site-document-actions__title",
  4677. as: "h1"
  4678. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
  4679. as: "span"
  4680. }, (0,external_wp_i18n_namespaceObject.sprintf)(
  4681. /* translators: %s: the entity being edited, like "template"*/
  4682. (0,external_wp_i18n_namespaceObject.__)('Editing %s: '), entityLabel)), entityTitle), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
  4683. size: "body",
  4684. className: "edit-site-document-actions__secondary-item"
  4685. }, label !== null && label !== void 0 ? label : ''), dropdownContent && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
  4686. popoverProps: {
  4687. anchorRef: titleRef.current
  4688. },
  4689. position: "bottom center",
  4690. renderToggle: _ref2 => {
  4691. let {
  4692. isOpen,
  4693. onToggle
  4694. } = _ref2;
  4695. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  4696. className: "edit-site-document-actions__get-info",
  4697. icon: chevron_down,
  4698. "aria-expanded": isOpen,
  4699. "aria-haspopup": "true",
  4700. onClick: onToggle,
  4701. label: (0,external_wp_i18n_namespaceObject.sprintf)(
  4702. /* translators: %s: the entity to see details about, like "template"*/
  4703. (0,external_wp_i18n_namespaceObject.__)('Show %s details'), entityLabel)
  4704. }, showIconLabels && (0,external_wp_i18n_namespaceObject.__)('Details'));
  4705. },
  4706. contentClassName: "edit-site-document-actions__info-dropdown",
  4707. renderContent: dropdownContent
  4708. })));
  4709. }
  4710. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/routes/link.js
  4711. /**
  4712. * WordPress dependencies
  4713. */
  4714. /**
  4715. * Internal dependencies
  4716. */
  4717. function useLink() {
  4718. let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  4719. let state = arguments.length > 1 ? arguments[1] : undefined;
  4720. let shouldReplace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  4721. const history = useHistory();
  4722. function onClick(event) {
  4723. event.preventDefault();
  4724. if (shouldReplace) {
  4725. history.replace(params, state);
  4726. } else {
  4727. history.push(params, state);
  4728. }
  4729. }
  4730. return {
  4731. href: (0,external_wp_url_namespaceObject.addQueryArgs)(window.location.href, params),
  4732. onClick
  4733. };
  4734. }
  4735. function Link(_ref) {
  4736. let {
  4737. params = {},
  4738. state,
  4739. replace: shouldReplace = false,
  4740. children,
  4741. ...props
  4742. } = _ref;
  4743. const {
  4744. href,
  4745. onClick
  4746. } = useLink(params, state, shouldReplace);
  4747. return (0,external_wp_element_namespaceObject.createElement)("a", extends_extends({
  4748. href: href,
  4749. onClick: onClick
  4750. }, props), children);
  4751. }
  4752. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-details/template-areas.js
  4753. /**
  4754. * WordPress dependencies
  4755. */
  4756. /**
  4757. * Internal dependencies
  4758. */
  4759. function TemplatePartItemMore(_ref) {
  4760. var _templatePart$title;
  4761. let {
  4762. onClose,
  4763. templatePart,
  4764. closeTemplateDetailsDropdown
  4765. } = _ref;
  4766. const {
  4767. revertTemplate
  4768. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  4769. const {
  4770. params
  4771. } = useLocation();
  4772. const editLinkProps = useLink({
  4773. postId: templatePart.id,
  4774. postType: templatePart.type
  4775. }, {
  4776. fromTemplateId: params.postId
  4777. });
  4778. function editTemplatePart(event) {
  4779. editLinkProps.onClick(event);
  4780. onClose();
  4781. closeTemplateDetailsDropdown();
  4782. }
  4783. function clearCustomizations() {
  4784. revertTemplate(templatePart);
  4785. onClose();
  4786. closeTemplateDetailsDropdown();
  4787. }
  4788. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, extends_extends({}, editLinkProps, {
  4789. onClick: editTemplatePart
  4790. }), (0,external_wp_i18n_namespaceObject.sprintf)(
  4791. /* translators: %s: template part title */
  4792. (0,external_wp_i18n_namespaceObject.__)('Edit %s'), (_templatePart$title = templatePart.title) === null || _templatePart$title === void 0 ? void 0 : _templatePart$title.rendered))), isTemplateRevertable(templatePart) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  4793. info: (0,external_wp_i18n_namespaceObject.__)('Restore template to default state'),
  4794. onClick: clearCustomizations
  4795. }, (0,external_wp_i18n_namespaceObject.__)('Clear customizations'))));
  4796. }
  4797. function TemplatePartItem(_ref2) {
  4798. let {
  4799. templatePart,
  4800. clientId,
  4801. closeTemplateDetailsDropdown
  4802. } = _ref2;
  4803. const {
  4804. selectBlock,
  4805. toggleBlockHighlight
  4806. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  4807. const templatePartArea = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4808. const defaultAreas = select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas();
  4809. return defaultAreas.find(defaultArea => defaultArea.area === templatePart.area);
  4810. }, [templatePart.area]);
  4811. const highlightBlock = () => toggleBlockHighlight(clientId, true);
  4812. const cancelHighlightBlock = () => toggleBlockHighlight(clientId, false);
  4813. return (0,external_wp_element_namespaceObject.createElement)("div", {
  4814. role: "menuitem",
  4815. className: "edit-site-template-details__template-areas-item"
  4816. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  4817. role: "button",
  4818. icon: templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea.icon,
  4819. iconPosition: "left",
  4820. onClick: () => {
  4821. selectBlock(clientId);
  4822. },
  4823. onMouseOver: highlightBlock,
  4824. onMouseLeave: cancelHighlightBlock,
  4825. onFocus: highlightBlock,
  4826. onBlur: cancelHighlightBlock
  4827. }, templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea.label), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
  4828. icon: more_vertical,
  4829. label: (0,external_wp_i18n_namespaceObject.__)('More options'),
  4830. className: "edit-site-template-details__template-areas-item-more"
  4831. }, _ref3 => {
  4832. let {
  4833. onClose
  4834. } = _ref3;
  4835. return (0,external_wp_element_namespaceObject.createElement)(TemplatePartItemMore, {
  4836. onClose: onClose,
  4837. templatePart: templatePart,
  4838. closeTemplateDetailsDropdown: closeTemplateDetailsDropdown
  4839. });
  4840. }));
  4841. }
  4842. function TemplateAreas(_ref4) {
  4843. let {
  4844. closeTemplateDetailsDropdown
  4845. } = _ref4;
  4846. const templateParts = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentTemplateTemplateParts(), []);
  4847. if (!templateParts.length) {
  4848. return null;
  4849. }
  4850. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  4851. label: (0,external_wp_i18n_namespaceObject.__)('Areas'),
  4852. className: "edit-site-template-details__group edit-site-template-details__template-areas"
  4853. }, templateParts.map(_ref5 => {
  4854. let {
  4855. templatePart,
  4856. block
  4857. } = _ref5;
  4858. return (0,external_wp_element_namespaceObject.createElement)(TemplatePartItem, {
  4859. key: templatePart.slug,
  4860. clientId: block.clientId,
  4861. templatePart: templatePart,
  4862. closeTemplateDetailsDropdown: closeTemplateDetailsDropdown
  4863. });
  4864. }));
  4865. }
  4866. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-details/edit-template-title.js
  4867. /**
  4868. * WordPress dependencies
  4869. */
  4870. function EditTemplateTitle(_ref) {
  4871. let {
  4872. template
  4873. } = _ref;
  4874. const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', template.type, 'title', template.id);
  4875. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  4876. label: (0,external_wp_i18n_namespaceObject.__)('Title'),
  4877. value: title,
  4878. help: (0,external_wp_i18n_namespaceObject.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'),
  4879. onChange: newTitle => {
  4880. setTitle(newTitle || template.slug);
  4881. }
  4882. });
  4883. }
  4884. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-details/index.js
  4885. /**
  4886. * WordPress dependencies
  4887. */
  4888. /**
  4889. * Internal dependencies
  4890. */
  4891. function TemplateDetails(_ref) {
  4892. let {
  4893. template,
  4894. onClose
  4895. } = _ref;
  4896. const {
  4897. title,
  4898. description
  4899. } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetTemplateInfo(template), []);
  4900. const {
  4901. revertTemplate
  4902. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  4903. const templateSubMenu = (0,external_wp_element_namespaceObject.useMemo)(() => {
  4904. if ((template === null || template === void 0 ? void 0 : template.type) === 'wp_template') {
  4905. return {
  4906. title: (0,external_wp_i18n_namespaceObject.__)('templates'),
  4907. menu: MENU_TEMPLATES
  4908. };
  4909. }
  4910. return TEMPLATE_PARTS_SUB_MENUS.find(_ref2 => {
  4911. let {
  4912. area
  4913. } = _ref2;
  4914. return area === (template === null || template === void 0 ? void 0 : template.area);
  4915. });
  4916. }, [template]);
  4917. const browseAllLinkProps = useLink({
  4918. // TODO: We should update this to filter by template part's areas as well.
  4919. postType: template.type,
  4920. postId: undefined
  4921. }); // Only user-created and non-default templates can change the name.
  4922. const canEditTitle = template.is_custom && !template.has_theme_file;
  4923. if (!template) {
  4924. return null;
  4925. }
  4926. const revert = () => {
  4927. revertTemplate(template);
  4928. onClose();
  4929. };
  4930. return (0,external_wp_element_namespaceObject.createElement)("div", {
  4931. className: "edit-site-template-details"
  4932. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  4933. className: "edit-site-template-details__group"
  4934. }, canEditTitle ? (0,external_wp_element_namespaceObject.createElement)(EditTemplateTitle, {
  4935. template: template
  4936. }) : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
  4937. level: 4,
  4938. weight: 600,
  4939. className: "edit-site-template-details__title"
  4940. }, title), description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
  4941. size: "body",
  4942. className: "edit-site-template-details__description",
  4943. as: "p"
  4944. }, description)), (0,external_wp_element_namespaceObject.createElement)(TemplateAreas, {
  4945. closeTemplateDetailsDropdown: onClose
  4946. }), isTemplateRevertable(template) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  4947. className: "edit-site-template-details__group edit-site-template-details__revert"
  4948. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  4949. className: "edit-site-template-details__revert-button",
  4950. info: (0,external_wp_i18n_namespaceObject.__)('Restore template to default state'),
  4951. onClick: revert
  4952. }, (0,external_wp_i18n_namespaceObject.__)('Clear customizations'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, extends_extends({
  4953. className: "edit-site-template-details__show-all-button"
  4954. }, browseAllLinkProps), (0,external_wp_i18n_namespaceObject.sprintf)(
  4955. /* translators: the template part's area name ("Headers", "Sidebars") or "templates". */
  4956. (0,external_wp_i18n_namespaceObject.__)('Browse all %s'), templateSubMenu.title)));
  4957. }
  4958. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/index.js
  4959. /**
  4960. * WordPress dependencies
  4961. */
  4962. /**
  4963. * Internal dependencies
  4964. */
  4965. const preventDefault = event => {
  4966. event.preventDefault();
  4967. };
  4968. function Header(_ref) {
  4969. let {
  4970. openEntitiesSavedStates,
  4971. isEntitiesSavedStatesOpen,
  4972. showIconLabels
  4973. } = _ref;
  4974. const inserterButton = (0,external_wp_element_namespaceObject.useRef)();
  4975. const {
  4976. deviceType,
  4977. entityTitle,
  4978. template,
  4979. templateType,
  4980. isInserterOpen,
  4981. isListViewOpen,
  4982. listViewShortcut,
  4983. isLoaded,
  4984. isVisualMode
  4985. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4986. const {
  4987. __experimentalGetPreviewDeviceType,
  4988. getEditedPostType,
  4989. getEditedPostId,
  4990. isInserterOpened,
  4991. isListViewOpened,
  4992. getEditorMode
  4993. } = select(store_store);
  4994. const {
  4995. getEditedEntityRecord
  4996. } = select(external_wp_coreData_namespaceObject.store);
  4997. const {
  4998. __experimentalGetTemplateInfo: getTemplateInfo
  4999. } = select(external_wp_editor_namespaceObject.store);
  5000. const {
  5001. getShortcutRepresentation
  5002. } = select(external_wp_keyboardShortcuts_namespaceObject.store);
  5003. const postType = getEditedPostType();
  5004. const postId = getEditedPostId();
  5005. const record = getEditedEntityRecord('postType', postType, postId);
  5006. const _isLoaded = !!postId;
  5007. return {
  5008. deviceType: __experimentalGetPreviewDeviceType(),
  5009. entityTitle: getTemplateInfo(record).title,
  5010. isLoaded: _isLoaded,
  5011. template: record,
  5012. templateType: postType,
  5013. isInserterOpen: isInserterOpened(),
  5014. isListViewOpen: isListViewOpened(),
  5015. listViewShortcut: getShortcutRepresentation('core/edit-site/toggle-list-view'),
  5016. isVisualMode: getEditorMode() === 'visual'
  5017. };
  5018. }, []);
  5019. const {
  5020. __experimentalSetPreviewDeviceType: setPreviewDeviceType,
  5021. setIsInserterOpened,
  5022. setIsListViewOpened
  5023. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  5024. const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
  5025. const openInserter = (0,external_wp_element_namespaceObject.useCallback)(() => {
  5026. if (isInserterOpen) {
  5027. // Focusing the inserter button closes the inserter popover.
  5028. inserterButton.current.focus();
  5029. } else {
  5030. setIsInserterOpened(true);
  5031. }
  5032. }, [isInserterOpen, setIsInserterOpened]);
  5033. const toggleListView = (0,external_wp_element_namespaceObject.useCallback)(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]);
  5034. const isFocusMode = templateType === 'wp_template_part';
  5035. return (0,external_wp_element_namespaceObject.createElement)("div", {
  5036. className: "edit-site-header"
  5037. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  5038. className: "edit-site-header_start"
  5039. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  5040. className: "edit-site-header__toolbar"
  5041. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  5042. ref: inserterButton,
  5043. variant: "primary",
  5044. isPressed: isInserterOpen,
  5045. className: "edit-site-header-toolbar__inserter-toggle",
  5046. disabled: !isVisualMode,
  5047. onMouseDown: preventDefault,
  5048. onClick: openInserter,
  5049. icon: library_plus,
  5050. label: (0,external_wp_i18n_namespaceObject._x)('Toggle block inserter', 'Generic label for block inserter button')
  5051. }, showIconLabels && (!isInserterOpen ? (0,external_wp_i18n_namespaceObject.__)('Add') : (0,external_wp_i18n_namespaceObject.__)('Close'))), isLargeViewport && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
  5052. as: external_wp_blockEditor_namespaceObject.ToolSelector,
  5053. disabled: !isVisualMode
  5054. }), (0,external_wp_element_namespaceObject.createElement)(UndoButton, null), (0,external_wp_element_namespaceObject.createElement)(RedoButton, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  5055. className: "edit-site-header-toolbar__list-view-toggle",
  5056. disabled: !isVisualMode,
  5057. icon: list_view,
  5058. isPressed: isListViewOpen
  5059. /* translators: button label text should, if possible, be under 16 characters. */
  5060. ,
  5061. label: (0,external_wp_i18n_namespaceObject.__)('List View'),
  5062. onClick: toggleListView,
  5063. shortcut: listViewShortcut
  5064. })))), (0,external_wp_element_namespaceObject.createElement)("div", {
  5065. className: "edit-site-header_center"
  5066. }, (0,external_wp_element_namespaceObject.createElement)(DocumentActions, {
  5067. entityTitle: entityTitle,
  5068. entityLabel: templateType === 'wp_template_part' ? 'template part' : 'template',
  5069. isLoaded: isLoaded,
  5070. showIconLabels: showIconLabels
  5071. }, _ref2 => {
  5072. let {
  5073. onClose
  5074. } = _ref2;
  5075. return (0,external_wp_element_namespaceObject.createElement)(TemplateDetails, {
  5076. template: template,
  5077. onClose: onClose
  5078. });
  5079. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  5080. className: "edit-site-header_end"
  5081. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  5082. className: "edit-site-header__actions"
  5083. }, !isFocusMode && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalPreviewOptions, {
  5084. deviceType: deviceType,
  5085. setDeviceType: setPreviewDeviceType
  5086. }), (0,external_wp_element_namespaceObject.createElement)(SaveButton, {
  5087. openEntitiesSavedStates: openEntitiesSavedStates,
  5088. isEntitiesSavedStatesOpen: isEntitiesSavedStatesOpen
  5089. }), (0,external_wp_element_namespaceObject.createElement)(pinned_items.Slot, {
  5090. scope: "core/edit-site"
  5091. }), (0,external_wp_element_namespaceObject.createElement)(MoreMenu, null))));
  5092. }
  5093. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cog.js
  5094. /**
  5095. * WordPress dependencies
  5096. */
  5097. const cog = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5098. xmlns: "http://www.w3.org/2000/svg",
  5099. viewBox: "0 0 24 24"
  5100. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5101. fillRule: "evenodd",
  5102. d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",
  5103. clipRule: "evenodd"
  5104. }));
  5105. /* harmony default export */ var library_cog = (cog);
  5106. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/default-sidebar.js
  5107. /**
  5108. * WordPress dependencies
  5109. */
  5110. function default_sidebar_DefaultSidebar(_ref) {
  5111. let {
  5112. className,
  5113. identifier,
  5114. title,
  5115. icon,
  5116. children,
  5117. closeLabel,
  5118. header,
  5119. headerClassName,
  5120. panelClassName
  5121. } = _ref;
  5122. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(complementary_area, {
  5123. className: className,
  5124. scope: "core/edit-site",
  5125. identifier: identifier,
  5126. title: title,
  5127. icon: icon,
  5128. closeLabel: closeLabel,
  5129. header: header,
  5130. headerClassName: headerClassName,
  5131. panelClassName: panelClassName
  5132. }, children), (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaMoreMenuItem, {
  5133. scope: "core/edit-site",
  5134. identifier: identifier,
  5135. icon: icon
  5136. }, title));
  5137. }
  5138. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/styles.js
  5139. /**
  5140. * WordPress dependencies
  5141. */
  5142. const styles = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5143. viewBox: "0 0 24 24",
  5144. xmlns: "http://www.w3.org/2000/svg"
  5145. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5146. d: "M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"
  5147. }));
  5148. /* harmony default export */ var library_styles = (styles);
  5149. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/icon-with-current-color.js
  5150. /**
  5151. * External dependencies
  5152. */
  5153. /**
  5154. * WordPress dependencies
  5155. */
  5156. function IconWithCurrentColor(_ref) {
  5157. let {
  5158. className,
  5159. ...props
  5160. } = _ref;
  5161. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, extends_extends({
  5162. className: classnames_default()(className, 'edit-site-global-styles-icon-with-current-color')
  5163. }, props));
  5164. }
  5165. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/navigation-button.js
  5166. /**
  5167. * WordPress dependencies
  5168. */
  5169. /**
  5170. * Internal dependencies
  5171. */
  5172. function GenericNavigationButton(_ref) {
  5173. let {
  5174. icon,
  5175. children,
  5176. ...props
  5177. } = _ref;
  5178. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItem, props, icon && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  5179. justify: "flex-start"
  5180. }, (0,external_wp_element_namespaceObject.createElement)(IconWithCurrentColor, {
  5181. icon: icon,
  5182. size: 24
  5183. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, children)), !icon && children);
  5184. }
  5185. function NavigationButton(props) {
  5186. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, extends_extends({
  5187. as: GenericNavigationButton
  5188. }, props));
  5189. }
  5190. function NavigationBackButton(props) {
  5191. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorBackButton, extends_extends({
  5192. as: GenericNavigationButton
  5193. }, props));
  5194. }
  5195. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/typography.js
  5196. /**
  5197. * WordPress dependencies
  5198. */
  5199. const typography = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5200. xmlns: "http://www.w3.org/2000/svg",
  5201. viewBox: "0 0 24 24"
  5202. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5203. d: "M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"
  5204. }));
  5205. /* harmony default export */ var library_typography = (typography);
  5206. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/color.js
  5207. /**
  5208. * WordPress dependencies
  5209. */
  5210. const color = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5211. viewBox: "0 0 24 24",
  5212. xmlns: "http://www.w3.org/2000/svg"
  5213. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5214. d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"
  5215. }));
  5216. /* harmony default export */ var library_color = (color);
  5217. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
  5218. /**
  5219. * WordPress dependencies
  5220. */
  5221. const layout = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5222. xmlns: "http://www.w3.org/2000/svg",
  5223. viewBox: "0 0 24 24"
  5224. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5225. d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  5226. }));
  5227. /* harmony default export */ var library_layout = (layout);
  5228. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/utils.js
  5229. /**
  5230. * External dependencies
  5231. */
  5232. /* Supporting data. */
  5233. const ROOT_BLOCK_NAME = 'root';
  5234. const ROOT_BLOCK_SELECTOR = 'body';
  5235. const ROOT_BLOCK_SUPPORTS = (/* unused pure expression or super */ null && (['background', 'backgroundColor', 'color', 'linkColor', 'fontFamily', 'fontSize', 'fontStyle', 'fontWeight', 'lineHeight', 'textDecoration', 'textTransform', 'padding']));
  5236. const PRESET_METADATA = [{
  5237. path: ['color', 'palette'],
  5238. valueKey: 'color',
  5239. cssVarInfix: 'color',
  5240. classes: [{
  5241. classSuffix: 'color',
  5242. propertyName: 'color'
  5243. }, {
  5244. classSuffix: 'background-color',
  5245. propertyName: 'background-color'
  5246. }, {
  5247. classSuffix: 'border-color',
  5248. propertyName: 'border-color'
  5249. }]
  5250. }, {
  5251. path: ['color', 'gradients'],
  5252. valueKey: 'gradient',
  5253. cssVarInfix: 'gradient',
  5254. classes: [{
  5255. classSuffix: 'gradient-background',
  5256. propertyName: 'background'
  5257. }]
  5258. }, {
  5259. path: ['color', 'duotone'],
  5260. cssVarInfix: 'duotone',
  5261. valueFunc: _ref => {
  5262. let {
  5263. slug
  5264. } = _ref;
  5265. return `url( '#wp-duotone-${slug}' )`;
  5266. },
  5267. classes: []
  5268. }, {
  5269. path: ['typography', 'fontSizes'],
  5270. valueKey: 'size',
  5271. cssVarInfix: 'font-size',
  5272. classes: [{
  5273. classSuffix: 'font-size',
  5274. propertyName: 'font-size'
  5275. }]
  5276. }, {
  5277. path: ['typography', 'fontFamilies'],
  5278. valueKey: 'fontFamily',
  5279. cssVarInfix: 'font-family',
  5280. classes: [{
  5281. classSuffix: 'font-family',
  5282. propertyName: 'font-family'
  5283. }]
  5284. }];
  5285. const STYLE_PATH_TO_CSS_VAR_INFIX = {
  5286. 'color.background': 'color',
  5287. 'color.text': 'color',
  5288. 'elements.link.color.text': 'color',
  5289. 'color.gradient': 'gradient',
  5290. 'typography.fontSize': 'font-size',
  5291. 'typography.fontFamily': 'font-family'
  5292. };
  5293. function findInPresetsBy(features, blockName, presetPath, presetProperty, presetValueValue) {
  5294. // Block presets take priority above root level presets.
  5295. const orderedPresetsByOrigin = [(0,external_lodash_namespaceObject.get)(features, ['blocks', blockName, ...presetPath]), (0,external_lodash_namespaceObject.get)(features, presetPath)];
  5296. for (const presetByOrigin of orderedPresetsByOrigin) {
  5297. if (presetByOrigin) {
  5298. // Preset origins ordered by priority.
  5299. const origins = ['custom', 'theme', 'default'];
  5300. for (const origin of origins) {
  5301. const presets = presetByOrigin[origin];
  5302. if (presets) {
  5303. const presetObject = (0,external_lodash_namespaceObject.find)(presets, preset => preset[presetProperty] === presetValueValue);
  5304. if (presetObject) {
  5305. if (presetProperty === 'slug') {
  5306. return presetObject;
  5307. } // If there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored.
  5308. const highestPresetObjectWithSameSlug = findInPresetsBy(features, blockName, presetPath, 'slug', presetObject.slug);
  5309. if (highestPresetObjectWithSameSlug[presetProperty] === presetObject[presetProperty]) {
  5310. return presetObject;
  5311. }
  5312. return undefined;
  5313. }
  5314. }
  5315. }
  5316. }
  5317. }
  5318. }
  5319. function getPresetVariableFromValue(features, blockName, variableStylePath, presetPropertyValue) {
  5320. if (!presetPropertyValue) {
  5321. return presetPropertyValue;
  5322. }
  5323. const cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[variableStylePath];
  5324. const metadata = (0,external_lodash_namespaceObject.find)(PRESET_METADATA, ['cssVarInfix', cssVarInfix]);
  5325. if (!metadata) {
  5326. // The property doesn't have preset data
  5327. // so the value should be returned as it is.
  5328. return presetPropertyValue;
  5329. }
  5330. const {
  5331. valueKey,
  5332. path
  5333. } = metadata;
  5334. const presetObject = findInPresetsBy(features, blockName, path, valueKey, presetPropertyValue);
  5335. if (!presetObject) {
  5336. // Value wasn't found in the presets,
  5337. // so it must be a custom value.
  5338. return presetPropertyValue;
  5339. }
  5340. return `var:preset|${cssVarInfix}|${presetObject.slug}`;
  5341. }
  5342. function getValueFromPresetVariable(features, blockName, variable, _ref2) {
  5343. let [presetType, slug] = _ref2;
  5344. const metadata = (0,external_lodash_namespaceObject.find)(PRESET_METADATA, ['cssVarInfix', presetType]);
  5345. if (!metadata) {
  5346. return variable;
  5347. }
  5348. const presetObject = findInPresetsBy(features, blockName, metadata.path, 'slug', slug);
  5349. if (presetObject) {
  5350. const {
  5351. valueKey
  5352. } = metadata;
  5353. const result = presetObject[valueKey];
  5354. return getValueFromVariable(features, blockName, result);
  5355. }
  5356. return variable;
  5357. }
  5358. function getValueFromCustomVariable(features, blockName, variable, path) {
  5359. var _get;
  5360. const result = (_get = (0,external_lodash_namespaceObject.get)(features, ['blocks', blockName, 'custom', ...path])) !== null && _get !== void 0 ? _get : (0,external_lodash_namespaceObject.get)(features, ['custom', ...path]);
  5361. if (!result) {
  5362. return variable;
  5363. } // A variable may reference another variable so we need recursion until we find the value.
  5364. return getValueFromVariable(features, blockName, result);
  5365. }
  5366. function getValueFromVariable(features, blockName, variable) {
  5367. if (!variable || !(0,external_lodash_namespaceObject.isString)(variable)) {
  5368. return variable;
  5369. }
  5370. const USER_VALUE_PREFIX = 'var:';
  5371. const THEME_VALUE_PREFIX = 'var(--wp--';
  5372. const THEME_VALUE_SUFFIX = ')';
  5373. let parsedVar;
  5374. if (variable.startsWith(USER_VALUE_PREFIX)) {
  5375. parsedVar = variable.slice(USER_VALUE_PREFIX.length).split('|');
  5376. } else if (variable.startsWith(THEME_VALUE_PREFIX) && variable.endsWith(THEME_VALUE_SUFFIX)) {
  5377. parsedVar = variable.slice(THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length).split('--');
  5378. } else {
  5379. // We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )`
  5380. return variable;
  5381. }
  5382. const [type, ...path] = parsedVar;
  5383. if (type === 'preset') {
  5384. return getValueFromPresetVariable(features, blockName, variable, path);
  5385. }
  5386. if (type === 'custom') {
  5387. return getValueFromCustomVariable(features, blockName, variable, path);
  5388. }
  5389. return variable;
  5390. }
  5391. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/context.js
  5392. /**
  5393. * WordPress dependencies
  5394. */
  5395. const DEFAULT_GLOBAL_STYLES_CONTEXT = {
  5396. user: {},
  5397. base: {},
  5398. merged: {},
  5399. setUserConfig: () => {}
  5400. };
  5401. const GlobalStylesContext = (0,external_wp_element_namespaceObject.createContext)(DEFAULT_GLOBAL_STYLES_CONTEXT);
  5402. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/hooks.js
  5403. /**
  5404. * External dependencies
  5405. */
  5406. /**
  5407. * WordPress dependencies
  5408. */
  5409. /**
  5410. * Internal dependencies
  5411. */
  5412. const EMPTY_CONFIG = {
  5413. settings: {},
  5414. styles: {}
  5415. };
  5416. const useGlobalStylesReset = () => {
  5417. const {
  5418. user: config,
  5419. setUserConfig
  5420. } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
  5421. const canReset = !!config && !(0,external_lodash_namespaceObject.isEqual)(config, EMPTY_CONFIG);
  5422. return [canReset, (0,external_wp_element_namespaceObject.useCallback)(() => setUserConfig(() => EMPTY_CONFIG), [setUserConfig])];
  5423. };
  5424. function useSetting(path, blockName) {
  5425. var _getSettingValueForCo;
  5426. let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'all';
  5427. const {
  5428. merged: mergedConfig,
  5429. base: baseConfig,
  5430. user: userConfig,
  5431. setUserConfig
  5432. } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
  5433. const fullPath = !blockName ? `settings.${path}` : `settings.blocks.${blockName}.${path}`;
  5434. const setSetting = newValue => {
  5435. setUserConfig(currentConfig => {
  5436. const newUserConfig = (0,external_lodash_namespaceObject.cloneDeep)(currentConfig);
  5437. const pathToSet = external_wp_blocks_namespaceObject.__EXPERIMENTAL_PATHS_WITH_MERGE[path] ? fullPath + '.custom' : fullPath;
  5438. (0,external_lodash_namespaceObject.set)(newUserConfig, pathToSet, newValue);
  5439. return newUserConfig;
  5440. });
  5441. };
  5442. const getSettingValueForContext = name => {
  5443. const currentPath = !name ? `settings.${path}` : `settings.blocks.${name}.${path}`;
  5444. const getSettingValue = configToUse => {
  5445. const result = (0,external_lodash_namespaceObject.get)(configToUse, currentPath);
  5446. if (external_wp_blocks_namespaceObject.__EXPERIMENTAL_PATHS_WITH_MERGE[path]) {
  5447. var _ref, _result$custom;
  5448. return (_ref = (_result$custom = result === null || result === void 0 ? void 0 : result.custom) !== null && _result$custom !== void 0 ? _result$custom : result === null || result === void 0 ? void 0 : result.theme) !== null && _ref !== void 0 ? _ref : result === null || result === void 0 ? void 0 : result.default;
  5449. }
  5450. return result;
  5451. };
  5452. let result;
  5453. switch (source) {
  5454. case 'all':
  5455. result = getSettingValue(mergedConfig);
  5456. break;
  5457. case 'user':
  5458. result = getSettingValue(userConfig);
  5459. break;
  5460. case 'base':
  5461. result = getSettingValue(baseConfig);
  5462. break;
  5463. default:
  5464. throw 'Unsupported source';
  5465. }
  5466. return result;
  5467. }; // Unlike styles settings get inherited from top level settings.
  5468. const resultWithFallback = (_getSettingValueForCo = getSettingValueForContext(blockName)) !== null && _getSettingValueForCo !== void 0 ? _getSettingValueForCo : getSettingValueForContext();
  5469. return [resultWithFallback, setSetting];
  5470. }
  5471. function useStyle(path, blockName) {
  5472. var _get;
  5473. let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'all';
  5474. const {
  5475. merged: mergedConfig,
  5476. base: baseConfig,
  5477. user: userConfig,
  5478. setUserConfig
  5479. } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
  5480. const finalPath = !blockName ? `styles.${path}` : `styles.blocks.${blockName}.${path}`;
  5481. const setStyle = newValue => {
  5482. setUserConfig(currentConfig => {
  5483. const newUserConfig = (0,external_lodash_namespaceObject.cloneDeep)(currentConfig);
  5484. (0,external_lodash_namespaceObject.set)(newUserConfig, finalPath, getPresetVariableFromValue(mergedConfig.settings, blockName, path, newValue));
  5485. return newUserConfig;
  5486. });
  5487. };
  5488. let result;
  5489. switch (source) {
  5490. case 'all':
  5491. result = getValueFromVariable(mergedConfig.settings, blockName, (_get = (0,external_lodash_namespaceObject.get)(userConfig, finalPath)) !== null && _get !== void 0 ? _get : (0,external_lodash_namespaceObject.get)(baseConfig, finalPath));
  5492. break;
  5493. case 'user':
  5494. result = getValueFromVariable(mergedConfig.settings, blockName, (0,external_lodash_namespaceObject.get)(userConfig, finalPath));
  5495. break;
  5496. case 'base':
  5497. result = getValueFromVariable(baseConfig.settings, blockName, (0,external_lodash_namespaceObject.get)(baseConfig, finalPath));
  5498. break;
  5499. default:
  5500. throw 'Unsupported source';
  5501. }
  5502. return [result, setStyle];
  5503. }
  5504. const hooks_ROOT_BLOCK_SUPPORTS = ['background', 'backgroundColor', 'color', 'linkColor', 'fontFamily', 'fontSize', 'fontStyle', 'fontWeight', 'lineHeight', 'textDecoration', 'textTransform', 'padding'];
  5505. function getSupportedGlobalStylesPanels(name) {
  5506. if (!name) {
  5507. return hooks_ROOT_BLOCK_SUPPORTS;
  5508. }
  5509. const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
  5510. if (!blockType) {
  5511. return [];
  5512. }
  5513. const supportKeys = [];
  5514. Object.keys(external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY).forEach(styleName => {
  5515. if (!external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[styleName].support) {
  5516. return;
  5517. } // Opting out means that, for certain support keys like background color,
  5518. // blocks have to explicitly set the support value false. If the key is
  5519. // unset, we still enable it.
  5520. if (external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[styleName].requiresOptOut) {
  5521. if ((0,external_lodash_namespaceObject.has)(blockType.supports, external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[styleName].support[0]) && (0,external_lodash_namespaceObject.get)(blockType.supports, external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[styleName].support) !== false) {
  5522. return supportKeys.push(styleName);
  5523. }
  5524. }
  5525. if ((0,external_lodash_namespaceObject.get)(blockType.supports, external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[styleName].support, false)) {
  5526. return supportKeys.push(styleName);
  5527. }
  5528. });
  5529. return supportKeys;
  5530. }
  5531. function useColorsPerOrigin(name) {
  5532. const [customColors] = useSetting('color.palette.custom', name);
  5533. const [themeColors] = useSetting('color.palette.theme', name);
  5534. const [defaultColors] = useSetting('color.palette.default', name);
  5535. const [shouldDisplayDefaultColors] = useSetting('color.defaultPalette');
  5536. return (0,external_wp_element_namespaceObject.useMemo)(() => {
  5537. const result = [];
  5538. if (themeColors && themeColors.length) {
  5539. result.push({
  5540. name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'),
  5541. colors: themeColors
  5542. });
  5543. }
  5544. if (shouldDisplayDefaultColors && defaultColors && defaultColors.length) {
  5545. result.push({
  5546. name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'),
  5547. colors: defaultColors
  5548. });
  5549. }
  5550. if (customColors && customColors.length) {
  5551. result.push({
  5552. name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette is created by the user.'),
  5553. colors: customColors
  5554. });
  5555. }
  5556. return result;
  5557. }, [customColors, themeColors, defaultColors]);
  5558. }
  5559. function useGradientsPerOrigin(name) {
  5560. const [customGradients] = useSetting('color.gradients.custom', name);
  5561. const [themeGradients] = useSetting('color.gradients.theme', name);
  5562. const [defaultGradients] = useSetting('color.gradients.default', name);
  5563. const [shouldDisplayDefaultGradients] = useSetting('color.defaultGradients');
  5564. return (0,external_wp_element_namespaceObject.useMemo)(() => {
  5565. const result = [];
  5566. if (themeGradients && themeGradients.length) {
  5567. result.push({
  5568. name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'),
  5569. gradients: themeGradients
  5570. });
  5571. }
  5572. if (shouldDisplayDefaultGradients && defaultGradients && defaultGradients.length) {
  5573. result.push({
  5574. name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'),
  5575. gradients: defaultGradients
  5576. });
  5577. }
  5578. if (customGradients && customGradients.length) {
  5579. result.push({
  5580. name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette is created by the user.'),
  5581. gradients: customGradients
  5582. });
  5583. }
  5584. return result;
  5585. }, [customGradients, themeGradients, defaultGradients]);
  5586. }
  5587. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/border-panel.js
  5588. /**
  5589. * WordPress dependencies
  5590. */
  5591. /**
  5592. * Internal dependencies
  5593. */
  5594. const MIN_BORDER_WIDTH = 0;
  5595. function useHasBorderPanel(name) {
  5596. const controls = [useHasBorderColorControl(name), useHasBorderRadiusControl(name), useHasBorderStyleControl(name), useHasBorderWidthControl(name)];
  5597. return controls.some(Boolean);
  5598. }
  5599. function useHasBorderColorControl(name) {
  5600. const supports = getSupportedGlobalStylesPanels(name);
  5601. return useSetting('border.color', name)[0] && supports.includes('borderColor');
  5602. }
  5603. function useHasBorderRadiusControl(name) {
  5604. const supports = getSupportedGlobalStylesPanels(name);
  5605. return useSetting('border.radius', name)[0] && supports.includes('borderRadius');
  5606. }
  5607. function useHasBorderStyleControl(name) {
  5608. const supports = getSupportedGlobalStylesPanels(name);
  5609. return useSetting('border.style', name)[0] && supports.includes('borderStyle');
  5610. }
  5611. function useHasBorderWidthControl(name) {
  5612. const supports = getSupportedGlobalStylesPanels(name);
  5613. return useSetting('border.width', name)[0] && supports.includes('borderWidth');
  5614. }
  5615. function BorderPanel(_ref) {
  5616. let {
  5617. name
  5618. } = _ref;
  5619. // To better reflect if the user has customized a value we need to
  5620. // ensure the style value being checked is from the `user` origin.
  5621. const [userBorderStyles] = useStyle('border', name, 'user');
  5622. const createHasValueCallback = feature => () => !!(userBorderStyles !== null && userBorderStyles !== void 0 && userBorderStyles[feature]);
  5623. const createResetCallback = setStyle => () => setStyle(undefined);
  5624. const handleOnChange = setStyle => value => {
  5625. setStyle(value || undefined);
  5626. };
  5627. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  5628. availableUnits: useSetting('spacing.units')[0] || ['px', 'em', 'rem']
  5629. }); // Border width.
  5630. const showBorderWidth = useHasBorderWidthControl(name);
  5631. const [borderWidthValue, setBorderWidth] = useStyle('border.width', name); // Border style.
  5632. const showBorderStyle = useHasBorderStyleControl(name);
  5633. const [borderStyle, setBorderStyle] = useStyle('border.style', name); // When we set a border color or width ensure we have a style so the user
  5634. // can see a visible border.
  5635. const handleOnChangeWithStyle = setStyle => value => {
  5636. if (!!value && !borderStyle) {
  5637. setBorderStyle('solid');
  5638. }
  5639. setStyle(value || undefined);
  5640. }; // Border color.
  5641. const showBorderColor = useHasBorderColorControl(name);
  5642. const [borderColor, setBorderColor] = useStyle('border.color', name);
  5643. const disableCustomColors = !useSetting('color.custom')[0];
  5644. const disableCustomGradients = !useSetting('color.customGradient')[0];
  5645. const borderColorSettings = [{
  5646. label: (0,external_wp_i18n_namespaceObject.__)('Color'),
  5647. colors: useColorsPerOrigin(name),
  5648. colorValue: borderColor,
  5649. onColorChange: handleOnChangeWithStyle(setBorderColor),
  5650. clearable: false
  5651. }]; // Border radius.
  5652. const showBorderRadius = useHasBorderRadiusControl(name);
  5653. const [borderRadiusValues, setBorderRadius] = useStyle('border.radius', name);
  5654. const hasBorderRadius = () => {
  5655. const borderValues = userBorderStyles === null || userBorderStyles === void 0 ? void 0 : userBorderStyles.radius;
  5656. if (typeof borderValues === 'object') {
  5657. return Object.entries(borderValues).some(Boolean);
  5658. }
  5659. return !!borderValues;
  5660. };
  5661. const resetAll = () => {
  5662. setBorderColor(undefined);
  5663. setBorderRadius(undefined);
  5664. setBorderStyle(undefined);
  5665. setBorderWidth(undefined);
  5666. };
  5667. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
  5668. label: (0,external_wp_i18n_namespaceObject.__)('Border'),
  5669. resetAll: resetAll
  5670. }, showBorderWidth && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  5671. className: "single-column",
  5672. hasValue: createHasValueCallback('width'),
  5673. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  5674. onDeselect: createResetCallback(setBorderWidth),
  5675. isShownByDefault: true
  5676. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  5677. value: borderWidthValue,
  5678. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  5679. min: MIN_BORDER_WIDTH,
  5680. onChange: handleOnChangeWithStyle(setBorderWidth),
  5681. units: units
  5682. })), showBorderStyle && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  5683. className: "single-column",
  5684. hasValue: createHasValueCallback('style'),
  5685. label: (0,external_wp_i18n_namespaceObject.__)('Style'),
  5686. onDeselect: createResetCallback(setBorderStyle),
  5687. isShownByDefault: true
  5688. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBorderStyleControl, {
  5689. value: borderStyle,
  5690. onChange: handleOnChange(setBorderStyle)
  5691. })), showBorderColor && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  5692. hasValue: createHasValueCallback('color'),
  5693. label: (0,external_wp_i18n_namespaceObject.__)('Color'),
  5694. onDeselect: createResetCallback(setBorderColor),
  5695. isShownByDefault: true
  5696. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, {
  5697. __experimentalHasMultipleOrigins: true,
  5698. __experimentalIsRenderedInSidebar: true,
  5699. disableCustomColors: disableCustomColors,
  5700. disableCustomGradients: disableCustomGradients,
  5701. enableAlpha: true,
  5702. settings: borderColorSettings
  5703. })), showBorderRadius && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  5704. hasValue: hasBorderRadius,
  5705. label: (0,external_wp_i18n_namespaceObject.__)('Radius'),
  5706. onDeselect: createResetCallback(setBorderRadius),
  5707. isShownByDefault: true
  5708. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBorderRadiusControl, {
  5709. values: borderRadiusValues,
  5710. onChange: handleOnChange(setBorderRadius)
  5711. })));
  5712. }
  5713. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-utils.js
  5714. /**
  5715. * Internal dependencies
  5716. */
  5717. function useHasColorPanel(name) {
  5718. const supports = getSupportedGlobalStylesPanels(name);
  5719. return supports.includes('color') || supports.includes('backgroundColor') || supports.includes('background') || supports.includes('linkColor');
  5720. }
  5721. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/dimensions-panel.js
  5722. /**
  5723. * WordPress dependencies
  5724. */
  5725. /**
  5726. * Internal dependencies
  5727. */
  5728. const AXIAL_SIDES = ['horizontal', 'vertical'];
  5729. function useHasDimensionsPanel(name) {
  5730. const hasPadding = useHasPadding(name);
  5731. const hasMargin = useHasMargin(name);
  5732. const hasGap = useHasGap(name);
  5733. return hasPadding || hasMargin || hasGap;
  5734. }
  5735. function useHasPadding(name) {
  5736. const supports = getSupportedGlobalStylesPanels(name);
  5737. const [settings] = useSetting('spacing.padding', name);
  5738. return settings && supports.includes('padding');
  5739. }
  5740. function useHasMargin(name) {
  5741. const supports = getSupportedGlobalStylesPanels(name);
  5742. const [settings] = useSetting('spacing.margin', name);
  5743. return settings && supports.includes('margin');
  5744. }
  5745. function useHasGap(name) {
  5746. const supports = getSupportedGlobalStylesPanels(name);
  5747. const [settings] = useSetting('spacing.blockGap', name); // Do not show the gap control panel for block-level global styles
  5748. // as they do not work on the frontend.
  5749. // See: https://github.com/WordPress/gutenberg/pull/39845.
  5750. // We can revert this condition when they're working again.
  5751. return !!name ? false : settings && supports.includes('--wp--style--block-gap');
  5752. }
  5753. function filterValuesBySides(values, sides) {
  5754. if (!sides) {
  5755. // If no custom side configuration all sides are opted into by default.
  5756. return values;
  5757. } // Only include sides opted into within filtered values.
  5758. const filteredValues = {};
  5759. sides.forEach(side => {
  5760. if (side === 'vertical') {
  5761. filteredValues.top = values.top;
  5762. filteredValues.bottom = values.bottom;
  5763. }
  5764. if (side === 'horizontal') {
  5765. filteredValues.left = values.left;
  5766. filteredValues.right = values.right;
  5767. }
  5768. filteredValues[side] = values[side];
  5769. });
  5770. return filteredValues;
  5771. }
  5772. function splitStyleValue(value) {
  5773. // Check for shorthand value ( a string value ).
  5774. if (value && typeof value === 'string') {
  5775. // Convert to value for individual sides for BoxControl.
  5776. return {
  5777. top: value,
  5778. right: value,
  5779. bottom: value,
  5780. left: value
  5781. };
  5782. }
  5783. return value;
  5784. }
  5785. function DimensionsPanel(_ref) {
  5786. let {
  5787. name
  5788. } = _ref;
  5789. const showPaddingControl = useHasPadding(name);
  5790. const showMarginControl = useHasMargin(name);
  5791. const showGapControl = useHasGap(name);
  5792. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  5793. availableUnits: useSetting('spacing.units', name)[0] || ['%', 'px', 'em', 'rem', 'vw']
  5794. });
  5795. const [rawPadding, setRawPadding] = useStyle('spacing.padding', name);
  5796. const paddingValues = splitStyleValue(rawPadding);
  5797. const paddingSides = (0,external_wp_blockEditor_namespaceObject.__experimentalUseCustomSides)(name, 'padding');
  5798. const isAxialPadding = paddingSides && paddingSides.some(side => AXIAL_SIDES.includes(side));
  5799. const setPaddingValues = newPaddingValues => {
  5800. const padding = filterValuesBySides(newPaddingValues, paddingSides);
  5801. setRawPadding(padding);
  5802. };
  5803. const resetPaddingValue = () => setPaddingValues({});
  5804. const hasPaddingValue = () => !!paddingValues && Object.keys(paddingValues).length;
  5805. const [rawMargin, setRawMargin] = useStyle('spacing.margin', name);
  5806. const marginValues = splitStyleValue(rawMargin);
  5807. const marginSides = (0,external_wp_blockEditor_namespaceObject.__experimentalUseCustomSides)(name, 'margin');
  5808. const isAxialMargin = marginSides && marginSides.some(side => AXIAL_SIDES.includes(side));
  5809. const setMarginValues = newMarginValues => {
  5810. const margin = filterValuesBySides(newMarginValues, marginSides);
  5811. setRawMargin(margin);
  5812. };
  5813. const resetMarginValue = () => setMarginValues({});
  5814. const hasMarginValue = () => !!marginValues && Object.keys(marginValues).length;
  5815. const [gapValue, setGapValue] = useStyle('spacing.blockGap', name);
  5816. const resetGapValue = () => setGapValue(undefined);
  5817. const hasGapValue = () => !!gapValue;
  5818. const resetAll = () => {
  5819. resetPaddingValue();
  5820. resetMarginValue();
  5821. resetGapValue();
  5822. };
  5823. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
  5824. label: (0,external_wp_i18n_namespaceObject.__)('Dimensions'),
  5825. resetAll: resetAll
  5826. }, showPaddingControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  5827. hasValue: hasPaddingValue,
  5828. label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
  5829. onDeselect: resetPaddingValue,
  5830. isShownByDefault: true
  5831. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
  5832. values: paddingValues,
  5833. onChange: setPaddingValues,
  5834. label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
  5835. sides: paddingSides,
  5836. units: units,
  5837. allowReset: false,
  5838. splitOnAxis: isAxialPadding
  5839. })), showMarginControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  5840. hasValue: hasMarginValue,
  5841. label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
  5842. onDeselect: resetMarginValue,
  5843. isShownByDefault: true
  5844. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
  5845. values: marginValues,
  5846. onChange: setMarginValues,
  5847. label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
  5848. sides: marginSides,
  5849. units: units,
  5850. allowReset: false,
  5851. splitOnAxis: isAxialMargin
  5852. })), showGapControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  5853. hasValue: hasGapValue,
  5854. label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
  5855. onDeselect: resetGapValue,
  5856. isShownByDefault: true
  5857. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  5858. label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
  5859. __unstableInputWidth: "80px",
  5860. min: 0,
  5861. onChange: setGapValue,
  5862. units: units,
  5863. value: gapValue
  5864. })));
  5865. }
  5866. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-panel.js
  5867. /**
  5868. * WordPress dependencies
  5869. */
  5870. /**
  5871. * Internal dependencies
  5872. */
  5873. function useHasTypographyPanel(name) {
  5874. const hasLineHeight = useHasLineHeightControl(name);
  5875. const hasFontAppearance = useHasAppearanceControl(name);
  5876. const hasLetterSpacing = useHasLetterSpacingControl(name);
  5877. const supports = getSupportedGlobalStylesPanels(name);
  5878. return hasLineHeight || hasFontAppearance || hasLetterSpacing || supports.includes('fontSize');
  5879. }
  5880. function useHasLineHeightControl(name) {
  5881. const supports = getSupportedGlobalStylesPanels(name);
  5882. return useSetting('typography.lineHeight', name)[0] && supports.includes('lineHeight');
  5883. }
  5884. function useHasAppearanceControl(name) {
  5885. const supports = getSupportedGlobalStylesPanels(name);
  5886. const hasFontStyles = useSetting('typography.fontStyle', name)[0] && supports.includes('fontStyle');
  5887. const hasFontWeights = useSetting('typography.fontWeight', name)[0] && supports.includes('fontWeight');
  5888. return hasFontStyles || hasFontWeights;
  5889. }
  5890. function useHasLetterSpacingControl(name) {
  5891. const supports = getSupportedGlobalStylesPanels(name);
  5892. return useSetting('typography.letterSpacing', name)[0] && supports.includes('letterSpacing');
  5893. }
  5894. function TypographyPanel(_ref) {
  5895. let {
  5896. name,
  5897. element
  5898. } = _ref;
  5899. const supports = getSupportedGlobalStylesPanels(name);
  5900. const prefix = element === 'text' || !element ? '' : `elements.${element}.`;
  5901. const [fontSizes] = useSetting('typography.fontSizes', name);
  5902. const disableCustomFontSizes = !useSetting('typography.customFontSize', name)[0];
  5903. const [fontFamilies] = useSetting('typography.fontFamilies', name);
  5904. const hasFontStyles = useSetting('typography.fontStyle', name)[0] && supports.includes('fontStyle');
  5905. const hasFontWeights = useSetting('typography.fontWeight', name)[0] && supports.includes('fontWeight');
  5906. const hasLineHeightEnabled = useHasLineHeightControl(name);
  5907. const hasAppearanceControl = useHasAppearanceControl(name);
  5908. const hasLetterSpacingControl = useHasLetterSpacingControl(name);
  5909. const [fontFamily, setFontFamily] = useStyle(prefix + 'typography.fontFamily', name);
  5910. const [fontSize, setFontSize] = useStyle(prefix + 'typography.fontSize', name);
  5911. const [fontStyle, setFontStyle] = useStyle(prefix + 'typography.fontStyle', name);
  5912. const [fontWeight, setFontWeight] = useStyle(prefix + 'typography.fontWeight', name);
  5913. const [lineHeight, setLineHeight] = useStyle(prefix + 'typography.lineHeight', name);
  5914. const [letterSpacing, setLetterSpacing] = useStyle(prefix + 'typography.letterSpacing', name);
  5915. const [backgroundColor] = useStyle(prefix + 'color.background', name);
  5916. const [gradientValue] = useStyle(prefix + 'color.gradient', name);
  5917. const [color] = useStyle(prefix + 'color.text', name);
  5918. const extraStyles = element === 'link' ? {
  5919. textDecoration: 'underline'
  5920. } : {};
  5921. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  5922. className: "edit-site-typography-panel",
  5923. initialOpen: true
  5924. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  5925. className: "edit-site-typography-panel__preview",
  5926. style: {
  5927. fontFamily: fontFamily !== null && fontFamily !== void 0 ? fontFamily : 'serif',
  5928. background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor,
  5929. color,
  5930. fontSize,
  5931. fontStyle,
  5932. fontWeight,
  5933. letterSpacing,
  5934. ...extraStyles
  5935. }
  5936. }, "Aa"), supports.includes('fontFamily') && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalFontFamilyControl, {
  5937. fontFamilies: fontFamilies,
  5938. value: fontFamily,
  5939. onChange: setFontFamily
  5940. }), supports.includes('fontSize') && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FontSizePicker, {
  5941. value: fontSize,
  5942. onChange: setFontSize,
  5943. fontSizes: fontSizes,
  5944. disableCustomFontSizes: disableCustomFontSizes
  5945. }), hasLineHeightEnabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, {
  5946. marginBottom: 6
  5947. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.LineHeightControl, {
  5948. __nextHasNoMarginBottom: true,
  5949. value: lineHeight,
  5950. onChange: setLineHeight
  5951. })), hasAppearanceControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalFontAppearanceControl, {
  5952. value: {
  5953. fontStyle,
  5954. fontWeight
  5955. },
  5956. onChange: _ref2 => {
  5957. let {
  5958. fontStyle: newFontStyle,
  5959. fontWeight: newFontWeight
  5960. } = _ref2;
  5961. setFontStyle(newFontStyle);
  5962. setFontWeight(newFontWeight);
  5963. },
  5964. hasFontStyles: hasFontStyles,
  5965. hasFontWeights: hasFontWeights
  5966. }), hasLetterSpacingControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLetterSpacingControl, {
  5967. value: letterSpacing,
  5968. onChange: setLetterSpacing
  5969. }));
  5970. }
  5971. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/context-menu.js
  5972. /**
  5973. * WordPress dependencies
  5974. */
  5975. /**
  5976. * Internal dependencies
  5977. */
  5978. function ContextMenu(_ref) {
  5979. let {
  5980. name,
  5981. parentMenu = ''
  5982. } = _ref;
  5983. const hasTypographyPanel = useHasTypographyPanel(name);
  5984. const hasColorPanel = useHasColorPanel(name);
  5985. const hasBorderPanel = useHasBorderPanel(name);
  5986. const hasDimensionsPanel = useHasDimensionsPanel(name);
  5987. const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;
  5988. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, hasTypographyPanel && (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  5989. icon: library_typography,
  5990. path: parentMenu + '/typography'
  5991. }, (0,external_wp_i18n_namespaceObject.__)('Typography')), hasColorPanel && (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  5992. icon: library_color,
  5993. path: parentMenu + '/colors'
  5994. }, (0,external_wp_i18n_namespaceObject.__)('Colors')), hasLayoutPanel && (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  5995. icon: library_layout,
  5996. path: parentMenu + '/layout'
  5997. }, (0,external_wp_i18n_namespaceObject.__)('Layout')));
  5998. }
  5999. /* harmony default export */ var context_menu = (ContextMenu);
  6000. ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/utils.js
  6001. /**
  6002. * External dependencies
  6003. */
  6004. /**
  6005. * Internal dependencies
  6006. */
  6007. function generateBoxRules(style, options, path, ruleKey) {
  6008. const boxStyle = (0,external_lodash_namespaceObject.get)(style, path);
  6009. if (!boxStyle) {
  6010. return [];
  6011. }
  6012. const rules = [];
  6013. if (typeof boxStyle === 'string') {
  6014. rules.push({
  6015. selector: options.selector,
  6016. key: ruleKey,
  6017. value: boxStyle
  6018. });
  6019. } else {
  6020. const sideRules = ['top', 'right', 'bottom', 'left'].reduce((acc, side) => {
  6021. const value = (0,external_lodash_namespaceObject.get)(boxStyle, [side]);
  6022. if (value) {
  6023. acc.push({
  6024. selector: options.selector,
  6025. key: `${ruleKey}${(0,external_lodash_namespaceObject.upperFirst)(side)}`,
  6026. value
  6027. });
  6028. }
  6029. return acc;
  6030. }, []);
  6031. rules.push(...sideRules);
  6032. }
  6033. return rules;
  6034. }
  6035. ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/padding.js
  6036. /**
  6037. * Internal dependencies
  6038. */
  6039. const padding = {
  6040. name: 'padding',
  6041. generate: (style, options) => {
  6042. return generateBoxRules(style, options, ['spacing', 'padding'], 'padding');
  6043. }
  6044. };
  6045. /* harmony default export */ var styles_padding = (padding);
  6046. ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/margin.js
  6047. /**
  6048. * Internal dependencies
  6049. */
  6050. const margin = {
  6051. name: 'margin',
  6052. generate: (style, options) => {
  6053. return generateBoxRules(style, options, ['spacing', 'margin'], 'margin');
  6054. }
  6055. };
  6056. /* harmony default export */ var styles_margin = (margin);
  6057. ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/index.js
  6058. /**
  6059. * Internal dependencies
  6060. */
  6061. const styleDefinitions = [styles_margin, styles_padding];
  6062. ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/index.js
  6063. /**
  6064. * External dependencies
  6065. */
  6066. /**
  6067. * Internal dependencies
  6068. */
  6069. /**
  6070. * Generates a stylesheet for a given style object and selector.
  6071. *
  6072. * @param style Style object.
  6073. * @param options Options object with settings to adjust how the styles are generated.
  6074. *
  6075. * @return generated stylesheet.
  6076. */
  6077. function generate(style, options) {
  6078. const rules = getCSSRules(style, options);
  6079. const groupedRules = groupBy(rules, 'selector');
  6080. const selectorRules = Object.keys(groupedRules).reduce((acc, subSelector) => {
  6081. acc.push(`${subSelector} { ${groupedRules[subSelector].map(rule => `${kebabCase(rule.key)}: ${rule.value};`).join(' ')} }`);
  6082. return acc;
  6083. }, []);
  6084. return selectorRules.join('\n');
  6085. }
  6086. /**
  6087. * Returns a JSON representation of the generated CSS rules.
  6088. *
  6089. * @param style Style object.
  6090. * @param options Options object with settings to adjust how the styles are generated.
  6091. *
  6092. * @return generated styles.
  6093. */
  6094. function getCSSRules(style, options) {
  6095. const rules = [];
  6096. styleDefinitions.forEach(definition => {
  6097. rules.push(...definition.generate(style, options));
  6098. });
  6099. return rules;
  6100. }
  6101. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/use-global-styles-output.js
  6102. /**
  6103. * External dependencies
  6104. */
  6105. /**
  6106. * WordPress dependencies
  6107. */
  6108. /**
  6109. * Internal dependencies
  6110. */
  6111. /**
  6112. * Internal dependencies
  6113. */
  6114. function compileStyleValue(uncompiledValue) {
  6115. const VARIABLE_REFERENCE_PREFIX = 'var:';
  6116. const VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';
  6117. const VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';
  6118. if ((0,external_lodash_namespaceObject.startsWith)(uncompiledValue, VARIABLE_REFERENCE_PREFIX)) {
  6119. const variable = uncompiledValue.slice(VARIABLE_REFERENCE_PREFIX.length).split(VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE).join(VARIABLE_PATH_SEPARATOR_TOKEN_STYLE);
  6120. return `var(--wp--${variable})`;
  6121. }
  6122. return uncompiledValue;
  6123. }
  6124. /**
  6125. * Transform given preset tree into a set of style declarations.
  6126. *
  6127. * @param {Object} blockPresets
  6128. *
  6129. * @return {Array} An array of style declarations.
  6130. */
  6131. function getPresetsDeclarations() {
  6132. let blockPresets = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  6133. return (0,external_lodash_namespaceObject.reduce)(PRESET_METADATA, (declarations, _ref) => {
  6134. let {
  6135. path,
  6136. valueKey,
  6137. valueFunc,
  6138. cssVarInfix
  6139. } = _ref;
  6140. const presetByOrigin = (0,external_lodash_namespaceObject.get)(blockPresets, path, []);
  6141. ['default', 'theme', 'custom'].forEach(origin => {
  6142. if (presetByOrigin[origin]) {
  6143. presetByOrigin[origin].forEach(value => {
  6144. if (valueKey) {
  6145. declarations.push(`--wp--preset--${cssVarInfix}--${(0,external_lodash_namespaceObject.kebabCase)(value.slug)}: ${value[valueKey]}`);
  6146. } else if (valueFunc && typeof valueFunc === 'function') {
  6147. declarations.push(`--wp--preset--${cssVarInfix}--${(0,external_lodash_namespaceObject.kebabCase)(value.slug)}: ${valueFunc(value)}`);
  6148. }
  6149. });
  6150. }
  6151. });
  6152. return declarations;
  6153. }, []);
  6154. }
  6155. /**
  6156. * Transform given preset tree into a set of preset class declarations.
  6157. *
  6158. * @param {string} blockSelector
  6159. * @param {Object} blockPresets
  6160. * @return {string} CSS declarations for the preset classes.
  6161. */
  6162. function getPresetsClasses(blockSelector) {
  6163. let blockPresets = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6164. return (0,external_lodash_namespaceObject.reduce)(PRESET_METADATA, (declarations, _ref2) => {
  6165. let {
  6166. path,
  6167. cssVarInfix,
  6168. classes
  6169. } = _ref2;
  6170. if (!classes) {
  6171. return declarations;
  6172. }
  6173. const presetByOrigin = (0,external_lodash_namespaceObject.get)(blockPresets, path, []);
  6174. ['default', 'theme', 'custom'].forEach(origin => {
  6175. if (presetByOrigin[origin]) {
  6176. presetByOrigin[origin].forEach(_ref3 => {
  6177. let {
  6178. slug
  6179. } = _ref3;
  6180. classes.forEach(_ref4 => {
  6181. let {
  6182. classSuffix,
  6183. propertyName
  6184. } = _ref4;
  6185. const classSelectorToUse = `.has-${(0,external_lodash_namespaceObject.kebabCase)(slug)}-${classSuffix}`;
  6186. const selectorToUse = blockSelector.split(',') // Selector can be "h1, h2, h3"
  6187. .map(selector => `${selector}${classSelectorToUse}`).join(',');
  6188. const value = `var(--wp--preset--${cssVarInfix}--${(0,external_lodash_namespaceObject.kebabCase)(slug)})`;
  6189. declarations += `${selectorToUse}{${propertyName}: ${value} !important;}`;
  6190. });
  6191. });
  6192. }
  6193. });
  6194. return declarations;
  6195. }, '');
  6196. }
  6197. function getPresetsSvgFilters() {
  6198. let blockPresets = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  6199. return PRESET_METADATA.filter( // Duotone are the only type of filters for now.
  6200. metadata => metadata.path.at(-1) === 'duotone').flatMap(metadata => {
  6201. const presetByOrigin = (0,external_lodash_namespaceObject.get)(blockPresets, metadata.path, {});
  6202. return ['default', 'theme'].filter(origin => presetByOrigin[origin]).flatMap(origin => presetByOrigin[origin].map(preset => (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstablePresetDuotoneFilter, {
  6203. preset: preset,
  6204. key: preset.slug
  6205. })));
  6206. });
  6207. }
  6208. function flattenTree() {
  6209. let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  6210. let prefix = arguments.length > 1 ? arguments[1] : undefined;
  6211. let token = arguments.length > 2 ? arguments[2] : undefined;
  6212. let result = [];
  6213. Object.keys(input).forEach(key => {
  6214. const newKey = prefix + (0,external_lodash_namespaceObject.kebabCase)(key.replace('/', '-'));
  6215. const newLeaf = input[key];
  6216. if (newLeaf instanceof Object) {
  6217. const newPrefix = newKey + token;
  6218. result = [...result, ...flattenTree(newLeaf, newPrefix, token)];
  6219. } else {
  6220. result.push(`${newKey}: ${newLeaf}`);
  6221. }
  6222. });
  6223. return result;
  6224. }
  6225. /**
  6226. * Transform given style tree into a set of style declarations.
  6227. *
  6228. * @param {Object} blockStyles Block styles.
  6229. *
  6230. * @return {Array} An array of style declarations.
  6231. */
  6232. function getStylesDeclarations() {
  6233. let blockStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  6234. const output = (0,external_lodash_namespaceObject.reduce)(external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY, (declarations, _ref5, key) => {
  6235. let {
  6236. value,
  6237. properties,
  6238. useEngine
  6239. } = _ref5;
  6240. const pathToValue = value;
  6241. if ((0,external_lodash_namespaceObject.first)(pathToValue) === 'elements' || useEngine) {
  6242. return declarations;
  6243. }
  6244. const styleValue = (0,external_lodash_namespaceObject.get)(blockStyles, pathToValue);
  6245. if (!!properties && !(0,external_lodash_namespaceObject.isString)(styleValue)) {
  6246. Object.entries(properties).forEach(entry => {
  6247. const [name, prop] = entry;
  6248. if (!(0,external_lodash_namespaceObject.get)(styleValue, [prop], false)) {
  6249. // Do not create a declaration
  6250. // for sub-properties that don't have any value.
  6251. return;
  6252. }
  6253. const cssProperty = (0,external_lodash_namespaceObject.kebabCase)(name);
  6254. declarations.push(`${cssProperty}: ${compileStyleValue((0,external_lodash_namespaceObject.get)(styleValue, [prop]))}`);
  6255. });
  6256. } else if ((0,external_lodash_namespaceObject.get)(blockStyles, pathToValue, false)) {
  6257. const cssProperty = key.startsWith('--') ? key : (0,external_lodash_namespaceObject.kebabCase)(key);
  6258. declarations.push(`${cssProperty}: ${compileStyleValue((0,external_lodash_namespaceObject.get)(blockStyles, pathToValue))}`);
  6259. }
  6260. return declarations;
  6261. }, []); // The goal is to move everything to server side generated engine styles
  6262. // This is temporary as we absorb more and more styles into the engine.
  6263. const extraRules = getCSSRules(blockStyles, {
  6264. selector: 'self'
  6265. });
  6266. extraRules.forEach(rule => {
  6267. if (rule.selector !== 'self') {
  6268. throw "This style can't be added as inline style";
  6269. }
  6270. const cssProperty = rule.key.startsWith('--') ? rule.key : (0,external_lodash_namespaceObject.kebabCase)(rule.key);
  6271. output.push(`${cssProperty}: ${compileStyleValue(rule.value)}`);
  6272. });
  6273. return output;
  6274. }
  6275. const getNodesWithStyles = (tree, blockSelectors) => {
  6276. var _tree$styles, _tree$styles2;
  6277. const nodes = [];
  6278. if (!(tree !== null && tree !== void 0 && tree.styles)) {
  6279. return nodes;
  6280. }
  6281. const pickStyleKeys = treeToPickFrom => (0,external_lodash_namespaceObject.pickBy)(treeToPickFrom, (value, key) => ['border', 'color', 'spacing', 'typography', 'filter'].includes(key)); // Top-level.
  6282. const styles = pickStyleKeys(tree.styles);
  6283. if (!!styles) {
  6284. nodes.push({
  6285. styles,
  6286. selector: ROOT_BLOCK_SELECTOR
  6287. });
  6288. }
  6289. (0,external_lodash_namespaceObject.forEach)((_tree$styles = tree.styles) === null || _tree$styles === void 0 ? void 0 : _tree$styles.elements, (value, key) => {
  6290. if (!!value && !!external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[key]) {
  6291. nodes.push({
  6292. styles: value,
  6293. selector: external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[key]
  6294. });
  6295. }
  6296. }); // Iterate over blocks: they can have styles & elements.
  6297. (0,external_lodash_namespaceObject.forEach)((_tree$styles2 = tree.styles) === null || _tree$styles2 === void 0 ? void 0 : _tree$styles2.blocks, (node, blockName) => {
  6298. var _blockSelectors$block;
  6299. const blockStyles = pickStyleKeys(node);
  6300. if (!!blockStyles && !!(blockSelectors !== null && blockSelectors !== void 0 && (_blockSelectors$block = blockSelectors[blockName]) !== null && _blockSelectors$block !== void 0 && _blockSelectors$block.selector)) {
  6301. nodes.push({
  6302. styles: blockStyles,
  6303. selector: blockSelectors[blockName].selector,
  6304. duotoneSelector: blockSelectors[blockName].duotoneSelector
  6305. });
  6306. }
  6307. (0,external_lodash_namespaceObject.forEach)(node === null || node === void 0 ? void 0 : node.elements, (value, elementName) => {
  6308. if (!!value && !!(blockSelectors !== null && blockSelectors !== void 0 && blockSelectors[blockName]) && !!(external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS !== null && external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS !== void 0 && external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[elementName])) {
  6309. nodes.push({
  6310. styles: value,
  6311. selector: blockSelectors[blockName].selector.split(',').map(sel => sel + ' ' + external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[elementName]).join(',')
  6312. });
  6313. }
  6314. });
  6315. });
  6316. return nodes;
  6317. };
  6318. const getNodesWithSettings = (tree, blockSelectors) => {
  6319. var _tree$settings, _tree$settings2;
  6320. const nodes = [];
  6321. if (!(tree !== null && tree !== void 0 && tree.settings)) {
  6322. return nodes;
  6323. }
  6324. const pickPresets = treeToPickFrom => {
  6325. const presets = {};
  6326. PRESET_METADATA.forEach(_ref6 => {
  6327. let {
  6328. path
  6329. } = _ref6;
  6330. const value = (0,external_lodash_namespaceObject.get)(treeToPickFrom, path, false);
  6331. if (value !== false) {
  6332. (0,external_lodash_namespaceObject.set)(presets, path, value);
  6333. }
  6334. });
  6335. return presets;
  6336. }; // Top-level.
  6337. const presets = pickPresets(tree.settings);
  6338. const custom = (_tree$settings = tree.settings) === null || _tree$settings === void 0 ? void 0 : _tree$settings.custom;
  6339. if (!(0,external_lodash_namespaceObject.isEmpty)(presets) || !!custom) {
  6340. nodes.push({
  6341. presets,
  6342. custom,
  6343. selector: ROOT_BLOCK_SELECTOR
  6344. });
  6345. } // Blocks.
  6346. (0,external_lodash_namespaceObject.forEach)((_tree$settings2 = tree.settings) === null || _tree$settings2 === void 0 ? void 0 : _tree$settings2.blocks, (node, blockName) => {
  6347. const blockPresets = pickPresets(node);
  6348. const blockCustom = node.custom;
  6349. if (!(0,external_lodash_namespaceObject.isEmpty)(blockPresets) || !!blockCustom) {
  6350. nodes.push({
  6351. presets: blockPresets,
  6352. custom: blockCustom,
  6353. selector: blockSelectors[blockName].selector
  6354. });
  6355. }
  6356. });
  6357. return nodes;
  6358. };
  6359. const toCustomProperties = (tree, blockSelectors) => {
  6360. const settings = getNodesWithSettings(tree, blockSelectors);
  6361. let ruleset = '';
  6362. settings.forEach(_ref7 => {
  6363. let {
  6364. presets,
  6365. custom,
  6366. selector
  6367. } = _ref7;
  6368. const declarations = getPresetsDeclarations(presets);
  6369. const customProps = flattenTree(custom, '--wp--custom--', '--');
  6370. if (customProps.length > 0) {
  6371. declarations.push(...customProps);
  6372. }
  6373. if (declarations.length > 0) {
  6374. ruleset = ruleset + `${selector}{${declarations.join(';')};}`;
  6375. }
  6376. });
  6377. return ruleset;
  6378. };
  6379. const toStyles = (tree, blockSelectors) => {
  6380. const nodesWithStyles = getNodesWithStyles(tree, blockSelectors);
  6381. const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
  6382. /*
  6383. * Reset default browser margin on the root body element.
  6384. * This is set on the root selector **before** generating the ruleset
  6385. * from the `theme.json`. This is to ensure that if the `theme.json` declares
  6386. * `margin` in its `spacing` declaration for the `body` element then these
  6387. * user-generated values take precedence in the CSS cascade.
  6388. * @link https://github.com/WordPress/gutenberg/issues/36147.
  6389. */
  6390. let ruleset = 'body {margin: 0;}';
  6391. nodesWithStyles.forEach(_ref8 => {
  6392. let {
  6393. selector,
  6394. duotoneSelector,
  6395. styles
  6396. } = _ref8;
  6397. const duotoneStyles = {};
  6398. if (styles !== null && styles !== void 0 && styles.filter) {
  6399. duotoneStyles.filter = styles.filter;
  6400. delete styles.filter;
  6401. } // Process duotone styles (they use color.__experimentalDuotone selector).
  6402. if (duotoneSelector) {
  6403. const duotoneDeclarations = getStylesDeclarations(duotoneStyles);
  6404. if (duotoneDeclarations.length === 0) {
  6405. return;
  6406. }
  6407. ruleset = ruleset + `${duotoneSelector}{${duotoneDeclarations.join(';')};}`;
  6408. } // Process the remaning block styles (they use either normal block class or __experimentalSelector).
  6409. const declarations = getStylesDeclarations(styles);
  6410. if (declarations.length === 0) {
  6411. return;
  6412. }
  6413. ruleset = ruleset + `${selector}{${declarations.join(';')};}`;
  6414. });
  6415. nodesWithSettings.forEach(_ref9 => {
  6416. let {
  6417. selector,
  6418. presets
  6419. } = _ref9;
  6420. if (ROOT_BLOCK_SELECTOR === selector) {
  6421. // Do not add extra specificity for top-level classes.
  6422. selector = '';
  6423. }
  6424. const classes = getPresetsClasses(selector, presets);
  6425. if (!(0,external_lodash_namespaceObject.isEmpty)(classes)) {
  6426. ruleset = ruleset + classes;
  6427. }
  6428. });
  6429. return ruleset;
  6430. };
  6431. function toSvgFilters(tree, blockSelectors) {
  6432. const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
  6433. return nodesWithSettings.flatMap(_ref10 => {
  6434. let {
  6435. presets
  6436. } = _ref10;
  6437. return getPresetsSvgFilters(presets);
  6438. });
  6439. }
  6440. const getBlockSelectors = blockTypes => {
  6441. const result = {};
  6442. blockTypes.forEach(blockType => {
  6443. var _blockType$supports$_, _blockType$supports, _blockType$supports$c, _blockType$supports2, _blockType$supports2$;
  6444. const name = blockType.name;
  6445. const selector = (_blockType$supports$_ = blockType === null || blockType === void 0 ? void 0 : (_blockType$supports = blockType.supports) === null || _blockType$supports === void 0 ? void 0 : _blockType$supports.__experimentalSelector) !== null && _blockType$supports$_ !== void 0 ? _blockType$supports$_ : '.wp-block-' + name.replace('core/', '').replace('/', '-');
  6446. const duotoneSelector = (_blockType$supports$c = blockType === null || blockType === void 0 ? void 0 : (_blockType$supports2 = blockType.supports) === null || _blockType$supports2 === void 0 ? void 0 : (_blockType$supports2$ = _blockType$supports2.color) === null || _blockType$supports2$ === void 0 ? void 0 : _blockType$supports2$.__experimentalDuotone) !== null && _blockType$supports$c !== void 0 ? _blockType$supports$c : null;
  6447. result[name] = {
  6448. name,
  6449. selector,
  6450. duotoneSelector
  6451. };
  6452. });
  6453. return result;
  6454. };
  6455. function useGlobalStylesOutput() {
  6456. const [stylesheets, setStylesheets] = (0,external_wp_element_namespaceObject.useState)([]);
  6457. const [settings, setSettings] = (0,external_wp_element_namespaceObject.useState)({});
  6458. const [svgFilters, setSvgFilters] = (0,external_wp_element_namespaceObject.useState)({});
  6459. const {
  6460. merged: mergedConfig
  6461. } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
  6462. (0,external_wp_element_namespaceObject.useEffect)(() => {
  6463. if (!(mergedConfig !== null && mergedConfig !== void 0 && mergedConfig.styles) || !(mergedConfig !== null && mergedConfig !== void 0 && mergedConfig.settings)) {
  6464. return;
  6465. }
  6466. const blockSelectors = getBlockSelectors((0,external_wp_blocks_namespaceObject.getBlockTypes)());
  6467. const customProperties = toCustomProperties(mergedConfig, blockSelectors);
  6468. const globalStyles = toStyles(mergedConfig, blockSelectors);
  6469. const filters = toSvgFilters(mergedConfig, blockSelectors);
  6470. setStylesheets([{
  6471. css: customProperties,
  6472. isGlobalStyles: true
  6473. }, {
  6474. css: globalStyles,
  6475. isGlobalStyles: true
  6476. }]);
  6477. setSettings(mergedConfig.settings);
  6478. setSvgFilters(filters);
  6479. }, [mergedConfig]);
  6480. return [stylesheets, settings, svgFilters];
  6481. }
  6482. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview.js
  6483. /**
  6484. * WordPress dependencies
  6485. */
  6486. /**
  6487. * Internal dependencies
  6488. */
  6489. const firstFrame = {
  6490. start: {
  6491. opacity: 1,
  6492. display: 'block'
  6493. },
  6494. hover: {
  6495. opacity: 0,
  6496. display: 'none'
  6497. }
  6498. };
  6499. const secondFrame = {
  6500. hover: {
  6501. opacity: 1,
  6502. display: 'block'
  6503. },
  6504. start: {
  6505. opacity: 0,
  6506. display: 'none'
  6507. }
  6508. };
  6509. const normalizedWidth = 248;
  6510. const normalizedHeight = 152;
  6511. const normalizedColorSwatchSize = 32;
  6512. const StylesPreview = _ref => {
  6513. let {
  6514. label,
  6515. isFocused
  6516. } = _ref;
  6517. const [fontWeight] = useStyle('typography.fontWeight');
  6518. const [fontFamily = 'serif'] = useStyle('typography.fontFamily');
  6519. const [headingFontFamily = fontFamily] = useStyle('elements.h1.typography.fontFamily');
  6520. const [headingFontWeight = fontWeight] = useStyle('elements.h1.typography.fontWeight');
  6521. const [textColor = 'black'] = useStyle('color.text');
  6522. const [headingColor = textColor] = useStyle('elements.h1.color.text');
  6523. const [linkColor = 'blue'] = useStyle('elements.link.color.text');
  6524. const [backgroundColor = 'white'] = useStyle('color.background');
  6525. const [gradientValue] = useStyle('color.gradient');
  6526. const [styles] = useGlobalStylesOutput();
  6527. const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
  6528. const [coreColors] = useSetting('color.palette.core');
  6529. const [themeColors] = useSetting('color.palette.theme');
  6530. const [customColors] = useSetting('color.palette.custom');
  6531. const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false);
  6532. const [containerResizeListener, {
  6533. width
  6534. }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
  6535. const ratio = width ? width / normalizedWidth : 1;
  6536. const paletteColors = (themeColors !== null && themeColors !== void 0 ? themeColors : []).concat(customColors !== null && customColors !== void 0 ? customColors : []).concat(coreColors !== null && coreColors !== void 0 ? coreColors : []);
  6537. const highlightedColors = paletteColors.filter( // we exclude these two colors because they are already visible in the preview.
  6538. _ref2 => {
  6539. let {
  6540. color
  6541. } = _ref2;
  6542. return color !== backgroundColor && color !== headingColor;
  6543. }).slice(0, 2); // Reset leaked styles from WP common.css.
  6544. const editorStyles = (0,external_wp_element_namespaceObject.useMemo)(() => {
  6545. if (styles) {
  6546. return [...styles, {
  6547. css: 'body{min-width: 0;}',
  6548. isGlobalStyles: true
  6549. }];
  6550. }
  6551. return styles;
  6552. }, [styles]);
  6553. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableIframe, {
  6554. className: "edit-site-global-styles-preview__iframe",
  6555. head: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, {
  6556. styles: editorStyles
  6557. }),
  6558. style: {
  6559. height: normalizedHeight * ratio,
  6560. visibility: !width ? 'hidden' : 'visible'
  6561. },
  6562. onMouseEnter: () => setIsHovered(true),
  6563. onMouseLeave: () => setIsHovered(false),
  6564. tabIndex: -1
  6565. }, containerResizeListener, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
  6566. style: {
  6567. height: normalizedHeight * ratio,
  6568. width: '100%',
  6569. background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor,
  6570. cursor: 'pointer'
  6571. },
  6572. initial: "start",
  6573. animate: (isHovered || isFocused) && !disableMotion ? 'hover' : 'start'
  6574. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
  6575. variants: firstFrame,
  6576. style: {
  6577. height: '100%',
  6578. overflow: 'hidden'
  6579. }
  6580. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  6581. spacing: 10 * ratio,
  6582. justify: "center",
  6583. style: {
  6584. height: '100%',
  6585. overflow: 'hidden'
  6586. }
  6587. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  6588. style: {
  6589. fontFamily: headingFontFamily,
  6590. fontSize: 65 * ratio,
  6591. color: headingColor,
  6592. fontWeight: headingFontWeight
  6593. }
  6594. }, "Aa"), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
  6595. spacing: 4 * ratio
  6596. }, highlightedColors.map(_ref3 => {
  6597. let {
  6598. slug,
  6599. color
  6600. } = _ref3;
  6601. return (0,external_wp_element_namespaceObject.createElement)("div", {
  6602. key: slug,
  6603. style: {
  6604. height: normalizedColorSwatchSize * ratio,
  6605. width: normalizedColorSwatchSize * ratio,
  6606. background: color,
  6607. borderRadius: normalizedColorSwatchSize * ratio / 2
  6608. }
  6609. });
  6610. })))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
  6611. variants: secondFrame,
  6612. style: {
  6613. height: '100%',
  6614. overflow: 'hidden'
  6615. }
  6616. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
  6617. spacing: 3 * ratio,
  6618. justify: "center",
  6619. style: {
  6620. height: '100%',
  6621. overflow: 'hidden',
  6622. padding: 10 * ratio,
  6623. boxSizing: 'border-box'
  6624. }
  6625. }, label && (0,external_wp_element_namespaceObject.createElement)("div", {
  6626. style: {
  6627. fontSize: 35 * ratio,
  6628. fontFamily: headingFontFamily,
  6629. color: headingColor,
  6630. fontWeight: headingFontWeight,
  6631. lineHeight: '1em'
  6632. }
  6633. }, label), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  6634. spacing: 2 * ratio,
  6635. justify: "flex-start"
  6636. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  6637. style: {
  6638. fontFamily,
  6639. fontSize: 24 * ratio,
  6640. color: textColor
  6641. }
  6642. }, "Aa"), (0,external_wp_element_namespaceObject.createElement)("div", {
  6643. style: {
  6644. fontFamily,
  6645. fontSize: 24 * ratio,
  6646. color: linkColor
  6647. }
  6648. }, "Aa")), paletteColors && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  6649. spacing: 0
  6650. }, paletteColors.slice(0, 4).map((_ref4, index) => {
  6651. let {
  6652. color
  6653. } = _ref4;
  6654. return (0,external_wp_element_namespaceObject.createElement)("div", {
  6655. key: index,
  6656. style: {
  6657. height: 10 * ratio,
  6658. width: 30 * ratio,
  6659. background: color,
  6660. flexGrow: 1
  6661. }
  6662. });
  6663. }))))));
  6664. };
  6665. /* harmony default export */ var preview = (StylesPreview);
  6666. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-root.js
  6667. /**
  6668. * WordPress dependencies
  6669. */
  6670. /**
  6671. * Internal dependencies
  6672. */
  6673. function ScreenRoot() {
  6674. const {
  6675. variations
  6676. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  6677. return {
  6678. variations: select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations()
  6679. };
  6680. }, []);
  6681. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Card, {
  6682. size: "small"
  6683. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CardBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
  6684. spacing: 2
  6685. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Card, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CardMedia, null, (0,external_wp_element_namespaceObject.createElement)(preview, null))), !!(variations !== null && variations !== void 0 && variations.length) && (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  6686. path: "/variations"
  6687. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  6688. justify: "space-between"
  6689. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_i18n_namespaceObject.__)('Browse styles')), (0,external_wp_element_namespaceObject.createElement)(IconWithCurrentColor, {
  6690. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right
  6691. }))))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CardBody, null, (0,external_wp_element_namespaceObject.createElement)(context_menu, null)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CardDivider, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CardBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItem, null, (0,external_wp_i18n_namespaceObject.__)('Customize the appearance of specific blocks for the whole site.')), (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  6692. path: "/blocks"
  6693. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  6694. justify: "space-between"
  6695. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_i18n_namespaceObject.__)('Blocks')), (0,external_wp_element_namespaceObject.createElement)(IconWithCurrentColor, {
  6696. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right
  6697. }))))));
  6698. }
  6699. /* harmony default export */ var screen_root = (ScreenRoot);
  6700. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/header.js
  6701. /**
  6702. * WordPress dependencies
  6703. */
  6704. /**
  6705. * Internal dependencies
  6706. */
  6707. function ScreenHeader(_ref) {
  6708. let {
  6709. title,
  6710. description
  6711. } = _ref;
  6712. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
  6713. spacing: 2
  6714. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  6715. spacing: 2
  6716. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalView, null, (0,external_wp_element_namespaceObject.createElement)(NavigationBackButton, {
  6717. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left,
  6718. size: "small",
  6719. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous view')
  6720. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
  6721. level: 5
  6722. }, title))), description && (0,external_wp_element_namespaceObject.createElement)("p", {
  6723. className: "edit-site-global-styles-header__description"
  6724. }, description));
  6725. }
  6726. /* harmony default export */ var header = (ScreenHeader);
  6727. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block-list.js
  6728. /**
  6729. * WordPress dependencies
  6730. */
  6731. /**
  6732. * Internal dependencies
  6733. */
  6734. function useSortedBlockTypes() {
  6735. const blockItems = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getBlockTypes(), []); // Ensure core blocks are prioritized in the returned results,
  6736. // because third party blocks can be registered earlier than
  6737. // the core blocks (usually by using the `init` action),
  6738. // thus affecting the display order.
  6739. // We don't sort reusable blocks as they are handled differently.
  6740. const groupByType = (blocks, block) => {
  6741. const {
  6742. core,
  6743. noncore
  6744. } = blocks;
  6745. const type = block.name.startsWith('core/') ? core : noncore;
  6746. type.push(block);
  6747. return blocks;
  6748. };
  6749. const {
  6750. core: coreItems,
  6751. noncore: nonCoreItems
  6752. } = blockItems.reduce(groupByType, {
  6753. core: [],
  6754. noncore: []
  6755. });
  6756. return [...coreItems, ...nonCoreItems];
  6757. }
  6758. function BlockMenuItem(_ref) {
  6759. let {
  6760. block
  6761. } = _ref;
  6762. const hasTypographyPanel = useHasTypographyPanel(block.name);
  6763. const hasColorPanel = useHasColorPanel(block.name);
  6764. const hasBorderPanel = useHasBorderPanel(block.name);
  6765. const hasDimensionsPanel = useHasDimensionsPanel(block.name);
  6766. const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;
  6767. const hasBlockMenuItem = hasTypographyPanel || hasColorPanel || hasLayoutPanel;
  6768. if (!hasBlockMenuItem) {
  6769. return null;
  6770. }
  6771. return (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  6772. path: '/blocks/' + block.name
  6773. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  6774. justify: "flex-start"
  6775. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  6776. icon: block.icon
  6777. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, block.title)));
  6778. }
  6779. function ScreenBlockList() {
  6780. const sortedBlockTypes = useSortedBlockTypes();
  6781. const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)('');
  6782. const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
  6783. const isMatchingSearchTerm = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).isMatchingSearchTerm, []);
  6784. const filteredBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => {
  6785. if (!filterValue) {
  6786. return sortedBlockTypes;
  6787. }
  6788. return sortedBlockTypes.filter(blockType => isMatchingSearchTerm(blockType, filterValue));
  6789. }, [filterValue, sortedBlockTypes, isMatchingSearchTerm]);
  6790. const blockTypesListRef = (0,external_wp_element_namespaceObject.useRef)(); // Announce search results on change
  6791. (0,external_wp_element_namespaceObject.useEffect)(() => {
  6792. if (!filterValue) {
  6793. return;
  6794. } // We extract the results from the wrapper div's `ref` because
  6795. // filtered items can contain items that will eventually not
  6796. // render and there is no reliable way to detect when a child
  6797. // will return `null`.
  6798. // TODO: We should find a better way of handling this as it's
  6799. // fragile and depends on the number of rendered elements of `BlockMenuItem`,
  6800. // which is now one.
  6801. // @see https://github.com/WordPress/gutenberg/pull/39117#discussion_r816022116
  6802. const count = blockTypesListRef.current.childElementCount;
  6803. const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
  6804. /* translators: %d: number of results. */
  6805. (0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', count), count);
  6806. debouncedSpeak(resultsFoundMessage, count);
  6807. }, [filterValue, debouncedSpeak]);
  6808. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  6809. title: (0,external_wp_i18n_namespaceObject.__)('Blocks'),
  6810. description: (0,external_wp_i18n_namespaceObject.__)('Customize the appearance of specific blocks and for the whole site.')
  6811. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SearchControl, {
  6812. className: "edit-site-block-types-search",
  6813. onChange: setFilterValue,
  6814. value: filterValue,
  6815. label: (0,external_wp_i18n_namespaceObject.__)('Search for blocks'),
  6816. placeholder: (0,external_wp_i18n_namespaceObject.__)('Search')
  6817. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  6818. ref: blockTypesListRef,
  6819. className: "edit-site-block-types-item-list"
  6820. }, filteredBlockTypes.map(block => (0,external_wp_element_namespaceObject.createElement)(BlockMenuItem, {
  6821. block: block,
  6822. key: 'menu-itemblock-' + block.name
  6823. }))));
  6824. }
  6825. /* harmony default export */ var screen_block_list = (ScreenBlockList);
  6826. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block.js
  6827. /**
  6828. * WordPress dependencies
  6829. */
  6830. /**
  6831. * Internal dependencies
  6832. */
  6833. function ScreenBlock(_ref) {
  6834. let {
  6835. name
  6836. } = _ref;
  6837. const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
  6838. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  6839. title: blockType.title
  6840. }), (0,external_wp_element_namespaceObject.createElement)(context_menu, {
  6841. parentMenu: '/blocks/' + name,
  6842. name: name
  6843. }));
  6844. }
  6845. /* harmony default export */ var screen_block = (ScreenBlock);
  6846. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/subtitle.js
  6847. /**
  6848. * WordPress dependencies
  6849. */
  6850. function Subtitle(_ref) {
  6851. let {
  6852. children
  6853. } = _ref;
  6854. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
  6855. className: "edit-site-global-styles-subtitle",
  6856. level: 2
  6857. }, children);
  6858. }
  6859. /* harmony default export */ var subtitle = (Subtitle);
  6860. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-typography.js
  6861. /**
  6862. * WordPress dependencies
  6863. */
  6864. /**
  6865. * Internal dependencies
  6866. */
  6867. function Item(_ref) {
  6868. let {
  6869. name,
  6870. parentMenu,
  6871. element,
  6872. label
  6873. } = _ref;
  6874. const hasSupport = !name;
  6875. const prefix = element === 'text' || !element ? '' : `elements.${element}.`;
  6876. const extraStyles = element === 'link' ? {
  6877. textDecoration: 'underline'
  6878. } : {};
  6879. const [fontFamily] = useStyle(prefix + 'typography.fontFamily', name);
  6880. const [fontStyle] = useStyle(prefix + 'typography.fontStyle', name);
  6881. const [fontWeight] = useStyle(prefix + 'typography.fontWeight', name);
  6882. const [letterSpacing] = useStyle(prefix + 'typography.letterSpacing', name);
  6883. const [backgroundColor] = useStyle(prefix + 'color.background', name);
  6884. const [gradientValue] = useStyle(prefix + 'color.gradient', name);
  6885. const [color] = useStyle(prefix + 'color.text', name);
  6886. if (!hasSupport) {
  6887. return null;
  6888. }
  6889. return (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  6890. path: parentMenu + '/typography/' + element
  6891. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  6892. justify: "flex-start"
  6893. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
  6894. className: "edit-site-global-styles-screen-typography__indicator",
  6895. style: {
  6896. fontFamily: fontFamily !== null && fontFamily !== void 0 ? fontFamily : 'serif',
  6897. background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor,
  6898. color,
  6899. fontStyle,
  6900. fontWeight,
  6901. letterSpacing,
  6902. ...extraStyles
  6903. }
  6904. }, (0,external_wp_i18n_namespaceObject.__)('Aa')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, label)));
  6905. }
  6906. function ScreenTypography(_ref2) {
  6907. let {
  6908. name
  6909. } = _ref2;
  6910. const parentMenu = name === undefined ? '' : '/blocks/' + name;
  6911. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  6912. title: (0,external_wp_i18n_namespaceObject.__)('Typography'),
  6913. description: (0,external_wp_i18n_namespaceObject.__)('Manage the typography settings for different elements.')
  6914. }), !name && (0,external_wp_element_namespaceObject.createElement)("div", {
  6915. className: "edit-site-global-styles-screen-typography"
  6916. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
  6917. spacing: 3
  6918. }, (0,external_wp_element_namespaceObject.createElement)(subtitle, null, (0,external_wp_i18n_namespaceObject.__)('Elements')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
  6919. isBordered: true,
  6920. isSeparated: true
  6921. }, (0,external_wp_element_namespaceObject.createElement)(Item, {
  6922. name: name,
  6923. parentMenu: parentMenu,
  6924. element: "text",
  6925. label: (0,external_wp_i18n_namespaceObject.__)('Text')
  6926. }), (0,external_wp_element_namespaceObject.createElement)(Item, {
  6927. name: name,
  6928. parentMenu: parentMenu,
  6929. element: "link",
  6930. label: (0,external_wp_i18n_namespaceObject.__)('Links')
  6931. })))), !!name && (0,external_wp_element_namespaceObject.createElement)(TypographyPanel, {
  6932. name: name,
  6933. element: "text"
  6934. }));
  6935. }
  6936. /* harmony default export */ var screen_typography = (ScreenTypography);
  6937. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-typography-element.js
  6938. /**
  6939. * WordPress dependencies
  6940. */
  6941. /**
  6942. * Internal dependencies
  6943. */
  6944. const screen_typography_element_elements = {
  6945. text: {
  6946. description: (0,external_wp_i18n_namespaceObject.__)('Manage the fonts used on the site.'),
  6947. title: (0,external_wp_i18n_namespaceObject.__)('Text')
  6948. },
  6949. link: {
  6950. description: (0,external_wp_i18n_namespaceObject.__)('Manage the fonts and typography used on the links.'),
  6951. title: (0,external_wp_i18n_namespaceObject.__)('Links')
  6952. }
  6953. };
  6954. function ScreenTypographyElement(_ref) {
  6955. let {
  6956. name,
  6957. element
  6958. } = _ref;
  6959. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  6960. title: screen_typography_element_elements[element].title,
  6961. description: screen_typography_element_elements[element].description
  6962. }), (0,external_wp_element_namespaceObject.createElement)(TypographyPanel, {
  6963. name: name,
  6964. element: element
  6965. }));
  6966. }
  6967. /* harmony default export */ var screen_typography_element = (ScreenTypographyElement);
  6968. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-indicator-wrapper.js
  6969. /**
  6970. * External dependencies
  6971. */
  6972. /**
  6973. * WordPress dependencies
  6974. */
  6975. function ColorIndicatorWrapper(_ref) {
  6976. let {
  6977. className,
  6978. ...props
  6979. } = _ref;
  6980. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, extends_extends({
  6981. className: classnames_default()('edit-site-global-styles__color-indicator-wrapper', className)
  6982. }, props));
  6983. }
  6984. /* harmony default export */ var color_indicator_wrapper = (ColorIndicatorWrapper);
  6985. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/palette.js
  6986. /**
  6987. * WordPress dependencies
  6988. */
  6989. /**
  6990. * Internal dependencies
  6991. */
  6992. const EMPTY_COLORS = [];
  6993. function Palette(_ref) {
  6994. let {
  6995. name
  6996. } = _ref;
  6997. const [customColors] = useSetting('color.palette.custom');
  6998. const [themeColors] = useSetting('color.palette.theme');
  6999. const [defaultColors] = useSetting('color.palette.default');
  7000. const [defaultPaletteEnabled] = useSetting('color.defaultPalette', name);
  7001. const colors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(customColors || EMPTY_COLORS), ...(themeColors || EMPTY_COLORS), ...(defaultColors && defaultPaletteEnabled ? defaultColors : EMPTY_COLORS)], [customColors, themeColors, defaultColors, defaultPaletteEnabled]);
  7002. const screenPath = !name ? '/colors/palette' : '/blocks/' + name + '/colors/palette';
  7003. const paletteButtonText = colors.length > 0 ? (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %d: Number of palette colors.
  7004. (0,external_wp_i18n_namespaceObject._n)('%d color', '%d colors', colors.length), colors.length) : (0,external_wp_i18n_namespaceObject.__)('Add custom colors');
  7005. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
  7006. spacing: 3
  7007. }, (0,external_wp_element_namespaceObject.createElement)(subtitle, null, (0,external_wp_i18n_namespaceObject.__)('Palette')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
  7008. isBordered: true,
  7009. isSeparated: true
  7010. }, (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  7011. path: screenPath
  7012. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  7013. direction: colors.length === 0 ? 'row-reverse' : 'row'
  7014. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalZStack, {
  7015. isLayered: false,
  7016. offset: -8
  7017. }, colors.slice(0, 5).map(_ref2 => {
  7018. let {
  7019. color
  7020. } = _ref2;
  7021. return (0,external_wp_element_namespaceObject.createElement)(color_indicator_wrapper, {
  7022. key: color
  7023. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
  7024. colorValue: color
  7025. }));
  7026. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, paletteButtonText)))));
  7027. }
  7028. /* harmony default export */ var palette = (Palette);
  7029. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-colors.js
  7030. /**
  7031. * WordPress dependencies
  7032. */
  7033. /**
  7034. * Internal dependencies
  7035. */
  7036. function BackgroundColorItem(_ref) {
  7037. let {
  7038. name,
  7039. parentMenu
  7040. } = _ref;
  7041. const supports = getSupportedGlobalStylesPanels(name);
  7042. const hasSupport = supports.includes('backgroundColor') || supports.includes('background');
  7043. const [backgroundColor] = useStyle('color.background', name);
  7044. const [gradientValue] = useStyle('color.gradient', name);
  7045. if (!hasSupport) {
  7046. return null;
  7047. }
  7048. return (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  7049. path: parentMenu + '/colors/background'
  7050. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  7051. justify: "flex-start"
  7052. }, (0,external_wp_element_namespaceObject.createElement)(color_indicator_wrapper, {
  7053. expanded: false
  7054. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
  7055. colorValue: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor
  7056. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_i18n_namespaceObject.__)('Background'))));
  7057. }
  7058. function TextColorItem(_ref2) {
  7059. let {
  7060. name,
  7061. parentMenu
  7062. } = _ref2;
  7063. const supports = getSupportedGlobalStylesPanels(name);
  7064. const hasSupport = supports.includes('color');
  7065. const [color] = useStyle('color.text', name);
  7066. if (!hasSupport) {
  7067. return null;
  7068. }
  7069. return (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  7070. path: parentMenu + '/colors/text'
  7071. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  7072. justify: "flex-start"
  7073. }, (0,external_wp_element_namespaceObject.createElement)(color_indicator_wrapper, {
  7074. expanded: false
  7075. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
  7076. colorValue: color
  7077. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_i18n_namespaceObject.__)('Text'))));
  7078. }
  7079. function LinkColorItem(_ref3) {
  7080. let {
  7081. name,
  7082. parentMenu
  7083. } = _ref3;
  7084. const supports = getSupportedGlobalStylesPanels(name);
  7085. const hasSupport = supports.includes('linkColor');
  7086. const [color] = useStyle('elements.link.color.text', name);
  7087. if (!hasSupport) {
  7088. return null;
  7089. }
  7090. return (0,external_wp_element_namespaceObject.createElement)(NavigationButton, {
  7091. path: parentMenu + '/colors/link'
  7092. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  7093. justify: "flex-start"
  7094. }, (0,external_wp_element_namespaceObject.createElement)(color_indicator_wrapper, {
  7095. expanded: false
  7096. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
  7097. colorValue: color
  7098. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_i18n_namespaceObject.__)('Links'))));
  7099. }
  7100. function ScreenColors(_ref4) {
  7101. let {
  7102. name
  7103. } = _ref4;
  7104. const parentMenu = name === undefined ? '' : '/blocks/' + name;
  7105. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  7106. title: (0,external_wp_i18n_namespaceObject.__)('Colors'),
  7107. description: (0,external_wp_i18n_namespaceObject.__)('Manage palettes and the default color of different global elements on the site.')
  7108. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  7109. className: "edit-site-global-styles-screen-colors"
  7110. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
  7111. spacing: 10
  7112. }, (0,external_wp_element_namespaceObject.createElement)(palette, {
  7113. name: name
  7114. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
  7115. spacing: 3
  7116. }, (0,external_wp_element_namespaceObject.createElement)(subtitle, null, (0,external_wp_i18n_namespaceObject.__)('Elements')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
  7117. isBordered: true,
  7118. isSeparated: true
  7119. }, (0,external_wp_element_namespaceObject.createElement)(BackgroundColorItem, {
  7120. name: name,
  7121. parentMenu: parentMenu
  7122. }), (0,external_wp_element_namespaceObject.createElement)(TextColorItem, {
  7123. name: name,
  7124. parentMenu: parentMenu
  7125. }), (0,external_wp_element_namespaceObject.createElement)(LinkColorItem, {
  7126. name: name,
  7127. parentMenu: parentMenu
  7128. }))))));
  7129. }
  7130. /* harmony default export */ var screen_colors = (ScreenColors);
  7131. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-palette-panel.js
  7132. /**
  7133. * WordPress dependencies
  7134. */
  7135. /**
  7136. * Internal dependencies
  7137. */
  7138. function ColorPalettePanel(_ref) {
  7139. let {
  7140. name
  7141. } = _ref;
  7142. const [themeColors, setThemeColors] = useSetting('color.palette.theme', name);
  7143. const [baseThemeColors] = useSetting('color.palette.theme', name, 'base');
  7144. const [defaultColors, setDefaultColors] = useSetting('color.palette.default', name);
  7145. const [baseDefaultColors] = useSetting('color.palette.default', name, 'base');
  7146. const [customColors, setCustomColors] = useSetting('color.palette.custom', name);
  7147. const [defaultPaletteEnabled] = useSetting('color.defaultPalette', name);
  7148. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
  7149. className: "edit-site-global-styles-color-palette-panel",
  7150. spacing: 10
  7151. }, !!themeColors && !!themeColors.length && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalPaletteEdit, {
  7152. canReset: themeColors !== baseThemeColors,
  7153. canOnlyChangeValues: true,
  7154. colors: themeColors,
  7155. onChange: setThemeColors,
  7156. paletteLabel: (0,external_wp_i18n_namespaceObject.__)('Theme')
  7157. }), !!defaultColors && !!defaultColors.length && !!defaultPaletteEnabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalPaletteEdit, {
  7158. canReset: defaultColors !== baseDefaultColors,
  7159. canOnlyChangeValues: true,
  7160. colors: defaultColors,
  7161. onChange: setDefaultColors,
  7162. paletteLabel: (0,external_wp_i18n_namespaceObject.__)('Default')
  7163. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalPaletteEdit, {
  7164. colors: customColors,
  7165. onChange: setCustomColors,
  7166. paletteLabel: (0,external_wp_i18n_namespaceObject.__)('Custom'),
  7167. emptyMessage: (0,external_wp_i18n_namespaceObject.__)('Custom colors are empty! Add some colors to create your own color palette.'),
  7168. slugPrefix: "custom-"
  7169. }));
  7170. }
  7171. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/gradients-palette-panel.js
  7172. /**
  7173. * External dependencies
  7174. */
  7175. /**
  7176. * WordPress dependencies
  7177. */
  7178. /**
  7179. * Internal dependencies
  7180. */
  7181. function GradientPalettePanel(_ref) {
  7182. let {
  7183. name
  7184. } = _ref;
  7185. const [themeGradients, setThemeGradients] = useSetting('color.gradients.theme', name);
  7186. const [baseThemeGradients] = useSetting('color.gradients.theme', name, 'base');
  7187. const [defaultGradients, setDefaultGradients] = useSetting('color.gradients.default', name);
  7188. const [baseDefaultGradients] = useSetting('color.gradients.default', name, 'base');
  7189. const [customGradients, setCustomGradients] = useSetting('color.gradients.custom', name);
  7190. const [defaultPaletteEnabled] = useSetting('color.defaultGradients', name);
  7191. const [duotonePalette] = useSetting('color.duotone') || [];
  7192. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
  7193. className: "edit-site-global-styles-gradient-palette-panel",
  7194. spacing: 10
  7195. }, !!themeGradients && !!themeGradients.length && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalPaletteEdit, {
  7196. canReset: themeGradients !== baseThemeGradients,
  7197. canOnlyChangeValues: true,
  7198. gradients: themeGradients,
  7199. onChange: setThemeGradients,
  7200. paletteLabel: (0,external_wp_i18n_namespaceObject.__)('Theme')
  7201. }), !!defaultGradients && !!defaultGradients.length && !!defaultPaletteEnabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalPaletteEdit, {
  7202. canReset: defaultGradients !== baseDefaultGradients,
  7203. canOnlyChangeValues: true,
  7204. gradients: defaultGradients,
  7205. onChange: setDefaultGradients,
  7206. paletteLabel: (0,external_wp_i18n_namespaceObject.__)('Default')
  7207. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalPaletteEdit, {
  7208. gradients: customGradients,
  7209. onChange: setCustomGradients,
  7210. paletteLabel: (0,external_wp_i18n_namespaceObject.__)('Custom'),
  7211. emptyMessage: (0,external_wp_i18n_namespaceObject.__)('Custom gradients are empty! Add some gradients to create your own palette.'),
  7212. slugPrefix: "custom-"
  7213. }), (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(subtitle, null, (0,external_wp_i18n_namespaceObject.__)('Duotone')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, {
  7214. margin: 3
  7215. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DuotonePicker, {
  7216. duotonePalette: duotonePalette,
  7217. disableCustomDuotone: true,
  7218. disableCustomColors: true,
  7219. clearable: false,
  7220. onChange: external_lodash_namespaceObject.noop
  7221. })));
  7222. }
  7223. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-color-palette.js
  7224. /**
  7225. * WordPress dependencies
  7226. */
  7227. /**
  7228. * Internal dependencies
  7229. */
  7230. function ScreenColorPalette(_ref) {
  7231. let {
  7232. name
  7233. } = _ref;
  7234. const [currentTab, setCurrentTab] = (0,external_wp_element_namespaceObject.useState)('solid');
  7235. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  7236. title: (0,external_wp_i18n_namespaceObject.__)('Palette'),
  7237. description: (0,external_wp_i18n_namespaceObject.__)('Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.')
  7238. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  7239. className: "edit-site-screen-color-palette-toggle",
  7240. value: currentTab,
  7241. onChange: setCurrentTab,
  7242. label: (0,external_wp_i18n_namespaceObject.__)('Select palette type'),
  7243. hideLabelFromVision: true,
  7244. isBlock: true
  7245. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  7246. value: "solid",
  7247. label: (0,external_wp_i18n_namespaceObject.__)('Solid')
  7248. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  7249. value: "gradient",
  7250. label: (0,external_wp_i18n_namespaceObject.__)('Gradient')
  7251. })), currentTab === 'solid' && (0,external_wp_element_namespaceObject.createElement)(ColorPalettePanel, {
  7252. name: name
  7253. }), currentTab === 'gradient' && (0,external_wp_element_namespaceObject.createElement)(GradientPalettePanel, {
  7254. name: name
  7255. }));
  7256. }
  7257. /* harmony default export */ var screen_color_palette = (ScreenColorPalette);
  7258. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-background-color.js
  7259. /**
  7260. * WordPress dependencies
  7261. */
  7262. /**
  7263. * Internal dependencies
  7264. */
  7265. function ScreenBackgroundColor(_ref) {
  7266. let {
  7267. name
  7268. } = _ref;
  7269. const supports = getSupportedGlobalStylesPanels(name);
  7270. const [solids] = useSetting('color.palette', name);
  7271. const [gradients] = useSetting('color.gradients', name);
  7272. const [areCustomSolidsEnabled] = useSetting('color.custom', name);
  7273. const [areCustomGradientsEnabled] = useSetting('color.customGradient', name);
  7274. const colorsPerOrigin = useColorsPerOrigin(name);
  7275. const gradientsPerOrigin = useGradientsPerOrigin(name);
  7276. const [isBackgroundEnabled] = useSetting('color.background', name);
  7277. const hasBackgroundColor = supports.includes('backgroundColor') && isBackgroundEnabled && (solids.length > 0 || areCustomSolidsEnabled);
  7278. const hasGradientColor = supports.includes('background') && (gradients.length > 0 || areCustomGradientsEnabled);
  7279. const [backgroundColor, setBackgroundColor] = useStyle('color.background', name);
  7280. const [userBackgroundColor] = useStyle('color.background', name, 'user');
  7281. const [gradient, setGradient] = useStyle('color.gradient', name);
  7282. const [userGradient] = useStyle('color.gradient', name, 'user');
  7283. if (!hasBackgroundColor && !hasGradientColor) {
  7284. return null;
  7285. }
  7286. let backgroundSettings = {};
  7287. if (hasBackgroundColor) {
  7288. backgroundSettings = {
  7289. colorValue: backgroundColor,
  7290. onColorChange: setBackgroundColor
  7291. };
  7292. if (backgroundColor) {
  7293. backgroundSettings.clearable = backgroundColor === userBackgroundColor;
  7294. }
  7295. }
  7296. let gradientSettings = {};
  7297. if (hasGradientColor) {
  7298. gradientSettings = {
  7299. gradientValue: gradient,
  7300. onGradientChange: setGradient
  7301. };
  7302. if (gradient) {
  7303. gradientSettings.clearable = gradient === userGradient;
  7304. }
  7305. }
  7306. const controlProps = { ...backgroundSettings,
  7307. ...gradientSettings
  7308. };
  7309. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  7310. title: (0,external_wp_i18n_namespaceObject.__)('Background'),
  7311. description: (0,external_wp_i18n_namespaceObject.__)('Set a background color or gradient for the whole site.')
  7312. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientControl, extends_extends({
  7313. className: "edit-site-screen-background-color__control",
  7314. colors: colorsPerOrigin,
  7315. gradients: gradientsPerOrigin,
  7316. disableCustomColors: !areCustomSolidsEnabled,
  7317. disableCustomGradients: !areCustomGradientsEnabled,
  7318. __experimentalHasMultipleOrigins: true,
  7319. showTitle: false,
  7320. enableAlpha: true,
  7321. __experimentalIsRenderedInSidebar: true
  7322. }, controlProps)));
  7323. }
  7324. /* harmony default export */ var screen_background_color = (ScreenBackgroundColor);
  7325. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-text-color.js
  7326. /**
  7327. * WordPress dependencies
  7328. */
  7329. /**
  7330. * Internal dependencies
  7331. */
  7332. function ScreenTextColor(_ref) {
  7333. let {
  7334. name
  7335. } = _ref;
  7336. const supports = getSupportedGlobalStylesPanels(name);
  7337. const [solids] = useSetting('color.palette', name);
  7338. const [areCustomSolidsEnabled] = useSetting('color.custom', name);
  7339. const [isTextEnabled] = useSetting('color.text', name);
  7340. const colorsPerOrigin = useColorsPerOrigin(name);
  7341. const hasTextColor = supports.includes('color') && isTextEnabled && (solids.length > 0 || areCustomSolidsEnabled);
  7342. const [color, setColor] = useStyle('color.text', name);
  7343. const [userColor] = useStyle('color.text', name, 'user');
  7344. if (!hasTextColor) {
  7345. return null;
  7346. }
  7347. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  7348. title: (0,external_wp_i18n_namespaceObject.__)('Text'),
  7349. description: (0,external_wp_i18n_namespaceObject.__)('Set the default color used for text across the site.')
  7350. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientControl, {
  7351. className: "edit-site-screen-text-color__control",
  7352. colors: colorsPerOrigin,
  7353. disableCustomColors: !areCustomSolidsEnabled,
  7354. __experimentalHasMultipleOrigins: true,
  7355. showTitle: false,
  7356. enableAlpha: true,
  7357. __experimentalIsRenderedInSidebar: true,
  7358. colorValue: color,
  7359. onColorChange: setColor,
  7360. clearable: color === userColor
  7361. }));
  7362. }
  7363. /* harmony default export */ var screen_text_color = (ScreenTextColor);
  7364. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-link-color.js
  7365. /**
  7366. * WordPress dependencies
  7367. */
  7368. /**
  7369. * Internal dependencies
  7370. */
  7371. function ScreenLinkColor(_ref) {
  7372. let {
  7373. name
  7374. } = _ref;
  7375. const supports = getSupportedGlobalStylesPanels(name);
  7376. const [solids] = useSetting('color.palette', name);
  7377. const [areCustomSolidsEnabled] = useSetting('color.custom', name);
  7378. const colorsPerOrigin = useColorsPerOrigin(name);
  7379. const [isLinkEnabled] = useSetting('color.link', name);
  7380. const hasLinkColor = supports.includes('linkColor') && isLinkEnabled && (solids.length > 0 || areCustomSolidsEnabled);
  7381. const [linkColor, setLinkColor] = useStyle('elements.link.color.text', name);
  7382. const [userLinkColor] = useStyle('elements.link.color.text', name, 'user');
  7383. if (!hasLinkColor) {
  7384. return null;
  7385. }
  7386. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  7387. title: (0,external_wp_i18n_namespaceObject.__)('Links'),
  7388. description: (0,external_wp_i18n_namespaceObject.__)('Set the default color used for links across the site.')
  7389. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientControl, {
  7390. className: "edit-site-screen-link-color__control",
  7391. colors: colorsPerOrigin,
  7392. disableCustomColors: !areCustomSolidsEnabled,
  7393. __experimentalHasMultipleOrigins: true,
  7394. showTitle: false,
  7395. enableAlpha: true,
  7396. __experimentalIsRenderedInSidebar: true,
  7397. colorValue: linkColor,
  7398. onColorChange: setLinkColor,
  7399. clearable: linkColor === userLinkColor
  7400. }));
  7401. }
  7402. /* harmony default export */ var screen_link_color = (ScreenLinkColor);
  7403. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-layout.js
  7404. /**
  7405. * WordPress dependencies
  7406. */
  7407. /**
  7408. * Internal dependencies
  7409. */
  7410. function ScreenLayout(_ref) {
  7411. let {
  7412. name
  7413. } = _ref;
  7414. const hasBorderPanel = useHasBorderPanel(name);
  7415. const hasDimensionsPanel = useHasDimensionsPanel(name);
  7416. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  7417. title: (0,external_wp_i18n_namespaceObject.__)('Layout')
  7418. }), hasDimensionsPanel && (0,external_wp_element_namespaceObject.createElement)(DimensionsPanel, {
  7419. name: name
  7420. }), hasBorderPanel && (0,external_wp_element_namespaceObject.createElement)(BorderPanel, {
  7421. name: name
  7422. }));
  7423. }
  7424. /* harmony default export */ var screen_layout = (ScreenLayout);
  7425. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/global-styles-provider.js
  7426. /**
  7427. * External dependencies
  7428. */
  7429. /**
  7430. * WordPress dependencies
  7431. */
  7432. /**
  7433. * Internal dependencies
  7434. */
  7435. function mergeTreesCustomizer(_, srcValue) {
  7436. // We only pass as arrays the presets,
  7437. // in which case we want the new array of values
  7438. // to override the old array (no merging).
  7439. if (Array.isArray(srcValue)) {
  7440. return srcValue;
  7441. }
  7442. }
  7443. function mergeBaseAndUserConfigs(base, user) {
  7444. return (0,external_lodash_namespaceObject.mergeWith)({}, base, user, mergeTreesCustomizer);
  7445. }
  7446. const cleanEmptyObject = object => {
  7447. if (!(0,external_lodash_namespaceObject.isObject)(object) || Array.isArray(object)) {
  7448. return object;
  7449. }
  7450. const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity);
  7451. return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
  7452. };
  7453. function useGlobalStylesUserConfig() {
  7454. const {
  7455. globalStylesId,
  7456. settings,
  7457. styles
  7458. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7459. const _globalStylesId = select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentGlobalStylesId();
  7460. const record = _globalStylesId ? select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('root', 'globalStyles', _globalStylesId) : undefined;
  7461. return {
  7462. globalStylesId: _globalStylesId,
  7463. settings: record === null || record === void 0 ? void 0 : record.settings,
  7464. styles: record === null || record === void 0 ? void 0 : record.styles
  7465. };
  7466. }, []);
  7467. const {
  7468. getEditedEntityRecord
  7469. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store);
  7470. const {
  7471. editEntityRecord
  7472. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  7473. const config = (0,external_wp_element_namespaceObject.useMemo)(() => {
  7474. return {
  7475. settings: settings !== null && settings !== void 0 ? settings : {},
  7476. styles: styles !== null && styles !== void 0 ? styles : {}
  7477. };
  7478. }, [settings, styles]);
  7479. const setConfig = (0,external_wp_element_namespaceObject.useCallback)(callback => {
  7480. var _record$styles, _record$settings;
  7481. const record = getEditedEntityRecord('root', 'globalStyles', globalStylesId);
  7482. const currentConfig = {
  7483. styles: (_record$styles = record === null || record === void 0 ? void 0 : record.styles) !== null && _record$styles !== void 0 ? _record$styles : {},
  7484. settings: (_record$settings = record === null || record === void 0 ? void 0 : record.settings) !== null && _record$settings !== void 0 ? _record$settings : {}
  7485. };
  7486. const updatedConfig = callback(currentConfig);
  7487. editEntityRecord('root', 'globalStyles', globalStylesId, {
  7488. styles: cleanEmptyObject(updatedConfig.styles) || {},
  7489. settings: cleanEmptyObject(updatedConfig.settings) || {}
  7490. });
  7491. }, [globalStylesId]);
  7492. return [!!settings || !!styles, config, setConfig];
  7493. }
  7494. function useGlobalStylesBaseConfig() {
  7495. const baseConfig = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7496. return select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeBaseGlobalStyles();
  7497. }, []);
  7498. return [!!baseConfig, baseConfig];
  7499. }
  7500. function useGlobalStylesContext() {
  7501. const [isUserConfigReady, userConfig, setUserConfig] = useGlobalStylesUserConfig();
  7502. const [isBaseConfigReady, baseConfig] = useGlobalStylesBaseConfig();
  7503. const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => {
  7504. if (!baseConfig || !userConfig) {
  7505. return {};
  7506. }
  7507. return mergeBaseAndUserConfigs(baseConfig, userConfig);
  7508. }, [userConfig, baseConfig]);
  7509. const context = (0,external_wp_element_namespaceObject.useMemo)(() => {
  7510. return {
  7511. isReady: isUserConfigReady && isBaseConfigReady,
  7512. user: userConfig,
  7513. base: baseConfig,
  7514. merged: mergedConfig,
  7515. setUserConfig
  7516. };
  7517. }, [mergedConfig, userConfig, baseConfig, setUserConfig, isUserConfigReady, isBaseConfigReady]);
  7518. return context;
  7519. }
  7520. function GlobalStylesProvider(_ref) {
  7521. let {
  7522. children
  7523. } = _ref;
  7524. const context = useGlobalStylesContext();
  7525. if (!context.isReady) {
  7526. return null;
  7527. }
  7528. return (0,external_wp_element_namespaceObject.createElement)(GlobalStylesContext.Provider, {
  7529. value: context
  7530. }, children);
  7531. }
  7532. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-style-variations.js
  7533. /**
  7534. * External dependencies
  7535. */
  7536. /**
  7537. * WordPress dependencies
  7538. */
  7539. /**
  7540. * Internal dependencies
  7541. */
  7542. function compareVariations(a, b) {
  7543. return (0,external_lodash_namespaceObject.isEqual)(a.styles, b.styles) && (0,external_lodash_namespaceObject.isEqual)(a.settings, b.settings);
  7544. }
  7545. function Variation(_ref) {
  7546. let {
  7547. variation
  7548. } = _ref;
  7549. const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false);
  7550. const {
  7551. base,
  7552. user,
  7553. setUserConfig
  7554. } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
  7555. const context = (0,external_wp_element_namespaceObject.useMemo)(() => {
  7556. var _variation$settings, _variation$styles;
  7557. return {
  7558. user: {
  7559. settings: (_variation$settings = variation.settings) !== null && _variation$settings !== void 0 ? _variation$settings : {},
  7560. styles: (_variation$styles = variation.styles) !== null && _variation$styles !== void 0 ? _variation$styles : {}
  7561. },
  7562. base,
  7563. merged: mergeBaseAndUserConfigs(base, variation),
  7564. setUserConfig: () => {}
  7565. };
  7566. }, [variation, base]);
  7567. const selectVariation = () => {
  7568. setUserConfig(() => {
  7569. return {
  7570. settings: variation.settings,
  7571. styles: variation.styles
  7572. };
  7573. });
  7574. };
  7575. const selectOnEnter = event => {
  7576. if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
  7577. event.preventDefault();
  7578. selectVariation();
  7579. }
  7580. };
  7581. const isActive = (0,external_wp_element_namespaceObject.useMemo)(() => {
  7582. return compareVariations(user, variation);
  7583. }, [user, variation]);
  7584. return (0,external_wp_element_namespaceObject.createElement)(GlobalStylesContext.Provider, {
  7585. value: context
  7586. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  7587. className: classnames_default()('edit-site-global-styles-variations_item', {
  7588. 'is-active': isActive
  7589. }),
  7590. role: "button",
  7591. onClick: selectVariation,
  7592. onKeyDown: selectOnEnter,
  7593. tabIndex: "0",
  7594. "aria-label": variation === null || variation === void 0 ? void 0 : variation.title,
  7595. onFocus: () => setIsFocused(true),
  7596. onBlur: () => setIsFocused(false)
  7597. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  7598. className: "edit-site-global-styles-variations_item-preview"
  7599. }, (0,external_wp_element_namespaceObject.createElement)(preview, {
  7600. label: variation === null || variation === void 0 ? void 0 : variation.title,
  7601. isFocused: isFocused
  7602. }))));
  7603. }
  7604. function ScreenStyleVariations() {
  7605. const {
  7606. variations
  7607. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7608. return {
  7609. variations: select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations()
  7610. };
  7611. }, []);
  7612. const withEmptyVariation = (0,external_wp_element_namespaceObject.useMemo)(() => {
  7613. return [{
  7614. title: (0,external_wp_i18n_namespaceObject.__)('Default'),
  7615. settings: {},
  7616. styles: {}
  7617. }, ...variations];
  7618. }, [variations]);
  7619. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
  7620. back: "/",
  7621. title: (0,external_wp_i18n_namespaceObject.__)('Browse styles'),
  7622. description: (0,external_wp_i18n_namespaceObject.__)('Choose a different style combination for the theme styles')
  7623. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Card, {
  7624. size: "small",
  7625. isBorderless: true
  7626. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CardBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalGrid, {
  7627. columns: 2
  7628. }, withEmptyVariation === null || withEmptyVariation === void 0 ? void 0 : withEmptyVariation.map((variation, index) => (0,external_wp_element_namespaceObject.createElement)(Variation, {
  7629. key: index,
  7630. variation: variation
  7631. }))))));
  7632. }
  7633. /* harmony default export */ var screen_style_variations = (ScreenStyleVariations);
  7634. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/ui.js
  7635. /**
  7636. * WordPress dependencies
  7637. */
  7638. /**
  7639. * Internal dependencies
  7640. */
  7641. function GlobalStylesNavigationScreen(_ref) {
  7642. let {
  7643. className,
  7644. ...props
  7645. } = _ref;
  7646. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, extends_extends({
  7647. className: ['edit-site-global-styles-sidebar__navigator-screen', className].filter(Boolean).join(' ')
  7648. }, props));
  7649. }
  7650. function ContextScreens(_ref2) {
  7651. let {
  7652. name
  7653. } = _ref2;
  7654. const parentMenu = name === undefined ? '' : '/blocks/' + name;
  7655. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7656. path: parentMenu + '/typography'
  7657. }, (0,external_wp_element_namespaceObject.createElement)(screen_typography, {
  7658. name: name
  7659. })), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7660. path: parentMenu + '/typography/text'
  7661. }, (0,external_wp_element_namespaceObject.createElement)(screen_typography_element, {
  7662. name: name,
  7663. element: "text"
  7664. })), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7665. path: parentMenu + '/typography/link'
  7666. }, (0,external_wp_element_namespaceObject.createElement)(screen_typography_element, {
  7667. name: name,
  7668. element: "link"
  7669. })), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7670. path: parentMenu + '/colors'
  7671. }, (0,external_wp_element_namespaceObject.createElement)(screen_colors, {
  7672. name: name
  7673. })), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7674. path: parentMenu + '/colors/palette'
  7675. }, (0,external_wp_element_namespaceObject.createElement)(screen_color_palette, {
  7676. name: name
  7677. })), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7678. path: parentMenu + '/colors/background'
  7679. }, (0,external_wp_element_namespaceObject.createElement)(screen_background_color, {
  7680. name: name
  7681. })), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7682. path: parentMenu + '/colors/text'
  7683. }, (0,external_wp_element_namespaceObject.createElement)(screen_text_color, {
  7684. name: name
  7685. })), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7686. path: parentMenu + '/colors/link'
  7687. }, (0,external_wp_element_namespaceObject.createElement)(screen_link_color, {
  7688. name: name
  7689. })), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7690. path: parentMenu + '/layout'
  7691. }, (0,external_wp_element_namespaceObject.createElement)(screen_layout, {
  7692. name: name
  7693. })));
  7694. }
  7695. function GlobalStylesUI() {
  7696. const blocks = (0,external_wp_blocks_namespaceObject.getBlockTypes)();
  7697. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, {
  7698. className: "edit-site-global-styles-sidebar__navigator-provider",
  7699. initialPath: "/"
  7700. }, (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7701. path: "/"
  7702. }, (0,external_wp_element_namespaceObject.createElement)(screen_root, null)), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7703. path: "/variations"
  7704. }, (0,external_wp_element_namespaceObject.createElement)(screen_style_variations, null)), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7705. path: "/blocks"
  7706. }, (0,external_wp_element_namespaceObject.createElement)(screen_block_list, null)), blocks.map(block => (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
  7707. key: 'menu-block-' + block.name,
  7708. path: '/blocks/' + block.name
  7709. }, (0,external_wp_element_namespaceObject.createElement)(screen_block, {
  7710. name: block.name
  7711. }))), (0,external_wp_element_namespaceObject.createElement)(ContextScreens, null), blocks.map(block => (0,external_wp_element_namespaceObject.createElement)(ContextScreens, {
  7712. key: 'screens-block-' + block.name,
  7713. name: block.name
  7714. })));
  7715. }
  7716. /* harmony default export */ var ui = (GlobalStylesUI);
  7717. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/index.js
  7718. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/global-styles-sidebar.js
  7719. /**
  7720. * WordPress dependencies
  7721. */
  7722. /**
  7723. * Internal dependencies
  7724. */
  7725. function GlobalStylesSidebar() {
  7726. const [canReset, onReset] = useGlobalStylesReset();
  7727. const {
  7728. toggle
  7729. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
  7730. return (0,external_wp_element_namespaceObject.createElement)(default_sidebar_DefaultSidebar, {
  7731. className: "edit-site-global-styles-sidebar",
  7732. identifier: "edit-site/global-styles",
  7733. title: (0,external_wp_i18n_namespaceObject.__)('Styles'),
  7734. icon: library_styles,
  7735. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close global styles sidebar'),
  7736. panelClassName: "edit-site-global-styles-sidebar__panel",
  7737. header: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexBlock, null, (0,external_wp_element_namespaceObject.createElement)("strong", null, (0,external_wp_i18n_namespaceObject.__)('Styles')), (0,external_wp_element_namespaceObject.createElement)("span", {
  7738. className: "edit-site-global-styles-sidebar__beta"
  7739. }, (0,external_wp_i18n_namespaceObject.__)('Beta'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
  7740. icon: more_vertical,
  7741. label: (0,external_wp_i18n_namespaceObject.__)('More Global Styles Actions'),
  7742. controls: [{
  7743. title: (0,external_wp_i18n_namespaceObject.__)('Reset to defaults'),
  7744. onClick: onReset,
  7745. isDisabled: !canReset
  7746. }, {
  7747. title: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide'),
  7748. onClick: () => toggle('core/edit-site', 'welcomeGuideStyles')
  7749. }]
  7750. })))
  7751. }, (0,external_wp_element_namespaceObject.createElement)(ui, null));
  7752. }
  7753. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js
  7754. /**
  7755. * WordPress dependencies
  7756. */
  7757. const ALLOWED_BLOCKS = {
  7758. 'core/navigation': ['core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu'],
  7759. 'core/social-links': ['core/social-link'],
  7760. 'core/navigation-submenu': ['core/navigation-link', 'core/navigation-submenu'],
  7761. 'core/navigation-link': ['core/navigation-link', 'core/navigation-submenu']
  7762. };
  7763. function navigation_menu_NavigationMenu(_ref) {
  7764. let {
  7765. innerBlocks,
  7766. id
  7767. } = _ref;
  7768. const {
  7769. updateBlockListSettings
  7770. } = useDispatch(blockEditorStore); //TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList
  7771. //Think through a better way of doing this, possible with adding allowed blocks to block library metadata
  7772. useEffect(() => {
  7773. updateBlockListSettings('', {
  7774. allowedBlocks: ALLOWED_BLOCKS['core/navigation']
  7775. });
  7776. innerBlocks.forEach(block => {
  7777. if (ALLOWED_BLOCKS[block.name]) {
  7778. updateBlockListSettings(block.clientId, {
  7779. allowedBlocks: ALLOWED_BLOCKS[block.name]
  7780. });
  7781. }
  7782. });
  7783. }, [updateBlockListSettings, innerBlocks]);
  7784. return createElement(Fragment, null, createElement(ListView, {
  7785. id: id,
  7786. showNestedBlocks: true,
  7787. expandNested: false,
  7788. __experimentalFeatures: true,
  7789. __experimentalPersistentListViewFeatures: true
  7790. }));
  7791. }
  7792. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/navigation-menu-sidebar/navigation-inspector.js
  7793. /**
  7794. * WordPress dependencies
  7795. */
  7796. /**
  7797. * Internal dependencies
  7798. */
  7799. const NAVIGATION_MENUS_QUERY = [{
  7800. per_page: -1,
  7801. status: 'publish'
  7802. }];
  7803. function navigation_inspector_NavigationInspector() {
  7804. var _navigationMenus$;
  7805. const {
  7806. selectedNavigationBlockId,
  7807. clientIdToRef,
  7808. navigationMenus,
  7809. isResolvingNavigationMenus,
  7810. hasResolvedNavigationMenus,
  7811. firstNavigationBlockId
  7812. } = useSelect(select => {
  7813. const {
  7814. __experimentalGetActiveBlockIdByBlockNames,
  7815. __experimentalGetGlobalBlocksByName,
  7816. getBlock
  7817. } = select(blockEditorStore);
  7818. const {
  7819. getEntityRecords,
  7820. hasFinishedResolution,
  7821. isResolving
  7822. } = select(coreStore);
  7823. const navigationMenusQuery = ['postType', 'wp_navigation', NAVIGATION_MENUS_QUERY[0]]; // Get the active Navigation block (if present).
  7824. const selectedNavId = __experimentalGetActiveBlockIdByBlockNames('core/navigation'); // Get all Navigation blocks currently within the editor canvas.
  7825. const navBlockIds = __experimentalGetGlobalBlocksByName('core/navigation');
  7826. const idToRef = {};
  7827. navBlockIds.forEach(id => {
  7828. var _getBlock, _getBlock$attributes;
  7829. idToRef[id] = (_getBlock = getBlock(id)) === null || _getBlock === void 0 ? void 0 : (_getBlock$attributes = _getBlock.attributes) === null || _getBlock$attributes === void 0 ? void 0 : _getBlock$attributes.ref;
  7830. });
  7831. return {
  7832. selectedNavigationBlockId: selectedNavId,
  7833. firstNavigationBlockId: navBlockIds === null || navBlockIds === void 0 ? void 0 : navBlockIds[0],
  7834. clientIdToRef: idToRef,
  7835. navigationMenus: getEntityRecords(...navigationMenusQuery),
  7836. isResolvingNavigationMenus: isResolving('getEntityRecords', navigationMenusQuery),
  7837. hasResolvedNavigationMenus: hasFinishedResolution('getEntityRecords', navigationMenusQuery)
  7838. };
  7839. }, []);
  7840. const navMenuListId = useInstanceId(NavigationMenu, 'edit-site-navigation-inspector-menu');
  7841. const firstNavRefInTemplate = clientIdToRef[firstNavigationBlockId];
  7842. const firstNavigationMenuRef = navigationMenus === null || navigationMenus === void 0 ? void 0 : (_navigationMenus$ = navigationMenus[0]) === null || _navigationMenus$ === void 0 ? void 0 : _navigationMenus$.id; // Default Navigation Menu is either:
  7843. // - the Navigation Menu referenced by the first Nav block within the template.
  7844. // - the first of the available Navigation Menus (`wp_navigation`) posts.
  7845. const defaultNavigationMenuId = firstNavRefInTemplate || firstNavigationMenuRef; // The Navigation Menu manually selected by the user within the Nav inspector.
  7846. const [currentMenuId, setCurrentMenuId] = useState(firstNavRefInTemplate); // If a Nav block is selected within the canvas then set the
  7847. // Navigation Menu referenced by it's `ref` attribute to be
  7848. // active within the Navigation sidebar.
  7849. useEffect(() => {
  7850. if (selectedNavigationBlockId) {
  7851. setCurrentMenuId(clientIdToRef[selectedNavigationBlockId]);
  7852. }
  7853. }, [selectedNavigationBlockId]);
  7854. let options = [];
  7855. if (navigationMenus) {
  7856. options = navigationMenus.map(_ref => {
  7857. let {
  7858. id,
  7859. title
  7860. } = _ref;
  7861. return {
  7862. value: id,
  7863. label: title.rendered
  7864. };
  7865. });
  7866. }
  7867. const [innerBlocks, onInput, onChange] = useEntityBlockEditor('postType', 'wp_navigation', {
  7868. id: currentMenuId || defaultNavigationMenuId
  7869. });
  7870. const {
  7871. isLoadingInnerBlocks,
  7872. hasLoadedInnerBlocks
  7873. } = useSelect(select => {
  7874. const {
  7875. isResolving,
  7876. hasFinishedResolution
  7877. } = select(coreStore);
  7878. return {
  7879. isLoadingInnerBlocks: isResolving('getEntityRecord', ['postType', 'wp_navigation', currentMenuId || defaultNavigationMenuId]),
  7880. hasLoadedInnerBlocks: hasFinishedResolution('getEntityRecord', ['postType', 'wp_navigation', currentMenuId || defaultNavigationMenuId])
  7881. };
  7882. }, [currentMenuId, defaultNavigationMenuId]);
  7883. const isLoading = !(hasResolvedNavigationMenus && hasLoadedInnerBlocks);
  7884. const hasMoreThanOneNavigationMenu = (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 1;
  7885. const hasNavigationMenus = !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length); // Entity block editor will return entities that are not currently published.
  7886. // Guard by only allowing their usage if there are published Nav Menus.
  7887. const publishedInnerBlocks = hasNavigationMenus ? innerBlocks : [];
  7888. const hasInnerBlocks = !!(publishedInnerBlocks !== null && publishedInnerBlocks !== void 0 && publishedInnerBlocks.length);
  7889. useEffect(() => {
  7890. if (isResolvingNavigationMenus) {
  7891. speak('Loading Navigation sidebar menus.');
  7892. }
  7893. if (hasResolvedNavigationMenus) {
  7894. speak('Navigation sidebar menus have loaded.');
  7895. }
  7896. }, [isResolvingNavigationMenus, hasResolvedNavigationMenus]);
  7897. useEffect(() => {
  7898. if (isLoadingInnerBlocks) {
  7899. speak('Loading Navigation sidebar selected menu items.');
  7900. }
  7901. if (hasLoadedInnerBlocks) {
  7902. speak('Navigation sidebar selected menu items have loaded.');
  7903. }
  7904. }, [isLoadingInnerBlocks, hasLoadedInnerBlocks]);
  7905. return createElement("div", {
  7906. className: "edit-site-navigation-inspector"
  7907. }, hasResolvedNavigationMenus && !hasNavigationMenus && createElement("p", {
  7908. className: "edit-site-navigation-inspector__empty-msg"
  7909. }, __('There are no Navigation Menus.')), !hasResolvedNavigationMenus && createElement("div", {
  7910. className: "edit-site-navigation-inspector__placeholder"
  7911. }), hasResolvedNavigationMenus && hasMoreThanOneNavigationMenu && createElement(SelectControl, {
  7912. "aria-controls": // aria-controls should only apply when referenced element is in DOM
  7913. hasLoadedInnerBlocks ? navMenuListId : undefined,
  7914. value: currentMenuId || defaultNavigationMenuId,
  7915. options: options,
  7916. onChange: newMenuId => setCurrentMenuId(Number(newMenuId))
  7917. }), isLoading && createElement(Fragment, null, createElement("div", {
  7918. className: "edit-site-navigation-inspector__placeholder is-child"
  7919. }), createElement("div", {
  7920. className: "edit-site-navigation-inspector__placeholder is-child"
  7921. }), createElement("div", {
  7922. className: "edit-site-navigation-inspector__placeholder is-child"
  7923. })), hasInnerBlocks && !isLoading && createElement(BlockEditorProvider, {
  7924. value: publishedInnerBlocks,
  7925. onChange: onChange,
  7926. onInput: onInput
  7927. }, createElement(NavigationMenu, {
  7928. id: navMenuListId,
  7929. innerBlocks: publishedInnerBlocks
  7930. })), !hasInnerBlocks && !isLoading && createElement("p", {
  7931. className: "edit-site-navigation-inspector__empty-msg"
  7932. }, __('Navigation Menu is empty.')));
  7933. }
  7934. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/navigation-menu-sidebar/index.js
  7935. /**
  7936. * WordPress dependencies
  7937. */
  7938. /**
  7939. * Internal dependencies
  7940. */
  7941. function NavigationMenuSidebar() {
  7942. return createElement(DefaultSidebar, {
  7943. className: "edit-site-navigation-menu-sidebar",
  7944. identifier: "edit-site/navigation-menu",
  7945. title: __('Navigation Menus'),
  7946. icon: navigation,
  7947. closeLabel: __('Close navigation menu sidebar'),
  7948. panelClassName: "edit-site-navigation-menu-sidebar__panel",
  7949. header: createElement(Flex, null, createElement(FlexBlock, null, createElement("strong", null, __('Navigation Menus'))))
  7950. }, createElement(NavigationInspector, null));
  7951. }
  7952. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/constants.js
  7953. const SIDEBAR_TEMPLATE = 'edit-site/template';
  7954. const SIDEBAR_BLOCK = 'edit-site/block-inspector';
  7955. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/settings-header/index.js
  7956. /**
  7957. * WordPress dependencies
  7958. */
  7959. /**
  7960. * Internal dependencies
  7961. */
  7962. const SettingsHeader = _ref => {
  7963. let {
  7964. sidebarName
  7965. } = _ref;
  7966. const {
  7967. enableComplementaryArea
  7968. } = (0,external_wp_data_namespaceObject.useDispatch)(store);
  7969. const openTemplateSettings = () => enableComplementaryArea(STORE_NAME, SIDEBAR_TEMPLATE);
  7970. const openBlockSettings = () => enableComplementaryArea(STORE_NAME, SIDEBAR_BLOCK);
  7971. const [templateAriaLabel, templateActiveClass] = sidebarName === SIDEBAR_TEMPLATE ? // translators: ARIA label for the Template sidebar tab, selected.
  7972. [(0,external_wp_i18n_namespaceObject.__)('Template (selected)'), 'is-active'] : // translators: ARIA label for the Template Settings Sidebar tab, not selected.
  7973. [(0,external_wp_i18n_namespaceObject.__)('Template'), ''];
  7974. const [blockAriaLabel, blockActiveClass] = sidebarName === SIDEBAR_BLOCK ? // translators: ARIA label for the Block Settings Sidebar tab, selected.
  7975. [(0,external_wp_i18n_namespaceObject.__)('Block (selected)'), 'is-active'] : // translators: ARIA label for the Block Settings Sidebar tab, not selected.
  7976. [(0,external_wp_i18n_namespaceObject.__)('Block'), ''];
  7977. /* Use a list so screen readers will announce how many tabs there are. */
  7978. return (0,external_wp_element_namespaceObject.createElement)("ul", null, (0,external_wp_element_namespaceObject.createElement)("li", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  7979. onClick: openTemplateSettings,
  7980. className: `edit-site-sidebar__panel-tab ${templateActiveClass}`,
  7981. "aria-label": templateAriaLabel // translators: Data label for the Template Settings Sidebar tab.
  7982. ,
  7983. "data-label": (0,external_wp_i18n_namespaceObject.__)('Template')
  7984. }, // translators: Text label for the Template Settings Sidebar tab.
  7985. (0,external_wp_i18n_namespaceObject.__)('Template'))), (0,external_wp_element_namespaceObject.createElement)("li", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  7986. onClick: openBlockSettings,
  7987. className: `edit-site-sidebar__panel-tab ${blockActiveClass}`,
  7988. "aria-label": blockAriaLabel // translators: Data label for the Block Settings Sidebar tab.
  7989. ,
  7990. "data-label": (0,external_wp_i18n_namespaceObject.__)('Block')
  7991. }, // translators: Text label for the Block Settings Sidebar tab.
  7992. (0,external_wp_i18n_namespaceObject.__)('Block'))));
  7993. };
  7994. /* harmony default export */ var settings_header = (SettingsHeader);
  7995. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/template-card/template-areas.js
  7996. /**
  7997. * WordPress dependencies
  7998. */
  7999. /**
  8000. * Internal dependencies
  8001. */
  8002. function TemplateAreaItem(_ref) {
  8003. let {
  8004. area,
  8005. clientId
  8006. } = _ref;
  8007. const {
  8008. selectBlock,
  8009. toggleBlockHighlight
  8010. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  8011. const templatePartArea = (0,external_wp_data_namespaceObject.useSelect)(select => {
  8012. const defaultAreas = select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas();
  8013. return defaultAreas.find(defaultArea => defaultArea.area === area);
  8014. }, [area]);
  8015. const highlightBlock = () => toggleBlockHighlight(clientId, true);
  8016. const cancelHighlightBlock = () => toggleBlockHighlight(clientId, false);
  8017. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  8018. className: "edit-site-template-card__template-areas-item",
  8019. icon: templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea.icon,
  8020. onMouseOver: highlightBlock,
  8021. onMouseLeave: cancelHighlightBlock,
  8022. onFocus: highlightBlock,
  8023. onBlur: cancelHighlightBlock,
  8024. onClick: () => {
  8025. selectBlock(clientId);
  8026. }
  8027. }, templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea.label);
  8028. }
  8029. function template_areas_TemplateAreas() {
  8030. const templateParts = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentTemplateTemplateParts(), []);
  8031. if (!templateParts.length) {
  8032. return null;
  8033. }
  8034. return (0,external_wp_element_namespaceObject.createElement)("section", {
  8035. className: "edit-site-template-card__template-areas"
  8036. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
  8037. level: 3,
  8038. className: "edit-site-template-card__template-areas-title"
  8039. }, (0,external_wp_i18n_namespaceObject.__)('Areas')), (0,external_wp_element_namespaceObject.createElement)("ul", {
  8040. className: "edit-site-template-card__template-areas-list"
  8041. }, templateParts.map(_ref2 => {
  8042. let {
  8043. templatePart,
  8044. block
  8045. } = _ref2;
  8046. return (0,external_wp_element_namespaceObject.createElement)("li", {
  8047. key: templatePart.slug
  8048. }, (0,external_wp_element_namespaceObject.createElement)(TemplateAreaItem, {
  8049. area: templatePart.area,
  8050. clientId: block.clientId
  8051. }));
  8052. })));
  8053. }
  8054. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/template-card/index.js
  8055. /**
  8056. * WordPress dependencies
  8057. */
  8058. /**
  8059. * Internal dependencies
  8060. */
  8061. function TemplateCard() {
  8062. const {
  8063. title,
  8064. description,
  8065. icon
  8066. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  8067. const {
  8068. getEditedPostType,
  8069. getEditedPostId
  8070. } = select(store_store);
  8071. const {
  8072. getEntityRecord
  8073. } = select(external_wp_coreData_namespaceObject.store);
  8074. const {
  8075. __experimentalGetTemplateInfo: getTemplateInfo
  8076. } = select(external_wp_editor_namespaceObject.store);
  8077. const postType = getEditedPostType();
  8078. const postId = getEditedPostId();
  8079. const record = getEntityRecord('postType', postType, postId);
  8080. const info = record ? getTemplateInfo(record) : {};
  8081. return info;
  8082. }, []);
  8083. if (!title && !description) {
  8084. return null;
  8085. }
  8086. return (0,external_wp_element_namespaceObject.createElement)("div", {
  8087. className: "edit-site-template-card"
  8088. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
  8089. className: "edit-site-template-card__icon",
  8090. icon: icon
  8091. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  8092. className: "edit-site-template-card__content"
  8093. }, (0,external_wp_element_namespaceObject.createElement)("h2", {
  8094. className: "edit-site-template-card__title"
  8095. }, title), (0,external_wp_element_namespaceObject.createElement)("div", {
  8096. className: "edit-site-template-card__description"
  8097. }, description), (0,external_wp_element_namespaceObject.createElement)(template_areas_TemplateAreas, null)));
  8098. }
  8099. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js
  8100. /**
  8101. * WordPress dependencies
  8102. */
  8103. /**
  8104. * Internal dependencies
  8105. */
  8106. const {
  8107. Slot: InspectorSlot,
  8108. Fill: InspectorFill
  8109. } = (0,external_wp_components_namespaceObject.createSlotFill)('EditSiteSidebarInspector');
  8110. const SidebarInspectorFill = InspectorFill;
  8111. function SidebarComplementaryAreaFills() {
  8112. const {
  8113. sidebar,
  8114. isEditorSidebarOpened,
  8115. hasBlockSelection
  8116. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  8117. const _sidebar = select(store).getActiveComplementaryArea(STORE_NAME);
  8118. const _isEditorSidebarOpened = [SIDEBAR_BLOCK, SIDEBAR_TEMPLATE].includes(_sidebar);
  8119. return {
  8120. sidebar: _sidebar,
  8121. isEditorSidebarOpened: _isEditorSidebarOpened,
  8122. hasBlockSelection: !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart()
  8123. };
  8124. }, []);
  8125. const {
  8126. enableComplementaryArea
  8127. } = (0,external_wp_data_namespaceObject.useDispatch)(store);
  8128. (0,external_wp_element_namespaceObject.useEffect)(() => {
  8129. if (!isEditorSidebarOpened) return;
  8130. if (hasBlockSelection) {
  8131. enableComplementaryArea(STORE_NAME, SIDEBAR_BLOCK);
  8132. } else {
  8133. enableComplementaryArea(STORE_NAME, SIDEBAR_TEMPLATE);
  8134. }
  8135. }, [hasBlockSelection, isEditorSidebarOpened]);
  8136. let sidebarName = sidebar;
  8137. if (!isEditorSidebarOpened) {
  8138. sidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;
  8139. } // Conditionally include NavMenu sidebar in Plugin only.
  8140. // Optimise for dead code elimination.
  8141. // See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.
  8142. let MaybeNavigationMenuSidebar = external_wp_element_namespaceObject.Fragment;
  8143. if (false) {}
  8144. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(default_sidebar_DefaultSidebar, {
  8145. identifier: sidebarName,
  8146. title: (0,external_wp_i18n_namespaceObject.__)('Settings'),
  8147. icon: library_cog,
  8148. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close settings sidebar'),
  8149. header: (0,external_wp_element_namespaceObject.createElement)(settings_header, {
  8150. sidebarName: sidebarName
  8151. }),
  8152. headerClassName: "edit-site-sidebar__panel-tabs"
  8153. }, sidebarName === SIDEBAR_TEMPLATE && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(TemplateCard, null)), sidebarName === SIDEBAR_BLOCK && (0,external_wp_element_namespaceObject.createElement)(InspectorSlot, {
  8154. bubblesVirtually: true
  8155. })), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesSidebar, null), (0,external_wp_element_namespaceObject.createElement)(MaybeNavigationMenuSidebar, null));
  8156. }
  8157. ;// CONCATENATED MODULE: external ["wp","htmlEntities"]
  8158. var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
  8159. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/home.js
  8160. /**
  8161. * WordPress dependencies
  8162. */
  8163. const home = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8164. xmlns: "http://www.w3.org/2000/svg",
  8165. viewBox: "0 0 24 24"
  8166. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8167. d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"
  8168. }));
  8169. /* harmony default export */ var library_home = (home);
  8170. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
  8171. /**
  8172. * WordPress dependencies
  8173. */
  8174. const symbolFilled = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8175. xmlns: "http://www.w3.org/2000/svg",
  8176. viewBox: "0 0 24 24"
  8177. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8178. d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
  8179. }));
  8180. /* harmony default export */ var symbol_filled = (symbolFilled);
  8181. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/main-dashboard-button/index.js
  8182. /**
  8183. * WordPress dependencies
  8184. */
  8185. const slotName = '__experimentalMainDashboardButton';
  8186. const {
  8187. Fill,
  8188. Slot: MainDashboardButtonSlot
  8189. } = (0,external_wp_components_namespaceObject.createSlotFill)(slotName);
  8190. const MainDashboardButton = Fill;
  8191. const main_dashboard_button_Slot = _ref => {
  8192. let {
  8193. children
  8194. } = _ref;
  8195. const slot = (0,external_wp_components_namespaceObject.__experimentalUseSlot)(slotName);
  8196. const hasFills = Boolean(slot.fills && slot.fills.length);
  8197. if (!hasFills) {
  8198. return children;
  8199. }
  8200. return (0,external_wp_element_namespaceObject.createElement)(MainDashboardButtonSlot, {
  8201. bubblesVirtually: true
  8202. });
  8203. };
  8204. MainDashboardButton.Slot = main_dashboard_button_Slot;
  8205. /* harmony default export */ var main_dashboard_button = (MainDashboardButton);
  8206. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-sidebar/navigation-panel/index.js
  8207. /**
  8208. * External dependencies
  8209. */
  8210. /**
  8211. * WordPress dependencies
  8212. */
  8213. /**
  8214. * Internal dependencies
  8215. */
  8216. const SITE_EDITOR_KEY = 'site-editor';
  8217. function NavLink(_ref) {
  8218. let {
  8219. params,
  8220. replace,
  8221. ...props
  8222. } = _ref;
  8223. const linkProps = useLink(params, replace);
  8224. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigationItem, extends_extends({}, linkProps, props));
  8225. }
  8226. const NavigationPanel = _ref2 => {
  8227. let {
  8228. activeItem = SITE_EDITOR_KEY
  8229. } = _ref2;
  8230. const {
  8231. homeTemplate,
  8232. isNavigationOpen,
  8233. siteTitle
  8234. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  8235. const {
  8236. getEntityRecord
  8237. } = select(external_wp_coreData_namespaceObject.store);
  8238. const {
  8239. getSettings,
  8240. isNavigationOpened
  8241. } = select(store_store);
  8242. const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
  8243. return {
  8244. siteTitle: siteData.name,
  8245. homeTemplate: getSettings().__unstableHomeTemplate,
  8246. isNavigationOpen: isNavigationOpened()
  8247. };
  8248. }, []);
  8249. const {
  8250. setIsNavigationPanelOpened
  8251. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  8252. const closeOnEscape = event => {
  8253. if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
  8254. event.preventDefault();
  8255. setIsNavigationPanelOpened(false);
  8256. }
  8257. };
  8258. return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
  8259. (0,external_wp_element_namespaceObject.createElement)("div", {
  8260. className: classnames_default()(`edit-site-navigation-panel`, {
  8261. 'is-open': isNavigationOpen
  8262. }),
  8263. onKeyDown: closeOnEscape
  8264. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  8265. className: "edit-site-navigation-panel__inner"
  8266. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  8267. className: "edit-site-navigation-panel__site-title-container"
  8268. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  8269. className: "edit-site-navigation-panel__site-title"
  8270. }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle))), (0,external_wp_element_namespaceObject.createElement)("div", {
  8271. className: "edit-site-navigation-panel__scroll-container"
  8272. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigation, {
  8273. activeItem: activeItem
  8274. }, (0,external_wp_element_namespaceObject.createElement)(main_dashboard_button.Slot, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigationBackButton, {
  8275. backButtonLabel: (0,external_wp_i18n_namespaceObject.__)('Dashboard'),
  8276. className: "edit-site-navigation-panel__back-to-dashboard",
  8277. href: "index.php"
  8278. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigationMenu, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigationGroup, {
  8279. title: (0,external_wp_i18n_namespaceObject.__)('Editor')
  8280. }, (0,external_wp_element_namespaceObject.createElement)(NavLink, {
  8281. icon: library_home,
  8282. title: (0,external_wp_i18n_namespaceObject.__)('Site'),
  8283. item: SITE_EDITOR_KEY,
  8284. params: {
  8285. postId: homeTemplate === null || homeTemplate === void 0 ? void 0 : homeTemplate.postId,
  8286. postType: homeTemplate === null || homeTemplate === void 0 ? void 0 : homeTemplate.postType
  8287. }
  8288. }), (0,external_wp_element_namespaceObject.createElement)(NavLink, {
  8289. icon: library_layout,
  8290. title: (0,external_wp_i18n_namespaceObject.__)('Templates'),
  8291. item: "wp_template",
  8292. params: {
  8293. postId: undefined,
  8294. postType: 'wp_template'
  8295. }
  8296. }), (0,external_wp_element_namespaceObject.createElement)(NavLink, {
  8297. icon: symbol_filled,
  8298. title: (0,external_wp_i18n_namespaceObject.__)('Template Parts'),
  8299. item: "wp_template_part",
  8300. params: {
  8301. postId: undefined,
  8302. postType: 'wp_template_part'
  8303. }
  8304. })))))))
  8305. );
  8306. };
  8307. /* harmony default export */ var navigation_panel = (NavigationPanel);
  8308. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js
  8309. /**
  8310. * WordPress dependencies
  8311. */
  8312. const wordpress = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8313. xmlns: "http://www.w3.org/2000/svg",
  8314. viewBox: "-2 -2 24 24"
  8315. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8316. d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"
  8317. }));
  8318. /* harmony default export */ var library_wordpress = (wordpress);
  8319. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-sidebar/navigation-toggle/index.js
  8320. /**
  8321. * External dependencies
  8322. */
  8323. /**
  8324. * WordPress dependencies
  8325. */
  8326. /**
  8327. * Internal dependencies
  8328. */
  8329. function NavigationToggle(_ref) {
  8330. let {
  8331. icon
  8332. } = _ref;
  8333. const {
  8334. isNavigationOpen,
  8335. isRequestingSiteIcon,
  8336. siteIconUrl
  8337. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  8338. const {
  8339. getEntityRecord,
  8340. isResolving
  8341. } = select(external_wp_coreData_namespaceObject.store);
  8342. const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
  8343. return {
  8344. isNavigationOpen: select(store_store).isNavigationOpened(),
  8345. isRequestingSiteIcon: isResolving('core', 'getEntityRecord', ['root', '__unstableBase', undefined]),
  8346. siteIconUrl: siteData.site_icon_url
  8347. };
  8348. }, []);
  8349. const {
  8350. setIsNavigationPanelOpened
  8351. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  8352. const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
  8353. const navigationToggleRef = (0,external_wp_element_namespaceObject.useRef)();
  8354. (0,external_wp_element_namespaceObject.useEffect)(() => {
  8355. // TODO: Remove this effect when alternative solution is merged.
  8356. // See: https://github.com/WordPress/gutenberg/pull/37314
  8357. if (!isNavigationOpen) {
  8358. navigationToggleRef.current.focus();
  8359. }
  8360. }, [isNavigationOpen]);
  8361. const toggleNavigationPanel = () => setIsNavigationPanelOpened(!isNavigationOpen);
  8362. let buttonIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
  8363. size: "36px",
  8364. icon: library_wordpress
  8365. });
  8366. const effect = {
  8367. expand: {
  8368. scale: 1.25,
  8369. transition: {
  8370. type: 'tween',
  8371. duration: '0.3'
  8372. }
  8373. }
  8374. };
  8375. if (siteIconUrl) {
  8376. buttonIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.img, {
  8377. variants: !disableMotion && effect,
  8378. alt: (0,external_wp_i18n_namespaceObject.__)('Site Icon'),
  8379. className: "edit-site-navigation-toggle__site-icon",
  8380. src: siteIconUrl
  8381. });
  8382. } else if (isRequestingSiteIcon) {
  8383. buttonIcon = null;
  8384. } else if (icon) {
  8385. buttonIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
  8386. size: "36px",
  8387. icon: icon
  8388. });
  8389. }
  8390. const classes = classnames_default()({
  8391. 'edit-site-navigation-toggle__button': true,
  8392. 'has-icon': siteIconUrl
  8393. });
  8394. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
  8395. className: 'edit-site-navigation-toggle' + (isNavigationOpen ? ' is-open' : ''),
  8396. whileHover: "expand"
  8397. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  8398. className: classes,
  8399. label: (0,external_wp_i18n_namespaceObject.__)('Toggle navigation'),
  8400. ref: navigationToggleRef // isPressed will add unwanted styles.
  8401. ,
  8402. "aria-pressed": isNavigationOpen,
  8403. onClick: toggleNavigationPanel,
  8404. showTooltip: true
  8405. }, buttonIcon));
  8406. }
  8407. /* harmony default export */ var navigation_toggle = (NavigationToggle);
  8408. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-sidebar/index.js
  8409. /**
  8410. * WordPress dependencies
  8411. */
  8412. /**
  8413. * Internal dependencies
  8414. */
  8415. const {
  8416. Fill: NavigationPanelPreviewFill,
  8417. Slot: NavigationPanelPreviewSlot
  8418. } = (0,external_wp_components_namespaceObject.createSlotFill)('EditSiteNavigationPanelPreview');
  8419. const {
  8420. Fill: NavigationSidebarFill,
  8421. Slot: NavigationSidebarSlot
  8422. } = (0,external_wp_components_namespaceObject.createSlotFill)('EditSiteNavigationSidebar');
  8423. function NavigationSidebar(_ref) {
  8424. let {
  8425. isDefaultOpen = false,
  8426. activeTemplateType
  8427. } = _ref;
  8428. const isDesktopViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
  8429. const {
  8430. setIsNavigationPanelOpened
  8431. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  8432. (0,external_wp_element_namespaceObject.useEffect)(function autoOpenNavigationPanelOnViewportChange() {
  8433. setIsNavigationPanelOpened(isDefaultOpen && isDesktopViewport);
  8434. }, [isDefaultOpen, isDesktopViewport, setIsNavigationPanelOpened]);
  8435. return (0,external_wp_element_namespaceObject.createElement)(NavigationSidebarFill, null, (0,external_wp_element_namespaceObject.createElement)(navigation_toggle, null), (0,external_wp_element_namespaceObject.createElement)(navigation_panel, {
  8436. activeItem: activeTemplateType
  8437. }), (0,external_wp_element_namespaceObject.createElement)(NavigationPanelPreviewSlot, null));
  8438. }
  8439. NavigationSidebar.Slot = NavigationSidebarSlot;
  8440. /* harmony default export */ var navigation_sidebar = (NavigationSidebar);
  8441. ;// CONCATENATED MODULE: external ["wp","reusableBlocks"]
  8442. var external_wp_reusableBlocks_namespaceObject = window["wp"]["reusableBlocks"];
  8443. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-part-converter/convert-to-regular.js
  8444. /**
  8445. * WordPress dependencies
  8446. */
  8447. function ConvertToRegularBlocks(_ref) {
  8448. let {
  8449. clientId
  8450. } = _ref;
  8451. const {
  8452. getBlocks
  8453. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  8454. const {
  8455. replaceBlocks
  8456. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  8457. const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]);
  8458. if (!canRemove) {
  8459. return null;
  8460. }
  8461. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, null, _ref2 => {
  8462. let {
  8463. onClose
  8464. } = _ref2;
  8465. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  8466. onClick: () => {
  8467. replaceBlocks(clientId, getBlocks(clientId));
  8468. onClose();
  8469. }
  8470. }, (0,external_wp_i18n_namespaceObject.__)('Detach blocks from template part'));
  8471. });
  8472. }
  8473. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/create-template-part-modal/index.js
  8474. /**
  8475. * WordPress dependencies
  8476. */
  8477. /**
  8478. * Internal dependencies
  8479. */
  8480. function CreateTemplatePartModal(_ref) {
  8481. let {
  8482. closeModal,
  8483. onCreate
  8484. } = _ref;
  8485. const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)('');
  8486. const [area, setArea] = (0,external_wp_element_namespaceObject.useState)(TEMPLATE_PART_AREA_GENERAL);
  8487. const [isSubmitting, setIsSubmitting] = (0,external_wp_element_namespaceObject.useState)(false);
  8488. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CreateTemplatePartModal);
  8489. const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas(), []);
  8490. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  8491. title: (0,external_wp_i18n_namespaceObject.__)('Create a template part'),
  8492. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
  8493. onRequestClose: closeModal,
  8494. overlayClassName: "edit-site-create-template-part-modal"
  8495. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  8496. onSubmit: async event => {
  8497. event.preventDefault();
  8498. if (!title) {
  8499. return;
  8500. }
  8501. setIsSubmitting(true);
  8502. await onCreate({
  8503. title,
  8504. area
  8505. });
  8506. }
  8507. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  8508. label: (0,external_wp_i18n_namespaceObject.__)('Name'),
  8509. value: title,
  8510. onChange: setTitle,
  8511. required: true
  8512. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  8513. label: (0,external_wp_i18n_namespaceObject.__)('Area'),
  8514. id: `edit-site-create-template-part-modal__area-selection-${instanceId}`,
  8515. className: "edit-site-create-template-part-modal__area-base-control"
  8516. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalRadioGroup, {
  8517. label: (0,external_wp_i18n_namespaceObject.__)('Area'),
  8518. className: "edit-site-create-template-part-modal__area-radio-group",
  8519. id: `edit-site-create-template-part-modal__area-selection-${instanceId}`,
  8520. onChange: setArea,
  8521. checked: area
  8522. }, templatePartAreas.map(_ref2 => {
  8523. let {
  8524. icon,
  8525. label,
  8526. area: value,
  8527. description
  8528. } = _ref2;
  8529. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalRadio, {
  8530. key: label,
  8531. value: value,
  8532. className: "edit-site-create-template-part-modal__area-radio"
  8533. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
  8534. align: "start",
  8535. justify: "start"
  8536. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
  8537. icon: icon
  8538. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexBlock, {
  8539. className: "edit-site-create-template-part-modal__option-label"
  8540. }, label, (0,external_wp_element_namespaceObject.createElement)("div", null, description)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
  8541. className: "edit-site-create-template-part-modal__checkbox"
  8542. }, area === value && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
  8543. icon: library_check
  8544. }))));
  8545. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
  8546. className: "edit-site-create-template-part-modal__modal-actions",
  8547. justify: "flex-end"
  8548. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  8549. variant: "secondary",
  8550. onClick: () => {
  8551. closeModal();
  8552. }
  8553. }, (0,external_wp_i18n_namespaceObject.__)('Cancel'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  8554. variant: "primary",
  8555. type: "submit",
  8556. disabled: !title,
  8557. isBusy: isSubmitting
  8558. }, (0,external_wp_i18n_namespaceObject.__)('Create'))))));
  8559. }
  8560. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-part-converter/convert-to-template-part.js
  8561. /**
  8562. * External dependencies
  8563. */
  8564. /**
  8565. * WordPress dependencies
  8566. */
  8567. /**
  8568. * Internal dependencies
  8569. */
  8570. function ConvertToTemplatePart(_ref) {
  8571. let {
  8572. clientIds,
  8573. blocks
  8574. } = _ref;
  8575. const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  8576. const {
  8577. replaceBlocks
  8578. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  8579. const {
  8580. saveEntityRecord
  8581. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  8582. const {
  8583. createSuccessNotice
  8584. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  8585. const onConvert = async _ref2 => {
  8586. let {
  8587. title,
  8588. area
  8589. } = _ref2;
  8590. // Currently template parts only allow latin chars.
  8591. // Fallback slug will receive suffix by default.
  8592. const cleanSlug = (0,external_lodash_namespaceObject.kebabCase)(title).replace(/[^\w-]+/g, '') || 'wp-custom-part';
  8593. const templatePart = await saveEntityRecord('postType', 'wp_template_part', {
  8594. slug: cleanSlug,
  8595. title,
  8596. content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
  8597. area
  8598. });
  8599. replaceBlocks(clientIds, (0,external_wp_blocks_namespaceObject.createBlock)('core/template-part', {
  8600. slug: templatePart.slug,
  8601. theme: templatePart.theme
  8602. }));
  8603. createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template part created.'), {
  8604. type: 'snackbar'
  8605. }); // The modal and this component will be unmounted because of `replaceBlocks` above,
  8606. // so no need to call `closeModal` or `onClose`.
  8607. };
  8608. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, null, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  8609. onClick: () => {
  8610. setIsModalOpen(true);
  8611. }
  8612. }, (0,external_wp_i18n_namespaceObject.__)('Make template part'))), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(CreateTemplatePartModal, {
  8613. closeModal: () => {
  8614. setIsModalOpen(false);
  8615. },
  8616. onCreate: onConvert
  8617. }));
  8618. }
  8619. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-part-converter/index.js
  8620. /**
  8621. * WordPress dependencies
  8622. */
  8623. /**
  8624. * Internal dependencies
  8625. */
  8626. function TemplatePartConverter() {
  8627. var _blocks$;
  8628. const {
  8629. clientIds,
  8630. blocks
  8631. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  8632. const {
  8633. getSelectedBlockClientIds,
  8634. getBlocksByClientId
  8635. } = select(external_wp_blockEditor_namespaceObject.store);
  8636. const selectedBlockClientIds = getSelectedBlockClientIds();
  8637. return {
  8638. clientIds: selectedBlockClientIds,
  8639. blocks: getBlocksByClientId(selectedBlockClientIds)
  8640. };
  8641. }, []); // Allow converting a single template part to standard blocks.
  8642. if (blocks.length === 1 && ((_blocks$ = blocks[0]) === null || _blocks$ === void 0 ? void 0 : _blocks$.name) === 'core/template-part') {
  8643. return (0,external_wp_element_namespaceObject.createElement)(ConvertToRegularBlocks, {
  8644. clientId: clientIds[0]
  8645. });
  8646. }
  8647. return (0,external_wp_element_namespaceObject.createElement)(ConvertToTemplatePart, {
  8648. clientIds: clientIds,
  8649. blocks: blocks
  8650. });
  8651. }
  8652. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js
  8653. /**
  8654. * WordPress dependencies
  8655. */
  8656. const pencil = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8657. xmlns: "http://www.w3.org/2000/svg",
  8658. viewBox: "0 0 24 24"
  8659. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8660. d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"
  8661. }));
  8662. /* harmony default export */ var library_pencil = (pencil);
  8663. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
  8664. /**
  8665. * Internal dependencies
  8666. */
  8667. /* harmony default export */ var edit = (library_pencil);
  8668. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigate-to-link/index.js
  8669. /**
  8670. * WordPress dependencies
  8671. */
  8672. function NavigateToLink(_ref) {
  8673. let {
  8674. type,
  8675. id,
  8676. activePage,
  8677. onActivePageChange
  8678. } = _ref;
  8679. const post = (0,external_wp_data_namespaceObject.useSelect)(select => type && id && type !== 'URL' && select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', type, id), [type, id]);
  8680. const onClick = (0,external_wp_element_namespaceObject.useMemo)(() => {
  8681. if (!(post !== null && post !== void 0 && post.link)) return null;
  8682. const path = (0,external_wp_url_namespaceObject.getPathAndQueryString)(post.link);
  8683. if (path === (activePage === null || activePage === void 0 ? void 0 : activePage.path)) return null;
  8684. return () => onActivePageChange({
  8685. type,
  8686. slug: post.slug,
  8687. path,
  8688. context: {
  8689. postType: post.type,
  8690. postId: post.id
  8691. }
  8692. });
  8693. }, [post, activePage === null || activePage === void 0 ? void 0 : activePage.path, onActivePageChange]);
  8694. return onClick && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  8695. icon: edit,
  8696. label: (0,external_wp_i18n_namespaceObject.__)('Edit Page Template'),
  8697. onClick: onClick
  8698. });
  8699. }
  8700. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/block-inspector-button.js
  8701. /**
  8702. * WordPress dependencies
  8703. */
  8704. /**
  8705. * Internal dependencies
  8706. */
  8707. function BlockInspectorButton(_ref) {
  8708. let {
  8709. onClick = () => {}
  8710. } = _ref;
  8711. const {
  8712. shortcut,
  8713. isBlockInspectorOpen
  8714. } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
  8715. shortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getShortcutRepresentation('core/edit-site/toggle-block-settings-sidebar'),
  8716. isBlockInspectorOpen: select(store).getActiveComplementaryArea(store_store.name) === SIDEBAR_BLOCK
  8717. }), []);
  8718. const {
  8719. enableComplementaryArea,
  8720. disableComplementaryArea
  8721. } = (0,external_wp_data_namespaceObject.useDispatch)(store);
  8722. const label = isBlockInspectorOpen ? (0,external_wp_i18n_namespaceObject.__)('Hide more settings') : (0,external_wp_i18n_namespaceObject.__)('Show more settings');
  8723. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  8724. onClick: () => {
  8725. if (isBlockInspectorOpen) {
  8726. disableComplementaryArea(STORE_NAME);
  8727. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Block settings closed'));
  8728. } else {
  8729. enableComplementaryArea(STORE_NAME, SIDEBAR_BLOCK);
  8730. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Additional settings are now available in the Editor block settings sidebar'));
  8731. } // Close dropdown menu.
  8732. onClick();
  8733. },
  8734. shortcut: shortcut
  8735. }, label);
  8736. }
  8737. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/edit-template-part-menu-button/index.js
  8738. /**
  8739. * WordPress dependencies
  8740. */
  8741. /**
  8742. * Internal dependencies
  8743. */
  8744. function EditTemplatePartMenuButton() {
  8745. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, null, _ref => {
  8746. let {
  8747. selectedClientIds,
  8748. onClose
  8749. } = _ref;
  8750. return (0,external_wp_element_namespaceObject.createElement)(EditTemplatePartMenuItem, {
  8751. selectedClientId: selectedClientIds[0],
  8752. onClose: onClose
  8753. });
  8754. });
  8755. }
  8756. function EditTemplatePartMenuItem(_ref2) {
  8757. let {
  8758. selectedClientId,
  8759. onClose
  8760. } = _ref2;
  8761. const {
  8762. params
  8763. } = useLocation();
  8764. const selectedTemplatePart = (0,external_wp_data_namespaceObject.useSelect)(select => {
  8765. const block = select(external_wp_blockEditor_namespaceObject.store).getBlock(selectedClientId);
  8766. if (block && (0,external_wp_blocks_namespaceObject.isTemplatePart)(block)) {
  8767. const {
  8768. theme,
  8769. slug
  8770. } = block.attributes;
  8771. return select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', // Ideally this should be an official public API.
  8772. `${theme}//${slug}`);
  8773. }
  8774. }, [selectedClientId]);
  8775. const linkProps = useLink({
  8776. postId: selectedTemplatePart === null || selectedTemplatePart === void 0 ? void 0 : selectedTemplatePart.id,
  8777. postType: selectedTemplatePart === null || selectedTemplatePart === void 0 ? void 0 : selectedTemplatePart.type
  8778. }, {
  8779. fromTemplateId: params.postId
  8780. });
  8781. if (!selectedTemplatePart) {
  8782. return null;
  8783. }
  8784. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, extends_extends({}, linkProps, {
  8785. onClick: event => {
  8786. linkProps.onClick(event);
  8787. onClose();
  8788. }
  8789. }),
  8790. /* translators: %s: template part title */
  8791. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Edit %s'), selectedTemplatePart.slug));
  8792. }
  8793. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-left.js
  8794. /**
  8795. * WordPress dependencies
  8796. */
  8797. const arrowLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8798. xmlns: "http://www.w3.org/2000/svg",
  8799. viewBox: "0 0 24 24"
  8800. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8801. d: "M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"
  8802. }));
  8803. /* harmony default export */ var arrow_left = (arrowLeft);
  8804. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/back-button.js
  8805. /**
  8806. * WordPress dependencies
  8807. */
  8808. /**
  8809. * Internal dependencies
  8810. */
  8811. function BackButton() {
  8812. var _location$state;
  8813. const location = useLocation();
  8814. const history = useHistory();
  8815. const isTemplatePart = location.params.postType === 'wp_template_part';
  8816. const previousTemplateId = (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.fromTemplateId;
  8817. if (!isTemplatePart || !previousTemplateId) {
  8818. return null;
  8819. }
  8820. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  8821. className: "edit-site-visual-editor__back-button",
  8822. icon: arrow_left,
  8823. onClick: () => {
  8824. history.back();
  8825. }
  8826. }, (0,external_wp_i18n_namespaceObject.__)('Back'));
  8827. }
  8828. /* harmony default export */ var back_button = (BackButton);
  8829. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/resize-handle.js
  8830. /**
  8831. * WordPress dependencies
  8832. */
  8833. const DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels.
  8834. function ResizeHandle(_ref) {
  8835. let {
  8836. direction,
  8837. resizeWidthBy
  8838. } = _ref;
  8839. function handleKeyDown(event) {
  8840. const {
  8841. keyCode
  8842. } = event;
  8843. if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.LEFT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.RIGHT) {
  8844. resizeWidthBy(DELTA_DISTANCE);
  8845. } else if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.RIGHT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.LEFT) {
  8846. resizeWidthBy(-DELTA_DISTANCE);
  8847. }
  8848. }
  8849. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("button", {
  8850. className: `resizable-editor__drag-handle is-${direction}`,
  8851. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Drag to resize'),
  8852. "aria-describedby": `resizable-editor__resize-help-${direction}`,
  8853. onKeyDown: handleKeyDown
  8854. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
  8855. id: `resizable-editor__resize-help-${direction}`
  8856. }, (0,external_wp_i18n_namespaceObject.__)('Use left and right arrow keys to resize the canvas.')));
  8857. }
  8858. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/resizable-editor.js
  8859. /**
  8860. * WordPress dependencies
  8861. */
  8862. /**
  8863. * Internal dependencies
  8864. */
  8865. const DEFAULT_STYLES = {
  8866. width: '100%',
  8867. height: '100%'
  8868. }; // Removes the inline styles in the drag handles.
  8869. const HANDLE_STYLES_OVERRIDE = {
  8870. position: undefined,
  8871. userSelect: undefined,
  8872. cursor: undefined,
  8873. width: undefined,
  8874. height: undefined,
  8875. top: undefined,
  8876. right: undefined,
  8877. bottom: undefined,
  8878. left: undefined
  8879. };
  8880. function ResizableEditor(_ref) {
  8881. let {
  8882. enableResizing,
  8883. settings,
  8884. children,
  8885. ...props
  8886. } = _ref;
  8887. const deviceType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).__experimentalGetPreviewDeviceType(), []);
  8888. const deviceStyles = (0,external_wp_blockEditor_namespaceObject.__experimentalUseResizeCanvas)(deviceType);
  8889. const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)(DEFAULT_STYLES.width);
  8890. const [height, setHeight] = (0,external_wp_element_namespaceObject.useState)(DEFAULT_STYLES.height);
  8891. const iframeRef = (0,external_wp_element_namespaceObject.useRef)();
  8892. const mouseMoveTypingResetRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseMouseMoveTypingReset)();
  8893. const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([iframeRef, mouseMoveTypingResetRef]);
  8894. (0,external_wp_element_namespaceObject.useEffect)(function autoResizeIframeHeight() {
  8895. const iframe = iframeRef.current;
  8896. if (!iframe || !enableResizing) {
  8897. return;
  8898. }
  8899. let animationFrame = null;
  8900. function resizeHeight() {
  8901. if (!animationFrame) {
  8902. // Throttle the updates on animation frame.
  8903. animationFrame = iframe.contentWindow.requestAnimationFrame(() => {
  8904. setHeight(iframe.contentDocument.documentElement.scrollHeight);
  8905. animationFrame = null;
  8906. });
  8907. }
  8908. }
  8909. let resizeObserver;
  8910. function registerObserver() {
  8911. var _resizeObserver;
  8912. (_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.disconnect();
  8913. resizeObserver = new iframe.contentWindow.ResizeObserver(resizeHeight); // Observing the <html> rather than the <body> because the latter
  8914. // gets destroyed and remounted after initialization in <Iframe>.
  8915. resizeObserver.observe(iframe.contentDocument.documentElement);
  8916. resizeHeight();
  8917. } // This is only required in Firefox for some unknown reasons.
  8918. iframe.addEventListener('load', registerObserver); // This is required in Chrome and Safari.
  8919. registerObserver();
  8920. return () => {
  8921. var _iframe$contentWindow, _resizeObserver2;
  8922. (_iframe$contentWindow = iframe.contentWindow) === null || _iframe$contentWindow === void 0 ? void 0 : _iframe$contentWindow.cancelAnimationFrame(animationFrame);
  8923. (_resizeObserver2 = resizeObserver) === null || _resizeObserver2 === void 0 ? void 0 : _resizeObserver2.disconnect();
  8924. iframe.removeEventListener('load', registerObserver);
  8925. };
  8926. }, [enableResizing]);
  8927. const resizeWidthBy = (0,external_wp_element_namespaceObject.useCallback)(deltaPixels => {
  8928. if (iframeRef.current) {
  8929. setWidth(iframeRef.current.offsetWidth + deltaPixels);
  8930. }
  8931. }, []);
  8932. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  8933. size: {
  8934. width,
  8935. height
  8936. },
  8937. onResizeStop: (event, direction, element) => {
  8938. setWidth(element.style.width);
  8939. },
  8940. minWidth: 300,
  8941. maxWidth: "100%",
  8942. maxHeight: "100%",
  8943. enable: {
  8944. right: enableResizing,
  8945. left: enableResizing
  8946. },
  8947. showHandle: enableResizing // The editor is centered horizontally, resizing it only
  8948. // moves half the distance. Hence double the ratio to correctly
  8949. // align the cursor to the resizer handle.
  8950. ,
  8951. resizeRatio: 2,
  8952. handleComponent: {
  8953. left: (0,external_wp_element_namespaceObject.createElement)(ResizeHandle, {
  8954. direction: "left",
  8955. resizeWidthBy: resizeWidthBy
  8956. }),
  8957. right: (0,external_wp_element_namespaceObject.createElement)(ResizeHandle, {
  8958. direction: "right",
  8959. resizeWidthBy: resizeWidthBy
  8960. })
  8961. },
  8962. handleClasses: undefined,
  8963. handleStyles: {
  8964. left: HANDLE_STYLES_OVERRIDE,
  8965. right: HANDLE_STYLES_OVERRIDE
  8966. }
  8967. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableIframe, extends_extends({
  8968. style: enableResizing ? undefined : deviceStyles,
  8969. head: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, {
  8970. styles: settings.styles
  8971. }), (0,external_wp_element_namespaceObject.createElement)("style", null, // Forming a "block formatting context" to prevent margin collapsing.
  8972. // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
  8973. `.is-root-container { display: flow-root; }`), enableResizing && (0,external_wp_element_namespaceObject.createElement)("style", null, // Force the <html> and <body>'s heights to fit the content.
  8974. `html, body { height: -moz-fit-content !important; height: fit-content !important; min-height: 0 !important; }`, // Some themes will have `min-height: 100vh` for the root container,
  8975. // which isn't a requirement in auto resize mode.
  8976. `.is-root-container { min-height: 0 !important; }`)),
  8977. assets: settings.__unstableResolvedAssets,
  8978. ref: ref,
  8979. name: "editor-canvas",
  8980. className: "edit-site-visual-editor__editor-canvas"
  8981. }, props), settings.svgFilters, children));
  8982. }
  8983. /* harmony default export */ var resizable_editor = (ResizableEditor);
  8984. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/index.js
  8985. /**
  8986. * External dependencies
  8987. */
  8988. /**
  8989. * WordPress dependencies
  8990. */
  8991. /**
  8992. * Internal dependencies
  8993. */
  8994. const LAYOUT = {
  8995. type: 'default',
  8996. // At the root level of the site editor, no alignments should be allowed.
  8997. alignments: []
  8998. };
  8999. function BlockEditor(_ref) {
  9000. var _storedSettings$__exp, _storedSettings$__exp2;
  9001. let {
  9002. setIsInserterOpen
  9003. } = _ref;
  9004. const {
  9005. storedSettings,
  9006. templateType,
  9007. templateId,
  9008. page
  9009. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  9010. const {
  9011. getSettings,
  9012. getEditedPostType,
  9013. getEditedPostId,
  9014. getPage
  9015. } = select(store_store);
  9016. return {
  9017. storedSettings: getSettings(setIsInserterOpen),
  9018. templateType: getEditedPostType(),
  9019. templateId: getEditedPostId(),
  9020. page: getPage()
  9021. };
  9022. }, [setIsInserterOpen]);
  9023. const settingsBlockPatterns = (_storedSettings$__exp = storedSettings.__experimentalAdditionalBlockPatterns) !== null && _storedSettings$__exp !== void 0 ? _storedSettings$__exp : // WP 6.0
  9024. storedSettings.__experimentalBlockPatterns; // WP 5.9
  9025. const settingsBlockPatternCategories = (_storedSettings$__exp2 = storedSettings.__experimentalAdditionalBlockPatternCategories) !== null && _storedSettings$__exp2 !== void 0 ? _storedSettings$__exp2 : // WP 6.0
  9026. storedSettings.__experimentalBlockPatternCategories; // WP 5.9
  9027. const {
  9028. restBlockPatterns,
  9029. restBlockPatternCategories
  9030. } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
  9031. restBlockPatterns: select(external_wp_coreData_namespaceObject.store).getBlockPatterns(),
  9032. restBlockPatternCategories: select(external_wp_coreData_namespaceObject.store).getBlockPatternCategories()
  9033. }), []);
  9034. const blockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_lodash_namespaceObject.unionBy)(settingsBlockPatterns, restBlockPatterns, 'name'), [settingsBlockPatterns, restBlockPatterns]);
  9035. const blockPatternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_lodash_namespaceObject.unionBy)(settingsBlockPatternCategories, restBlockPatternCategories, 'name'), [settingsBlockPatternCategories, restBlockPatternCategories]);
  9036. const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...(0,external_lodash_namespaceObject.omit)(storedSettings, ['__experimentalAdditionalBlockPatterns', '__experimentalAdditionalBlockPatternCategories']),
  9037. __experimentalBlockPatterns: blockPatterns,
  9038. __experimentalBlockPatternCategories: blockPatternCategories
  9039. }), [storedSettings, blockPatterns, blockPatternCategories]);
  9040. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', templateType);
  9041. const {
  9042. setPage
  9043. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  9044. const {
  9045. enableComplementaryArea
  9046. } = (0,external_wp_data_namespaceObject.useDispatch)(store);
  9047. const openNavigationSidebar = (0,external_wp_element_namespaceObject.useCallback)(() => {
  9048. enableComplementaryArea('core/edit-site', 'edit-site/navigation-menu');
  9049. }, [enableComplementaryArea]);
  9050. const contentRef = (0,external_wp_element_namespaceObject.useRef)();
  9051. const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([contentRef, (0,external_wp_blockEditor_namespaceObject.__unstableUseTypingObserver)()]);
  9052. const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<');
  9053. const {
  9054. clearSelectedBlock
  9055. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  9056. const isTemplatePart = templateType === 'wp_template_part';
  9057. const hasBlocks = blocks.length !== 0;
  9058. const NavMenuSidebarToggle = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  9059. className: "components-toolbar__control",
  9060. label: (0,external_wp_i18n_namespaceObject.__)('Open list view'),
  9061. onClick: openNavigationSidebar,
  9062. icon: list_view
  9063. })); // Conditionally include NavMenu sidebar in Plugin only.
  9064. // Optimise for dead code elimination.
  9065. // See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.
  9066. let MaybeNavMenuSidebarToggle = external_wp_element_namespaceObject.Fragment;
  9067. if (false) {}
  9068. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, {
  9069. settings: settings,
  9070. value: blocks,
  9071. onInput: onInput,
  9072. onChange: onChange,
  9073. useSubRegistry: false
  9074. }, (0,external_wp_element_namespaceObject.createElement)(EditTemplatePartMenuButton, null), (0,external_wp_element_namespaceObject.createElement)(TemplatePartConverter, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl.ViewerFill, null, (0,external_wp_element_namespaceObject.useCallback)(fillProps => (0,external_wp_element_namespaceObject.createElement)(NavigateToLink, extends_extends({}, fillProps, {
  9075. activePage: page,
  9076. onActivePageChange: setPage
  9077. })), [page])), (0,external_wp_element_namespaceObject.createElement)(SidebarInspectorFill, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockInspector, null)), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockTools, {
  9078. className: classnames_default()('edit-site-visual-editor', {
  9079. 'is-focus-mode': isTemplatePart
  9080. }),
  9081. __unstableContentRef: contentRef,
  9082. onClick: event => {
  9083. // Clear selected block when clicking on the gray background.
  9084. if (event.target === event.currentTarget) {
  9085. clearSelectedBlock();
  9086. }
  9087. }
  9088. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorKeyboardShortcuts.Register, null), (0,external_wp_element_namespaceObject.createElement)(back_button, null), (0,external_wp_element_namespaceObject.createElement)(resizable_editor // Reinitialize the editor and reset the states when the template changes.
  9089. , {
  9090. key: templateId,
  9091. enableResizing: isTemplatePart && // Disable resizing in mobile viewport.
  9092. !isMobileViewport,
  9093. settings: settings,
  9094. contentRef: mergedRefs
  9095. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockList, {
  9096. className: "edit-site-block-editor__block-list wp-site-blocks",
  9097. __experimentalLayout: LAYOUT,
  9098. renderAppender: isTemplatePart && hasBlocks ? false : undefined
  9099. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, null, _ref2 => {
  9100. let {
  9101. onClose
  9102. } = _ref2;
  9103. return (0,external_wp_element_namespaceObject.createElement)(BlockInspectorButton, {
  9104. onClick: onClose
  9105. });
  9106. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableBlockToolbarLastItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableBlockNameContext.Consumer, null, blockName => blockName === 'core/navigation' && (0,external_wp_element_namespaceObject.createElement)(MaybeNavMenuSidebarToggle, null)))), (0,external_wp_element_namespaceObject.createElement)(external_wp_reusableBlocks_namespaceObject.ReusableBlocksMenuItems, null));
  9107. }
  9108. // EXTERNAL MODULE: ./node_modules/react-autosize-textarea/lib/index.js
  9109. var lib = __webpack_require__(773);
  9110. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/code-editor/code-editor-text-area.js
  9111. /**
  9112. * External dependencies
  9113. */
  9114. /**
  9115. * WordPress dependencies
  9116. */
  9117. /**
  9118. * WordPress dependencies
  9119. */
  9120. /**
  9121. * WordPress dependencies
  9122. */
  9123. function CodeEditorTextArea(_ref) {
  9124. let {
  9125. value,
  9126. onChange,
  9127. onInput
  9128. } = _ref;
  9129. const [stateValue, setStateValue] = (0,external_wp_element_namespaceObject.useState)(value);
  9130. const [isDirty, setIsDirty] = (0,external_wp_element_namespaceObject.useState)(false);
  9131. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CodeEditorTextArea);
  9132. if (!isDirty && stateValue !== value) {
  9133. setStateValue(value);
  9134. }
  9135. /**
  9136. * Handles a textarea change event to notify the onChange prop callback and
  9137. * reflect the new value in the component's own state. This marks the start
  9138. * of the user's edits, if not already changed, preventing future props
  9139. * changes to value from replacing the rendered value. This is expected to
  9140. * be followed by a reset to dirty state via `stopEditing`.
  9141. *
  9142. * @see stopEditing
  9143. *
  9144. * @param {Event} event Change event.
  9145. */
  9146. const onChangeHandler = event => {
  9147. const newValue = event.target.value;
  9148. onInput(newValue);
  9149. setStateValue(newValue);
  9150. setIsDirty(true);
  9151. };
  9152. /**
  9153. * Function called when the user has completed their edits, responsible for
  9154. * ensuring that changes, if made, are surfaced to the onPersist prop
  9155. * callback and resetting dirty state.
  9156. */
  9157. const stopEditing = () => {
  9158. if (isDirty) {
  9159. onChange(stateValue);
  9160. setIsDirty(false);
  9161. }
  9162. };
  9163. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
  9164. as: "label",
  9165. htmlFor: `code-editor-text-area-${instanceId}`
  9166. }, (0,external_wp_i18n_namespaceObject.__)('Type text or HTML')), (0,external_wp_element_namespaceObject.createElement)(lib/* default */.Z, {
  9167. autoComplete: "off",
  9168. dir: "auto",
  9169. value: stateValue,
  9170. onChange: onChangeHandler,
  9171. onBlur: stopEditing,
  9172. className: "edit-site-code-editor-text-area",
  9173. id: `code-editor-text-area-${instanceId}`,
  9174. placeholder: (0,external_wp_i18n_namespaceObject.__)('Start writing with text or HTML')
  9175. }));
  9176. }
  9177. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/code-editor/index.js
  9178. /**
  9179. * WordPress dependencies
  9180. */
  9181. /**
  9182. * Internal dependencies
  9183. */
  9184. function CodeEditor() {
  9185. const {
  9186. templateType,
  9187. shortcut
  9188. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  9189. const {
  9190. getEditedPostType
  9191. } = select(store_store);
  9192. const {
  9193. getShortcutRepresentation
  9194. } = select(external_wp_keyboardShortcuts_namespaceObject.store);
  9195. return {
  9196. templateType: getEditedPostType(),
  9197. shortcut: getShortcutRepresentation('core/edit-site/toggle-mode')
  9198. };
  9199. }, []);
  9200. const [contentStructure, setContent] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', templateType, 'content');
  9201. const [blocks,, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', templateType);
  9202. const content = contentStructure instanceof Function ? contentStructure({
  9203. blocks
  9204. }) : contentStructure;
  9205. const {
  9206. switchEditorMode
  9207. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  9208. return (0,external_wp_element_namespaceObject.createElement)("div", {
  9209. className: "edit-site-code-editor"
  9210. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  9211. className: "edit-site-code-editor__toolbar"
  9212. }, (0,external_wp_element_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Editing code')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  9213. variant: "tertiary",
  9214. onClick: () => switchEditorMode('visual'),
  9215. shortcut: shortcut
  9216. }, (0,external_wp_i18n_namespaceObject.__)('Exit code editor'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  9217. className: "edit-site-code-editor__body"
  9218. }, (0,external_wp_element_namespaceObject.createElement)(CodeEditorTextArea, {
  9219. value: content,
  9220. onChange: newContent => {
  9221. onChange((0,external_wp_blocks_namespaceObject.parse)(newContent), {
  9222. selection: undefined
  9223. });
  9224. },
  9225. onInput: setContent
  9226. })));
  9227. }
  9228. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcuts/index.js
  9229. /**
  9230. * WordPress dependencies
  9231. */
  9232. /**
  9233. * Internal dependencies
  9234. */
  9235. function KeyboardShortcuts(_ref) {
  9236. let {
  9237. openEntitiesSavedStates
  9238. } = _ref;
  9239. const {
  9240. __experimentalGetDirtyEntityRecords,
  9241. isSavingEntityRecord
  9242. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store);
  9243. const {
  9244. getEditorMode
  9245. } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
  9246. const isListViewOpen = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).isListViewOpened(), []);
  9247. const isBlockInspectorOpen = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getActiveComplementaryArea(store_store.name) === SIDEBAR_BLOCK, []);
  9248. const {
  9249. redo,
  9250. undo
  9251. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  9252. const {
  9253. setIsListViewOpened,
  9254. switchEditorMode
  9255. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  9256. const {
  9257. enableComplementaryArea,
  9258. disableComplementaryArea
  9259. } = (0,external_wp_data_namespaceObject.useDispatch)(store);
  9260. (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-site/save', event => {
  9261. event.preventDefault();
  9262. const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
  9263. const isDirty = !!dirtyEntityRecords.length;
  9264. const isSaving = dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key));
  9265. if (!isSaving && isDirty) {
  9266. openEntitiesSavedStates();
  9267. }
  9268. });
  9269. (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-site/undo', event => {
  9270. undo();
  9271. event.preventDefault();
  9272. });
  9273. (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-site/redo', event => {
  9274. redo();
  9275. event.preventDefault();
  9276. });
  9277. (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-site/toggle-list-view', () => {
  9278. setIsListViewOpened(!isListViewOpen);
  9279. });
  9280. (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-site/toggle-block-settings-sidebar', event => {
  9281. // This shortcut has no known clashes, but use preventDefault to prevent any
  9282. // obscure shortcuts from triggering.
  9283. event.preventDefault();
  9284. if (isBlockInspectorOpen) {
  9285. disableComplementaryArea(STORE_NAME);
  9286. } else {
  9287. enableComplementaryArea(STORE_NAME, SIDEBAR_BLOCK);
  9288. }
  9289. });
  9290. (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-site/toggle-mode', () => {
  9291. switchEditorMode(getEditorMode() === 'visual' ? 'text' : 'visual');
  9292. });
  9293. return null;
  9294. }
  9295. function KeyboardShortcutsRegister() {
  9296. // Registering the shortcuts.
  9297. const {
  9298. registerShortcut
  9299. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
  9300. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9301. registerShortcut({
  9302. name: 'core/edit-site/save',
  9303. category: 'global',
  9304. description: (0,external_wp_i18n_namespaceObject.__)('Save your changes.'),
  9305. keyCombination: {
  9306. modifier: 'primary',
  9307. character: 's'
  9308. }
  9309. });
  9310. registerShortcut({
  9311. name: 'core/edit-site/undo',
  9312. category: 'global',
  9313. description: (0,external_wp_i18n_namespaceObject.__)('Undo your last changes.'),
  9314. keyCombination: {
  9315. modifier: 'primary',
  9316. character: 'z'
  9317. }
  9318. });
  9319. registerShortcut({
  9320. name: 'core/edit-site/redo',
  9321. category: 'global',
  9322. description: (0,external_wp_i18n_namespaceObject.__)('Redo your last undo.'),
  9323. keyCombination: {
  9324. modifier: 'primaryShift',
  9325. character: 'z'
  9326. }
  9327. });
  9328. registerShortcut({
  9329. name: 'core/edit-site/toggle-list-view',
  9330. category: 'global',
  9331. description: (0,external_wp_i18n_namespaceObject.__)('Open the block list view.'),
  9332. keyCombination: {
  9333. modifier: 'access',
  9334. character: 'o'
  9335. }
  9336. });
  9337. registerShortcut({
  9338. name: 'core/edit-site/toggle-block-settings-sidebar',
  9339. category: 'global',
  9340. description: (0,external_wp_i18n_namespaceObject.__)('Show or hide the block settings sidebar.'),
  9341. keyCombination: {
  9342. modifier: 'primaryShift',
  9343. character: ','
  9344. }
  9345. });
  9346. registerShortcut({
  9347. name: 'core/edit-site/keyboard-shortcuts',
  9348. category: 'main',
  9349. description: (0,external_wp_i18n_namespaceObject.__)('Display these keyboard shortcuts.'),
  9350. keyCombination: {
  9351. modifier: 'access',
  9352. character: 'h'
  9353. }
  9354. });
  9355. registerShortcut({
  9356. name: 'core/edit-site/next-region',
  9357. category: 'global',
  9358. description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the next part of the editor.'),
  9359. keyCombination: {
  9360. modifier: 'ctrl',
  9361. character: '`'
  9362. },
  9363. aliases: [{
  9364. modifier: 'access',
  9365. character: 'n'
  9366. }]
  9367. });
  9368. registerShortcut({
  9369. name: 'core/edit-site/previous-region',
  9370. category: 'global',
  9371. description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous part of the editor.'),
  9372. keyCombination: {
  9373. modifier: 'ctrlShift',
  9374. character: '`'
  9375. },
  9376. aliases: [{
  9377. modifier: 'access',
  9378. character: 'p'
  9379. }]
  9380. });
  9381. registerShortcut({
  9382. name: 'core/edit-site/toggle-mode',
  9383. category: 'global',
  9384. description: (0,external_wp_i18n_namespaceObject.__)('Switch between visual editor and code editor.'),
  9385. keyCombination: {
  9386. modifier: 'secondary',
  9387. character: 'm'
  9388. }
  9389. });
  9390. }, [registerShortcut]);
  9391. return null;
  9392. }
  9393. KeyboardShortcuts.Register = KeyboardShortcutsRegister;
  9394. /* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts);
  9395. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/url-query-controller/index.js
  9396. /**
  9397. * WordPress dependencies
  9398. */
  9399. /**
  9400. * Internal dependencies
  9401. */
  9402. function URLQueryController() {
  9403. const {
  9404. setTemplate,
  9405. setTemplatePart,
  9406. setPage
  9407. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  9408. const {
  9409. params: {
  9410. postId,
  9411. postType
  9412. }
  9413. } = useLocation(); // Set correct entity on page navigation.
  9414. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9415. if ('page' === postType || 'post' === postType) {
  9416. setPage({
  9417. context: {
  9418. postType,
  9419. postId
  9420. }
  9421. }); // Resolves correct template based on ID.
  9422. } else if ('wp_template' === postType) {
  9423. setTemplate(postId);
  9424. } else if ('wp_template_part' === postType) {
  9425. setTemplatePart(postId);
  9426. }
  9427. }, [postId, postType]);
  9428. return null;
  9429. }
  9430. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
  9431. /**
  9432. * WordPress dependencies
  9433. */
  9434. const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  9435. xmlns: "http://www.w3.org/2000/svg",
  9436. viewBox: "0 0 24 24"
  9437. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  9438. d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
  9439. }));
  9440. /* harmony default export */ var library_close = (close_close);
  9441. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/secondary-sidebar/inserter-sidebar.js
  9442. /**
  9443. * WordPress dependencies
  9444. */
  9445. /**
  9446. * Internal dependencies
  9447. */
  9448. function InserterSidebar() {
  9449. const {
  9450. setIsInserterOpened
  9451. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  9452. const insertionPoint = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).__experimentalGetInsertionPoint(), []);
  9453. const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
  9454. const TagName = !isMobile ? external_wp_components_namespaceObject.VisuallyHidden : 'div';
  9455. const [inserterDialogRef, inserterDialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({
  9456. onClose: () => setIsInserterOpened(false),
  9457. focusOnMount: null
  9458. });
  9459. const libraryRef = (0,external_wp_element_namespaceObject.useRef)();
  9460. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9461. libraryRef.current.focusSearch();
  9462. }, []);
  9463. return (0,external_wp_element_namespaceObject.createElement)("div", extends_extends({
  9464. ref: inserterDialogRef
  9465. }, inserterDialogProps, {
  9466. className: "edit-site-editor__inserter-panel"
  9467. }), (0,external_wp_element_namespaceObject.createElement)(TagName, {
  9468. className: "edit-site-editor__inserter-panel-header"
  9469. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  9470. icon: library_close,
  9471. label: (0,external_wp_i18n_namespaceObject.__)('Close block inserter'),
  9472. onClick: () => setIsInserterOpened(false)
  9473. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  9474. className: "edit-site-editor__inserter-panel-content"
  9475. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLibrary, {
  9476. showInserterHelpPanel: true,
  9477. shouldFocusBlock: isMobile,
  9478. rootClientId: insertionPoint.rootClientId,
  9479. __experimentalInsertionIndex: insertionPoint.insertionIndex,
  9480. __experimentalFilterValue: insertionPoint.filterValue,
  9481. ref: libraryRef
  9482. })));
  9483. }
  9484. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/secondary-sidebar/list-view-sidebar.js
  9485. /**
  9486. * WordPress dependencies
  9487. */
  9488. /**
  9489. * Internal dependencies
  9490. */
  9491. function ListViewSidebar() {
  9492. const {
  9493. setIsListViewOpened
  9494. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  9495. const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement');
  9496. const headerFocusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)();
  9497. const contentFocusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)();
  9498. function closeOnEscape(event) {
  9499. if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
  9500. setIsListViewOpened(false);
  9501. }
  9502. }
  9503. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewSidebar);
  9504. const labelId = `edit-site-editor__list-view-panel-label-${instanceId}`;
  9505. return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
  9506. (0,external_wp_element_namespaceObject.createElement)("div", {
  9507. "aria-labelledby": labelId,
  9508. className: "edit-site-editor__list-view-panel",
  9509. onKeyDown: closeOnEscape
  9510. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  9511. className: "edit-site-editor__list-view-panel-header",
  9512. ref: headerFocusReturnRef
  9513. }, (0,external_wp_element_namespaceObject.createElement)("strong", {
  9514. id: labelId
  9515. }, (0,external_wp_i18n_namespaceObject.__)('List View')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  9516. icon: close_small,
  9517. label: (0,external_wp_i18n_namespaceObject.__)('Close List View Sidebar'),
  9518. onClick: () => setIsListViewOpened(false)
  9519. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  9520. className: "edit-site-editor__list-view-panel-content",
  9521. ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([contentFocusReturnRef, focusOnMountRef])
  9522. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalListView, {
  9523. showNestedBlocks: true,
  9524. __experimentalFeatures: true,
  9525. __experimentalPersistentListViewFeatures: true
  9526. })))
  9527. );
  9528. }
  9529. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/error-boundary/warning.js
  9530. /**
  9531. * WordPress dependencies
  9532. */
  9533. function CopyButton(_ref) {
  9534. let {
  9535. text,
  9536. children
  9537. } = _ref;
  9538. const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text);
  9539. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  9540. variant: "secondary",
  9541. ref: ref
  9542. }, children);
  9543. }
  9544. function ErrorBoundaryWarning(_ref2) {
  9545. let {
  9546. message,
  9547. error,
  9548. reboot,
  9549. dashboardLink
  9550. } = _ref2;
  9551. const actions = [];
  9552. if (reboot) {
  9553. actions.push((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  9554. key: "recovery",
  9555. onClick: reboot,
  9556. variant: "secondary"
  9557. }, (0,external_wp_i18n_namespaceObject.__)('Attempt Recovery')));
  9558. }
  9559. if (error) {
  9560. actions.push((0,external_wp_element_namespaceObject.createElement)(CopyButton, {
  9561. key: "copy-error",
  9562. text: error.stack
  9563. }, (0,external_wp_i18n_namespaceObject.__)('Copy Error')));
  9564. }
  9565. if (dashboardLink) {
  9566. actions.push((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  9567. key: "back-to-dashboard",
  9568. variant: "secondary",
  9569. href: dashboardLink
  9570. }, (0,external_wp_i18n_namespaceObject.__)('Back to dashboard')));
  9571. }
  9572. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
  9573. className: "editor-error-boundary",
  9574. actions: actions
  9575. }, message);
  9576. }
  9577. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/error-boundary/index.js
  9578. /**
  9579. * WordPress dependencies
  9580. */
  9581. /**
  9582. * Internal dependencies
  9583. */
  9584. class ErrorBoundary extends external_wp_element_namespaceObject.Component {
  9585. constructor() {
  9586. super(...arguments);
  9587. this.reboot = this.reboot.bind(this);
  9588. this.state = {
  9589. error: null
  9590. };
  9591. }
  9592. static getDerivedStateFromError(error) {
  9593. return {
  9594. error
  9595. };
  9596. }
  9597. reboot() {
  9598. this.props.onError();
  9599. }
  9600. render() {
  9601. const {
  9602. error
  9603. } = this.state;
  9604. if (!error) {
  9605. return this.props.children;
  9606. }
  9607. return (0,external_wp_element_namespaceObject.createElement)(ErrorBoundaryWarning, {
  9608. message: (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.'),
  9609. error: error,
  9610. reboot: this.reboot
  9611. });
  9612. }
  9613. }
  9614. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/image.js
  9615. function WelcomeGuideImage(_ref) {
  9616. let {
  9617. nonAnimatedSrc,
  9618. animatedSrc
  9619. } = _ref;
  9620. return (0,external_wp_element_namespaceObject.createElement)("picture", {
  9621. className: "edit-site-welcome-guide__image"
  9622. }, (0,external_wp_element_namespaceObject.createElement)("source", {
  9623. srcSet: nonAnimatedSrc,
  9624. media: "(prefers-reduced-motion: reduce)"
  9625. }), (0,external_wp_element_namespaceObject.createElement)("img", {
  9626. src: animatedSrc,
  9627. width: "312",
  9628. height: "240",
  9629. alt: ""
  9630. }));
  9631. }
  9632. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/editor.js
  9633. /**
  9634. * WordPress dependencies
  9635. */
  9636. /**
  9637. * Internal dependencies
  9638. */
  9639. function WelcomeGuideEditor() {
  9640. const {
  9641. toggle
  9642. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
  9643. const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'welcomeGuide'), []);
  9644. if (!isActive) {
  9645. return null;
  9646. }
  9647. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Guide, {
  9648. className: "edit-site-welcome-guide",
  9649. contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the site editor'),
  9650. finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get Started'),
  9651. onFinish: () => toggle('core/edit-site', 'welcomeGuide'),
  9652. pages: [{
  9653. image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, {
  9654. nonAnimatedSrc: "https://s.w.org/images/block-editor/edit-your-site.svg?1",
  9655. animatedSrc: "https://s.w.org/images/block-editor/edit-your-site.gif?1"
  9656. }),
  9657. content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", {
  9658. className: "edit-site-welcome-guide__heading"
  9659. }, (0,external_wp_i18n_namespaceObject.__)('Edit your site')), (0,external_wp_element_namespaceObject.createElement)("p", {
  9660. className: "edit-site-welcome-guide__text"
  9661. }, (0,external_wp_i18n_namespaceObject.__)('Design everything on your site — from the header right down to the footer — using blocks.')), (0,external_wp_element_namespaceObject.createElement)("p", {
  9662. className: "edit-site-welcome-guide__text"
  9663. }, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors.'), {
  9664. StylesIconImage: (0,external_wp_element_namespaceObject.createElement)("img", {
  9665. alt: (0,external_wp_i18n_namespaceObject.__)('styles'),
  9666. src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"
  9667. })
  9668. })))
  9669. }]
  9670. });
  9671. }
  9672. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/styles.js
  9673. /**
  9674. * WordPress dependencies
  9675. */
  9676. /**
  9677. * Internal dependencies
  9678. */
  9679. function WelcomeGuideStyles() {
  9680. const {
  9681. toggle
  9682. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
  9683. const {
  9684. isActive,
  9685. isStylesOpen
  9686. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  9687. const sidebar = select(store).getActiveComplementaryArea(store_store.name);
  9688. return {
  9689. isActive: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'welcomeGuideStyles'),
  9690. isStylesOpen: sidebar === 'edit-site/global-styles'
  9691. };
  9692. }, []);
  9693. if (!isActive || !isStylesOpen) {
  9694. return null;
  9695. }
  9696. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Guide, {
  9697. className: "edit-site-welcome-guide",
  9698. contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to styles'),
  9699. finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get Started'),
  9700. onFinish: () => toggle('core/edit-site', 'welcomeGuideStyles'),
  9701. pages: [{
  9702. image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, {
  9703. nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-to-styles.svg?1",
  9704. animatedSrc: "https://s.w.org/images/block-editor/welcome-to-styles.gif?1"
  9705. }),
  9706. content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", {
  9707. className: "edit-site-welcome-guide__heading"
  9708. }, (0,external_wp_i18n_namespaceObject.__)('Welcome to Styles')), (0,external_wp_element_namespaceObject.createElement)("p", {
  9709. className: "edit-site-welcome-guide__text"
  9710. }, (0,external_wp_i18n_namespaceObject.__)('Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.')))
  9711. }, {
  9712. image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, {
  9713. nonAnimatedSrc: "https://s.w.org/images/block-editor/set-the-design.svg?1",
  9714. animatedSrc: "https://s.w.org/images/block-editor/set-the-design.gif?1"
  9715. }),
  9716. content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", {
  9717. className: "edit-site-welcome-guide__heading"
  9718. }, (0,external_wp_i18n_namespaceObject.__)('Set the design')), (0,external_wp_element_namespaceObject.createElement)("p", {
  9719. className: "edit-site-welcome-guide__text"
  9720. }, (0,external_wp_i18n_namespaceObject.__)('You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ')))
  9721. }, {
  9722. image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, {
  9723. nonAnimatedSrc: "https://s.w.org/images/block-editor/personalize-blocks.svg?1",
  9724. animatedSrc: "https://s.w.org/images/block-editor/personalize-blocks.gif?1"
  9725. }),
  9726. content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", {
  9727. className: "edit-site-welcome-guide__heading"
  9728. }, (0,external_wp_i18n_namespaceObject.__)('Personalize blocks')), (0,external_wp_element_namespaceObject.createElement)("p", {
  9729. className: "edit-site-welcome-guide__text"
  9730. }, (0,external_wp_i18n_namespaceObject.__)('You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.')))
  9731. }, {
  9732. image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, {
  9733. nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
  9734. animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
  9735. }),
  9736. content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", {
  9737. className: "edit-site-welcome-guide__heading"
  9738. }, (0,external_wp_i18n_namespaceObject.__)('Learn more')), (0,external_wp_element_namespaceObject.createElement)("p", {
  9739. className: "edit-site-welcome-guide__text"
  9740. }, (0,external_wp_i18n_namespaceObject.__)('New to block themes and styling your site? '), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  9741. href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/styles-overview/')
  9742. }, (0,external_wp_i18n_namespaceObject.__)('Here’s a detailed guide to learn how to make the most of it.'))))
  9743. }]
  9744. });
  9745. }
  9746. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/index.js
  9747. /**
  9748. * Internal dependencies
  9749. */
  9750. function WelcomeGuide() {
  9751. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideEditor, null), (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideStyles, null));
  9752. }
  9753. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/editor/global-styles-renderer.js
  9754. /**
  9755. * External dependencies
  9756. */
  9757. /**
  9758. * WordPress dependencies
  9759. */
  9760. /**
  9761. * Internal dependencies
  9762. */
  9763. /**
  9764. * Internal dependencies
  9765. */
  9766. function useGlobalStylesRenderer() {
  9767. const [styles, settings, svgFilters] = useGlobalStylesOutput();
  9768. const {
  9769. getSettings
  9770. } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
  9771. const {
  9772. updateSettings
  9773. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  9774. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9775. if (!styles || !settings) {
  9776. return;
  9777. }
  9778. const currentStoreSettings = getSettings();
  9779. const nonGlobalStyles = (0,external_lodash_namespaceObject.filter)(currentStoreSettings.styles, style => !style.isGlobalStyles);
  9780. updateSettings({ ...currentStoreSettings,
  9781. styles: [...nonGlobalStyles, ...styles],
  9782. svgFilters,
  9783. __experimentalFeatures: settings
  9784. });
  9785. }, [styles, settings]);
  9786. }
  9787. function GlobalStylesRenderer() {
  9788. useGlobalStylesRenderer();
  9789. return null;
  9790. }
  9791. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/routes/use-title.js
  9792. /**
  9793. * WordPress dependencies
  9794. */
  9795. /**
  9796. * Internal dependencies
  9797. */
  9798. function useTitle(title) {
  9799. const location = useLocation();
  9800. const siteTitle = (0,external_wp_data_namespaceObject.useSelect)(select => {
  9801. var _select$getEntityReco;
  9802. return (_select$getEntityReco = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site')) === null || _select$getEntityReco === void 0 ? void 0 : _select$getEntityReco.title;
  9803. }, []);
  9804. const isInitialLocationRef = (0,external_wp_element_namespaceObject.useRef)(true);
  9805. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9806. isInitialLocationRef.current = false;
  9807. }, [location]);
  9808. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9809. // Don't update or announce the title for initial page load.
  9810. if (isInitialLocationRef.current) {
  9811. return;
  9812. }
  9813. if (title && siteTitle) {
  9814. // @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68
  9815. const formattedTitle = (0,external_wp_i18n_namespaceObject.sprintf)(
  9816. /* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */
  9817. (0,external_wp_i18n_namespaceObject.__)('%1$s ‹ %2$s — WordPress'), title, siteTitle);
  9818. document.title = formattedTitle; // Announce title on route change for screen readers.
  9819. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)(
  9820. /* translators: The page title that is currently displaying. */
  9821. (0,external_wp_i18n_namespaceObject.__)('Now displaying: %s'), document.title), 'assertive');
  9822. }
  9823. }, [title, siteTitle, location]);
  9824. }
  9825. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/editor/index.js
  9826. /**
  9827. * WordPress dependencies
  9828. */
  9829. /**
  9830. * Internal dependencies
  9831. */
  9832. const interfaceLabels = {
  9833. drawer: (0,external_wp_i18n_namespaceObject.__)('Navigation Sidebar')
  9834. };
  9835. function Editor(_ref) {
  9836. let {
  9837. onError
  9838. } = _ref;
  9839. const {
  9840. isInserterOpen,
  9841. isListViewOpen,
  9842. sidebarIsOpened,
  9843. settings,
  9844. entityId,
  9845. templateType,
  9846. page,
  9847. template,
  9848. templateResolved,
  9849. isNavigationOpen,
  9850. previousShortcut,
  9851. nextShortcut,
  9852. editorMode,
  9853. showIconLabels
  9854. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  9855. const {
  9856. isInserterOpened,
  9857. isListViewOpened,
  9858. getSettings,
  9859. getEditedPostType,
  9860. getEditedPostId,
  9861. getPage,
  9862. isNavigationOpened,
  9863. getEditorMode
  9864. } = select(store_store);
  9865. const {
  9866. hasFinishedResolution,
  9867. getEntityRecord
  9868. } = select(external_wp_coreData_namespaceObject.store);
  9869. const postType = getEditedPostType();
  9870. const postId = getEditedPostId(); // The currently selected entity to display. Typically template or template part.
  9871. return {
  9872. isInserterOpen: isInserterOpened(),
  9873. isListViewOpen: isListViewOpened(),
  9874. sidebarIsOpened: !!select(store).getActiveComplementaryArea(store_store.name),
  9875. settings: getSettings(),
  9876. templateType: postType,
  9877. page: getPage(),
  9878. template: postId ? getEntityRecord('postType', postType, postId) : null,
  9879. templateResolved: postId ? hasFinishedResolution('getEntityRecord', ['postType', postType, postId]) : false,
  9880. entityId: postId,
  9881. isNavigationOpen: isNavigationOpened(),
  9882. previousShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-site/previous-region'),
  9883. nextShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-site/next-region'),
  9884. editorMode: getEditorMode(),
  9885. showIconLabels: select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'showIconLabels')
  9886. };
  9887. }, []);
  9888. const {
  9889. setPage,
  9890. setIsInserterOpened
  9891. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  9892. const {
  9893. enableComplementaryArea
  9894. } = (0,external_wp_data_namespaceObject.useDispatch)(store);
  9895. const [isEntitiesSavedStatesOpen, setIsEntitiesSavedStatesOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  9896. const openEntitiesSavedStates = (0,external_wp_element_namespaceObject.useCallback)(() => setIsEntitiesSavedStatesOpen(true), []);
  9897. const closeEntitiesSavedStates = (0,external_wp_element_namespaceObject.useCallback)(() => {
  9898. setIsEntitiesSavedStatesOpen(false);
  9899. }, []);
  9900. const blockContext = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...(page === null || page === void 0 ? void 0 : page.context),
  9901. queryContext: [(page === null || page === void 0 ? void 0 : page.context.queryContext) || {
  9902. page: 1
  9903. }, newQueryContext => setPage({ ...page,
  9904. context: { ...(page === null || page === void 0 ? void 0 : page.context),
  9905. queryContext: { ...(page === null || page === void 0 ? void 0 : page.context.queryContext),
  9906. ...newQueryContext
  9907. }
  9908. }
  9909. })]
  9910. }), [page === null || page === void 0 ? void 0 : page.context]);
  9911. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9912. if (isNavigationOpen) {
  9913. document.body.classList.add('is-navigation-sidebar-open');
  9914. } else {
  9915. document.body.classList.remove('is-navigation-sidebar-open');
  9916. }
  9917. }, [isNavigationOpen]);
  9918. (0,external_wp_element_namespaceObject.useEffect)(function openGlobalStylesOnLoad() {
  9919. const searchParams = new URLSearchParams(window.location.search);
  9920. if (searchParams.get('styles') === 'open') {
  9921. enableComplementaryArea('core/edit-site', 'edit-site/global-styles');
  9922. }
  9923. }, [enableComplementaryArea]); // Don't render the Editor until the settings are set and loaded.
  9924. const isReady = (settings === null || settings === void 0 ? void 0 : settings.siteUrl) && templateType !== undefined && entityId !== undefined;
  9925. const secondarySidebarLabel = isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('List View') : (0,external_wp_i18n_namespaceObject.__)('Block Library');
  9926. const secondarySidebar = () => {
  9927. if (editorMode === 'visual' && isInserterOpen) {
  9928. return (0,external_wp_element_namespaceObject.createElement)(InserterSidebar, null);
  9929. }
  9930. if (editorMode === 'visual' && isListViewOpen) {
  9931. return (0,external_wp_element_namespaceObject.createElement)(ListViewSidebar, null);
  9932. }
  9933. return null;
  9934. }; // Only announce the title once the editor is ready to prevent "Replace"
  9935. // action in <URlQueryController> from double-announcing.
  9936. useTitle(isReady && (0,external_wp_i18n_namespaceObject.__)('Editor (beta)'));
  9937. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(URLQueryController, null), isReady && (0,external_wp_element_namespaceObject.createElement)(external_wp_keyboardShortcuts_namespaceObject.ShortcutProvider, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_coreData_namespaceObject.EntityProvider, {
  9938. kind: "root",
  9939. type: "site"
  9940. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_coreData_namespaceObject.EntityProvider, {
  9941. kind: "postType",
  9942. type: templateType,
  9943. id: entityId
  9944. }, (0,external_wp_element_namespaceObject.createElement)(GlobalStylesProvider, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
  9945. value: blockContext
  9946. }, (0,external_wp_element_namespaceObject.createElement)(GlobalStylesRenderer, null), (0,external_wp_element_namespaceObject.createElement)(ErrorBoundary, {
  9947. onError: onError
  9948. }, (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts.Register, null), (0,external_wp_element_namespaceObject.createElement)(SidebarComplementaryAreaFills, null), (0,external_wp_element_namespaceObject.createElement)(interface_skeleton, {
  9949. labels: { ...interfaceLabels,
  9950. secondarySidebar: secondarySidebarLabel
  9951. },
  9952. className: showIconLabels && 'show-icon-labels',
  9953. secondarySidebar: secondarySidebar(),
  9954. sidebar: sidebarIsOpened && (0,external_wp_element_namespaceObject.createElement)(complementary_area.Slot, {
  9955. scope: "core/edit-site"
  9956. }),
  9957. drawer: (0,external_wp_element_namespaceObject.createElement)(navigation_sidebar.Slot, null),
  9958. header: (0,external_wp_element_namespaceObject.createElement)(Header, {
  9959. openEntitiesSavedStates: openEntitiesSavedStates,
  9960. showIconLabels: showIconLabels
  9961. }),
  9962. notices: (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorSnackbars, null),
  9963. content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorNotices, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockStyles.Slot, {
  9964. scope: "core/block-inspector"
  9965. }), editorMode === 'visual' && template && (0,external_wp_element_namespaceObject.createElement)(BlockEditor, {
  9966. setIsInserterOpen: setIsInserterOpened
  9967. }), editorMode === 'text' && template && (0,external_wp_element_namespaceObject.createElement)(CodeEditor, null), templateResolved && !template && (settings === null || settings === void 0 ? void 0 : settings.siteUrl) && entityId && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  9968. status: "warning",
  9969. isDismissible: false
  9970. }, (0,external_wp_i18n_namespaceObject.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")), (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts, {
  9971. openEntitiesSavedStates: openEntitiesSavedStates
  9972. })),
  9973. actions: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isEntitiesSavedStatesOpen ? (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EntitiesSavedStates, {
  9974. close: closeEntitiesSavedStates
  9975. }) : (0,external_wp_element_namespaceObject.createElement)("div", {
  9976. className: "edit-site-editor__toggle-save-panel"
  9977. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  9978. variant: "secondary",
  9979. className: "edit-site-editor__toggle-save-panel-button",
  9980. onClick: openEntitiesSavedStates,
  9981. "aria-expanded": false
  9982. }, (0,external_wp_i18n_namespaceObject.__)('Open save panel')))),
  9983. footer: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, {
  9984. rootLabelText: (0,external_wp_i18n_namespaceObject.__)('Template')
  9985. }),
  9986. shortcuts: {
  9987. previous: previousShortcut,
  9988. next: nextShortcut
  9989. }
  9990. }), (0,external_wp_element_namespaceObject.createElement)(WelcomeGuide, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, null))))))));
  9991. }
  9992. /* harmony default export */ var editor = (Editor);
  9993. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/use-register-shortcuts.js
  9994. /**
  9995. * WordPress dependencies
  9996. */
  9997. function useRegisterShortcuts() {
  9998. const {
  9999. registerShortcut
  10000. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
  10001. (0,external_wp_element_namespaceObject.useEffect)(() => {
  10002. registerShortcut({
  10003. name: 'core/edit-site/next-region',
  10004. category: 'global',
  10005. description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the next part of the editor.'),
  10006. keyCombination: {
  10007. modifier: 'ctrl',
  10008. character: '`'
  10009. },
  10010. aliases: [{
  10011. modifier: 'access',
  10012. character: 'n'
  10013. }]
  10014. });
  10015. registerShortcut({
  10016. name: 'core/edit-site/previous-region',
  10017. category: 'global',
  10018. description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous part of the editor.'),
  10019. keyCombination: {
  10020. modifier: 'ctrlShift',
  10021. character: '`'
  10022. },
  10023. aliases: [{
  10024. modifier: 'access',
  10025. character: 'p'
  10026. }]
  10027. });
  10028. }, []);
  10029. }
  10030. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post.js
  10031. /**
  10032. * WordPress dependencies
  10033. */
  10034. const post = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10035. xmlns: "http://www.w3.org/2000/svg",
  10036. viewBox: "0 0 24 24"
  10037. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10038. d: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"
  10039. }));
  10040. /* harmony default export */ var library_post = (post);
  10041. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js
  10042. /**
  10043. * WordPress dependencies
  10044. */
  10045. const page = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10046. xmlns: "http://www.w3.org/2000/svg",
  10047. viewBox: "0 0 24 24"
  10048. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10049. d: "M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"
  10050. }));
  10051. /* harmony default export */ var library_page = (page);
  10052. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js
  10053. /**
  10054. * WordPress dependencies
  10055. */
  10056. const archive = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10057. viewBox: "0 0 24 24",
  10058. xmlns: "http://www.w3.org/2000/svg"
  10059. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10060. d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"
  10061. }));
  10062. /* harmony default export */ var library_archive = (archive);
  10063. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js
  10064. /**
  10065. * WordPress dependencies
  10066. */
  10067. const search = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10068. xmlns: "http://www.w3.org/2000/svg",
  10069. viewBox: "0 0 24 24"
  10070. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10071. d: "M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"
  10072. }));
  10073. /* harmony default export */ var library_search = (search);
  10074. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/not-found.js
  10075. /**
  10076. * WordPress dependencies
  10077. */
  10078. const notFound = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10079. xmlns: "http://www.w3.org/2000/svg",
  10080. viewBox: "0 0 24 24"
  10081. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10082. d: "M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v10zm-11-7.6h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-.9 3.5H6.3l1.2-1.7v1.7zm5.6-3.2c-.4-.2-.8-.4-1.2-.4-.5 0-.9.1-1.2.4-.4.2-.6.6-.8 1-.2.4-.3.9-.3 1.5s.1 1.1.3 1.6c.2.4.5.8.8 1 .4.2.8.4 1.2.4.5 0 .9-.1 1.2-.4.4-.2.6-.6.8-1 .2-.4.3-1 .3-1.6 0-.6-.1-1.1-.3-1.5-.1-.5-.4-.8-.8-1zm0 3.6c-.1.3-.3.5-.5.7-.2.1-.4.2-.7.2-.3 0-.5-.1-.7-.2-.2-.1-.4-.4-.5-.7-.1-.3-.2-.7-.2-1.2 0-.7.1-1.2.4-1.5.3-.3.6-.5 1-.5s.7.2 1 .5c.3.3.4.8.4 1.5-.1.5-.1.9-.2 1.2zm5-3.9h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-1 3.5H16l1.2-1.7v1.7z"
  10083. }));
  10084. /* harmony default export */ var not_found = (notFound);
  10085. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list.js
  10086. /**
  10087. * WordPress dependencies
  10088. */
  10089. const list = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10090. viewBox: "0 0 24 24",
  10091. xmlns: "http://www.w3.org/2000/svg"
  10092. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10093. d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"
  10094. }));
  10095. /* harmony default export */ var library_list = (list);
  10096. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js
  10097. /**
  10098. * WordPress dependencies
  10099. */
  10100. const category = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10101. viewBox: "0 0 24 24",
  10102. xmlns: "http://www.w3.org/2000/svg"
  10103. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10104. d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",
  10105. fillRule: "evenodd",
  10106. clipRule: "evenodd"
  10107. }));
  10108. /* harmony default export */ var library_category = (category);
  10109. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-author.js
  10110. /**
  10111. * WordPress dependencies
  10112. */
  10113. const postAuthor = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10114. viewBox: "0 0 24 24",
  10115. xmlns: "http://www.w3.org/2000/svg"
  10116. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10117. d: "M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",
  10118. fillRule: "evenodd",
  10119. clipRule: "evenodd"
  10120. }));
  10121. /* harmony default export */ var post_author = (postAuthor);
  10122. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-meta.js
  10123. /**
  10124. * WordPress dependencies
  10125. */
  10126. const blockDefault = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10127. xmlns: "http://www.w3.org/2000/svg",
  10128. viewBox: "0 0 24 24"
  10129. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10130. "fill-rule": "evenodd",
  10131. d: "M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z",
  10132. "clip-rule": "evenodd"
  10133. }));
  10134. /* harmony default export */ var block_meta = (blockDefault);
  10135. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-date.js
  10136. /**
  10137. * WordPress dependencies
  10138. */
  10139. const postDate = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10140. xmlns: "http://www.w3.org/2000/svg",
  10141. viewBox: "0 0 24 24"
  10142. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10143. d: "M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"
  10144. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10145. d: "M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"
  10146. }));
  10147. /* harmony default export */ var post_date = (postDate);
  10148. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tag.js
  10149. /**
  10150. * WordPress dependencies
  10151. */
  10152. const tag = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10153. xmlns: "http://www.w3.org/2000/svg",
  10154. viewBox: "0 0 24 24"
  10155. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10156. d: "M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"
  10157. }));
  10158. /* harmony default export */ var library_tag = (tag);
  10159. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js
  10160. /**
  10161. * WordPress dependencies
  10162. */
  10163. const media = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10164. xmlns: "http://www.w3.org/2000/svg",
  10165. viewBox: "0 0 24 24"
  10166. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10167. d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"
  10168. }));
  10169. /* harmony default export */ var library_media = (media);
  10170. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/new-template.js
  10171. /**
  10172. * External dependencies
  10173. */
  10174. /**
  10175. * WordPress dependencies
  10176. */
  10177. /**
  10178. * Internal dependencies
  10179. */
  10180. const DEFAULT_TEMPLATE_SLUGS = ['front-page', 'single-post', 'page', 'index', 'archive', 'author', 'category', 'date', 'tag', 'taxonomy', 'search', '404'];
  10181. const TEMPLATE_ICONS = {
  10182. 'front-page': library_home,
  10183. 'single-post': library_post,
  10184. page: library_page,
  10185. archive: library_archive,
  10186. search: library_search,
  10187. 404: not_found,
  10188. index: library_list,
  10189. category: library_category,
  10190. author: post_author,
  10191. taxonomy: block_meta,
  10192. date: post_date,
  10193. tag: library_tag,
  10194. attachment: library_media
  10195. };
  10196. function NewTemplate(_ref) {
  10197. let {
  10198. postType
  10199. } = _ref;
  10200. const history = useHistory();
  10201. const {
  10202. templates,
  10203. defaultTemplateTypes
  10204. } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
  10205. templates: select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_template', {
  10206. per_page: -1
  10207. }),
  10208. defaultTemplateTypes: select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplateTypes()
  10209. }), []);
  10210. const {
  10211. saveEntityRecord
  10212. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  10213. const {
  10214. createErrorNotice
  10215. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  10216. const {
  10217. setTemplate
  10218. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  10219. async function createTemplate(_ref2) {
  10220. let {
  10221. slug
  10222. } = _ref2;
  10223. try {
  10224. const {
  10225. title,
  10226. description
  10227. } = (0,external_lodash_namespaceObject.find)(defaultTemplateTypes, {
  10228. slug
  10229. });
  10230. const template = await saveEntityRecord('postType', 'wp_template', {
  10231. excerpt: description,
  10232. // Slugs need to be strings, so this is for template `404`
  10233. slug: slug.toString(),
  10234. status: 'publish',
  10235. title
  10236. }, {
  10237. throwOnError: true
  10238. }); // Set template before navigating away to avoid initial stale value.
  10239. setTemplate(template.id, template.slug); // Navigate to the created template editor.
  10240. history.push({
  10241. postId: template.id,
  10242. postType: template.type
  10243. }); // TODO: Add a success notice?
  10244. } catch (error) {
  10245. const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the template.');
  10246. createErrorNotice(errorMessage, {
  10247. type: 'snackbar'
  10248. });
  10249. }
  10250. }
  10251. const existingTemplateSlugs = (0,external_lodash_namespaceObject.map)(templates, 'slug');
  10252. const missingTemplates = (0,external_lodash_namespaceObject.filter)(defaultTemplateTypes, template => (0,external_lodash_namespaceObject.includes)(DEFAULT_TEMPLATE_SLUGS, template.slug) && !(0,external_lodash_namespaceObject.includes)(existingTemplateSlugs, template.slug));
  10253. if (!missingTemplates.length) {
  10254. return null;
  10255. } // Update the sort order to match the DEFAULT_TEMPLATE_SLUGS order.
  10256. missingTemplates.sort((template1, template2) => {
  10257. return DEFAULT_TEMPLATE_SLUGS.indexOf(template1.slug) - DEFAULT_TEMPLATE_SLUGS.indexOf(template2.slug);
  10258. });
  10259. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
  10260. className: "edit-site-new-template-dropdown",
  10261. icon: null,
  10262. text: postType.labels.add_new,
  10263. label: postType.labels.add_new_item,
  10264. popoverProps: {
  10265. noArrow: false
  10266. },
  10267. toggleProps: {
  10268. variant: 'primary'
  10269. }
  10270. }, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, {
  10271. className: "edit-site-new-template-dropdown__popover"
  10272. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  10273. label: postType.labels.add_new_item
  10274. }, (0,external_lodash_namespaceObject.map)(missingTemplates, _ref3 => {
  10275. let {
  10276. title,
  10277. description,
  10278. slug
  10279. } = _ref3;
  10280. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  10281. icon: TEMPLATE_ICONS[slug],
  10282. iconPosition: "left",
  10283. info: description,
  10284. key: slug,
  10285. onClick: () => {
  10286. createTemplate({
  10287. slug
  10288. }); // We will be navigated way so no need to close the dropdown.
  10289. }
  10290. }, title);
  10291. }))));
  10292. }
  10293. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/new-template-part.js
  10294. /**
  10295. * External dependencies
  10296. */
  10297. /**
  10298. * WordPress dependencies
  10299. */
  10300. /**
  10301. * Internal dependencies
  10302. */
  10303. function NewTemplatePart(_ref) {
  10304. let {
  10305. postType
  10306. } = _ref;
  10307. const history = useHistory();
  10308. const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  10309. const {
  10310. createErrorNotice
  10311. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  10312. const {
  10313. saveEntityRecord
  10314. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  10315. async function createTemplatePart(_ref2) {
  10316. let {
  10317. title,
  10318. area
  10319. } = _ref2;
  10320. if (!title) {
  10321. createErrorNotice((0,external_wp_i18n_namespaceObject.__)('Title is not defined.'), {
  10322. type: 'snackbar'
  10323. });
  10324. return;
  10325. }
  10326. try {
  10327. // Currently template parts only allow latin chars.
  10328. // Fallback slug will receive suffix by default.
  10329. const cleanSlug = (0,external_lodash_namespaceObject.kebabCase)(title).replace(/[^\w-]+/g, '') || 'wp-custom-part';
  10330. const templatePart = await saveEntityRecord('postType', 'wp_template_part', {
  10331. slug: cleanSlug,
  10332. title,
  10333. content: '',
  10334. area
  10335. }, {
  10336. throwOnError: true
  10337. });
  10338. setIsModalOpen(false); // Navigate to the created template part editor.
  10339. history.push({
  10340. postId: templatePart.id,
  10341. postType: templatePart.type
  10342. }); // TODO: Add a success notice?
  10343. } catch (error) {
  10344. const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the template part.');
  10345. createErrorNotice(errorMessage, {
  10346. type: 'snackbar'
  10347. });
  10348. setIsModalOpen(false);
  10349. }
  10350. }
  10351. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10352. variant: "primary",
  10353. onClick: () => {
  10354. setIsModalOpen(true);
  10355. }
  10356. }, postType.labels.add_new), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(CreateTemplatePartModal, {
  10357. closeModal: () => setIsModalOpen(false),
  10358. onCreate: createTemplatePart
  10359. }));
  10360. }
  10361. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/index.js
  10362. /**
  10363. * WordPress dependencies
  10364. */
  10365. /**
  10366. * Internal dependencies
  10367. */
  10368. function AddNewTemplate(_ref) {
  10369. let {
  10370. templateType = 'wp_template'
  10371. } = _ref;
  10372. const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType(templateType), [templateType]);
  10373. if (!postType) {
  10374. return null;
  10375. }
  10376. if (templateType === 'wp_template') {
  10377. return (0,external_wp_element_namespaceObject.createElement)(NewTemplate, {
  10378. postType: postType
  10379. });
  10380. } else if (templateType === 'wp_template_part') {
  10381. return (0,external_wp_element_namespaceObject.createElement)(NewTemplatePart, {
  10382. postType: postType
  10383. });
  10384. }
  10385. return null;
  10386. }
  10387. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/header.js
  10388. /**
  10389. * WordPress dependencies
  10390. */
  10391. /**
  10392. * Internal dependencies
  10393. */
  10394. function header_Header(_ref) {
  10395. var _postType$labels;
  10396. let {
  10397. templateType
  10398. } = _ref;
  10399. const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType(templateType), [templateType]);
  10400. if (!postType) {
  10401. return null;
  10402. }
  10403. return (0,external_wp_element_namespaceObject.createElement)("header", {
  10404. className: "edit-site-list-header"
  10405. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
  10406. level: 1,
  10407. className: "edit-site-list-header__title"
  10408. }, (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.name), (0,external_wp_element_namespaceObject.createElement)("div", {
  10409. className: "edit-site-list-header__right"
  10410. }, (0,external_wp_element_namespaceObject.createElement)(AddNewTemplate, {
  10411. templateType: templateType
  10412. })));
  10413. }
  10414. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/is-template-removable.js
  10415. /**
  10416. * Check if a template is removable.
  10417. *
  10418. * @param {Object} template The template entity to check.
  10419. * @return {boolean} Whether the template is revertable.
  10420. */
  10421. function isTemplateRemovable(template) {
  10422. if (!template) {
  10423. return false;
  10424. }
  10425. return template.source === 'custom' && !template.has_theme_file;
  10426. }
  10427. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/actions/rename-menu-item.js
  10428. /**
  10429. * WordPress dependencies
  10430. */
  10431. function RenameMenuItem(_ref) {
  10432. let {
  10433. template,
  10434. onClose
  10435. } = _ref;
  10436. const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(() => template.title.rendered);
  10437. const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  10438. const {
  10439. editEntityRecord,
  10440. saveEditedEntityRecord
  10441. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  10442. const {
  10443. createSuccessNotice,
  10444. createErrorNotice
  10445. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  10446. if (!template.is_custom) {
  10447. return null;
  10448. }
  10449. async function onTemplateRename(event) {
  10450. event.preventDefault();
  10451. try {
  10452. await editEntityRecord('postType', template.type, template.id, {
  10453. title
  10454. }); // Update state before saving rerenders the list.
  10455. setTitle('');
  10456. setIsModalOpen(false);
  10457. onClose(); // Persist edited entity.
  10458. await saveEditedEntityRecord('postType', template.type, template.id, {
  10459. throwOnError: true
  10460. });
  10461. createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Entity renamed.'), {
  10462. type: 'snackbar'
  10463. });
  10464. } catch (error) {
  10465. const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while renaming the entity.');
  10466. createErrorNotice(errorMessage, {
  10467. type: 'snackbar'
  10468. });
  10469. }
  10470. }
  10471. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  10472. onClick: () => {
  10473. setIsModalOpen(true);
  10474. setTitle(template.title.rendered);
  10475. }
  10476. }, (0,external_wp_i18n_namespaceObject.__)('Rename')), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  10477. title: (0,external_wp_i18n_namespaceObject.__)('Rename'),
  10478. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
  10479. onRequestClose: () => {
  10480. setIsModalOpen(false);
  10481. },
  10482. overlayClassName: "edit-site-list__rename-modal"
  10483. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  10484. onSubmit: onTemplateRename
  10485. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
  10486. align: "flex-start",
  10487. gap: 8
  10488. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  10489. label: (0,external_wp_i18n_namespaceObject.__)('Name'),
  10490. value: title,
  10491. onChange: setTitle,
  10492. required: true
  10493. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
  10494. className: "edit-site-list__rename-modal-actions",
  10495. justify: "flex-end",
  10496. expanded: false
  10497. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10498. variant: "tertiary",
  10499. onClick: () => {
  10500. setIsModalOpen(false);
  10501. }
  10502. }, (0,external_wp_i18n_namespaceObject.__)('Cancel'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10503. variant: "primary",
  10504. type: "submit"
  10505. }, (0,external_wp_i18n_namespaceObject.__)('Save')))))));
  10506. }
  10507. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/actions/index.js
  10508. /**
  10509. * WordPress dependencies
  10510. */
  10511. /**
  10512. * Internal dependencies
  10513. */
  10514. function Actions(_ref) {
  10515. let {
  10516. template
  10517. } = _ref;
  10518. const {
  10519. removeTemplate,
  10520. revertTemplate
  10521. } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
  10522. const {
  10523. saveEditedEntityRecord
  10524. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  10525. const {
  10526. createSuccessNotice,
  10527. createErrorNotice
  10528. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  10529. const isRemovable = isTemplateRemovable(template);
  10530. const isRevertable = isTemplateRevertable(template);
  10531. if (!isRemovable && !isRevertable) {
  10532. return null;
  10533. }
  10534. async function revertAndSaveTemplate() {
  10535. try {
  10536. await revertTemplate(template, {
  10537. allowUndo: false
  10538. });
  10539. await saveEditedEntityRecord('postType', template.type, template.id);
  10540. createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Entity reverted.'), {
  10541. type: 'snackbar'
  10542. });
  10543. } catch (error) {
  10544. const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the entity.');
  10545. createErrorNotice(errorMessage, {
  10546. type: 'snackbar'
  10547. });
  10548. }
  10549. }
  10550. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
  10551. icon: more_vertical,
  10552. label: (0,external_wp_i18n_namespaceObject.__)('Actions'),
  10553. className: "edit-site-list-table__actions"
  10554. }, _ref2 => {
  10555. let {
  10556. onClose
  10557. } = _ref2;
  10558. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, isRemovable && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(RenameMenuItem, {
  10559. template: template,
  10560. onClose: onClose
  10561. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  10562. isDestructive: true,
  10563. isTertiary: true,
  10564. onClick: () => {
  10565. removeTemplate(template);
  10566. onClose();
  10567. }
  10568. }, (0,external_wp_i18n_namespaceObject.__)('Delete'))), isRevertable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  10569. info: (0,external_wp_i18n_namespaceObject.__)('Restore to default state'),
  10570. onClick: () => {
  10571. revertAndSaveTemplate();
  10572. onClose();
  10573. }
  10574. }, (0,external_wp_i18n_namespaceObject.__)('Clear customizations')));
  10575. });
  10576. }
  10577. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plugins.js
  10578. /**
  10579. * WordPress dependencies
  10580. */
  10581. const plugins = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10582. xmlns: "http://www.w3.org/2000/svg",
  10583. viewBox: "0 0 24 24"
  10584. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10585. d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"
  10586. }));
  10587. /* harmony default export */ var library_plugins = (plugins);
  10588. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js
  10589. /**
  10590. * WordPress dependencies
  10591. */
  10592. const commentAuthorAvatar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10593. xmlns: "http://www.w3.org/2000/svg",
  10594. viewBox: "0 0 24 24"
  10595. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10596. fillRule: "evenodd",
  10597. d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",
  10598. clipRule: "evenodd"
  10599. }));
  10600. /* harmony default export */ var comment_author_avatar = (commentAuthorAvatar);
  10601. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/globe.js
  10602. /**
  10603. * WordPress dependencies
  10604. */
  10605. const globe = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10606. xmlns: "http://www.w3.org/2000/svg",
  10607. viewBox: "0 0 24 24"
  10608. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10609. d: "M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"
  10610. }));
  10611. /* harmony default export */ var library_globe = (globe);
  10612. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/added-by.js
  10613. /**
  10614. * External dependencies
  10615. */
  10616. /**
  10617. * WordPress dependencies
  10618. */
  10619. const TEMPLATE_POST_TYPE_NAMES = ['wp_template', 'wp_template_part'];
  10620. function CustomizedTooltip(_ref) {
  10621. let {
  10622. isCustomized,
  10623. children
  10624. } = _ref;
  10625. if (!isCustomized) {
  10626. return children;
  10627. }
  10628. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
  10629. text: (0,external_wp_i18n_namespaceObject.__)('This template has been customized')
  10630. }, children);
  10631. }
  10632. function BaseAddedBy(_ref2) {
  10633. let {
  10634. text,
  10635. icon,
  10636. imageUrl,
  10637. isCustomized
  10638. } = _ref2;
  10639. const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_namespaceObject.useState)(false);
  10640. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  10641. alignment: "left"
  10642. }, (0,external_wp_element_namespaceObject.createElement)(CustomizedTooltip, {
  10643. isCustomized: isCustomized
  10644. }, imageUrl ? (0,external_wp_element_namespaceObject.createElement)("div", {
  10645. className: classnames_default()('edit-site-list-added-by__avatar', {
  10646. 'is-loaded': isImageLoaded
  10647. })
  10648. }, (0,external_wp_element_namespaceObject.createElement)("img", {
  10649. onLoad: () => setIsImageLoaded(true),
  10650. alt: "",
  10651. src: imageUrl
  10652. })) : (0,external_wp_element_namespaceObject.createElement)("div", {
  10653. className: classnames_default()('edit-site-list-added-by__icon', {
  10654. 'is-customized': isCustomized
  10655. })
  10656. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
  10657. icon: icon
  10658. }))), (0,external_wp_element_namespaceObject.createElement)("span", null, text));
  10659. }
  10660. function AddedByTheme(_ref3) {
  10661. var _theme$name;
  10662. let {
  10663. slug,
  10664. isCustomized
  10665. } = _ref3;
  10666. const theme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getTheme(slug), [slug]);
  10667. return (0,external_wp_element_namespaceObject.createElement)(BaseAddedBy, {
  10668. icon: library_layout,
  10669. text: (theme === null || theme === void 0 ? void 0 : (_theme$name = theme.name) === null || _theme$name === void 0 ? void 0 : _theme$name.rendered) || slug,
  10670. isCustomized: isCustomized
  10671. });
  10672. }
  10673. function AddedByPlugin(_ref4) {
  10674. let {
  10675. slug,
  10676. isCustomized
  10677. } = _ref4;
  10678. const plugin = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPlugin(slug), [slug]);
  10679. return (0,external_wp_element_namespaceObject.createElement)(BaseAddedBy, {
  10680. icon: library_plugins,
  10681. text: (plugin === null || plugin === void 0 ? void 0 : plugin.name) || slug,
  10682. isCustomized: isCustomized
  10683. });
  10684. }
  10685. function AddedByAuthor(_ref5) {
  10686. var _user$avatar_urls;
  10687. let {
  10688. id
  10689. } = _ref5;
  10690. const user = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getUser(id), [id]);
  10691. return (0,external_wp_element_namespaceObject.createElement)(BaseAddedBy, {
  10692. icon: comment_author_avatar,
  10693. imageUrl: user === null || user === void 0 ? void 0 : (_user$avatar_urls = user.avatar_urls) === null || _user$avatar_urls === void 0 ? void 0 : _user$avatar_urls[48],
  10694. text: user === null || user === void 0 ? void 0 : user.nickname
  10695. });
  10696. }
  10697. function AddedBySite() {
  10698. const {
  10699. name,
  10700. logoURL
  10701. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  10702. var _getMedia;
  10703. const {
  10704. getEntityRecord,
  10705. getMedia
  10706. } = select(external_wp_coreData_namespaceObject.store);
  10707. const siteData = getEntityRecord('root', '__unstableBase');
  10708. return {
  10709. name: siteData === null || siteData === void 0 ? void 0 : siteData.name,
  10710. logoURL: siteData !== null && siteData !== void 0 && siteData.site_logo ? (_getMedia = getMedia(siteData.site_logo)) === null || _getMedia === void 0 ? void 0 : _getMedia.source_url : undefined
  10711. };
  10712. }, []);
  10713. return (0,external_wp_element_namespaceObject.createElement)(BaseAddedBy, {
  10714. icon: library_globe,
  10715. imageUrl: logoURL,
  10716. text: name
  10717. });
  10718. }
  10719. function AddedBy(_ref6) {
  10720. let {
  10721. templateType,
  10722. template
  10723. } = _ref6;
  10724. if (!template) {
  10725. return;
  10726. }
  10727. if (TEMPLATE_POST_TYPE_NAMES.includes(templateType)) {
  10728. // Template originally provided by a theme, but customized by a user.
  10729. // Templates originally didn't have the 'origin' field so identify
  10730. // older customized templates by checking for no origin and a 'theme'
  10731. // or 'custom' source.
  10732. if (template.has_theme_file && (template.origin === 'theme' || !template.origin && ['theme', 'custom'].includes(template.source))) {
  10733. return (0,external_wp_element_namespaceObject.createElement)(AddedByTheme, {
  10734. slug: template.theme,
  10735. isCustomized: template.source === 'custom'
  10736. });
  10737. } // Template originally provided by a plugin, but customized by a user.
  10738. if (template.has_theme_file && template.origin === 'plugin') {
  10739. return (0,external_wp_element_namespaceObject.createElement)(AddedByPlugin, {
  10740. slug: template.theme,
  10741. isCustomized: template.source === 'custom'
  10742. });
  10743. } // Template was created from scratch, but has no author. Author support
  10744. // was only added to templates in WordPress 5.9. Fallback to showing the
  10745. // site logo and title.
  10746. if (!template.has_theme_file && template.source === 'custom' && !template.author) {
  10747. return (0,external_wp_element_namespaceObject.createElement)(AddedBySite, null);
  10748. }
  10749. } // Simply show the author for templates created from scratch that have an
  10750. // author or for any other post type.
  10751. return (0,external_wp_element_namespaceObject.createElement)(AddedByAuthor, {
  10752. id: template.author
  10753. });
  10754. }
  10755. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/table.js
  10756. /**
  10757. * WordPress dependencies
  10758. */
  10759. /**
  10760. * Internal dependencies
  10761. */
  10762. function Table(_ref) {
  10763. let {
  10764. templateType
  10765. } = _ref;
  10766. const {
  10767. records: templates,
  10768. isResolving: isLoading
  10769. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('postType', templateType, {
  10770. per_page: -1
  10771. });
  10772. const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType(templateType), [templateType]);
  10773. if (!templates || isLoading) {
  10774. return null;
  10775. }
  10776. if (!templates.length) {
  10777. var _postType$labels, _postType$labels$name;
  10778. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_i18n_namespaceObject.sprintf)( // translators: The template type name, should be either "templates" or "template parts".
  10779. (0,external_wp_i18n_namespaceObject.__)('No %s found.'), postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : (_postType$labels$name = _postType$labels.name) === null || _postType$labels$name === void 0 ? void 0 : _postType$labels$name.toLowerCase()));
  10780. }
  10781. return (// These explicit aria roles are needed for Safari.
  10782. // See https://developer.mozilla.org/en-US/docs/Web/CSS/display#tables
  10783. (0,external_wp_element_namespaceObject.createElement)("table", {
  10784. className: "edit-site-list-table",
  10785. role: "table"
  10786. }, (0,external_wp_element_namespaceObject.createElement)("thead", null, (0,external_wp_element_namespaceObject.createElement)("tr", {
  10787. className: "edit-site-list-table-head",
  10788. role: "row"
  10789. }, (0,external_wp_element_namespaceObject.createElement)("th", {
  10790. className: "edit-site-list-table-column",
  10791. role: "columnheader"
  10792. }, (0,external_wp_i18n_namespaceObject.__)('Template')), (0,external_wp_element_namespaceObject.createElement)("th", {
  10793. className: "edit-site-list-table-column",
  10794. role: "columnheader"
  10795. }, (0,external_wp_i18n_namespaceObject.__)('Added by')), (0,external_wp_element_namespaceObject.createElement)("th", {
  10796. className: "edit-site-list-table-column",
  10797. role: "columnheader"
  10798. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_wp_i18n_namespaceObject.__)('Actions'))))), (0,external_wp_element_namespaceObject.createElement)("tbody", null, templates.map(template => {
  10799. var _template$title;
  10800. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  10801. key: template.id,
  10802. className: "edit-site-list-table-row",
  10803. role: "row"
  10804. }, (0,external_wp_element_namespaceObject.createElement)("td", {
  10805. className: "edit-site-list-table-column",
  10806. role: "cell"
  10807. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
  10808. level: 4
  10809. }, (0,external_wp_element_namespaceObject.createElement)(Link, {
  10810. params: {
  10811. postId: template.id,
  10812. postType: template.type
  10813. }
  10814. }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(((_template$title = template.title) === null || _template$title === void 0 ? void 0 : _template$title.rendered) || template.slug))), template.description), (0,external_wp_element_namespaceObject.createElement)("td", {
  10815. className: "edit-site-list-table-column",
  10816. role: "cell"
  10817. }, (0,external_wp_element_namespaceObject.createElement)(AddedBy, {
  10818. templateType: templateType,
  10819. template: template
  10820. })), (0,external_wp_element_namespaceObject.createElement)("td", {
  10821. className: "edit-site-list-table-column",
  10822. role: "cell"
  10823. }, (0,external_wp_element_namespaceObject.createElement)(Actions, {
  10824. template: template
  10825. })));
  10826. })))
  10827. );
  10828. }
  10829. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/index.js
  10830. /**
  10831. * External dependencies
  10832. */
  10833. /**
  10834. * WordPress dependencies
  10835. */
  10836. /**
  10837. * Internal dependencies
  10838. */
  10839. function List() {
  10840. var _postType$labels, _postType$labels2;
  10841. const {
  10842. params: {
  10843. postType: templateType
  10844. }
  10845. } = useLocation();
  10846. useRegisterShortcuts();
  10847. const {
  10848. previousShortcut,
  10849. nextShortcut,
  10850. isNavigationOpen
  10851. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  10852. return {
  10853. previousShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-site/previous-region'),
  10854. nextShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-site/next-region'),
  10855. isNavigationOpen: select(store_store).isNavigationOpened()
  10856. };
  10857. }, []);
  10858. const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType(templateType), [templateType]);
  10859. useTitle(postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.name); // `postType` could load in asynchronously. Only provide the detailed region labels if
  10860. // the postType has loaded, otherwise `InterfaceSkeleton` will fallback to the defaults.
  10861. const itemsListLabel = postType === null || postType === void 0 ? void 0 : (_postType$labels2 = postType.labels) === null || _postType$labels2 === void 0 ? void 0 : _postType$labels2.items_list;
  10862. const detailedRegionLabels = postType ? {
  10863. header: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s - the name of the page, 'Header' as in the header area of that page.
  10864. (0,external_wp_i18n_namespaceObject.__)('%s - Header'), itemsListLabel),
  10865. body: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s - the name of the page, 'Content' as in the content area of that page.
  10866. (0,external_wp_i18n_namespaceObject.__)('%s - Content'), itemsListLabel)
  10867. } : undefined;
  10868. return (0,external_wp_element_namespaceObject.createElement)(interface_skeleton, {
  10869. className: classnames_default()('edit-site-list', {
  10870. 'is-navigation-open': isNavigationOpen
  10871. }),
  10872. labels: {
  10873. drawer: (0,external_wp_i18n_namespaceObject.__)('Navigation Sidebar'),
  10874. ...detailedRegionLabels
  10875. },
  10876. header: (0,external_wp_element_namespaceObject.createElement)(header_Header, {
  10877. templateType: templateType
  10878. }),
  10879. drawer: (0,external_wp_element_namespaceObject.createElement)(navigation_sidebar.Slot, null),
  10880. notices: (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorSnackbars, null),
  10881. content: (0,external_wp_element_namespaceObject.createElement)(Table, {
  10882. templateType: templateType
  10883. }),
  10884. shortcuts: {
  10885. previous: previousShortcut,
  10886. next: nextShortcut
  10887. }
  10888. });
  10889. }
  10890. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/get-is-list-page.js
  10891. /**
  10892. * Returns if the params match the list page route.
  10893. *
  10894. * @param {Object} params The search params.
  10895. * @param {string} params.postId The post ID.
  10896. * @param {string} params.postType The post type.
  10897. * @return {boolean} Is list page or not.
  10898. */
  10899. function getIsListPage(_ref) {
  10900. let {
  10901. postId,
  10902. postType
  10903. } = _ref;
  10904. return !!(!postId && postType);
  10905. }
  10906. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/app/index.js
  10907. /**
  10908. * WordPress dependencies
  10909. */
  10910. /**
  10911. * Internal dependencies
  10912. */
  10913. function EditSiteApp(_ref) {
  10914. let {
  10915. reboot
  10916. } = _ref;
  10917. const {
  10918. createErrorNotice
  10919. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  10920. function onPluginAreaError(name) {
  10921. createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  10922. /* translators: %s: plugin name */
  10923. (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name));
  10924. }
  10925. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SlotFillProvider, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.UnsavedChangesWarning, null), (0,external_wp_element_namespaceObject.createElement)(Routes, null, _ref2 => {
  10926. let {
  10927. params
  10928. } = _ref2;
  10929. const isListPage = getIsListPage(params);
  10930. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isListPage ? (0,external_wp_element_namespaceObject.createElement)(List, null) : (0,external_wp_element_namespaceObject.createElement)(editor, {
  10931. onError: reboot
  10932. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_plugins_namespaceObject.PluginArea, {
  10933. onError: onPluginAreaError
  10934. }), (0,external_wp_element_namespaceObject.createElement)(navigation_sidebar // Open the navigation sidebar by default when in the list page.
  10935. , {
  10936. isDefaultOpen: !!isListPage,
  10937. activeTemplateType: isListPage ? params.postType : undefined
  10938. }));
  10939. }));
  10940. }
  10941. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/plugin-sidebar/index.js
  10942. /**
  10943. * WordPress dependencies
  10944. */
  10945. /**
  10946. * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
  10947. * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
  10948. * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:
  10949. *
  10950. * ```js
  10951. * wp.data.dispatch( 'core/edit-site' ).openGeneralSidebar( 'plugin-name/sidebar-name' );
  10952. * ```
  10953. *
  10954. * @see PluginSidebarMoreMenuItem
  10955. *
  10956. * @param {Object} props Element props.
  10957. * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
  10958. * @param {string} [props.className] An optional class name added to the sidebar body.
  10959. * @param {string} props.title Title displayed at the top of the sidebar.
  10960. * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.
  10961. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
  10962. *
  10963. * @example
  10964. * ```js
  10965. * // Using ES5 syntax
  10966. * var __ = wp.i18n.__;
  10967. * var el = wp.element.createElement;
  10968. * var PanelBody = wp.components.PanelBody;
  10969. * var PluginSidebar = wp.editSite.PluginSidebar;
  10970. * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
  10971. *
  10972. * function MyPluginSidebar() {
  10973. * return el(
  10974. * PluginSidebar,
  10975. * {
  10976. * name: 'my-sidebar',
  10977. * title: 'My sidebar title',
  10978. * icon: moreIcon,
  10979. * },
  10980. * el(
  10981. * PanelBody,
  10982. * {},
  10983. * __( 'My sidebar content' )
  10984. * )
  10985. * );
  10986. * }
  10987. * ```
  10988. *
  10989. * @example
  10990. * ```jsx
  10991. * // Using ESNext syntax
  10992. * import { __ } from '@wordpress/i18n';
  10993. * import { PanelBody } from '@wordpress/components';
  10994. * import { PluginSidebar } from '@wordpress/edit-site';
  10995. * import { more } from '@wordpress/icons';
  10996. *
  10997. * const MyPluginSidebar = () => (
  10998. * <PluginSidebar
  10999. * name="my-sidebar"
  11000. * title="My sidebar title"
  11001. * icon={ more }
  11002. * >
  11003. * <PanelBody>
  11004. * { __( 'My sidebar content' ) }
  11005. * </PanelBody>
  11006. * </PluginSidebar>
  11007. * );
  11008. * ```
  11009. */
  11010. function PluginSidebarEditSite(_ref) {
  11011. let {
  11012. className,
  11013. ...props
  11014. } = _ref;
  11015. return (0,external_wp_element_namespaceObject.createElement)(complementary_area, extends_extends({
  11016. panelClassName: className,
  11017. className: "edit-site-sidebar",
  11018. scope: "core/edit-site"
  11019. }, props));
  11020. }
  11021. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/plugin-sidebar-more-menu-item/index.js
  11022. /**
  11023. * WordPress dependencies
  11024. */
  11025. /**
  11026. * Renders a menu item in `Plugins` group in `More Menu` drop down,
  11027. * and can be used to activate the corresponding `PluginSidebar` component.
  11028. * The text within the component appears as the menu item label.
  11029. *
  11030. * @param {Object} props Component props.
  11031. * @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.
  11032. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
  11033. *
  11034. * @example
  11035. * ```js
  11036. * // Using ES5 syntax
  11037. * var __ = wp.i18n.__;
  11038. * var PluginSidebarMoreMenuItem = wp.editSite.PluginSidebarMoreMenuItem;
  11039. * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
  11040. *
  11041. * function MySidebarMoreMenuItem() {
  11042. * return wp.element.createElement(
  11043. * PluginSidebarMoreMenuItem,
  11044. * {
  11045. * target: 'my-sidebar',
  11046. * icon: moreIcon,
  11047. * },
  11048. * __( 'My sidebar title' )
  11049. * )
  11050. * }
  11051. * ```
  11052. *
  11053. * @example
  11054. * ```jsx
  11055. * // Using ESNext syntax
  11056. * import { __ } from '@wordpress/i18n';
  11057. * import { PluginSidebarMoreMenuItem } from '@wordpress/edit-site';
  11058. * import { more } from '@wordpress/icons';
  11059. *
  11060. * const MySidebarMoreMenuItem = () => (
  11061. * <PluginSidebarMoreMenuItem
  11062. * target="my-sidebar"
  11063. * icon={ more }
  11064. * >
  11065. * { __( 'My sidebar title' ) }
  11066. * </PluginSidebarMoreMenuItem>
  11067. * );
  11068. * ```
  11069. *
  11070. * @return {WPComponent} The component to be rendered.
  11071. */
  11072. function PluginSidebarMoreMenuItem(props) {
  11073. return (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaMoreMenuItem // Menu item is marked with unstable prop for backward compatibility.
  11074. // @see https://github.com/WordPress/gutenberg/issues/14457
  11075. , extends_extends({
  11076. __unstableExplicitMenuItem: true,
  11077. scope: "core/edit-site"
  11078. }, props));
  11079. }
  11080. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/plugin-more-menu-item/index.js
  11081. /**
  11082. * WordPress dependencies
  11083. */
  11084. /**
  11085. * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.
  11086. * The text within the component appears as the menu item label.
  11087. *
  11088. * @param {Object} props Component properties.
  11089. * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
  11090. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
  11091. * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.
  11092. * @param {...*} [props.other] Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.
  11093. *
  11094. * @example
  11095. * ```js
  11096. * // Using ES5 syntax
  11097. * var __ = wp.i18n.__;
  11098. * var PluginMoreMenuItem = wp.editSite.PluginMoreMenuItem;
  11099. * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
  11100. *
  11101. * function onButtonClick() {
  11102. * alert( 'Button clicked.' );
  11103. * }
  11104. *
  11105. * function MyButtonMoreMenuItem() {
  11106. * return wp.element.createElement(
  11107. * PluginMoreMenuItem,
  11108. * {
  11109. * icon: moreIcon,
  11110. * onClick: onButtonClick,
  11111. * },
  11112. * __( 'My button title' )
  11113. * );
  11114. * }
  11115. * ```
  11116. *
  11117. * @example
  11118. * ```jsx
  11119. * // Using ESNext syntax
  11120. * import { __ } from '@wordpress/i18n';
  11121. * import { PluginMoreMenuItem } from '@wordpress/edit-site';
  11122. * import { more } from '@wordpress/icons';
  11123. *
  11124. * function onButtonClick() {
  11125. * alert( 'Button clicked.' );
  11126. * }
  11127. *
  11128. * const MyButtonMoreMenuItem = () => (
  11129. * <PluginMoreMenuItem
  11130. * icon={ more }
  11131. * onClick={ onButtonClick }
  11132. * >
  11133. * { __( 'My button title' ) }
  11134. * </PluginMoreMenuItem>
  11135. * );
  11136. * ```
  11137. *
  11138. * @return {WPComponent} The component to be rendered.
  11139. */
  11140. /* harmony default export */ var plugin_more_menu_item = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => {
  11141. var _ownProps$as;
  11142. return {
  11143. as: (_ownProps$as = ownProps.as) !== null && _ownProps$as !== void 0 ? _ownProps$as : external_wp_components_namespaceObject.MenuItem,
  11144. icon: ownProps.icon || context.icon,
  11145. name: 'core/edit-site/plugin-more-menu'
  11146. };
  11147. }))(action_item));
  11148. ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/index.js
  11149. /**
  11150. * WordPress dependencies
  11151. */
  11152. /**
  11153. * Internal dependencies
  11154. */
  11155. /**
  11156. * Reinitializes the editor after the user chooses to reboot the editor after
  11157. * an unhandled error occurs, replacing previously mounted editor element using
  11158. * an initial state from prior to the crash.
  11159. *
  11160. * @param {Element} target DOM node in which editor is rendered.
  11161. * @param {?Object} settings Editor settings object.
  11162. */
  11163. function reinitializeEditor(target, settings) {
  11164. // Display warning if editor wasn't able to resolve homepage template.
  11165. if (!settings.__unstableHomeTemplate) {
  11166. (0,external_wp_element_namespaceObject.render)((0,external_wp_element_namespaceObject.createElement)(ErrorBoundaryWarning, {
  11167. message: (0,external_wp_i18n_namespaceObject.__)('The editor is unable to find a block template for the homepage.'),
  11168. dashboardLink: "index.php"
  11169. }), target);
  11170. return;
  11171. } // This will be a no-op if the target doesn't have any React nodes.
  11172. (0,external_wp_element_namespaceObject.unmountComponentAtNode)(target);
  11173. const reboot = reinitializeEditor.bind(null, target, settings); // We dispatch actions and update the store synchronously before rendering
  11174. // so that we won't trigger unnecessary re-renders with useEffect.
  11175. {
  11176. (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/edit-site', {
  11177. editorMode: 'visual',
  11178. fixedToolbar: false,
  11179. focusMode: false,
  11180. keepCaretInsideBlock: false,
  11181. welcomeGuide: true,
  11182. welcomeGuideStyles: true
  11183. });
  11184. (0,external_wp_data_namespaceObject.dispatch)(store_store).updateSettings(settings); // Keep the defaultTemplateTypes in the core/editor settings too,
  11185. // so that they can be selected with core/editor selectors in any editor.
  11186. // This is needed because edit-site doesn't initialize with EditorProvider,
  11187. // which internally uses updateEditorSettings as well.
  11188. (0,external_wp_data_namespaceObject.dispatch)(external_wp_editor_namespaceObject.store).updateEditorSettings({
  11189. defaultTemplateTypes: settings.defaultTemplateTypes,
  11190. defaultTemplatePartAreas: settings.defaultTemplatePartAreas
  11191. });
  11192. const isLandingOnListPage = getIsListPage((0,external_wp_url_namespaceObject.getQueryArgs)(window.location.href));
  11193. if (isLandingOnListPage) {
  11194. // Default the navigation panel to be opened when we're in a bigger
  11195. // screen and land in the list screen.
  11196. (0,external_wp_data_namespaceObject.dispatch)(store_store).setIsNavigationPanelOpened((0,external_wp_data_namespaceObject.select)(external_wp_viewport_namespaceObject.store).isViewportMatch('medium'));
  11197. }
  11198. }
  11199. (0,external_wp_element_namespaceObject.render)((0,external_wp_element_namespaceObject.createElement)(EditSiteApp, {
  11200. reboot: reboot
  11201. }), target);
  11202. }
  11203. /**
  11204. * Initializes the site editor screen.
  11205. *
  11206. * @param {string} id ID of the root element to render the screen in.
  11207. * @param {Object} settings Editor settings.
  11208. */
  11209. function initializeEditor(id, settings) {
  11210. settings.__experimentalFetchLinkSuggestions = (search, searchOptions) => (0,external_wp_coreData_namespaceObject.__experimentalFetchLinkSuggestions)(search, searchOptions, settings);
  11211. settings.__experimentalFetchRichUrlData = external_wp_coreData_namespaceObject.__experimentalFetchUrlData;
  11212. settings.__experimentalSpotlightEntityBlocks = ['core/template-part'];
  11213. const target = document.getElementById(id);
  11214. (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).__experimentalReapplyBlockTypeFilters();
  11215. (0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)();
  11216. if (false) {}
  11217. reinitializeEditor(target, settings);
  11218. }
  11219. }();
  11220. (window.wp = window.wp || {}).editSite = __webpack_exports__;
  11221. /******/ })()
  11222. ;