123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187 |
- /******/ (function() { // webpackBootstrap
- /******/ var __webpack_modules__ = ({
- /***/ 3827:
- /***/ (function(module, exports) {
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- Copyright (c) 2018 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
- */
- /* global define */
- (function () {
- 'use strict';
- var classNames = (function () {
- // don't inherit from Object so we can skip hasOwnProperty check later
- // http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232
- function StorageObject() {}
- StorageObject.prototype = Object.create(null);
- function _parseArray (resultSet, array) {
- var length = array.length;
- for (var i = 0; i < length; ++i) {
- _parse(resultSet, array[i]);
- }
- }
- var hasOwn = {}.hasOwnProperty;
- function _parseNumber (resultSet, num) {
- resultSet[num] = true;
- }
- function _parseObject (resultSet, object) {
- if (object.toString === Object.prototype.toString) {
- for (var k in object) {
- if (hasOwn.call(object, k)) {
- // set value to false instead of deleting it to avoid changing object structure
- // https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions
- resultSet[k] = !!object[k];
- }
- }
- } else {
- resultSet[object.toString()] = true;
- }
- }
- var SPACE = /\s+/;
- function _parseString (resultSet, str) {
- var array = str.split(SPACE);
- var length = array.length;
- for (var i = 0; i < length; ++i) {
- resultSet[array[i]] = true;
- }
- }
- function _parse (resultSet, arg) {
- if (!arg) return;
- var argType = typeof arg;
- // 'foo bar'
- if (argType === 'string') {
- _parseString(resultSet, arg);
- // ['foo', 'bar', ...]
- } else if (Array.isArray(arg)) {
- _parseArray(resultSet, arg);
- // { 'foo': true, ... }
- } else if (argType === 'object') {
- _parseObject(resultSet, arg);
- // '130'
- } else if (argType === 'number') {
- _parseNumber(resultSet, arg);
- }
- }
- function _classNames () {
- // don't leak arguments
- // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
- var len = arguments.length;
- var args = Array(len);
- for (var i = 0; i < len; i++) {
- args[i] = arguments[i];
- }
- var classSet = new StorageObject();
- _parseArray(classSet, args);
- var list = [];
- for (var k in classSet) {
- if (classSet[k]) {
- list.push(k)
- }
- }
- return list.join(' ');
- }
- return _classNames;
- })();
- if ( true && module.exports) {
- classNames.default = classNames;
- module.exports = classNames;
- } else if (true) {
- // register as 'classnames', consistent with npm package name
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
- return classNames;
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
- }());
- /***/ }),
- /***/ 4403:
- /***/ (function(module, exports) {
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- Copyright (c) 2018 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
- */
- /* global define */
- (function () {
- 'use strict';
- var hasOwn = {}.hasOwnProperty;
- function classNames() {
- var classes = [];
- for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
- if (!arg) continue;
- var argType = typeof arg;
- if (argType === 'string' || argType === 'number') {
- classes.push(arg);
- } else if (Array.isArray(arg)) {
- if (arg.length) {
- var inner = classNames.apply(null, arg);
- if (inner) {
- classes.push(inner);
- }
- }
- } else if (argType === 'object') {
- if (arg.toString === Object.prototype.toString) {
- for (var key in arg) {
- if (hasOwn.call(arg, key) && arg[key]) {
- classes.push(key);
- }
- }
- } else {
- classes.push(arg.toString());
- }
- }
- }
- return classes.join(' ');
- }
- if ( true && module.exports) {
- classNames.default = classNames;
- module.exports = classNames;
- } else if (true) {
- // register as 'classnames', consistent with npm package name
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
- return classNames;
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
- }());
- /***/ }),
- /***/ 5027:
- /***/ (function(module) {
- /*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */
- (function (global, factory) {
- true ? module.exports = factory() :
- 0;
- }(this, (function () { 'use strict';
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
- if (staticProps) _defineProperties(Constructor, staticProps);
- return Constructor;
- }
- function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
- }
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) return arr;
- }
- function _iterableToArrayLimit(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = undefined;
- try {
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
- if (i && _arr.length === i) break;
- }
- } catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- var FastAverageColor =
- /*#__PURE__*/
- function () {
- function FastAverageColor() {
- _classCallCheck(this, FastAverageColor);
- }
- _createClass(FastAverageColor, [{
- key: "getColorAsync",
- /**
- * Get asynchronously the average color from not loaded image.
- *
- * @param {HTMLImageElement} resource
- * @param {Function} callback
- * @param {Object|null} [options]
- * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
- * @param {*} [options.data]
- * @param {string} [options.mode="speed"] "precision" or "speed"
- * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
- * @param {number} [options.step=1]
- * @param {number} [options.left=0]
- * @param {number} [options.top=0]
- * @param {number} [options.width=width of resource]
- * @param {number} [options.height=height of resource]
- */
- value: function getColorAsync(resource, callback, options) {
- if (resource.complete) {
- callback.call(resource, this.getColor(resource, options), options && options.data);
- } else {
- this._bindImageEvents(resource, callback, options);
- }
- }
- /**
- * Get the average color from images, videos and canvas.
- *
- * @param {HTMLImageElement|HTMLVideoElement|HTMLCanvasElement} resource
- * @param {Object|null} [options]
- * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
- * @param {*} [options.data]
- * @param {string} [options.mode="speed"] "precision" or "speed"
- * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
- * @param {number} [options.step=1]
- * @param {number} [options.left=0]
- * @param {number} [options.top=0]
- * @param {number} [options.width=width of resource]
- * @param {number} [options.height=height of resource]
- *
- * @returns {Object}
- */
- }, {
- key: "getColor",
- value: function getColor(resource, options) {
- options = options || {};
- var defaultColor = this._getDefaultColor(options),
- originalSize = this._getOriginalSize(resource),
- size = this._prepareSizeAndPosition(originalSize, options);
- var error = null,
- value = defaultColor;
- if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) {
- return this._prepareResult(defaultColor, new Error('FastAverageColor: Incorrect sizes.'));
- }
- if (!this._ctx) {
- this._canvas = this._makeCanvas();
- this._ctx = this._canvas.getContext && this._canvas.getContext('2d');
- if (!this._ctx) {
- return this._prepareResult(defaultColor, new Error('FastAverageColor: Canvas Context 2D is not supported in this browser.'));
- }
- }
- this._canvas.width = size.destWidth;
- this._canvas.height = size.destHeight;
- try {
- this._ctx.clearRect(0, 0, size.destWidth, size.destHeight);
- this._ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight);
- var bitmapData = this._ctx.getImageData(0, 0, size.destWidth, size.destHeight).data;
- value = this.getColorFromArray4(bitmapData, options);
- } catch (e) {
- // Security error, CORS
- // https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image
- error = e;
- }
- return this._prepareResult(value, error);
- }
- /**
- * Get the average color from a array when 1 pixel is 4 bytes.
- *
- * @param {Array|Uint8Array} arr
- * @param {Object} [options]
- * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
- * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
- * @param {number} [options.step=1]
- *
- * @returns {Array} [red (0-255), green (0-255), blue (0-255), alpha (0-255)]
- */
- }, {
- key: "getColorFromArray4",
- value: function getColorFromArray4(arr, options) {
- options = options || {};
- var bytesPerPixel = 4,
- arrLength = arr.length;
- if (arrLength < bytesPerPixel) {
- return this._getDefaultColor(options);
- }
- var len = arrLength - arrLength % bytesPerPixel,
- preparedStep = (options.step || 1) * bytesPerPixel,
- algorithm = '_' + (options.algorithm || 'sqrt') + 'Algorithm';
- if (typeof this[algorithm] !== 'function') {
- throw new Error("FastAverageColor: ".concat(options.algorithm, " is unknown algorithm."));
- }
- return this[algorithm](arr, len, preparedStep);
- }
- /**
- * Destroy the instance.
- */
- }, {
- key: "destroy",
- value: function destroy() {
- delete this._canvas;
- delete this._ctx;
- }
- }, {
- key: "_getDefaultColor",
- value: function _getDefaultColor(options) {
- return this._getOption(options, 'defaultColor', [255, 255, 255, 255]);
- }
- }, {
- key: "_getOption",
- value: function _getOption(options, name, defaultValue) {
- return typeof options[name] === 'undefined' ? defaultValue : options[name];
- }
- }, {
- key: "_prepareSizeAndPosition",
- value: function _prepareSizeAndPosition(originalSize, options) {
- var srcLeft = this._getOption(options, 'left', 0),
- srcTop = this._getOption(options, 'top', 0),
- srcWidth = this._getOption(options, 'width', originalSize.width),
- srcHeight = this._getOption(options, 'height', originalSize.height),
- destWidth = srcWidth,
- destHeight = srcHeight;
- if (options.mode === 'precision') {
- return {
- srcLeft: srcLeft,
- srcTop: srcTop,
- srcWidth: srcWidth,
- srcHeight: srcHeight,
- destWidth: destWidth,
- destHeight: destHeight
- };
- }
- var maxSize = 100,
- minSize = 10;
- var factor;
- if (srcWidth > srcHeight) {
- factor = srcWidth / srcHeight;
- destWidth = maxSize;
- destHeight = Math.round(destWidth / factor);
- } else {
- factor = srcHeight / srcWidth;
- destHeight = maxSize;
- destWidth = Math.round(destHeight / factor);
- }
- if (destWidth > srcWidth || destHeight > srcHeight || destWidth < minSize || destHeight < minSize) {
- destWidth = srcWidth;
- destHeight = srcHeight;
- }
- return {
- srcLeft: srcLeft,
- srcTop: srcTop,
- srcWidth: srcWidth,
- srcHeight: srcHeight,
- destWidth: destWidth,
- destHeight: destHeight
- };
- }
- }, {
- key: "_simpleAlgorithm",
- value: function _simpleAlgorithm(arr, len, preparedStep) {
- var redTotal = 0,
- greenTotal = 0,
- blueTotal = 0,
- alphaTotal = 0,
- count = 0;
- for (var i = 0; i < len; i += preparedStep) {
- var alpha = arr[i + 3],
- red = arr[i] * alpha,
- green = arr[i + 1] * alpha,
- blue = arr[i + 2] * alpha;
- redTotal += red;
- greenTotal += green;
- blueTotal += blue;
- alphaTotal += alpha;
- count++;
- }
- return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
- }
- }, {
- key: "_sqrtAlgorithm",
- value: function _sqrtAlgorithm(arr, len, preparedStep) {
- var redTotal = 0,
- greenTotal = 0,
- blueTotal = 0,
- alphaTotal = 0,
- count = 0;
- for (var i = 0; i < len; i += preparedStep) {
- var red = arr[i],
- green = arr[i + 1],
- blue = arr[i + 2],
- alpha = arr[i + 3];
- redTotal += red * red * alpha;
- greenTotal += green * green * alpha;
- blueTotal += blue * blue * alpha;
- alphaTotal += alpha;
- count++;
- }
- return alphaTotal ? [Math.round(Math.sqrt(redTotal / alphaTotal)), Math.round(Math.sqrt(greenTotal / alphaTotal)), Math.round(Math.sqrt(blueTotal / alphaTotal)), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
- }
- }, {
- key: "_dominantAlgorithm",
- value: function _dominantAlgorithm(arr, len, preparedStep) {
- var colorHash = {},
- divider = 24;
- for (var i = 0; i < len; i += preparedStep) {
- var red = arr[i],
- green = arr[i + 1],
- blue = arr[i + 2],
- alpha = arr[i + 3],
- key = Math.round(red / divider) + ',' + Math.round(green / divider) + ',' + Math.round(blue / divider);
- if (colorHash[key]) {
- colorHash[key] = [colorHash[key][0] + red * alpha, colorHash[key][1] + green * alpha, colorHash[key][2] + blue * alpha, colorHash[key][3] + alpha, colorHash[key][4] + 1];
- } else {
- colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1];
- }
- }
- var buffer = Object.keys(colorHash).map(function (key) {
- return colorHash[key];
- }).sort(function (a, b) {
- var countA = a[4],
- countB = b[4];
- return countA > countB ? -1 : countA === countB ? 0 : 1;
- });
- var _buffer$ = _slicedToArray(buffer[0], 5),
- redTotal = _buffer$[0],
- greenTotal = _buffer$[1],
- blueTotal = _buffer$[2],
- alphaTotal = _buffer$[3],
- count = _buffer$[4];
- return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
- }
- }, {
- key: "_bindImageEvents",
- value: function _bindImageEvents(resource, callback, options) {
- var _this = this;
- options = options || {};
- var data = options && options.data,
- defaultColor = this._getDefaultColor(options),
- onload = function onload() {
- unbindEvents();
- callback.call(resource, _this.getColor(resource, options), data);
- },
- onerror = function onerror() {
- unbindEvents();
- callback.call(resource, _this._prepareResult(defaultColor, new Error('Image error')), data);
- },
- onabort = function onabort() {
- unbindEvents();
- callback.call(resource, _this._prepareResult(defaultColor, new Error('Image abort')), data);
- },
- unbindEvents = function unbindEvents() {
- resource.removeEventListener('load', onload);
- resource.removeEventListener('error', onerror);
- resource.removeEventListener('abort', onabort);
- };
- resource.addEventListener('load', onload);
- resource.addEventListener('error', onerror);
- resource.addEventListener('abort', onabort);
- }
- }, {
- key: "_prepareResult",
- value: function _prepareResult(value, error) {
- var rgb = value.slice(0, 3),
- rgba = [].concat(rgb, value[3] / 255),
- isDark = this._isDark(value);
- return {
- error: error,
- value: value,
- rgb: 'rgb(' + rgb.join(',') + ')',
- rgba: 'rgba(' + rgba.join(',') + ')',
- hex: this._arrayToHex(rgb),
- hexa: this._arrayToHex(value),
- isDark: isDark,
- isLight: !isDark
- };
- }
- }, {
- key: "_getOriginalSize",
- value: function _getOriginalSize(resource) {
- if (resource instanceof HTMLImageElement) {
- return {
- width: resource.naturalWidth,
- height: resource.naturalHeight
- };
- }
- if (resource instanceof HTMLVideoElement) {
- return {
- width: resource.videoWidth,
- height: resource.videoHeight
- };
- }
- return {
- width: resource.width,
- height: resource.height
- };
- }
- }, {
- key: "_toHex",
- value: function _toHex(num) {
- var str = num.toString(16);
- return str.length === 1 ? '0' + str : str;
- }
- }, {
- key: "_arrayToHex",
- value: function _arrayToHex(arr) {
- return '#' + arr.map(this._toHex).join('');
- }
- }, {
- key: "_isDark",
- value: function _isDark(color) {
- // http://www.w3.org/TR/AERT#color-contrast
- var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000;
- return result < 128;
- }
- }, {
- key: "_makeCanvas",
- value: function _makeCanvas() {
- return typeof window === 'undefined' ? new OffscreenCanvas(1, 1) : document.createElement('canvas');
- }
- }]);
- return FastAverageColor;
- }();
- return FastAverageColor;
- })));
- /***/ }),
- /***/ 9756:
- /***/ (function(module) {
- /**
- * Memize options object.
- *
- * @typedef MemizeOptions
- *
- * @property {number} [maxSize] Maximum size of the cache.
- */
- /**
- * Internal cache entry.
- *
- * @typedef MemizeCacheNode
- *
- * @property {?MemizeCacheNode|undefined} [prev] Previous node.
- * @property {?MemizeCacheNode|undefined} [next] Next node.
- * @property {Array<*>} args Function arguments for cache
- * entry.
- * @property {*} val Function result.
- */
- /**
- * Properties of the enhanced function for controlling cache.
- *
- * @typedef MemizeMemoizedFunction
- *
- * @property {()=>void} clear Clear the cache.
- */
- /**
- * Accepts a function to be memoized, and returns a new memoized function, with
- * optional options.
- *
- * @template {Function} F
- *
- * @param {F} fn Function to memoize.
- * @param {MemizeOptions} [options] Options object.
- *
- * @return {F & MemizeMemoizedFunction} Memoized function.
- */
- function memize( fn, options ) {
- var size = 0;
- /** @type {?MemizeCacheNode|undefined} */
- var head;
- /** @type {?MemizeCacheNode|undefined} */
- var tail;
- options = options || {};
- function memoized( /* ...args */ ) {
- var node = head,
- len = arguments.length,
- args, i;
- searchCache: while ( node ) {
- // Perform a shallow equality test to confirm that whether the node
- // under test is a candidate for the arguments passed. Two arrays
- // are shallowly equal if their length matches and each entry is
- // strictly equal between the two sets. Avoid abstracting to a
- // function which could incur an arguments leaking deoptimization.
- // Check whether node arguments match arguments length
- if ( node.args.length !== arguments.length ) {
- node = node.next;
- continue;
- }
- // Check whether node arguments match arguments values
- for ( i = 0; i < len; i++ ) {
- if ( node.args[ i ] !== arguments[ i ] ) {
- node = node.next;
- continue searchCache;
- }
- }
- // At this point we can assume we've found a match
- // Surface matched node to head if not already
- if ( node !== head ) {
- // As tail, shift to previous. Must only shift if not also
- // head, since if both head and tail, there is no previous.
- if ( node === tail ) {
- tail = node.prev;
- }
- // Adjust siblings to point to each other. If node was tail,
- // this also handles new tail's empty `next` assignment.
- /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next;
- if ( node.next ) {
- node.next.prev = node.prev;
- }
- node.next = head;
- node.prev = null;
- /** @type {MemizeCacheNode} */ ( head ).prev = node;
- head = node;
- }
- // Return immediately
- return node.val;
- }
- // No cached value found. Continue to insertion phase:
- // Create a copy of arguments (avoid leaking deoptimization)
- args = new Array( len );
- for ( i = 0; i < len; i++ ) {
- args[ i ] = arguments[ i ];
- }
- node = {
- args: args,
- // Generate the result from original function
- val: fn.apply( null, args ),
- };
- // Don't need to check whether node is already head, since it would
- // have been returned above already if it was
- // Shift existing head down list
- if ( head ) {
- head.prev = node;
- node.next = head;
- } else {
- // If no head, follows that there's no tail (at initial or reset)
- tail = node;
- }
- // Trim tail if we're reached max size and are pending cache insertion
- if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) {
- tail = /** @type {MemizeCacheNode} */ ( tail ).prev;
- /** @type {MemizeCacheNode} */ ( tail ).next = null;
- } else {
- size++;
- }
- head = node;
- return node.val;
- }
- memoized.clear = function() {
- head = null;
- tail = null;
- size = 0;
- };
- if ( false ) {}
- // Ignore reason: There's not a clear solution to create an intersection of
- // the function with additional properties, where the goal is to retain the
- // function signature of the incoming argument and add control properties
- // on the return value.
- // @ts-ignore
- return memoized;
- }
- module.exports = memize;
- /***/ })
- /******/ });
- /************************************************************************/
- /******/ // The module cache
- /******/ var __webpack_module_cache__ = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/ // Check if module is in cache
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
- /******/ if (cachedModule !== undefined) {
- /******/ return cachedModule.exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = __webpack_module_cache__[moduleId] = {
- /******/ // no module.id needed
- /******/ // no module.loaded needed
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /************************************************************************/
- /******/ /* webpack/runtime/compat get default export */
- /******/ !function() {
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function() { return module['default']; } :
- /******/ function() { return module; };
- /******/ __webpack_require__.d(getter, { a: getter });
- /******/ return getter;
- /******/ };
- /******/ }();
- /******/
- /******/ /* webpack/runtime/define property getters */
- /******/ !function() {
- /******/ // define getter functions for harmony exports
- /******/ __webpack_require__.d = function(exports, definition) {
- /******/ for(var key in definition) {
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
- /******/ }
- /******/ }
- /******/ };
- /******/ }();
- /******/
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
- /******/ !function() {
- /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
- /******/ }();
- /******/
- /******/ /* webpack/runtime/make namespace object */
- /******/ !function() {
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/ }();
- /******/
- /************************************************************************/
- var __webpack_exports__ = {};
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
- !function() {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "__experimentalGetCoreBlocks": function() { return /* binding */ __experimentalGetCoreBlocks; },
- "__experimentalRegisterExperimentalCoreBlocks": function() { return /* binding */ __experimentalRegisterExperimentalCoreBlocks; },
- "registerCoreBlocks": function() { return /* binding */ registerCoreBlocks; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js
- var archives_namespaceObject = {};
- __webpack_require__.r(archives_namespaceObject);
- __webpack_require__.d(archives_namespaceObject, {
- "metadata": function() { return metadata; },
- "name": function() { return archives_name; },
- "settings": function() { return settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/avatar/index.js
- var avatar_namespaceObject = {};
- __webpack_require__.r(avatar_namespaceObject);
- __webpack_require__.d(avatar_namespaceObject, {
- "metadata": function() { return avatar_metadata; },
- "name": function() { return avatar_name; },
- "settings": function() { return avatar_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js
- var build_module_audio_namespaceObject = {};
- __webpack_require__.r(build_module_audio_namespaceObject);
- __webpack_require__.d(build_module_audio_namespaceObject, {
- "metadata": function() { return audio_metadata; },
- "name": function() { return audio_name; },
- "settings": function() { return audio_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js
- var build_module_button_namespaceObject = {};
- __webpack_require__.r(build_module_button_namespaceObject);
- __webpack_require__.d(build_module_button_namespaceObject, {
- "metadata": function() { return button_metadata; },
- "name": function() { return button_name; },
- "settings": function() { return button_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js
- var build_module_buttons_namespaceObject = {};
- __webpack_require__.r(build_module_buttons_namespaceObject);
- __webpack_require__.d(build_module_buttons_namespaceObject, {
- "metadata": function() { return buttons_metadata; },
- "name": function() { return buttons_name; },
- "settings": function() { return buttons_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js
- var build_module_calendar_namespaceObject = {};
- __webpack_require__.r(build_module_calendar_namespaceObject);
- __webpack_require__.d(build_module_calendar_namespaceObject, {
- "metadata": function() { return calendar_metadata; },
- "name": function() { return calendar_name; },
- "settings": function() { return calendar_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js
- var categories_namespaceObject = {};
- __webpack_require__.r(categories_namespaceObject);
- __webpack_require__.d(categories_namespaceObject, {
- "metadata": function() { return categories_metadata; },
- "name": function() { return categories_name; },
- "settings": function() { return categories_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js
- var freeform_namespaceObject = {};
- __webpack_require__.r(freeform_namespaceObject);
- __webpack_require__.d(freeform_namespaceObject, {
- "metadata": function() { return freeform_metadata; },
- "name": function() { return freeform_name; },
- "settings": function() { return freeform_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js
- var build_module_code_namespaceObject = {};
- __webpack_require__.r(build_module_code_namespaceObject);
- __webpack_require__.d(build_module_code_namespaceObject, {
- "metadata": function() { return code_metadata; },
- "name": function() { return code_name; },
- "settings": function() { return code_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js
- var build_module_column_namespaceObject = {};
- __webpack_require__.r(build_module_column_namespaceObject);
- __webpack_require__.d(build_module_column_namespaceObject, {
- "metadata": function() { return column_metadata; },
- "name": function() { return column_name; },
- "settings": function() { return column_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js
- var build_module_columns_namespaceObject = {};
- __webpack_require__.r(build_module_columns_namespaceObject);
- __webpack_require__.d(build_module_columns_namespaceObject, {
- "metadata": function() { return columns_metadata; },
- "name": function() { return columns_name; },
- "settings": function() { return columns_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
- var build_module_comment_author_name_namespaceObject = {};
- __webpack_require__.r(build_module_comment_author_name_namespaceObject);
- __webpack_require__.d(build_module_comment_author_name_namespaceObject, {
- "metadata": function() { return comment_author_name_metadata; },
- "name": function() { return comment_author_name_name; },
- "settings": function() { return comment_author_name_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
- var build_module_comment_content_namespaceObject = {};
- __webpack_require__.r(build_module_comment_content_namespaceObject);
- __webpack_require__.d(build_module_comment_content_namespaceObject, {
- "metadata": function() { return comment_content_metadata; },
- "name": function() { return comment_content_name; },
- "settings": function() { return comment_content_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
- var comment_date_namespaceObject = {};
- __webpack_require__.r(comment_date_namespaceObject);
- __webpack_require__.d(comment_date_namespaceObject, {
- "metadata": function() { return comment_date_metadata; },
- "name": function() { return comment_date_name; },
- "settings": function() { return comment_date_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
- var build_module_comment_edit_link_namespaceObject = {};
- __webpack_require__.r(build_module_comment_edit_link_namespaceObject);
- __webpack_require__.d(build_module_comment_edit_link_namespaceObject, {
- "metadata": function() { return comment_edit_link_metadata; },
- "name": function() { return comment_edit_link_name; },
- "settings": function() { return comment_edit_link_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
- var build_module_comment_reply_link_namespaceObject = {};
- __webpack_require__.r(build_module_comment_reply_link_namespaceObject);
- __webpack_require__.d(build_module_comment_reply_link_namespaceObject, {
- "metadata": function() { return comment_reply_link_metadata; },
- "name": function() { return comment_reply_link_name; },
- "settings": function() { return comment_reply_link_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
- var comment_template_namespaceObject = {};
- __webpack_require__.r(comment_template_namespaceObject);
- __webpack_require__.d(comment_template_namespaceObject, {
- "metadata": function() { return comment_template_metadata; },
- "name": function() { return comment_template_name; },
- "settings": function() { return comment_template_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
- var comments_pagination_previous_namespaceObject = {};
- __webpack_require__.r(comments_pagination_previous_namespaceObject);
- __webpack_require__.d(comments_pagination_previous_namespaceObject, {
- "metadata": function() { return comments_pagination_previous_metadata; },
- "name": function() { return comments_pagination_previous_name; },
- "settings": function() { return comments_pagination_previous_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/index.js
- var comments_query_loop_namespaceObject = {};
- __webpack_require__.r(comments_query_loop_namespaceObject);
- __webpack_require__.d(comments_query_loop_namespaceObject, {
- "metadata": function() { return comments_query_loop_metadata; },
- "name": function() { return comments_query_loop_name; },
- "settings": function() { return comments_query_loop_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
- var comments_pagination_namespaceObject = {};
- __webpack_require__.r(comments_pagination_namespaceObject);
- __webpack_require__.d(comments_pagination_namespaceObject, {
- "metadata": function() { return comments_pagination_metadata; },
- "name": function() { return comments_pagination_name; },
- "settings": function() { return comments_pagination_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
- var comments_pagination_next_namespaceObject = {};
- __webpack_require__.r(comments_pagination_next_namespaceObject);
- __webpack_require__.d(comments_pagination_next_namespaceObject, {
- "metadata": function() { return comments_pagination_next_metadata; },
- "name": function() { return comments_pagination_next_name; },
- "settings": function() { return comments_pagination_next_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
- var comments_pagination_numbers_namespaceObject = {};
- __webpack_require__.r(comments_pagination_numbers_namespaceObject);
- __webpack_require__.d(comments_pagination_numbers_namespaceObject, {
- "metadata": function() { return comments_pagination_numbers_metadata; },
- "name": function() { return comments_pagination_numbers_name; },
- "settings": function() { return comments_pagination_numbers_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
- var comments_title_namespaceObject = {};
- __webpack_require__.r(comments_title_namespaceObject);
- __webpack_require__.d(comments_title_namespaceObject, {
- "metadata": function() { return comments_title_metadata; },
- "name": function() { return comments_title_name; },
- "settings": function() { return comments_title_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js
- var build_module_cover_namespaceObject = {};
- __webpack_require__.r(build_module_cover_namespaceObject);
- __webpack_require__.d(build_module_cover_namespaceObject, {
- "metadata": function() { return cover_metadata; },
- "name": function() { return cover_name; },
- "settings": function() { return cover_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js
- var embed_namespaceObject = {};
- __webpack_require__.r(embed_namespaceObject);
- __webpack_require__.d(embed_namespaceObject, {
- "metadata": function() { return embed_metadata; },
- "name": function() { return embed_name; },
- "settings": function() { return embed_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js
- var build_module_file_namespaceObject = {};
- __webpack_require__.r(build_module_file_namespaceObject);
- __webpack_require__.d(build_module_file_namespaceObject, {
- "metadata": function() { return file_metadata; },
- "name": function() { return file_name; },
- "settings": function() { return file_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js
- var build_module_gallery_namespaceObject = {};
- __webpack_require__.r(build_module_gallery_namespaceObject);
- __webpack_require__.d(build_module_gallery_namespaceObject, {
- "metadata": function() { return gallery_metadata; },
- "name": function() { return gallery_name; },
- "settings": function() { return gallery_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js
- var build_module_group_namespaceObject = {};
- __webpack_require__.r(build_module_group_namespaceObject);
- __webpack_require__.d(build_module_group_namespaceObject, {
- "metadata": function() { return group_metadata; },
- "name": function() { return group_name; },
- "settings": function() { return group_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js
- var build_module_heading_namespaceObject = {};
- __webpack_require__.r(build_module_heading_namespaceObject);
- __webpack_require__.d(build_module_heading_namespaceObject, {
- "metadata": function() { return heading_metadata; },
- "name": function() { return heading_name; },
- "settings": function() { return heading_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/home-link/index.js
- var home_link_namespaceObject = {};
- __webpack_require__.r(home_link_namespaceObject);
- __webpack_require__.d(home_link_namespaceObject, {
- "metadata": function() { return home_link_metadata; },
- "name": function() { return home_link_name; },
- "settings": function() { return home_link_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js
- var build_module_html_namespaceObject = {};
- __webpack_require__.r(build_module_html_namespaceObject);
- __webpack_require__.d(build_module_html_namespaceObject, {
- "metadata": function() { return html_metadata; },
- "name": function() { return html_name; },
- "settings": function() { return html_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js
- var build_module_image_namespaceObject = {};
- __webpack_require__.r(build_module_image_namespaceObject);
- __webpack_require__.d(build_module_image_namespaceObject, {
- "metadata": function() { return image_metadata; },
- "name": function() { return image_name; },
- "settings": function() { return image_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
- var latest_comments_namespaceObject = {};
- __webpack_require__.r(latest_comments_namespaceObject);
- __webpack_require__.d(latest_comments_namespaceObject, {
- "metadata": function() { return latest_comments_metadata; },
- "name": function() { return latest_comments_name; },
- "settings": function() { return latest_comments_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
- var latest_posts_namespaceObject = {};
- __webpack_require__.r(latest_posts_namespaceObject);
- __webpack_require__.d(latest_posts_namespaceObject, {
- "metadata": function() { return latest_posts_metadata; },
- "name": function() { return latest_posts_name; },
- "settings": function() { return latest_posts_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js
- var build_module_list_namespaceObject = {};
- __webpack_require__.r(build_module_list_namespaceObject);
- __webpack_require__.d(build_module_list_namespaceObject, {
- "metadata": function() { return list_metadata; },
- "name": function() { return list_name; },
- "settings": function() { return list_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
- var loginout_namespaceObject = {};
- __webpack_require__.r(loginout_namespaceObject);
- __webpack_require__.d(loginout_namespaceObject, {
- "metadata": function() { return loginout_metadata; },
- "name": function() { return loginout_name; },
- "settings": function() { return loginout_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
- var media_text_namespaceObject = {};
- __webpack_require__.r(media_text_namespaceObject);
- __webpack_require__.d(media_text_namespaceObject, {
- "metadata": function() { return media_text_metadata; },
- "name": function() { return media_text_name; },
- "settings": function() { return media_text_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js
- var missing_namespaceObject = {};
- __webpack_require__.r(missing_namespaceObject);
- __webpack_require__.d(missing_namespaceObject, {
- "metadata": function() { return missing_metadata; },
- "name": function() { return missing_name; },
- "settings": function() { return missing_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js
- var build_module_more_namespaceObject = {};
- __webpack_require__.r(build_module_more_namespaceObject);
- __webpack_require__.d(build_module_more_namespaceObject, {
- "metadata": function() { return more_metadata; },
- "name": function() { return more_name; },
- "settings": function() { return more_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
- var build_module_navigation_namespaceObject = {};
- __webpack_require__.r(build_module_navigation_namespaceObject);
- __webpack_require__.d(build_module_navigation_namespaceObject, {
- "metadata": function() { return navigation_metadata; },
- "name": function() { return navigation_name; },
- "settings": function() { return navigation_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
- var navigation_link_namespaceObject = {};
- __webpack_require__.r(navigation_link_namespaceObject);
- __webpack_require__.d(navigation_link_namespaceObject, {
- "metadata": function() { return navigation_link_metadata; },
- "name": function() { return navigation_link_name; },
- "settings": function() { return navigation_link_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
- var navigation_submenu_namespaceObject = {};
- __webpack_require__.r(navigation_submenu_namespaceObject);
- __webpack_require__.d(navigation_submenu_namespaceObject, {
- "metadata": function() { return navigation_submenu_metadata; },
- "name": function() { return navigation_submenu_name; },
- "settings": function() { return navigation_submenu_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
- var nextpage_namespaceObject = {};
- __webpack_require__.r(nextpage_namespaceObject);
- __webpack_require__.d(nextpage_namespaceObject, {
- "metadata": function() { return nextpage_metadata; },
- "name": function() { return nextpage_name; },
- "settings": function() { return nextpage_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
- var pattern_namespaceObject = {};
- __webpack_require__.r(pattern_namespaceObject);
- __webpack_require__.d(pattern_namespaceObject, {
- "metadata": function() { return pattern_metadata; },
- "name": function() { return pattern_name; },
- "settings": function() { return pattern_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
- var page_list_namespaceObject = {};
- __webpack_require__.r(page_list_namespaceObject);
- __webpack_require__.d(page_list_namespaceObject, {
- "metadata": function() { return page_list_metadata; },
- "name": function() { return page_list_name; },
- "settings": function() { return page_list_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
- var build_module_paragraph_namespaceObject = {};
- __webpack_require__.r(build_module_paragraph_namespaceObject);
- __webpack_require__.d(build_module_paragraph_namespaceObject, {
- "metadata": function() { return paragraph_metadata; },
- "name": function() { return paragraph_name; },
- "settings": function() { return paragraph_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
- var build_module_post_author_namespaceObject = {};
- __webpack_require__.r(build_module_post_author_namespaceObject);
- __webpack_require__.d(build_module_post_author_namespaceObject, {
- "metadata": function() { return post_author_metadata; },
- "name": function() { return post_author_name; },
- "settings": function() { return post_author_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js
- var post_author_biography_namespaceObject = {};
- __webpack_require__.r(post_author_biography_namespaceObject);
- __webpack_require__.d(post_author_biography_namespaceObject, {
- "metadata": function() { return post_author_biography_metadata; },
- "name": function() { return post_author_biography_name; },
- "settings": function() { return post_author_biography_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments/index.js
- var build_module_post_comments_namespaceObject = {};
- __webpack_require__.r(build_module_post_comments_namespaceObject);
- __webpack_require__.d(build_module_post_comments_namespaceObject, {
- "metadata": function() { return post_comments_metadata; },
- "name": function() { return post_comments_name; },
- "settings": function() { return post_comments_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js
- var build_module_post_comments_form_namespaceObject = {};
- __webpack_require__.r(build_module_post_comments_form_namespaceObject);
- __webpack_require__.d(build_module_post_comments_form_namespaceObject, {
- "metadata": function() { return post_comments_form_metadata; },
- "name": function() { return post_comments_form_name; },
- "settings": function() { return post_comments_form_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
- var build_module_post_content_namespaceObject = {};
- __webpack_require__.r(build_module_post_content_namespaceObject);
- __webpack_require__.d(build_module_post_content_namespaceObject, {
- "metadata": function() { return post_content_metadata; },
- "name": function() { return post_content_name; },
- "settings": function() { return post_content_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
- var build_module_post_date_namespaceObject = {};
- __webpack_require__.r(build_module_post_date_namespaceObject);
- __webpack_require__.d(build_module_post_date_namespaceObject, {
- "metadata": function() { return post_date_metadata; },
- "name": function() { return post_date_name; },
- "settings": function() { return post_date_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
- var build_module_post_excerpt_namespaceObject = {};
- __webpack_require__.r(build_module_post_excerpt_namespaceObject);
- __webpack_require__.d(build_module_post_excerpt_namespaceObject, {
- "metadata": function() { return post_excerpt_metadata; },
- "name": function() { return post_excerpt_name; },
- "settings": function() { return post_excerpt_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
- var build_module_post_featured_image_namespaceObject = {};
- __webpack_require__.r(build_module_post_featured_image_namespaceObject);
- __webpack_require__.d(build_module_post_featured_image_namespaceObject, {
- "metadata": function() { return post_featured_image_metadata; },
- "name": function() { return post_featured_image_name; },
- "settings": function() { return post_featured_image_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
- var post_navigation_link_namespaceObject = {};
- __webpack_require__.r(post_navigation_link_namespaceObject);
- __webpack_require__.d(post_navigation_link_namespaceObject, {
- "metadata": function() { return post_navigation_link_metadata; },
- "name": function() { return post_navigation_link_name; },
- "settings": function() { return post_navigation_link_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
- var post_template_namespaceObject = {};
- __webpack_require__.r(post_template_namespaceObject);
- __webpack_require__.d(post_template_namespaceObject, {
- "metadata": function() { return post_template_metadata; },
- "name": function() { return post_template_name; },
- "settings": function() { return post_template_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
- var build_module_post_terms_namespaceObject = {};
- __webpack_require__.r(build_module_post_terms_namespaceObject);
- __webpack_require__.d(build_module_post_terms_namespaceObject, {
- "metadata": function() { return post_terms_metadata; },
- "name": function() { return post_terms_name; },
- "settings": function() { return post_terms_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
- var build_module_post_title_namespaceObject = {};
- __webpack_require__.r(build_module_post_title_namespaceObject);
- __webpack_require__.d(build_module_post_title_namespaceObject, {
- "metadata": function() { return post_title_metadata; },
- "name": function() { return post_title_name; },
- "settings": function() { return post_title_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
- var build_module_preformatted_namespaceObject = {};
- __webpack_require__.r(build_module_preformatted_namespaceObject);
- __webpack_require__.d(build_module_preformatted_namespaceObject, {
- "metadata": function() { return preformatted_metadata; },
- "name": function() { return preformatted_name; },
- "settings": function() { return preformatted_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
- var build_module_pullquote_namespaceObject = {};
- __webpack_require__.r(build_module_pullquote_namespaceObject);
- __webpack_require__.d(build_module_pullquote_namespaceObject, {
- "metadata": function() { return pullquote_metadata; },
- "name": function() { return pullquote_name; },
- "settings": function() { return pullquote_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query/index.js
- var query_namespaceObject = {};
- __webpack_require__.r(query_namespaceObject);
- __webpack_require__.d(query_namespaceObject, {
- "metadata": function() { return query_metadata; },
- "name": function() { return query_name; },
- "settings": function() { return query_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js
- var query_no_results_namespaceObject = {};
- __webpack_require__.r(query_no_results_namespaceObject);
- __webpack_require__.d(query_no_results_namespaceObject, {
- "metadata": function() { return query_no_results_metadata; },
- "name": function() { return query_no_results_name; },
- "settings": function() { return query_no_results_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
- var build_module_query_pagination_namespaceObject = {};
- __webpack_require__.r(build_module_query_pagination_namespaceObject);
- __webpack_require__.d(build_module_query_pagination_namespaceObject, {
- "metadata": function() { return query_pagination_metadata; },
- "name": function() { return query_pagination_name; },
- "settings": function() { return query_pagination_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
- var build_module_query_pagination_next_namespaceObject = {};
- __webpack_require__.r(build_module_query_pagination_next_namespaceObject);
- __webpack_require__.d(build_module_query_pagination_next_namespaceObject, {
- "metadata": function() { return query_pagination_next_metadata; },
- "name": function() { return query_pagination_next_name; },
- "settings": function() { return query_pagination_next_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
- var build_module_query_pagination_numbers_namespaceObject = {};
- __webpack_require__.r(build_module_query_pagination_numbers_namespaceObject);
- __webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, {
- "metadata": function() { return query_pagination_numbers_metadata; },
- "name": function() { return query_pagination_numbers_name; },
- "settings": function() { return query_pagination_numbers_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
- var build_module_query_pagination_previous_namespaceObject = {};
- __webpack_require__.r(build_module_query_pagination_previous_namespaceObject);
- __webpack_require__.d(build_module_query_pagination_previous_namespaceObject, {
- "metadata": function() { return query_pagination_previous_metadata; },
- "name": function() { return query_pagination_previous_name; },
- "settings": function() { return query_pagination_previous_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
- var build_module_query_title_namespaceObject = {};
- __webpack_require__.r(build_module_query_title_namespaceObject);
- __webpack_require__.d(build_module_query_title_namespaceObject, {
- "metadata": function() { return query_title_metadata; },
- "name": function() { return query_title_name; },
- "settings": function() { return query_title_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js
- var build_module_quote_namespaceObject = {};
- __webpack_require__.r(build_module_quote_namespaceObject);
- __webpack_require__.d(build_module_quote_namespaceObject, {
- "metadata": function() { return quote_metadata; },
- "name": function() { return quote_name; },
- "settings": function() { return quote_settings; },
- "settingsV1": function() { return quote_settingsV1; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js
- var block_namespaceObject = {};
- __webpack_require__.r(block_namespaceObject);
- __webpack_require__.d(block_namespaceObject, {
- "metadata": function() { return block_metadata; },
- "name": function() { return block_name; },
- "settings": function() { return block_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/read-more/index.js
- var read_more_namespaceObject = {};
- __webpack_require__.r(read_more_namespaceObject);
- __webpack_require__.d(read_more_namespaceObject, {
- "metadata": function() { return read_more_metadata; },
- "name": function() { return read_more_name; },
- "settings": function() { return read_more_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js
- var build_module_rss_namespaceObject = {};
- __webpack_require__.r(build_module_rss_namespaceObject);
- __webpack_require__.d(build_module_rss_namespaceObject, {
- "metadata": function() { return rss_metadata; },
- "name": function() { return rss_name; },
- "settings": function() { return rss_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js
- var build_module_search_namespaceObject = {};
- __webpack_require__.r(build_module_search_namespaceObject);
- __webpack_require__.d(build_module_search_namespaceObject, {
- "metadata": function() { return search_metadata; },
- "name": function() { return search_name; },
- "settings": function() { return search_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js
- var build_module_separator_namespaceObject = {};
- __webpack_require__.r(build_module_separator_namespaceObject);
- __webpack_require__.d(build_module_separator_namespaceObject, {
- "metadata": function() { return separator_metadata; },
- "name": function() { return separator_name; },
- "settings": function() { return separator_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
- var build_module_shortcode_namespaceObject = {};
- __webpack_require__.r(build_module_shortcode_namespaceObject);
- __webpack_require__.d(build_module_shortcode_namespaceObject, {
- "metadata": function() { return shortcode_metadata; },
- "name": function() { return shortcode_name; },
- "settings": function() { return shortcode_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
- var build_module_site_logo_namespaceObject = {};
- __webpack_require__.r(build_module_site_logo_namespaceObject);
- __webpack_require__.d(build_module_site_logo_namespaceObject, {
- "metadata": function() { return site_logo_metadata; },
- "name": function() { return site_logo_name; },
- "settings": function() { return site_logo_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
- var site_tagline_namespaceObject = {};
- __webpack_require__.r(site_tagline_namespaceObject);
- __webpack_require__.d(site_tagline_namespaceObject, {
- "metadata": function() { return site_tagline_metadata; },
- "name": function() { return site_tagline_name; },
- "settings": function() { return site_tagline_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
- var site_title_namespaceObject = {};
- __webpack_require__.r(site_title_namespaceObject);
- __webpack_require__.d(site_title_namespaceObject, {
- "metadata": function() { return site_title_metadata; },
- "name": function() { return site_title_name; },
- "settings": function() { return site_title_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
- var social_link_namespaceObject = {};
- __webpack_require__.r(social_link_namespaceObject);
- __webpack_require__.d(social_link_namespaceObject, {
- "metadata": function() { return social_link_metadata; },
- "name": function() { return social_link_name; },
- "settings": function() { return social_link_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
- var social_links_namespaceObject = {};
- __webpack_require__.r(social_links_namespaceObject);
- __webpack_require__.d(social_links_namespaceObject, {
- "metadata": function() { return social_links_metadata; },
- "name": function() { return social_links_name; },
- "settings": function() { return social_links_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
- var spacer_namespaceObject = {};
- __webpack_require__.r(spacer_namespaceObject);
- __webpack_require__.d(spacer_namespaceObject, {
- "metadata": function() { return spacer_metadata; },
- "name": function() { return spacer_name; },
- "settings": function() { return spacer_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js
- var build_module_table_namespaceObject = {};
- __webpack_require__.r(build_module_table_namespaceObject);
- __webpack_require__.d(build_module_table_namespaceObject, {
- "metadata": function() { return table_metadata; },
- "name": function() { return table_name; },
- "settings": function() { return table_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
- var tag_cloud_namespaceObject = {};
- __webpack_require__.r(tag_cloud_namespaceObject);
- __webpack_require__.d(tag_cloud_namespaceObject, {
- "metadata": function() { return tag_cloud_metadata; },
- "name": function() { return tag_cloud_name; },
- "settings": function() { return tag_cloud_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
- var template_part_namespaceObject = {};
- __webpack_require__.r(template_part_namespaceObject);
- __webpack_require__.d(template_part_namespaceObject, {
- "metadata": function() { return template_part_metadata; },
- "name": function() { return template_part_name; },
- "settings": function() { return template_part_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
- var build_module_term_description_namespaceObject = {};
- __webpack_require__.r(build_module_term_description_namespaceObject);
- __webpack_require__.d(build_module_term_description_namespaceObject, {
- "metadata": function() { return term_description_metadata; },
- "name": function() { return term_description_name; },
- "settings": function() { return term_description_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
- var text_columns_namespaceObject = {};
- __webpack_require__.r(text_columns_namespaceObject);
- __webpack_require__.d(text_columns_namespaceObject, {
- "metadata": function() { return text_columns_metadata; },
- "name": function() { return text_columns_name; },
- "settings": function() { return text_columns_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js
- var build_module_verse_namespaceObject = {};
- __webpack_require__.r(build_module_verse_namespaceObject);
- __webpack_require__.d(build_module_verse_namespaceObject, {
- "metadata": function() { return verse_metadata; },
- "name": function() { return verse_name; },
- "settings": function() { return verse_settings; }
- });
- // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js
- var build_module_video_namespaceObject = {};
- __webpack_require__.r(build_module_video_namespaceObject);
- __webpack_require__.d(build_module_video_namespaceObject, {
- "metadata": function() { return video_metadata; },
- "name": function() { return video_name; },
- "settings": function() { return video_settings; }
- });
- ;// CONCATENATED MODULE: external ["wp","blocks"]
- var external_wp_blocks_namespaceObject = window["wp"]["blocks"];
- ;// CONCATENATED MODULE: external ["wp","element"]
- var external_wp_element_namespaceObject = window["wp"]["element"];
- ;// CONCATENATED MODULE: external ["wp","primitives"]
- var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js
- /**
- * WordPress dependencies
- */
- const archive = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var library_archive = (archive);
- ;// CONCATENATED MODULE: external ["wp","components"]
- var external_wp_components_namespaceObject = window["wp"]["components"];
- ;// CONCATENATED MODULE: external ["wp","i18n"]
- var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
- ;// CONCATENATED MODULE: external ["wp","blockEditor"]
- var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
- ;// CONCATENATED MODULE: external ["wp","serverSideRender"]
- var external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"];
- var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/edit.js
- /**
- * WordPress dependencies
- */
- function ArchivesEdit(_ref) {
- let {
- attributes,
- setAttributes
- } = _ref;
- const {
- showPostCounts,
- displayAsDropdown,
- type
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Archives settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'),
- checked: displayAsDropdown,
- onChange: () => setAttributes({
- displayAsDropdown: !displayAsDropdown
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
- checked: showPostCounts,
- onChange: () => setAttributes({
- showPostCounts: !showPostCounts
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Group by:'),
- options: [{
- label: (0,external_wp_i18n_namespaceObject.__)('Year'),
- value: 'yearly'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Month'),
- value: 'monthly'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Week'),
- value: 'weekly'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Day'),
- value: 'daily'
- }],
- value: type,
- onChange: value => setAttributes({
- type: value
- })
- }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
- block: "core/archives",
- attributes: attributes
- }))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/archives",
- title: "Archives",
- category: "widgets",
- description: "Display a date archive of your posts.",
- textdomain: "default",
- attributes: {
- displayAsDropdown: {
- type: "boolean",
- "default": false
- },
- showPostCounts: {
- type: "boolean",
- "default": false
- },
- type: {
- type: "string",
- "default": "monthly"
- }
- },
- supports: {
- align: true,
- html: false
- },
- editorStyle: "wp-block-archives-editor"
- };
- const {
- name: archives_name
- } = metadata;
- const settings = {
- icon: library_archive,
- example: {},
- edit: ArchivesEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js
- /**
- * WordPress dependencies
- */
- const commentAuthorAvatar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- fillRule: "evenodd",
- 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",
- clipRule: "evenodd"
- }));
- /* harmony default export */ var comment_author_avatar = (commentAuthorAvatar);
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
- function _extends() {
- _extends = Object.assign ? Object.assign.bind() : function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
- return target;
- };
- return _extends.apply(this, arguments);
- }
- // EXTERNAL MODULE: ./node_modules/classnames/index.js
- var classnames = __webpack_require__(4403);
- var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
- ;// CONCATENATED MODULE: external ["wp","url"]
- var external_wp_url_namespaceObject = window["wp"]["url"];
- ;// CONCATENATED MODULE: external ["wp","coreData"]
- var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
- ;// CONCATENATED MODULE: external ["wp","data"]
- var external_wp_data_namespaceObject = window["wp"]["data"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/hooks.js
- /**
- * WordPress dependencies
- */
- function getAvatarSizes(sizes) {
- const minSize = sizes ? sizes[0] : 24;
- const maxSize = sizes ? sizes[sizes.length - 1] : 96;
- const maxSizeBuffer = Math.floor(maxSize * 2.5);
- return {
- minSize,
- maxSize: maxSizeBuffer
- };
- }
- function useDefaultAvatar() {
- const {
- avatarURL: defaultAvatarUrl
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- const {
- __experimentalDiscussionSettings
- } = getSettings();
- return __experimentalDiscussionSettings;
- });
- return defaultAvatarUrl;
- }
- function useCommentAvatar(_ref) {
- let {
- commentId
- } = _ref;
- const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId);
- const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId);
- const avatarUrls = avatars ? Object.values(avatars) : null;
- const sizes = avatars ? Object.keys(avatars) : null;
- const {
- minSize,
- maxSize
- } = getAvatarSizes(sizes);
- const defaultAvatar = useDefaultAvatar();
- return {
- src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
- minSize,
- maxSize,
- // translators: %s is the Author name.
- alt: authorName ? // translators: %s is the Author name.
- (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorName) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar')
- };
- }
- function useUserAvatar(_ref2) {
- let {
- userId,
- postId,
- postType
- } = _ref2;
- const {
- authorDetails
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getEditedEntityRecor;
- const {
- getEditedEntityRecord,
- getUser
- } = select(external_wp_coreData_namespaceObject.store);
- if (userId) {
- return {
- authorDetails: getUser(userId)
- };
- }
- const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
- return {
- authorDetails: _authorId ? getUser(_authorId) : null
- };
- }, [postType, postId, userId]);
- const avatarUrls = authorDetails && authorDetails !== null && authorDetails !== void 0 && authorDetails.avatar_urls ? Object.values(authorDetails.avatar_urls) : null;
- const sizes = authorDetails && authorDetails !== null && authorDetails !== void 0 && authorDetails.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null;
- const {
- minSize,
- maxSize
- } = getAvatarSizes(sizes);
- const defaultAvatar = useDefaultAvatar();
- return {
- src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
- minSize,
- maxSize,
- alt: authorDetails ? // translators: %s is the Author name.
- (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar')
- };
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/user-control.js
- /**
- * WordPress dependencies
- */
- const AUTHORS_QUERY = {
- who: 'authors',
- per_page: -1,
- _fields: 'id,name',
- context: 'view'
- };
- function UserControl(_ref) {
- let {
- value,
- onChange
- } = _ref;
- const [filteredAuthorsList, setFilteredAuthorsList] = (0,external_wp_element_namespaceObject.useState)();
- const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getUsers
- } = select(external_wp_coreData_namespaceObject.store);
- return getUsers(AUTHORS_QUERY);
- }, []);
- if (!authorsList) {
- return null;
- }
- const options = authorsList.map(author => {
- return {
- label: author.name,
- value: author.id
- };
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ComboboxControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('User'),
- help: (0,external_wp_i18n_namespaceObject.__)('Select the avatar user to display, if it is blank it will use the post/page author.'),
- value: value,
- onChange: onChange,
- options: filteredAuthorsList || options,
- onFilterValueChange: inputValue => setFilteredAuthorsList(options.filter(option => option.label.toLowerCase().startsWith(inputValue.toLowerCase())))
- });
- }
- /* harmony default export */ var user_control = (UserControl);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const AvatarInspectorControls = _ref => {
- let {
- setAttributes,
- avatar,
- attributes,
- selectUser
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
- onChange: newSize => setAttributes({
- size: newSize
- }),
- min: avatar.minSize,
- max: avatar.maxSize,
- initialPosition: attributes === null || attributes === void 0 ? void 0 : attributes.size,
- value: attributes === null || attributes === void 0 ? void 0 : attributes.size
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Link to user profile'),
- onChange: () => setAttributes({
- isLink: !attributes.isLink
- }),
- checked: attributes.isLink
- }), attributes.isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
- onChange: value => setAttributes({
- linkTarget: value ? '_blank' : '_self'
- }),
- checked: attributes.linkTarget === '_blank'
- }), selectUser && (0,external_wp_element_namespaceObject.createElement)(user_control, {
- value: attributes === null || attributes === void 0 ? void 0 : attributes.userId,
- onChange: value => {
- setAttributes({
- userId: value
- });
- }
- })));
- };
- const ResizableAvatar = _ref2 => {
- let {
- setAttributes,
- attributes,
- avatar,
- blockProps,
- isSelected
- } = _ref2;
- const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
- const doubledSizedSrc = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(avatar === null || avatar === void 0 ? void 0 : avatar.src, ['s']), {
- s: (attributes === null || attributes === void 0 ? void 0 : attributes.size) * 2
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
- size: {
- width: attributes.size,
- height: attributes.size
- },
- showHandle: isSelected,
- onResizeStop: (event, direction, elt, delta) => {
- setAttributes({
- size: parseInt(attributes.size + (delta.height || delta.width), 10)
- });
- },
- lockAspectRatio: true,
- enable: {
- top: false,
- right: !(0,external_wp_i18n_namespaceObject.isRTL)(),
- bottom: true,
- left: (0,external_wp_i18n_namespaceObject.isRTL)()
- },
- minWidth: avatar.minSize,
- maxWidth: avatar.maxSize
- }, (0,external_wp_element_namespaceObject.createElement)("img", _extends({
- src: doubledSizedSrc,
- alt: avatar.alt
- }, borderProps, {
- className: classnames_default()('avatar', 'avatar-' + attributes.size, 'photo', 'wp-block-avatar__image', borderProps.className),
- style: { ...borderProps.style // Border radius, width and style.
- }
- }))));
- };
- const CommentEdit = _ref3 => {
- let {
- attributes,
- context,
- setAttributes,
- isSelected
- } = _ref3;
- const {
- commentId
- } = context;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const avatar = useCommentAvatar({
- commentId
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AvatarInspectorControls, {
- avatar: avatar,
- setAttributes: setAttributes,
- attributes: attributes,
- selectUser: false
- }), attributes.isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#avatar-pseudo-link",
- className: "wp-block-avatar__link",
- onClick: event => event.preventDefault()
- }, (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
- attributes: attributes,
- avatar: avatar,
- blockProps: blockProps,
- isSelected: isSelected,
- setAttributes: setAttributes
- })) : (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
- attributes: attributes,
- avatar: avatar,
- blockProps: blockProps,
- isSelected: isSelected,
- setAttributes: setAttributes
- }));
- };
- const UserEdit = _ref4 => {
- let {
- attributes,
- context,
- setAttributes,
- isSelected
- } = _ref4;
- const {
- postId,
- postType
- } = context;
- const avatar = useUserAvatar({
- userId: attributes === null || attributes === void 0 ? void 0 : attributes.userId,
- postId,
- postType
- });
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AvatarInspectorControls, {
- selectUser: true,
- attributes: attributes,
- avatar: avatar,
- setAttributes: setAttributes
- }), (0,external_wp_element_namespaceObject.createElement)("div", null, attributes.isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#avatar-pseudo-link",
- className: "wp-block-avatar__link",
- onClick: event => event.preventDefault()
- }, (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
- attributes: attributes,
- avatar: avatar,
- blockProps: blockProps,
- isSelected: isSelected,
- setAttributes: setAttributes
- })) : (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
- attributes: attributes,
- avatar: avatar,
- blockProps: blockProps,
- isSelected: isSelected,
- setAttributes: setAttributes
- })));
- };
- function Edit(props) {
- var _props$context, _props$context2;
- // Don't show the Comment Edit controls if we have a comment ID set, or if we're in the Site Editor (where it is `null`).
- if (props !== null && props !== void 0 && (_props$context = props.context) !== null && _props$context !== void 0 && _props$context.commentId || (props === null || props === void 0 ? void 0 : (_props$context2 = props.context) === null || _props$context2 === void 0 ? void 0 : _props$context2.commentId) === null) {
- return (0,external_wp_element_namespaceObject.createElement)(CommentEdit, props);
- }
- return (0,external_wp_element_namespaceObject.createElement)(UserEdit, props);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const avatar_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/avatar",
- title: "Avatar",
- category: "theme",
- description: "Add a user's avatar.",
- textdomain: "default",
- attributes: {
- userId: {
- type: "number"
- },
- size: {
- type: "number",
- "default": 96
- },
- isLink: {
- type: "boolean",
- "default": false
- },
- linkTarget: {
- type: "string",
- "default": "_self"
- }
- },
- usesContext: ["postType", "postId", "commentId"],
- supports: {
- html: false,
- align: true,
- alignWide: false,
- spacing: {
- margin: true
- },
- __experimentalBorder: {
- __experimentalSkipSerialization: true,
- radius: true,
- width: true,
- color: true,
- style: true,
- __experimentalDefaultControls: {
- radius: true
- }
- },
- color: {
- text: false,
- background: false,
- __experimentalDuotone: "img"
- }
- },
- editorStyle: "wp-block-avatar",
- style: "wp-block-avatar"
- };
- const {
- name: avatar_name
- } = avatar_metadata;
- const avatar_settings = {
- icon: comment_author_avatar,
- edit: Edit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/audio.js
- /**
- * WordPress dependencies
- */
- const audio = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"
- }));
- /* harmony default export */ var library_audio = (audio);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js
- /**
- * WordPress dependencies
- */
- /* harmony default export */ var deprecated = ([{
- attributes: {
- src: {
- type: 'string',
- source: 'attribute',
- selector: 'audio',
- attribute: 'src'
- },
- caption: {
- type: 'string',
- source: 'html',
- selector: 'figcaption'
- },
- id: {
- type: 'number'
- },
- autoplay: {
- type: 'boolean',
- source: 'attribute',
- selector: 'audio',
- attribute: 'autoplay'
- },
- loop: {
- type: 'boolean',
- source: 'attribute',
- selector: 'audio',
- attribute: 'loop'
- },
- preload: {
- type: 'string',
- source: 'attribute',
- selector: 'audio',
- attribute: 'preload'
- }
- },
- supports: {
- align: true
- },
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- autoplay,
- caption,
- loop,
- preload,
- src
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("figure", null, (0,external_wp_element_namespaceObject.createElement)("audio", {
- controls: "controls",
- src: src,
- autoPlay: autoplay,
- loop: loop,
- preload: preload
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- }
- }]);
- ;// CONCATENATED MODULE: external ["wp","blob"]
- var external_wp_blob_namespaceObject = window["wp"]["blob"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js
- const ASPECT_RATIOS = [// Common video resolutions.
- {
- ratio: '2.33',
- className: 'wp-embed-aspect-21-9'
- }, {
- ratio: '2.00',
- className: 'wp-embed-aspect-18-9'
- }, {
- ratio: '1.78',
- className: 'wp-embed-aspect-16-9'
- }, {
- ratio: '1.33',
- className: 'wp-embed-aspect-4-3'
- }, // Vertical video and instagram square video support.
- {
- ratio: '1.00',
- className: 'wp-embed-aspect-1-1'
- }, {
- ratio: '0.56',
- className: 'wp-embed-aspect-9-16'
- }, {
- ratio: '0.50',
- className: 'wp-embed-aspect-1-2'
- }];
- const WP_EMBED_TYPE = 'wp-embed';
- ;// CONCATENATED MODULE: external "lodash"
- var external_lodash_namespaceObject = window["lodash"];
- // EXTERNAL MODULE: ./node_modules/classnames/dedupe.js
- var dedupe = __webpack_require__(3827);
- var dedupe_default = /*#__PURE__*/__webpack_require__.n(dedupe);
- // EXTERNAL MODULE: ./node_modules/memize/index.js
- var memize = __webpack_require__(9756);
- var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js
- /**
- * Internal dependencies
- */
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const util_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/embed",
- title: "Embed",
- category: "embed",
- description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
- textdomain: "default",
- attributes: {
- url: {
- type: "string"
- },
- caption: {
- type: "string",
- source: "html",
- selector: "figcaption"
- },
- type: {
- type: "string"
- },
- providerNameSlug: {
- type: "string"
- },
- allowResponsive: {
- type: "boolean",
- "default": true
- },
- responsive: {
- type: "boolean",
- "default": false
- },
- previewable: {
- type: "boolean",
- "default": true
- }
- },
- supports: {
- align: true
- },
- editorStyle: "wp-block-embed-editor",
- style: "wp-block-embed"
- };
- const {
- name: DEFAULT_EMBED_BLOCK
- } = util_metadata;
- /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
- /**
- * Returns the embed block's information by matching the provided service provider
- *
- * @param {string} provider The embed block's provider
- * @return {WPBlockVariation} The embed block's information
- */
- const getEmbedInfoByProvider = provider => {
- var _getBlockVariations;
- return (_getBlockVariations = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(_ref => {
- let {
- name
- } = _ref;
- return name === provider;
- });
- };
- /**
- * Returns true if any of the regular expressions match the URL.
- *
- * @param {string} url The URL to test.
- * @param {Array} patterns The list of regular expressions to test agains.
- * @return {boolean} True if any of the regular expressions match the URL.
- */
- const matchesPatterns = function (url) {
- let patterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- return patterns.some(pattern => url.match(pattern));
- };
- /**
- * Finds the block variation that should be used for the URL,
- * based on the provided URL and the variation's patterns.
- *
- * @param {string} url The URL to test.
- * @return {WPBlockVariation} The block variation that should be used for this URL
- */
- const findMoreSuitableBlock = url => {
- var _getBlockVariations2;
- return (_getBlockVariations2 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(_ref2 => {
- let {
- patterns
- } = _ref2;
- return matchesPatterns(url, patterns);
- });
- };
- const isFromWordPress = html => html && html.includes('class="wp-embedded-content"');
- const getPhotoHtml = photo => {
- // 100% width for the preview so it fits nicely into the document, some "thumbnails" are
- // actually the full size photo. If thumbnails not found, use full image.
- const imageUrl = photo.thumbnail_url || photo.url;
- const photoPreview = (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("img", {
- src: imageUrl,
- alt: photo.title,
- width: "100%"
- }));
- return (0,external_wp_element_namespaceObject.renderToString)(photoPreview);
- };
- /**
- * Creates a more suitable embed block based on the passed in props
- * and attributes generated from an embed block's preview.
- *
- * We require `attributesFromPreview` to be generated from the latest attributes
- * and preview, and because of the way the react lifecycle operates, we can't
- * guarantee that the attributes contained in the block's props are the latest
- * versions, so we require that these are generated separately.
- * See `getAttributesFromPreview` in the generated embed edit component.
- *
- * @param {Object} props The block's props.
- * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview.
- * @return {Object|undefined} A more suitable embed block if one exists.
- */
- const createUpgradedEmbedBlock = function (props) {
- var _getBlockVariations3;
- let attributesFromPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- const {
- preview,
- attributes = {}
- } = props;
- const {
- url,
- providerNameSlug,
- type,
- ...restAttributes
- } = attributes;
- if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) return;
- const matchedBlock = findMoreSuitableBlock(url); // WordPress blocks can work on multiple sites, and so don't have patterns,
- // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.
- const isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; // If current block is not WordPress and a more suitable block found
- // that is different from the current one, create the new matched block.
- const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug);
- if (shouldCreateNewBlock) {
- return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
- url,
- ...restAttributes,
- ...matchedBlock.attributes
- });
- }
- const wpVariation = (_getBlockVariations3 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(_ref3 => {
- let {
- name
- } = _ref3;
- return name === 'wordpress';
- }); // We can't match the URL for WordPress embeds, we have to check the HTML instead.
- if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) {
- return;
- } // This is not the WordPress embed block so transform it into one.
- return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
- url,
- ...wpVariation.attributes,
- // By now we have the preview, but when the new block first renders, it
- // won't have had all the attributes set, and so won't get the correct
- // type and it won't render correctly. So, we pass through the current attributes
- // here so that the initial render works when we switch to the WordPress
- // block. This only affects the WordPress block because it can't be
- // rendered in the usual Sandbox (it has a sandbox of its own) and it
- // relies on the preview to set the correct render type.
- ...attributesFromPreview
- });
- };
- /**
- * Removes all previously set aspect ratio related classes and return the rest
- * existing class names.
- *
- * @param {string} existingClassNames Any existing class names.
- * @return {string} The class names without any aspect ratio related class.
- */
- const removeAspectRatioClasses = existingClassNames => {
- if (!existingClassNames) {
- // Avoids extraneous work and also, by returning the same value as
- // received, ensures the post is not dirtied by a change of the block
- // attribute from `undefined` to an emtpy string.
- return existingClassNames;
- }
- const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, _ref4) => {
- let {
- className
- } = _ref4;
- accumulator[className] = false;
- return accumulator;
- }, {
- 'wp-has-aspect-ratio': false
- });
- return dedupe_default()(existingClassNames, aspectRatioClassNames);
- };
- /**
- * Returns class names with any relevant responsive aspect ratio names.
- *
- * @param {string} html The preview HTML that possibly contains an iframe with width and height set.
- * @param {string} existingClassNames Any existing class names.
- * @param {boolean} allowResponsive If the responsive class names should be added, or removed.
- * @return {string} Deduped class names.
- */
- function getClassNames(html, existingClassNames) {
- let allowResponsive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
- if (!allowResponsive) {
- return removeAspectRatioClasses(existingClassNames);
- }
- const previewDocument = document.implementation.createHTMLDocument('');
- previewDocument.body.innerHTML = html;
- const iframe = previewDocument.body.querySelector('iframe'); // If we have a fixed aspect iframe, and it's a responsive embed block.
- if (iframe && iframe.height && iframe.width) {
- const aspectRatio = (iframe.width / iframe.height).toFixed(2); // Given the actual aspect ratio, find the widest ratio to support it.
- for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) {
- const potentialRatio = ASPECT_RATIOS[ratioIndex];
- if (aspectRatio >= potentialRatio.ratio) {
- // Evaluate the difference between actual aspect ratio and closest match.
- // If the difference is too big, do not scale the embed according to aspect ratio.
- const ratioDiff = aspectRatio - potentialRatio.ratio;
- if (ratioDiff > 0.1) {
- // No close aspect ratio match found.
- return removeAspectRatioClasses(existingClassNames);
- } // Close aspect ratio match found.
- return dedupe_default()(removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio');
- }
- }
- }
- return existingClassNames;
- }
- /**
- * Fallback behaviour for unembeddable URLs.
- * Creates a paragraph block containing a link to the URL, and calls `onReplace`.
- *
- * @param {string} url The URL that could not be embedded.
- * @param {Function} onReplace Function to call with the created fallback block.
- */
- function fallback(url, onReplace) {
- const link = (0,external_wp_element_namespaceObject.createElement)("a", {
- href: url
- }, url);
- onReplace((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: (0,external_wp_element_namespaceObject.renderToString)(link)
- }));
- }
- /***
- * Gets block attributes based on the preview and responsive state.
- *
- * @param {Object} preview The preview data.
- * @param {string} title The block's title, e.g. Twitter.
- * @param {Object} currentClassNames The block's current class names.
- * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.
- * @param {boolean} allowResponsive Apply responsive classes to fixed size content.
- * @return {Object} Attributes and values.
- */
- const getAttributesFromPreview = memize_default()(function (preview, title, currentClassNames, isResponsive) {
- let allowResponsive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
- if (!preview) {
- return {};
- }
- const attributes = {}; // Some plugins only return HTML with no type info, so default this to 'rich'.
- let {
- type = 'rich'
- } = preview; // If we got a provider name from the API, use it for the slug, otherwise we use the title,
- // because not all embed code gives us a provider name.
- const {
- html,
- provider_name: providerName
- } = preview;
- const providerNameSlug = (0,external_lodash_namespaceObject.kebabCase)((providerName || title).toLowerCase());
- if (isFromWordPress(html)) {
- type = WP_EMBED_TYPE;
- }
- if (html || 'photo' === type) {
- attributes.type = type;
- attributes.providerNameSlug = providerNameSlug;
- }
- attributes.className = getClassNames(html, currentClassNames, isResponsive && allowResponsive);
- return attributes;
- });
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const ALLOWED_MEDIA_TYPES = ['audio'];
- function AudioEdit(_ref) {
- let {
- attributes,
- className,
- noticeOperations,
- setAttributes,
- onReplace,
- isSelected,
- noticeUI,
- insertBlocksAfter
- } = _ref;
- const {
- id,
- autoplay,
- caption,
- loop,
- preload,
- src
- } = attributes;
- const isTemporaryAudio = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src);
- const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- return getSettings().mediaUpload;
- }, []);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) {
- const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src);
- if (file) {
- mediaUpload({
- filesList: [file],
- onFileChange: _ref2 => {
- let [{
- id: mediaId,
- url
- }] = _ref2;
- setAttributes({
- id: mediaId,
- src: url
- });
- },
- onError: e => {
- setAttributes({
- src: undefined,
- id: undefined
- });
- noticeOperations.createErrorNotice(e);
- },
- allowedTypes: ALLOWED_MEDIA_TYPES
- });
- }
- }
- }, []);
- function toggleAttribute(attribute) {
- return newValue => {
- setAttributes({
- [attribute]: newValue
- });
- };
- }
- function onSelectURL(newSrc) {
- // Set the block's src from the edit component's state, and switch off
- // the editing UI.
- if (newSrc !== src) {
- // Check if there's an embed block that handles this URL.
- const embedBlock = createUpgradedEmbedBlock({
- attributes: {
- url: newSrc
- }
- });
- if (undefined !== embedBlock && onReplace) {
- onReplace(embedBlock);
- return;
- }
- setAttributes({
- src: newSrc,
- id: undefined
- });
- }
- }
- function onUploadError(message) {
- noticeOperations.removeAllNotices();
- noticeOperations.createErrorNotice(message);
- }
- function getAutoplayHelp(checked) {
- return checked ? (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.') : null;
- }
- function onSelectAudio(media) {
- if (!media || !media.url) {
- // In this case there was an error and we should continue in the editing state
- // previous attributes should be removed because they may be temporary blob urls.
- setAttributes({
- src: undefined,
- id: undefined
- });
- return;
- } // Sets the block's attribute and updates the edit component from the
- // selected media, then switches off the editing UI.
- setAttributes({
- src: media.url,
- id: media.id
- });
- }
- const classes = classnames_default()(className, {
- 'is-transient': isTemporaryAudio
- });
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classes
- });
- if (!src) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: library_audio
- }),
- onSelect: onSelectAudio,
- onSelectURL: onSelectURL,
- accept: "audio/*",
- allowedTypes: ALLOWED_MEDIA_TYPES,
- value: attributes,
- notices: noticeUI,
- onError: onUploadError
- }));
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
- mediaId: id,
- mediaURL: src,
- allowedTypes: ALLOWED_MEDIA_TYPES,
- accept: "audio/*",
- onSelect: onSelectAudio,
- onSelectURL: onSelectURL,
- onError: onUploadError
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Audio settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'),
- onChange: toggleAttribute('autoplay'),
- checked: autoplay,
- help: getAutoplayHelp
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Loop'),
- onChange: toggleAttribute('loop'),
- checked: loop
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'),
- value: preload || '' // `undefined` is required for the preload attribute to be unset.
- ,
- onChange: value => setAttributes({
- preload: value || undefined
- }),
- options: [{
- value: '',
- label: (0,external_wp_i18n_namespaceObject.__)('Browser default')
- }, {
- value: 'auto',
- label: (0,external_wp_i18n_namespaceObject.__)('Auto')
- }, {
- value: 'metadata',
- label: (0,external_wp_i18n_namespaceObject.__)('Metadata')
- }, {
- value: 'none',
- label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value')
- }]
- }))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
- isDisabled: !isSelected
- }, (0,external_wp_element_namespaceObject.createElement)("audio", {
- controls: "controls",
- src: src
- })), isTemporaryAudio && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: "figcaption",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Audio caption text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
- value: caption,
- onChange: value => setAttributes({
- caption: value
- }),
- inlineToolbar: true,
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
- })));
- }
- /* harmony default export */ var edit = ((0,external_wp_components_namespaceObject.withNotices)(AudioEdit));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/save.js
- /**
- * WordPress dependencies
- */
- function save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- autoplay,
- caption,
- loop,
- preload,
- src
- } = attributes;
- return src && (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("audio", {
- controls: "controls",
- src: src,
- autoPlay: autoplay,
- loop: loop,
- preload: preload
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/transforms.js
- /**
- * WordPress dependencies
- */
- const transforms = {
- from: [{
- type: 'files',
- isMatch(files) {
- return files.length === 1 && files[0].type.indexOf('audio/') === 0;
- },
- transform(files) {
- const file = files[0]; // We don't need to upload the media directly here
- // It's already done as part of the `componentDidMount`
- // in the audio block.
- const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', {
- src: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
- });
- return block;
- }
- }, {
- type: 'shortcode',
- tag: 'audio',
- attributes: {
- src: {
- type: 'string',
- shortcode: _ref => {
- let {
- named: {
- src,
- mp3,
- m4a,
- ogg,
- wav,
- wma
- }
- } = _ref;
- return src || mp3 || m4a || ogg || wav || wma;
- }
- },
- loop: {
- type: 'string',
- shortcode: _ref2 => {
- let {
- named: {
- loop
- }
- } = _ref2;
- return loop;
- }
- },
- autoplay: {
- type: 'string',
- shortcode: _ref3 => {
- let {
- named: {
- autoplay
- }
- } = _ref3;
- return autoplay;
- }
- },
- preload: {
- type: 'string',
- shortcode: _ref4 => {
- let {
- named: {
- preload
- }
- } = _ref4;
- return preload;
- }
- }
- }
- }]
- };
- /* harmony default export */ var audio_transforms = (transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const audio_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/audio",
- title: "Audio",
- category: "media",
- description: "Embed a simple audio player.",
- keywords: ["music", "sound", "podcast", "recording"],
- textdomain: "default",
- attributes: {
- src: {
- type: "string",
- source: "attribute",
- selector: "audio",
- attribute: "src"
- },
- caption: {
- type: "string",
- source: "html",
- selector: "figcaption"
- },
- id: {
- type: "number"
- },
- autoplay: {
- type: "boolean",
- source: "attribute",
- selector: "audio",
- attribute: "autoplay"
- },
- loop: {
- type: "boolean",
- source: "attribute",
- selector: "audio",
- attribute: "loop"
- },
- preload: {
- type: "string",
- source: "attribute",
- selector: "audio",
- attribute: "preload"
- }
- },
- supports: {
- anchor: true,
- align: true
- },
- editorStyle: "wp-block-audio-editor",
- style: "wp-block-audio"
- };
- const {
- name: audio_name
- } = audio_metadata;
- const audio_settings = {
- icon: library_audio,
- example: {
- attributes: {
- src: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg'
- }
- },
- transforms: audio_transforms,
- deprecated: deprecated,
- edit: edit,
- save: save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js
- /**
- * WordPress dependencies
- */
- const button_button = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"
- }));
- /* harmony default export */ var library_button = (button_button);
- ;// CONCATENATED MODULE: external ["wp","compose"]
- var external_wp_compose_namespaceObject = window["wp"]["compose"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/clean-empty-object.js
- /**
- * External dependencies
- */
- /**
- * Removed empty nodes from nested objects.
- *
- * @param {Object} object
- * @return {Object} Object cleaned from empty nodes.
- */
- const cleanEmptyObject = object => {
- if (!(0,external_lodash_namespaceObject.isObject)(object) || Array.isArray(object)) {
- return object;
- }
- const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity);
- return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
- };
- /* harmony default export */ var clean_empty_object = (cleanEmptyObject);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js
- /**
- * External dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Migrates the current style.typography.fontFamily attribute,
- * whose value was "var:preset|font-family|helvetica-arial",
- * to the style.fontFamily attribute, whose value will be "helvetica-arial".
- *
- * @param {Object} attributes The current attributes
- * @return {Object} The updated attributes.
- */
- /* harmony default export */ function migrate_font_family(attributes) {
- var _attributes$style, _attributes$style$typ;
- if (!(attributes !== null && attributes !== void 0 && (_attributes$style = attributes.style) !== null && _attributes$style !== void 0 && (_attributes$style$typ = _attributes$style.typography) !== null && _attributes$style$typ !== void 0 && _attributes$style$typ.fontFamily)) {
- return attributes;
- } // Clone first so when we delete the fontFamily
- // below we're not modifying the original
- // attributes. Because the deprecation may be discarded
- // we don't want to alter the original attributes.
- const atts = (0,external_lodash_namespaceObject.cloneDeep)(attributes);
- const fontFamily = atts.style.typography.fontFamily.split('|').pop();
- delete atts.style.typography.fontFamily;
- atts.style = clean_empty_object(atts.style);
- return { ...atts,
- fontFamily
- };
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const migrateBorderRadius = attributes => {
- var _newAttributes$style, _newAttributes$style$, _newAttributes$style2;
- const {
- borderRadius,
- ...newAttributes
- } = attributes; // We have to check old property `borderRadius` and if
- // `styles.border.radius` is a `number`
- const oldBorderRadius = [borderRadius, (_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : (_newAttributes$style$ = _newAttributes$style.border) === null || _newAttributes$style$ === void 0 ? void 0 : _newAttributes$style$.radius].find(possibleBorderRadius => {
- return typeof possibleBorderRadius === 'number' && possibleBorderRadius !== 0;
- });
- if (!oldBorderRadius) {
- return newAttributes;
- }
- return { ...newAttributes,
- style: { ...newAttributes.style,
- border: { ...((_newAttributes$style2 = newAttributes.style) === null || _newAttributes$style2 === void 0 ? void 0 : _newAttributes$style2.border),
- radius: `${oldBorderRadius}px`
- }
- }
- };
- };
- const migrateCustomColorsAndGradients = attributes => {
- if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customGradient) {
- return attributes;
- }
- const style = {
- color: {}
- };
- if (attributes.customTextColor) {
- style.color.text = attributes.customTextColor;
- }
- if (attributes.customBackgroundColor) {
- style.color.background = attributes.customBackgroundColor;
- }
- if (attributes.customGradient) {
- style.color.gradient = attributes.customGradient;
- }
- return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor', 'customGradient']),
- style
- };
- };
- const oldColorsMigration = attributes => {
- return migrateCustomColorsAndGradients((0,external_lodash_namespaceObject.omit)({ ...attributes,
- customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
- customBackgroundColor: attributes.color && '#' === attributes.color[0] ? attributes.color : undefined
- }, ['color', 'textColor']));
- };
- const blockAttributes = {
- url: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'href'
- },
- title: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'title'
- },
- text: {
- type: 'string',
- source: 'html',
- selector: 'a'
- }
- };
- const v10 = {
- attributes: {
- url: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'href'
- },
- title: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'title'
- },
- text: {
- type: 'string',
- source: 'html',
- selector: 'a'
- },
- linkTarget: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'target'
- },
- rel: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'rel'
- },
- placeholder: {
- type: 'string'
- },
- backgroundColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- gradient: {
- type: 'string'
- },
- width: {
- type: 'number'
- }
- },
- supports: {
- anchor: true,
- align: true,
- alignWide: false,
- color: {
- __experimentalSkipSerialization: true,
- gradients: true
- },
- typography: {
- fontSize: true,
- __experimentalFontFamily: true
- },
- reusable: false,
- spacing: {
- __experimentalSkipSerialization: true,
- padding: ['horizontal', 'vertical'],
- __experimentalDefaultControls: {
- padding: true
- }
- },
- __experimentalBorder: {
- radius: true,
- __experimentalSkipSerialization: true
- },
- __experimentalSelector: '.wp-block-button__link'
- },
- save(_ref) {
- var _style$border, _style$typography;
- let {
- attributes,
- className
- } = _ref;
- const {
- fontSize,
- linkTarget,
- rel,
- style,
- text,
- title,
- url,
- width
- } = attributes;
- if (!text) {
- return null;
- }
- const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
- const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
- const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, {
- // For backwards compatibility add style that isn't provided via
- // block support.
- 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
- });
- const buttonStyle = { ...borderProps.style,
- ...colorProps.style,
- ...spacingProps.style
- }; // The use of a `title` attribute here is soft-deprecated, but still applied
- // if it had already been assigned, for the sake of backward-compatibility.
- // A title will no longer be assigned for new or updated button block links.
- const wrapperClasses = classnames_default()(className, {
- [`has-custom-width wp-block-button__width-${width}`]: width,
- [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize)
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: wrapperClasses
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- className: buttonClasses,
- href: url,
- title: title,
- style: buttonStyle,
- value: text,
- target: linkTarget,
- rel: rel
- }));
- },
- migrate: migrate_font_family,
- isEligible(_ref2) {
- var _style$typography2;
- let {
- style
- } = _ref2;
- return style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontFamily;
- }
- };
- const deprecated_deprecated = [v10, {
- supports: {
- anchor: true,
- align: true,
- alignWide: false,
- color: {
- __experimentalSkipSerialization: true,
- gradients: true
- },
- typography: {
- fontSize: true,
- __experimentalFontFamily: true
- },
- reusable: false,
- __experimentalSelector: '.wp-block-button__link'
- },
- attributes: { ...blockAttributes,
- linkTarget: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'target'
- },
- rel: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'rel'
- },
- placeholder: {
- type: 'string'
- },
- backgroundColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- gradient: {
- type: 'string'
- },
- width: {
- type: 'number'
- }
- },
- isEligible(_ref3) {
- var _style$border2;
- let {
- style
- } = _ref3;
- return typeof (style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.radius) === 'number';
- },
- save(_ref4) {
- var _style$border3, _style$border4, _style$typography3;
- let {
- attributes,
- className
- } = _ref4;
- const {
- fontSize,
- linkTarget,
- rel,
- style,
- text,
- title,
- url,
- width
- } = attributes;
- if (!text) {
- return null;
- }
- const borderRadius = style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.radius;
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
- const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
- 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border4 = style.border) === null || _style$border4 === void 0 ? void 0 : _style$border4.radius) === 0
- });
- const buttonStyle = {
- borderRadius: borderRadius ? borderRadius : undefined,
- ...colorProps.style
- }; // The use of a `title` attribute here is soft-deprecated, but still applied
- // if it had already been assigned, for the sake of backward-compatibility.
- // A title will no longer be assigned for new or updated button block links.
- const wrapperClasses = classnames_default()(className, {
- [`has-custom-width wp-block-button__width-${width}`]: width,
- [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography3 = style.typography) === null || _style$typography3 === void 0 ? void 0 : _style$typography3.fontSize)
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: wrapperClasses
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- className: buttonClasses,
- href: url,
- title: title,
- style: buttonStyle,
- value: text,
- target: linkTarget,
- rel: rel
- }));
- },
- migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
- }, {
- supports: {
- anchor: true,
- align: true,
- alignWide: false,
- color: {
- __experimentalSkipSerialization: true
- },
- reusable: false,
- __experimentalSelector: '.wp-block-button__link'
- },
- attributes: { ...blockAttributes,
- linkTarget: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'target'
- },
- rel: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'rel'
- },
- placeholder: {
- type: 'string'
- },
- borderRadius: {
- type: 'number'
- },
- backgroundColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- gradient: {
- type: 'string'
- },
- style: {
- type: 'object'
- },
- width: {
- type: 'number'
- }
- },
- save(_ref5) {
- let {
- attributes,
- className
- } = _ref5;
- const {
- borderRadius,
- linkTarget,
- rel,
- text,
- title,
- url,
- width
- } = attributes;
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
- const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
- 'no-border-radius': borderRadius === 0
- });
- const buttonStyle = {
- borderRadius: borderRadius ? borderRadius + 'px' : undefined,
- ...colorProps.style
- }; // The use of a `title` attribute here is soft-deprecated, but still applied
- // if it had already been assigned, for the sake of backward-compatibility.
- // A title will no longer be assigned for new or updated button block links.
- const wrapperClasses = classnames_default()(className, {
- [`has-custom-width wp-block-button__width-${width}`]: width
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: wrapperClasses
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- className: buttonClasses,
- href: url,
- title: title,
- style: buttonStyle,
- value: text,
- target: linkTarget,
- rel: rel
- }));
- },
- migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
- }, {
- supports: {
- anchor: true,
- align: true,
- alignWide: false,
- color: {
- __experimentalSkipSerialization: true
- },
- reusable: false,
- __experimentalSelector: '.wp-block-button__link'
- },
- attributes: { ...blockAttributes,
- linkTarget: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'target'
- },
- rel: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'rel'
- },
- placeholder: {
- type: 'string'
- },
- borderRadius: {
- type: 'number'
- },
- backgroundColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- gradient: {
- type: 'string'
- },
- style: {
- type: 'object'
- },
- width: {
- type: 'number'
- }
- },
- save(_ref6) {
- let {
- attributes,
- className
- } = _ref6;
- const {
- borderRadius,
- linkTarget,
- rel,
- text,
- title,
- url,
- width
- } = attributes;
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
- const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
- 'no-border-radius': borderRadius === 0
- });
- const buttonStyle = {
- borderRadius: borderRadius ? borderRadius + 'px' : undefined,
- ...colorProps.style
- }; // The use of a `title` attribute here is soft-deprecated, but still applied
- // if it had already been assigned, for the sake of backward-compatibility.
- // A title will no longer be assigned for new or updated button block links.
- const wrapperClasses = classnames_default()(className, {
- [`has-custom-width wp-block-button__width-${width}`]: width
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: wrapperClasses
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- className: buttonClasses,
- href: url,
- title: title,
- style: buttonStyle,
- value: text,
- target: linkTarget,
- rel: rel
- }));
- },
- migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
- }, {
- supports: {
- align: true,
- alignWide: false,
- color: {
- gradients: true
- }
- },
- attributes: { ...blockAttributes,
- linkTarget: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'target'
- },
- rel: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'rel'
- },
- placeholder: {
- type: 'string'
- },
- borderRadius: {
- type: 'number'
- },
- backgroundColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- gradient: {
- type: 'string'
- },
- style: {
- type: 'object'
- }
- },
- save(_ref7) {
- let {
- attributes
- } = _ref7;
- const {
- borderRadius,
- linkTarget,
- rel,
- text,
- title,
- url
- } = attributes;
- const buttonClasses = classnames_default()('wp-block-button__link', {
- 'no-border-radius': borderRadius === 0
- });
- const buttonStyle = {
- borderRadius: borderRadius ? borderRadius + 'px' : undefined
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- className: buttonClasses,
- href: url,
- title: title,
- style: buttonStyle,
- value: text,
- target: linkTarget,
- rel: rel
- });
- },
- migrate: migrateBorderRadius
- }, {
- supports: {
- align: true,
- alignWide: false
- },
- attributes: { ...blockAttributes,
- linkTarget: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'target'
- },
- rel: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'rel'
- },
- placeholder: {
- type: 'string'
- },
- borderRadius: {
- type: 'number'
- },
- backgroundColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- },
- customGradient: {
- type: 'string'
- },
- gradient: {
- type: 'string'
- }
- },
- isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient,
- migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients),
- save(_ref8) {
- let {
- attributes
- } = _ref8;
- const {
- backgroundColor,
- borderRadius,
- customBackgroundColor,
- customTextColor,
- customGradient,
- linkTarget,
- gradient,
- rel,
- text,
- textColor,
- title,
- url
- } = attributes;
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const backgroundClass = !customGradient && (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
- const buttonClasses = classnames_default()('wp-block-button__link', {
- 'has-text-color': textColor || customTextColor,
- [textClass]: textClass,
- 'has-background': backgroundColor || customBackgroundColor || customGradient || gradient,
- [backgroundClass]: backgroundClass,
- 'no-border-radius': borderRadius === 0,
- [gradientClass]: gradientClass
- });
- const buttonStyle = {
- background: customGradient ? customGradient : undefined,
- backgroundColor: backgroundClass || customGradient || gradient ? undefined : customBackgroundColor,
- color: textClass ? undefined : customTextColor,
- borderRadius: borderRadius ? borderRadius + 'px' : undefined
- }; // The use of a `title` attribute here is soft-deprecated, but still applied
- // if it had already been assigned, for the sake of backward-compatibility.
- // A title will no longer be assigned for new or updated button block links.
- return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- className: buttonClasses,
- href: url,
- title: title,
- style: buttonStyle,
- value: text,
- target: linkTarget,
- rel: rel
- }));
- }
- }, {
- attributes: { ...blockAttributes,
- align: {
- type: 'string',
- default: 'none'
- },
- backgroundColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- },
- linkTarget: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'target'
- },
- rel: {
- type: 'string',
- source: 'attribute',
- selector: 'a',
- attribute: 'rel'
- },
- placeholder: {
- type: 'string'
- }
- },
- isEligible(attribute) {
- return attribute.className && attribute.className.includes('is-style-squared');
- },
- migrate(attributes) {
- let newClassName = attributes.className;
- if (newClassName) {
- newClassName = newClassName.replace(/is-style-squared[\s]?/, '').trim();
- }
- return migrateBorderRadius(migrateCustomColorsAndGradients({ ...attributes,
- className: newClassName ? newClassName : undefined,
- borderRadius: 0
- }));
- },
- save(_ref9) {
- let {
- attributes
- } = _ref9;
- const {
- backgroundColor,
- customBackgroundColor,
- customTextColor,
- linkTarget,
- rel,
- text,
- textColor,
- title,
- url
- } = attributes;
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const buttonClasses = classnames_default()('wp-block-button__link', {
- 'has-text-color': textColor || customTextColor,
- [textClass]: textClass,
- 'has-background': backgroundColor || customBackgroundColor,
- [backgroundClass]: backgroundClass
- });
- const buttonStyle = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- color: textClass ? undefined : customTextColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- className: buttonClasses,
- href: url,
- title: title,
- style: buttonStyle,
- value: text,
- target: linkTarget,
- rel: rel
- }));
- }
- }, {
- attributes: { ...blockAttributes,
- align: {
- type: 'string',
- default: 'none'
- },
- backgroundColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- }
- },
- migrate: oldColorsMigration,
- save(_ref10) {
- let {
- attributes
- } = _ref10;
- const {
- url,
- text,
- title,
- backgroundColor,
- textColor,
- customBackgroundColor,
- customTextColor
- } = attributes;
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const buttonClasses = classnames_default()('wp-block-button__link', {
- 'has-text-color': textColor || customTextColor,
- [textClass]: textClass,
- 'has-background': backgroundColor || customBackgroundColor,
- [backgroundClass]: backgroundClass
- });
- const buttonStyle = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- color: textClass ? undefined : customTextColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- className: buttonClasses,
- href: url,
- title: title,
- style: buttonStyle,
- value: text
- }));
- }
- }, {
- attributes: { ...blockAttributes,
- color: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- align: {
- type: 'string',
- default: 'none'
- }
- },
- save(_ref11) {
- let {
- attributes
- } = _ref11;
- const {
- url,
- text,
- title,
- align,
- color,
- textColor
- } = attributes;
- const buttonStyle = {
- backgroundColor: color,
- color: textColor
- };
- const linkClass = 'wp-block-button__link';
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: `align${align}`
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- className: linkClass,
- href: url,
- title: title,
- style: buttonStyle,
- value: text
- }));
- },
- migrate: oldColorsMigration
- }, {
- attributes: { ...blockAttributes,
- color: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- align: {
- type: 'string',
- default: 'none'
- }
- },
- save(_ref12) {
- let {
- attributes
- } = _ref12;
- const {
- url,
- text,
- title,
- align,
- color,
- textColor
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: `align${align}`,
- style: {
- backgroundColor: color
- }
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- href: url,
- title: title,
- style: {
- color: textColor
- },
- value: text
- }));
- },
- migrate: oldColorsMigration
- }];
- /* harmony default export */ var button_deprecated = (deprecated_deprecated);
- ;// CONCATENATED MODULE: external ["wp","keycodes"]
- var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js
- /**
- * WordPress dependencies
- */
- const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"
- }));
- /* harmony default export */ var library_link = (link_link);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js
- /**
- * WordPress dependencies
- */
- const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"
- }));
- /* harmony default export */ var link_off = (linkOff);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const NEW_TAB_REL = 'noreferrer noopener';
- function WidthPanel(_ref) {
- let {
- selectedWidth,
- setAttributes
- } = _ref;
- function handleChange(newWidth) {
- // Check if we are toggling the width off
- const width = selectedWidth === newWidth ? undefined : newWidth; // Update attributes.
- setAttributes({
- width
- });
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Width settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button width')
- }, [25, 50, 75, 100].map(widthValue => {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- key: widthValue,
- isSmall: true,
- variant: widthValue === selectedWidth ? 'primary' : undefined,
- onClick: () => handleChange(widthValue)
- }, widthValue, "%");
- })));
- }
- function ButtonEdit(props) {
- var _style$border;
- const {
- attributes,
- setAttributes,
- className,
- isSelected,
- onReplace,
- mergeBlocks
- } = props;
- const {
- linkTarget,
- placeholder,
- rel,
- style,
- text,
- url,
- width
- } = attributes;
- const onSetLinkRel = (0,external_wp_element_namespaceObject.useCallback)(value => {
- setAttributes({
- rel: value
- });
- }, [setAttributes]);
- function onToggleOpenInNewTab(value) {
- const newLinkTarget = value ? '_blank' : undefined;
- let updatedRel = rel;
- if (newLinkTarget && !rel) {
- updatedRel = NEW_TAB_REL;
- } else if (!newLinkTarget && rel === NEW_TAB_REL) {
- updatedRel = undefined;
- }
- setAttributes({
- linkTarget: newLinkTarget,
- rel: updatedRel
- });
- }
- function setButtonText(newText) {
- // Remove anchor tags from button text content.
- setAttributes({
- text: newText.replace(/<\/?a[^>]*>/g, '')
- });
- }
- function onKeyDown(event) {
- if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
- startEditing(event);
- } else if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'k')) {
- var _richTextRef$current;
- unlink();
- (_richTextRef$current = richTextRef.current) === null || _richTextRef$current === void 0 ? void 0 : _richTextRef$current.focus();
- }
- }
- const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
- const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
- const ref = (0,external_wp_element_namespaceObject.useRef)();
- const richTextRef = (0,external_wp_element_namespaceObject.useRef)();
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- ref,
- onKeyDown
- });
- const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
- const isURLSet = !!url;
- const opensInNewTab = linkTarget === '_blank';
- function startEditing(event) {
- event.preventDefault();
- setIsEditingURL(true);
- }
- function unlink() {
- setAttributes({
- url: undefined,
- linkTarget: undefined,
- rel: undefined
- });
- setIsEditingURL(false);
- }
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isSelected) {
- setIsEditingURL(false);
- }
- }, [isSelected]);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
- className: classnames_default()(blockProps.className, {
- [`has-custom-width wp-block-button__width-${width}`]: width,
- [`has-custom-font-size`]: blockProps.style.fontSize
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- ref: richTextRef,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'),
- placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Add text…'),
- value: text,
- onChange: value => setButtonText(value),
- withoutInteractiveFormatting: true,
- className: classnames_default()(className, 'wp-block-button__link', colorProps.className, borderProps.className, {
- // For backwards compatibility add style that isn't
- // provided via block support.
- 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
- }),
- style: { ...borderProps.style,
- ...colorProps.style,
- ...spacingProps.style
- },
- onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { ...attributes,
- text: value
- }),
- onReplace: onReplace,
- onMerge: mergeBlocks,
- identifier: "text"
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, !isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- name: "link",
- icon: library_link,
- title: (0,external_wp_i18n_namespaceObject.__)('Link'),
- shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
- onClick: startEditing
- }), isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- name: "link",
- icon: link_off,
- title: (0,external_wp_i18n_namespaceObject.__)('Unlink'),
- shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('k'),
- onClick: unlink,
- isActive: true
- })), isSelected && (isEditingURL || isURLSet) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
- position: "bottom center",
- onClose: () => {
- var _richTextRef$current2;
- setIsEditingURL(false);
- (_richTextRef$current2 = richTextRef.current) === null || _richTextRef$current2 === void 0 ? void 0 : _richTextRef$current2.focus();
- },
- anchorRef: ref === null || ref === void 0 ? void 0 : ref.current,
- focusOnMount: isEditingURL ? 'firstElement' : false,
- __unstableSlotName: '__unstable-block-tools-after'
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
- className: "wp-block-navigation-link__inline-link-input",
- value: {
- url,
- opensInNewTab
- },
- onChange: _ref2 => {
- let {
- url: newURL = '',
- opensInNewTab: newOpensInNewTab
- } = _ref2;
- setAttributes({
- url: newURL
- });
- if (opensInNewTab !== newOpensInNewTab) {
- onToggleOpenInNewTab(newOpensInNewTab);
- }
- },
- onRemove: () => {
- var _richTextRef$current3;
- unlink();
- (_richTextRef$current3 = richTextRef.current) === null || _richTextRef$current3 === void 0 ? void 0 : _richTextRef$current3.focus();
- },
- forceIsEditingLink: isEditingURL
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(WidthPanel, {
- selectedWidth: width,
- setAttributes: setAttributes
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "advanced"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
- value: rel || '',
- onChange: onSetLinkRel
- })));
- }
- /* harmony default export */ var button_edit = (ButtonEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function save_save(_ref) {
- var _style$border, _style$typography;
- let {
- attributes,
- className
- } = _ref;
- const {
- fontSize,
- linkTarget,
- rel,
- style,
- text,
- title,
- url,
- width
- } = attributes;
- if (!text) {
- return null;
- }
- const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
- const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
- const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, {
- // For backwards compatibility add style that isn't provided via
- // block support.
- 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
- });
- const buttonStyle = { ...borderProps.style,
- ...colorProps.style,
- ...spacingProps.style
- }; // The use of a `title` attribute here is soft-deprecated, but still applied
- // if it had already been assigned, for the sake of backward-compatibility.
- // A title will no longer be assigned for new or updated button block links.
- const wrapperClasses = classnames_default()(className, {
- [`has-custom-width wp-block-button__width-${width}`]: width,
- [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize)
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: wrapperClasses
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "a",
- className: buttonClasses,
- href: url,
- title: title,
- style: buttonStyle,
- value: text,
- target: linkTarget,
- rel: rel
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const button_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/button",
- title: "Button",
- category: "design",
- parent: ["core/buttons"],
- description: "Prompt visitors to take action with a button-style link.",
- keywords: ["link"],
- textdomain: "default",
- attributes: {
- url: {
- type: "string",
- source: "attribute",
- selector: "a",
- attribute: "href"
- },
- title: {
- type: "string",
- source: "attribute",
- selector: "a",
- attribute: "title"
- },
- text: {
- type: "string",
- source: "html",
- selector: "a"
- },
- linkTarget: {
- type: "string",
- source: "attribute",
- selector: "a",
- attribute: "target"
- },
- rel: {
- type: "string",
- source: "attribute",
- selector: "a",
- attribute: "rel"
- },
- placeholder: {
- type: "string"
- },
- backgroundColor: {
- type: "string"
- },
- textColor: {
- type: "string"
- },
- gradient: {
- type: "string"
- },
- width: {
- type: "number"
- }
- },
- supports: {
- anchor: true,
- align: true,
- alignWide: false,
- color: {
- __experimentalSkipSerialization: true,
- gradients: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- __experimentalFontFamily: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- reusable: false,
- spacing: {
- __experimentalSkipSerialization: true,
- padding: ["horizontal", "vertical"],
- __experimentalDefaultControls: {
- padding: true
- }
- },
- __experimentalBorder: {
- radius: true,
- __experimentalSkipSerialization: true,
- __experimentalDefaultControls: {
- radius: true
- }
- },
- __experimentalSelector: ".wp-block-button__link"
- },
- styles: [{
- name: "fill",
- label: "Fill",
- isDefault: true
- }, {
- name: "outline",
- label: "Outline"
- }],
- editorStyle: "wp-block-button-editor",
- style: "wp-block-button"
- };
- const {
- name: button_name
- } = button_metadata;
- const button_settings = {
- icon: library_button,
- example: {
- attributes: {
- className: 'is-style-fill',
- text: (0,external_wp_i18n_namespaceObject.__)('Call to Action')
- }
- },
- edit: button_edit,
- save: save_save,
- deprecated: button_deprecated,
- merge: (a, _ref) => {
- let {
- text = ''
- } = _ref;
- return { ...a,
- text: (a.text || '') + text
- };
- }
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/buttons.js
- /**
- * WordPress dependencies
- */
- const buttons = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M17 3H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5V6.2h-5v1.6zM17 13H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5v-1.5h-5v1.5z"
- }));
- /* harmony default export */ var library_buttons = (buttons);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * @param {Object} attributes Block's attributes.
- */
- const migrateWithLayout = attributes => {
- if (!!attributes.layout) {
- return attributes;
- }
- const {
- contentJustification,
- orientation,
- ...updatedAttributes
- } = attributes;
- if (contentJustification || orientation) {
- Object.assign(updatedAttributes, {
- layout: {
- type: 'flex',
- ...(contentJustification && {
- justifyContent: contentJustification
- }),
- ...(orientation && {
- orientation
- })
- }
- });
- }
- return updatedAttributes;
- };
- const buttons_deprecated_deprecated = [{
- attributes: {
- contentJustification: {
- type: 'string'
- },
- orientation: {
- type: 'string',
- default: 'horizontal'
- }
- },
- supports: {
- anchor: true,
- align: ['wide', 'full'],
- __experimentalExposeControlsToChildren: true,
- spacing: {
- blockGap: true,
- margin: ['top', 'bottom'],
- __experimentalDefaultControls: {
- blockGap: true
- }
- }
- },
- isEligible: _ref => {
- let {
- contentJustification,
- orientation
- } = _ref;
- return !!contentJustification || !!orientation;
- },
- migrate: migrateWithLayout,
- save(_ref2) {
- let {
- attributes: {
- contentJustification,
- orientation
- }
- } = _ref2;
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: classnames_default()({
- [`is-content-justification-${contentJustification}`]: contentJustification,
- 'is-vertical': orientation === 'vertical'
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
- }
- }, {
- supports: {
- align: ['center', 'left', 'right'],
- anchor: true
- },
- save() {
- return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
- },
- isEligible(_ref3) {
- let {
- align
- } = _ref3;
- return align && ['center', 'left', 'right'].includes(align);
- },
- migrate(attributes) {
- return migrateWithLayout({ ...attributes,
- align: undefined,
- // Floating Buttons blocks shouldn't have been supported in the
- // first place. Most users using them probably expected them to
- // act like content justification controls, so these blocks are
- // migrated to use content justification.
- // As for center-aligned Buttons blocks, the content justification
- // equivalent will create an identical end result in most cases.
- contentJustification: attributes.align
- });
- }
- }];
- /* harmony default export */ var buttons_deprecated = (buttons_deprecated_deprecated);
- ;// CONCATENATED MODULE: external ["wp","richText"]
- var external_wp_richText_namespaceObject = window["wp"]["richText"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const {
- name: transforms_name
- } = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/buttons",
- title: "Buttons",
- category: "design",
- description: "Prompt visitors to take action with a group of button-style links.",
- keywords: ["link"],
- textdomain: "default",
- supports: {
- anchor: true,
- align: ["wide", "full"],
- __experimentalExposeControlsToChildren: true,
- spacing: {
- blockGap: true,
- margin: ["top", "bottom"],
- __experimentalDefaultControls: {
- blockGap: true
- }
- },
- __experimentalLayout: {
- allowSwitching: false,
- allowInheriting: false,
- "default": {
- type: "flex"
- }
- }
- },
- editorStyle: "wp-block-buttons-editor",
- style: "wp-block-buttons"
- };
- const transforms_transforms = {
- from: [{
- type: 'block',
- isMultiBlock: true,
- blocks: ['core/button'],
- transform: buttons => // Creates the buttons block.
- (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons.
- buttons.map(attributes => // Create singular button in the buttons block.
- (0,external_wp_blocks_namespaceObject.createBlock)('core/button', attributes)))
- }, {
- type: 'block',
- isMultiBlock: true,
- blocks: ['core/paragraph'],
- transform: buttons => // Creates the buttons block.
- (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons.
- buttons.map(attributes => {
- const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content); // Remove any HTML tags.
- const text = element.innerText || ''; // Get first url.
- const link = element.querySelector('a');
- const url = link === null || link === void 0 ? void 0 : link.getAttribute('href'); // Create singular button in the buttons block.
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/button', {
- text,
- url
- });
- })),
- isMatch: paragraphs => {
- return paragraphs.every(attributes => {
- const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content);
- const text = element.innerText || '';
- const links = element.querySelectorAll('a');
- return text.length <= 30 && links.length <= 1;
- });
- }
- }]
- };
- /* harmony default export */ var buttons_transforms = (transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/edit.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const ALLOWED_BLOCKS = [button_name];
- const DEFAULT_BLOCK = {
- name: button_name,
- attributesToCopy: ['backgroundColor', 'border', 'className', 'fontFamily', 'fontSize', 'gradient', 'style', 'textColor', 'width']
- };
- function ButtonsEdit(_ref) {
- let {
- attributes: {
- layout = {}
- }
- } = _ref;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const preferredStyle = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _preferredStyleVariat;
- const preferredStyleVariations = select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalPreferredStyleVariations;
- return preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat[button_name];
- }, []);
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- allowedBlocks: ALLOWED_BLOCKS,
- __experimentalDefaultBlock: DEFAULT_BLOCK,
- __experimentalDirectInsert: true,
- template: [[button_name, {
- className: preferredStyle && `is-style-${preferredStyle}`
- }]],
- __experimentalLayout: layout,
- templateInsertUpdatesSelection: true
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
- }
- /* harmony default export */ var buttons_edit = (ButtonsEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/save.js
- /**
- * WordPress dependencies
- */
- function buttons_save_save() {
- const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save());
- return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const buttons_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/buttons",
- title: "Buttons",
- category: "design",
- description: "Prompt visitors to take action with a group of button-style links.",
- keywords: ["link"],
- textdomain: "default",
- supports: {
- anchor: true,
- align: ["wide", "full"],
- __experimentalExposeControlsToChildren: true,
- spacing: {
- blockGap: true,
- margin: ["top", "bottom"],
- __experimentalDefaultControls: {
- blockGap: true
- }
- },
- __experimentalLayout: {
- allowSwitching: false,
- allowInheriting: false,
- "default": {
- type: "flex"
- }
- }
- },
- editorStyle: "wp-block-buttons-editor",
- style: "wp-block-buttons"
- };
- const {
- name: buttons_name
- } = buttons_metadata;
- const buttons_settings = {
- icon: library_buttons,
- example: {
- innerBlocks: [{
- name: 'core/button',
- attributes: {
- text: (0,external_wp_i18n_namespaceObject.__)('Find out more')
- }
- }, {
- name: 'core/button',
- attributes: {
- text: (0,external_wp_i18n_namespaceObject.__)('Contact us')
- }
- }]
- },
- deprecated: buttons_deprecated,
- transforms: buttons_transforms,
- edit: buttons_edit,
- save: buttons_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js
- /**
- * WordPress dependencies
- */
- const calendar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"
- }));
- /* harmony default export */ var library_calendar = (calendar);
- ;// CONCATENATED MODULE: external "moment"
- var external_moment_namespaceObject = window["moment"];
- var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_namespaceObject);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const getYearMonth = memize_default()(date => {
- if (!date) {
- return {};
- }
- const momentDate = external_moment_default()(date);
- return {
- year: momentDate.year(),
- month: momentDate.month() + 1
- };
- });
- function CalendarEdit(_ref) {
- let {
- attributes
- } = _ref;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const {
- date,
- hasPosts,
- hasPostsResolved
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getEntityRecords,
- hasFinishedResolution
- } = select(external_wp_coreData_namespaceObject.store);
- const singlePublishedPostQuery = {
- status: 'publish',
- per_page: 1
- };
- const posts = getEntityRecords('postType', 'post', singlePublishedPostQuery);
- const postsResolved = hasFinishedResolution('getEntityRecords', ['postType', 'post', singlePublishedPostQuery]);
- let _date; // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
- // Blocks can be loaded into a *non-post* block editor.
- // eslint-disable-next-line @wordpress/data-no-store-string-literals
- const editorSelectors = select('core/editor');
- if (editorSelectors) {
- const postType = editorSelectors.getEditedPostAttribute('type'); // Dates are used to overwrite year and month used on the calendar.
- // This overwrite should only happen for 'post' post types.
- // For other post types the calendar always displays the current month.
- if (postType === 'post') {
- _date = editorSelectors.getEditedPostAttribute('date');
- }
- }
- return {
- date: _date,
- hasPostsResolved: postsResolved,
- hasPosts: postsResolved && (posts === null || posts === void 0 ? void 0 : posts.length) === 1
- };
- }, []);
- if (!hasPosts) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- icon: library_calendar,
- label: (0,external_wp_i18n_namespaceObject.__)('Calendar')
- }, !hasPostsResolved ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No published posts found.')));
- }
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
- block: "core/calendar",
- attributes: { ...attributes,
- ...getYearMonth(date)
- }
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js
- /**
- * WordPress dependencies
- */
- const calendar_transforms_transforms = {
- from: [{
- type: 'block',
- blocks: ['core/archives'],
- transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/calendar')
- }],
- to: [{
- type: 'block',
- blocks: ['core/archives'],
- transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/archives')
- }]
- };
- /* harmony default export */ var calendar_transforms = (calendar_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const calendar_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/calendar",
- title: "Calendar",
- category: "widgets",
- description: "A calendar of your site\u2019s posts.",
- keywords: ["posts", "archive"],
- textdomain: "default",
- attributes: {
- month: {
- type: "integer"
- },
- year: {
- type: "integer"
- }
- },
- supports: {
- align: true
- },
- style: "wp-block-calendar"
- };
- const {
- name: calendar_name
- } = calendar_metadata;
- const calendar_settings = {
- icon: library_calendar,
- example: {},
- edit: CalendarEdit,
- transforms: calendar_transforms
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js
- /**
- * WordPress dependencies
- */
- const category = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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",
- fillRule: "evenodd",
- clipRule: "evenodd"
- }));
- /* harmony default export */ var library_category = (category);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js
- /**
- * WordPress dependencies
- */
- const pin = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"
- }));
- /* harmony default export */ var library_pin = (pin);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function CategoriesEdit(_ref) {
- let {
- attributes: {
- displayAsDropdown,
- showHierarchy,
- showPostCounts,
- showOnlyTopLevel
- },
- setAttributes
- } = _ref;
- const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select');
- const query = {
- per_page: -1,
- hide_empty: true,
- context: 'view'
- };
- if (showOnlyTopLevel) {
- query.parent = 0;
- }
- const {
- records: categories,
- isResolving
- } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('taxonomy', 'category', query);
- const getCategoriesList = parentId => {
- if (!(categories !== null && categories !== void 0 && categories.length)) {
- return [];
- }
- if (parentId === null) {
- return categories;
- }
- return categories.filter(_ref2 => {
- let {
- parent
- } = _ref2;
- return parent === parentId;
- });
- };
- const getCategoryListClassName = level => {
- return `wp-block-categories__list wp-block-categories__list-level-${level}`;
- };
- const toggleAttribute = attributeName => newValue => setAttributes({
- [attributeName]: newValue
- });
- const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_lodash_namespaceObject.unescape)(name).trim();
- const renderCategoryList = () => {
- const parentId = showHierarchy ? 0 : null;
- const categoriesList = getCategoriesList(parentId);
- return (0,external_wp_element_namespaceObject.createElement)("ul", {
- className: getCategoryListClassName(0)
- }, categoriesList.map(category => renderCategoryListItem(category, 0)));
- };
- const renderCategoryListItem = (category, level) => {
- const childCategories = getCategoriesList(category.id);
- const {
- id,
- link,
- count,
- name
- } = category;
- return (0,external_wp_element_namespaceObject.createElement)("li", {
- key: id
- }, (0,external_wp_element_namespaceObject.createElement)("a", {
- href: link,
- target: "_blank",
- rel: "noreferrer noopener"
- }, renderCategoryName(name)), showPostCounts && (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "wp-block-categories__post-count"
- }, ` (${count})`), showHierarchy && !!childCategories.length && (0,external_wp_element_namespaceObject.createElement)("ul", {
- className: getCategoryListClassName(level + 1)
- }, childCategories.map(childCategory => renderCategoryListItem(childCategory, level + 1))));
- };
- const renderCategoryDropdown = () => {
- const parentId = showHierarchy ? 0 : null;
- const categoriesList = getCategoriesList(parentId);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
- as: "label",
- htmlFor: selectId
- }, (0,external_wp_i18n_namespaceObject.__)('Categories')), (0,external_wp_element_namespaceObject.createElement)("select", {
- id: selectId,
- className: "wp-block-categories__dropdown"
- }, categoriesList.map(category => renderCategoryDropdownItem(category, 0))));
- };
- const renderCategoryDropdownItem = (category, level) => {
- const {
- id,
- count,
- name
- } = category;
- const childCategories = getCategoriesList(id);
- return [(0,external_wp_element_namespaceObject.createElement)("option", {
- key: id
- }, (0,external_lodash_namespaceObject.times)(level * 3, () => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))];
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Categories settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'),
- checked: displayAsDropdown,
- onChange: toggleAttribute('displayAsDropdown')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
- checked: showPostCounts,
- onChange: toggleAttribute('showPostCounts')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show only top level categories'),
- checked: showOnlyTopLevel,
- onChange: toggleAttribute('showOnlyTopLevel')
- }), !showOnlyTopLevel && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'),
- checked: showHierarchy,
- onChange: toggleAttribute('showHierarchy')
- }))), isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- icon: library_pin,
- label: (0,external_wp_i18n_namespaceObject.__)('Categories')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), !isResolving && (categories === null || categories === void 0 ? void 0 : categories.length) === 0 && (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Your site does not have any posts, so there is nothing to display here at the moment.')), !isResolving && (categories === null || categories === void 0 ? void 0 : categories.length) > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList()));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const categories_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/categories",
- title: "Categories",
- category: "widgets",
- description: "Display a list of all categories.",
- textdomain: "default",
- attributes: {
- displayAsDropdown: {
- type: "boolean",
- "default": false
- },
- showHierarchy: {
- type: "boolean",
- "default": false
- },
- showPostCounts: {
- type: "boolean",
- "default": false
- },
- showOnlyTopLevel: {
- type: "boolean",
- "default": false
- }
- },
- supports: {
- align: true,
- html: false
- },
- editorStyle: "wp-block-categories-editor",
- style: "wp-block-categories"
- };
- const {
- name: categories_name
- } = categories_metadata;
- const categories_settings = {
- icon: library_category,
- example: {},
- edit: CategoriesEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/classic.js
- /**
- * WordPress dependencies
- */
- const classic = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z"
- }));
- /* harmony default export */ var library_classic = (classic);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js
- /**
- * WordPress dependencies
- */
- const ConvertToBlocksButton = _ref => {
- let {
- clientId
- } = _ref;
- const {
- replaceBlocks
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const block = (0,external_wp_data_namespaceObject.useSelect)(select => {
- return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId);
- }, [clientId]);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- onClick: () => replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({
- HTML: (0,external_wp_blocks_namespaceObject.serialize)(block)
- }))
- }, (0,external_wp_i18n_namespaceObject.__)('Convert to blocks'));
- };
- /* harmony default export */ var convert_to_blocks_button = (ConvertToBlocksButton);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const {
- wp: edit_wp
- } = window;
- function isTmceEmpty(editor) {
- // When tinyMce is empty the content seems to be:
- // <p><br data-mce-bogus="1"></p>
- // avoid expensive checks for large documents
- const body = editor.getBody();
- if (body.childNodes.length > 1) {
- return false;
- } else if (body.childNodes.length === 0) {
- return true;
- }
- if (body.childNodes[0].childNodes.length > 1) {
- return false;
- }
- return /^\n?$/.test(body.innerText || body.textContent);
- }
- function ClassicEdit(_ref) {
- let {
- clientId,
- attributes: {
- content
- },
- setAttributes,
- onReplace
- } = _ref;
- const {
- getMultiSelectedBlockClientIds
- } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
- const didMount = (0,external_wp_element_namespaceObject.useRef)(false);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!didMount.current) {
- return;
- }
- const editor = window.tinymce.get(`editor-${clientId}`);
- const currentContent = editor === null || editor === void 0 ? void 0 : editor.getContent();
- if (currentContent !== content) {
- editor.setContent(content || '');
- }
- }, [content]);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- const {
- baseURL,
- suffix
- } = window.wpEditorL10n.tinymce;
- didMount.current = true;
- window.tinymce.EditorManager.overrideDefaults({
- base_url: baseURL,
- suffix
- });
- function onSetup(editor) {
- let bookmark;
- if (content) {
- editor.on('loadContent', () => editor.setContent(content));
- }
- editor.on('blur', () => {
- var _getMultiSelectedBloc;
- bookmark = editor.selection.getBookmark(2, true); // There is an issue with Chrome and the editor.focus call in core at https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/lib/link.js#L451.
- // This causes a scroll to the top of editor content on return from some content updating dialogs so tracking
- // scroll position until this is fixed in core.
- const scrollContainer = document.querySelector('.interface-interface-skeleton__content');
- const scrollPosition = scrollContainer.scrollTop; // Only update attributes if we aren't multi-selecting blocks.
- // Updating during multi-selection can overwrite attributes of other blocks.
- if (!((_getMultiSelectedBloc = getMultiSelectedBlockClientIds()) !== null && _getMultiSelectedBloc !== void 0 && _getMultiSelectedBloc.length)) {
- setAttributes({
- content: editor.getContent()
- });
- }
- editor.once('focus', () => {
- if (bookmark) {
- editor.selection.moveToBookmark(bookmark);
- if (scrollContainer.scrollTop !== scrollPosition) {
- scrollContainer.scrollTop = scrollPosition;
- }
- }
- });
- return false;
- });
- editor.on('mousedown touchstart', () => {
- bookmark = null;
- });
- const debouncedOnChange = (0,external_lodash_namespaceObject.debounce)(() => {
- const value = editor.getContent();
- if (value !== editor._lastChange) {
- editor._lastChange = value;
- setAttributes({
- content: value
- });
- }
- }, 250);
- editor.on('Paste Change input Undo Redo', debouncedOnChange); // We need to cancel the debounce call because when we remove
- // the editor (onUnmount) this callback is executed in
- // another tick. This results in setting the content to empty.
- editor.on('remove', debouncedOnChange.cancel);
- editor.on('keydown', event => {
- if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z')) {
- // Prevent the gutenberg undo kicking in so TinyMCE undo stack works as expected.
- event.stopPropagation();
- }
- if ((event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) && isTmceEmpty(editor)) {
- // Delete the block.
- onReplace([]);
- event.preventDefault();
- event.stopImmediatePropagation();
- }
- const {
- altKey
- } = event;
- /*
- * Prevent Mousetrap from kicking in: TinyMCE already uses its own
- * `alt+f10` shortcut to focus its toolbar.
- */
- if (altKey && event.keyCode === external_wp_keycodes_namespaceObject.F10) {
- event.stopPropagation();
- }
- });
- editor.on('init', () => {
- const rootNode = editor.getBody(); // Create the toolbar by refocussing the editor.
- if (rootNode.ownerDocument.activeElement === rootNode) {
- rootNode.blur();
- editor.focus();
- }
- });
- }
- function initialize() {
- const {
- settings
- } = window.wpEditorL10n.tinymce;
- edit_wp.oldEditor.initialize(`editor-${clientId}`, {
- tinymce: { ...settings,
- inline: true,
- content_css: false,
- fixed_toolbar_container: `#toolbar-${clientId}`,
- setup: onSetup
- }
- });
- }
- function onReadyStateChange() {
- if (document.readyState === 'complete') {
- initialize();
- }
- }
- if (document.readyState === 'complete') {
- initialize();
- } else {
- document.addEventListener('readystatechange', onReadyStateChange);
- }
- return () => {
- document.removeEventListener('readystatechange', onReadyStateChange);
- edit_wp.oldEditor.remove(`editor-${clientId}`);
- };
- }, []);
- function focus() {
- const editor = window.tinymce.get(`editor-${clientId}`);
- if (editor) {
- editor.focus();
- }
- }
- function onToolbarKeyDown(event) {
- // Prevent WritingFlow from kicking in and allow arrows navigation on the toolbar.
- event.stopPropagation(); // Prevent Mousetrap from moving focus to the top toolbar when pressing `alt+f10` on this block toolbar.
- event.nativeEvent.stopImmediatePropagation();
- } // Disable reasons:
- //
- // jsx-a11y/no-static-element-interactions
- // - the toolbar itself is non-interactive, but must capture events
- // from the KeyboardShortcuts component to stop their propagation.
- /* eslint-disable jsx-a11y/no-static-element-interactions */
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(convert_to_blocks_button, {
- clientId: clientId
- }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
- key: "toolbar",
- id: `toolbar-${clientId}`,
- className: "block-library-classic__toolbar",
- onClick: focus,
- "data-placeholder": (0,external_wp_i18n_namespaceObject.__)('Classic'),
- onKeyDown: onToolbarKeyDown
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
- key: "editor",
- id: `editor-${clientId}`,
- className: "wp-block-freeform block-library-rich-text__tinymce"
- })));
- /* eslint-enable jsx-a11y/no-static-element-interactions */
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/save.js
- /**
- * WordPress dependencies
- */
- function freeform_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- content
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, content);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const freeform_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/freeform",
- title: "Classic",
- category: "text",
- description: "Use the classic WordPress editor.",
- textdomain: "default",
- attributes: {
- content: {
- type: "string",
- source: "html"
- }
- },
- supports: {
- className: false,
- customClassName: false,
- reusable: false
- },
- editorStyle: "wp-block-freeform-editor"
- };
- const {
- name: freeform_name
- } = freeform_metadata;
- const freeform_settings = {
- icon: library_classic,
- edit: ClassicEdit,
- save: freeform_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js
- /**
- * WordPress dependencies
- */
- const code = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"
- }));
- /* harmony default export */ var library_code = (code);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/edit.js
- /**
- * WordPress dependencies
- */
- function CodeEdit(_ref) {
- let {
- attributes,
- setAttributes,
- onRemove
- } = _ref;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- return (0,external_wp_element_namespaceObject.createElement)("pre", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: "code",
- value: attributes.content,
- onChange: content => setAttributes({
- content
- }),
- onRemove: onRemove,
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write code…'),
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Code'),
- preserveWhiteSpace: true,
- __unstablePastePlainText: true
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/utils.js
- /**
- * External dependencies
- */
- /**
- * Escapes ampersands, shortcodes, and links.
- *
- * @param {string} content The content of a code block.
- * @return {string} The given content with some characters escaped.
- */
- function utils_escape(content) {
- return (0,external_lodash_namespaceObject.flow)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || '');
- }
- /**
- * Returns the given content with all opening shortcode characters converted
- * into their HTML entity counterpart (i.e. [ => [). For instance, a
- * shortcode like [embed] becomes [embed]
- *
- * This function replicates the escaping of HTML tags, where a tag like
- * <strong> becomes <strong>.
- *
- * @param {string} content The content of a code block.
- * @return {string} The given content with its opening shortcode characters
- * converted into their HTML entity counterpart
- * (i.e. [ => [)
- */
- function escapeOpeningSquareBrackets(content) {
- return content.replace(/\[/g, '[');
- }
- /**
- * Converts the first two forward slashes of any isolated URL into their HTML
- * counterparts (i.e. // => //). For instance, https://youtube.com/watch?x
- * becomes https://youtube.com/watch?x.
- *
- * An isolated URL is a URL that sits in its own line, surrounded only by spacing
- * characters.
- *
- * See https://github.com/WordPress/wordpress-develop/blob/5.1.1/src/wp-includes/class-wp-embed.php#L403
- *
- * @param {string} content The content of a code block.
- * @return {string} The given content with its ampersands converted into
- * their HTML entity counterpart (i.e. & => &)
- */
- function escapeProtocolInIsolatedUrls(content) {
- return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1//$2');
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/save.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function code_save_save(_ref) {
- let {
- attributes
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "code",
- value: utils_escape(attributes.content)
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/transforms.js
- /**
- * WordPress dependencies
- */
- const code_transforms_transforms = {
- from: [{
- type: 'enter',
- regExp: /^```$/,
- transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/code')
- }, {
- type: 'block',
- blocks: ['core/html', 'core/paragraph'],
- transform: _ref => {
- let {
- content
- } = _ref;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/code', {
- content
- });
- }
- }, {
- type: 'raw',
- isMatch: node => node.nodeName === 'PRE' && node.children.length === 1 && node.firstChild.nodeName === 'CODE',
- schema: {
- pre: {
- children: {
- code: {
- children: {
- '#text': {}
- }
- }
- }
- }
- }
- }]
- };
- /* harmony default export */ var code_transforms = (code_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const code_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/code",
- title: "Code",
- category: "text",
- description: "Display code snippets that respect your spacing and tabs.",
- textdomain: "default",
- attributes: {
- content: {
- type: "string",
- source: "html",
- selector: "code"
- }
- },
- supports: {
- anchor: true,
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- spacing: {
- margin: ["top", "bottom"],
- padding: true
- },
- __experimentalBorder: {
- radius: true,
- color: true,
- width: true,
- style: true,
- __experimentalDefaultControls: {
- width: true,
- color: true
- }
- },
- color: {
- text: true,
- background: true,
- gradients: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- }
- },
- style: "wp-block-code"
- };
- const {
- name: code_name
- } = code_metadata;
- const code_settings = {
- icon: library_code,
- example: {
- attributes: {
- /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
- // translators: Preserve \n markers for line breaks
- content: (0,external_wp_i18n_namespaceObject.__)('// A "block" is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );')
- /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
- }
- },
- transforms: code_transforms,
- edit: CodeEdit,
- save: code_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/column.js
- /**
- * WordPress dependencies
- */
- const column = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"
- }));
- /* harmony default export */ var library_column = (column);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const column_deprecated_deprecated = [{
- attributes: {
- verticalAlignment: {
- type: 'string'
- },
- width: {
- type: 'number',
- min: 0,
- max: 100
- }
- },
- isEligible(_ref) {
- let {
- width
- } = _ref;
- return isFinite(width);
- },
- migrate(attributes) {
- return { ...attributes,
- width: `${attributes.width}%`
- };
- },
- save(_ref2) {
- let {
- attributes
- } = _ref2;
- const {
- verticalAlignment,
- width
- } = attributes;
- const wrapperClasses = classnames_default()({
- [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
- });
- const style = {
- flexBasis: width + '%'
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: wrapperClasses,
- style: style
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
- }
- }];
- /* harmony default export */ var column_deprecated = (column_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function ColumnEdit(_ref) {
- let {
- attributes: {
- verticalAlignment,
- width,
- templateLock = false,
- allowedBlocks
- },
- setAttributes,
- clientId
- } = _ref;
- const classes = classnames_default()('block-core-columns', {
- [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
- });
- const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
- availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
- });
- const {
- columnsIds,
- hasChildBlocks,
- rootClientId
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlockOrder,
- getBlockRootClientId
- } = select(external_wp_blockEditor_namespaceObject.store);
- const rootId = getBlockRootClientId(clientId);
- return {
- hasChildBlocks: getBlockOrder(clientId).length > 0,
- rootClientId: rootId,
- columnsIds: getBlockOrder(rootId)
- };
- }, [clientId]);
- const {
- updateBlockAttributes
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const updateAlignment = value => {
- // Update own alignment.
- setAttributes({
- verticalAlignment: value
- }); // Reset parent Columns block.
- updateBlockAttributes(rootClientId, {
- verticalAlignment: null
- });
- };
- const widthWithUnit = Number.isFinite(width) ? width + '%' : width;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classes,
- style: widthWithUnit ? {
- flexBasis: widthWithUnit
- } : undefined
- });
- const columnsCount = columnsIds.length;
- const currentColumnPosition = columnsIds.indexOf(clientId) + 1;
- const label = (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */
- (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount);
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps,
- 'aria-label': label
- }, {
- templateLock,
- allowedBlocks,
- renderAppender: hasChildBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, {
- onChange: updateAlignment,
- value: verticalAlignment
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Column settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Width'),
- labelPosition: "edge",
- __unstableInputWidth: "80px",
- value: width || '',
- onChange: nextWidth => {
- nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth;
- setAttributes({
- width: nextWidth
- });
- },
- units: units
- }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
- }
- /* harmony default export */ var column_edit = (ColumnEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function column_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- verticalAlignment,
- width
- } = attributes;
- const wrapperClasses = classnames_default()({
- [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
- });
- let style;
- if (width && /\d/.test(width)) {
- // Numbers are handled for backward compatibility as they can be still provided with templates.
- let flexBasis = Number.isFinite(width) ? width + '%' : width; // In some cases we need to round the width to a shorter float.
- if (!Number.isFinite(width) && width !== null && width !== void 0 && width.endsWith('%')) {
- const multiplier = 1000000000000; // Shrink the number back to a reasonable float.
- flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + '%';
- }
- style = {
- flexBasis
- };
- }
- const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: wrapperClasses,
- style
- });
- const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
- return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const column_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/column",
- title: "Column",
- category: "text",
- parent: ["core/columns"],
- description: "A single column within a columns block.",
- textdomain: "default",
- attributes: {
- verticalAlignment: {
- type: "string"
- },
- width: {
- type: "string"
- },
- allowedBlocks: {
- type: "array"
- },
- templateLock: {
- type: ["string", "boolean"],
- "enum": ["all", "insert", false]
- }
- },
- supports: {
- anchor: true,
- reusable: false,
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- spacing: {
- blockGap: true,
- padding: true,
- __experimentalDefaultControls: {
- padding: true
- }
- },
- __experimentalLayout: true
- }
- };
- const {
- name: column_name
- } = column_metadata;
- const column_settings = {
- icon: library_column,
- edit: column_edit,
- save: column_save_save,
- deprecated: column_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/columns.js
- /**
- * WordPress dependencies
- */
- const columns = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z"
- }));
- /* harmony default export */ var library_columns = (columns);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Given an HTML string for a deprecated columns inner block, returns the
- * column index to which the migrated inner block should be assigned. Returns
- * undefined if the inner block was not assigned to a column.
- *
- * @param {string} originalContent Deprecated Columns inner block HTML.
- *
- * @return {?number} Column to which inner block is to be assigned.
- */
- function getDeprecatedLayoutColumn(originalContent) {
- let {
- doc
- } = getDeprecatedLayoutColumn;
- if (!doc) {
- doc = document.implementation.createHTMLDocument('');
- getDeprecatedLayoutColumn.doc = doc;
- }
- let columnMatch;
- doc.body.innerHTML = originalContent;
- for (const classListItem of doc.body.firstChild.classList) {
- if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) {
- return Number(columnMatch[1]) - 1;
- }
- }
- }
- const migrateCustomColors = attributes => {
- if (!attributes.customTextColor && !attributes.customBackgroundColor) {
- return attributes;
- }
- const style = {
- color: {}
- };
- if (attributes.customTextColor) {
- style.color.text = attributes.customTextColor;
- }
- if (attributes.customBackgroundColor) {
- style.color.background = attributes.customBackgroundColor;
- }
- return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor']),
- style,
- isStackedOnMobile: true
- };
- };
- /* harmony default export */ var columns_deprecated = ([{
- attributes: {
- verticalAlignment: {
- type: 'string'
- },
- backgroundColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- }
- },
- migrate: migrateCustomColors,
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- verticalAlignment,
- backgroundColor,
- customBackgroundColor,
- textColor,
- customTextColor
- } = attributes;
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const className = classnames_default()({
- 'has-background': backgroundColor || customBackgroundColor,
- 'has-text-color': textColor || customTextColor,
- [backgroundClass]: backgroundClass,
- [textClass]: textClass,
- [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
- });
- const style = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- color: textClass ? undefined : customTextColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: className ? className : undefined,
- style: style
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
- }
- }, {
- attributes: {
- columns: {
- type: 'number',
- default: 2
- }
- },
- isEligible(attributes, innerBlocks) {
- // Since isEligible is called on every valid instance of the
- // Columns block and a deprecation is the unlikely case due to
- // its subsequent migration, optimize for the `false` condition
- // by performing a naive, inaccurate pass at inner blocks.
- const isFastPassEligible = innerBlocks.some(innerBlock => /layout-column-\d+/.test(innerBlock.originalContent));
- if (!isFastPassEligible) {
- return false;
- } // Only if the fast pass is considered eligible is the more
- // accurate, durable, slower condition performed.
- return innerBlocks.some(innerBlock => getDeprecatedLayoutColumn(innerBlock.originalContent) !== undefined);
- },
- migrate(attributes, innerBlocks) {
- const columns = innerBlocks.reduce((accumulator, innerBlock) => {
- const {
- originalContent
- } = innerBlock;
- let columnIndex = getDeprecatedLayoutColumn(originalContent);
- if (columnIndex === undefined) {
- columnIndex = 0;
- }
- if (!accumulator[columnIndex]) {
- accumulator[columnIndex] = [];
- }
- accumulator[columnIndex].push(innerBlock);
- return accumulator;
- }, []);
- const migratedInnerBlocks = columns.map(columnBlocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, columnBlocks));
- return [{ ...(0,external_lodash_namespaceObject.omit)(attributes, ['columns']),
- isStackedOnMobile: true
- }, migratedInnerBlocks];
- },
- save(_ref2) {
- let {
- attributes
- } = _ref2;
- const {
- columns
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: `has-${columns}-columns`
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
- }
- }, {
- attributes: {
- columns: {
- type: 'number',
- default: 2
- }
- },
- migrate(attributes, innerBlocks) {
- attributes = { ...(0,external_lodash_namespaceObject.omit)(attributes, ['columns']),
- isStackedOnMobile: true
- };
- return [attributes, innerBlocks];
- },
- save(_ref3) {
- let {
- attributes
- } = _ref3;
- const {
- verticalAlignment,
- columns
- } = attributes;
- const wrapperClasses = classnames_default()(`has-${columns}-columns`, {
- [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: wrapperClasses
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
- }
- }]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/utils.js
- /**
- * External dependencies
- */
- /**
- * Returns a column width attribute value rounded to standard precision.
- * Returns `undefined` if the value is not a valid finite number.
- *
- * @param {?number} value Raw value.
- *
- * @return {number} Value rounded to standard precision.
- */
- const toWidthPrecision = value => {
- const unitlessValue = parseFloat(value);
- return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : undefined;
- };
- /**
- * Returns an effective width for a given block. An effective width is equal to
- * its attribute value if set, or a computed value assuming equal distribution.
- *
- * @param {WPBlock} block Block object.
- * @param {number} totalBlockCount Total number of blocks in Columns.
- *
- * @return {number} Effective column width.
- */
- function getEffectiveColumnWidth(block, totalBlockCount) {
- const {
- width = 100 / totalBlockCount
- } = block.attributes;
- return toWidthPrecision(width);
- }
- /**
- * Returns the total width occupied by the given set of column blocks.
- *
- * @param {WPBlock[]} blocks Block objects.
- * @param {?number} totalBlockCount Total number of blocks in Columns.
- * Defaults to number of blocks passed.
- *
- * @return {number} Total width occupied by blocks.
- */
- function getTotalColumnsWidth(blocks) {
- let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length;
- return (0,external_lodash_namespaceObject.sumBy)(blocks, block => getEffectiveColumnWidth(block, totalBlockCount));
- }
- /**
- * Returns an object of `clientId` → `width` of effective column widths.
- *
- * @param {WPBlock[]} blocks Block objects.
- * @param {?number} totalBlockCount Total number of blocks in Columns.
- * Defaults to number of blocks passed.
- *
- * @return {Object<string,number>} Column widths.
- */
- function getColumnWidths(blocks) {
- let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length;
- return blocks.reduce((accumulator, block) => {
- const width = getEffectiveColumnWidth(block, totalBlockCount);
- return Object.assign(accumulator, {
- [block.clientId]: width
- });
- }, {});
- }
- /**
- * Returns an object of `clientId` → `width` of column widths as redistributed
- * proportional to their current widths, constrained or expanded to fit within
- * the given available width.
- *
- * @param {WPBlock[]} blocks Block objects.
- * @param {number} availableWidth Maximum width to fit within.
- * @param {?number} totalBlockCount Total number of blocks in Columns.
- * Defaults to number of blocks passed.
- *
- * @return {Object<string,number>} Redistributed column widths.
- */
- function getRedistributedColumnWidths(blocks, availableWidth) {
- let totalBlockCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : blocks.length;
- const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount);
- return (0,external_lodash_namespaceObject.mapValues)(getColumnWidths(blocks, totalBlockCount), width => {
- const newWidth = availableWidth * width / totalWidth;
- return toWidthPrecision(newWidth);
- });
- }
- /**
- * Returns true if column blocks within the provided set are assigned with
- * explicit widths, or false otherwise.
- *
- * @param {WPBlock[]} blocks Block objects.
- *
- * @return {boolean} Whether columns have explicit widths.
- */
- function hasExplicitPercentColumnWidths(blocks) {
- return blocks.every(block => {
- var _blockWidth$endsWith;
- const blockWidth = block.attributes.width;
- return Number.isFinite(blockWidth !== null && blockWidth !== void 0 && (_blockWidth$endsWith = blockWidth.endsWith) !== null && _blockWidth$endsWith !== void 0 && _blockWidth$endsWith.call(blockWidth, '%') ? parseFloat(blockWidth) : blockWidth);
- });
- }
- /**
- * Returns a copy of the given set of blocks with new widths assigned from the
- * provided object of redistributed column widths.
- *
- * @param {WPBlock[]} blocks Block objects.
- * @param {Object<string,number>} widths Redistributed column widths.
- *
- * @return {WPBlock[]} blocks Mapped block objects.
- */
- function getMappedColumnWidths(blocks, widths) {
- return blocks.map(block => (0,external_lodash_namespaceObject.merge)({}, block, {
- attributes: {
- width: `${widths[block.clientId]}%`
- }
- }));
- }
- /**
- * Returns an array with columns widths values, parsed or no depends on `withParsing` flag.
- *
- * @param {WPBlock[]} blocks Block objects.
- * @param {?boolean} withParsing Whether value has to be parsed.
- *
- * @return {Array<number,string>} Column widths.
- */
- function getWidths(blocks) {
- let withParsing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- return blocks.map(innerColumn => {
- const innerColumnWidth = innerColumn.attributes.width || 100 / blocks.length;
- return withParsing ? parseFloat(innerColumnWidth) : innerColumnWidth;
- });
- }
- /**
- * Returns a column width with unit.
- *
- * @param {string} width Column width.
- * @param {string} unit Column width unit.
- *
- * @return {string} Column width with unit.
- */
- function getWidthWithUnit(width, unit) {
- width = 0 > parseFloat(width) ? '0' : width;
- if (isPercentageUnit(unit)) {
- width = Math.min(width, 100);
- }
- return `${width}${unit}`;
- }
- /**
- * Returns a boolean whether passed unit is percentage
- *
- * @param {string} unit Column width unit.
- *
- * @return {boolean} Whether unit is '%'.
- */
- function isPercentageUnit(unit) {
- return unit === '%';
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Allowed blocks constant is passed to InnerBlocks precisely as specified here.
- * The contents of the array should never change.
- * The array should contain the name of each block that is allowed.
- * In columns block, the only block we allow is 'core/column'.
- *
- * @constant
- * @type {string[]}
- */
- const edit_ALLOWED_BLOCKS = ['core/column'];
- function ColumnsEditContainer(_ref) {
- let {
- attributes,
- setAttributes,
- updateAlignment,
- updateColumns,
- clientId
- } = _ref;
- const {
- isStackedOnMobile,
- verticalAlignment
- } = attributes;
- const {
- count
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- return {
- count: select(external_wp_blockEditor_namespaceObject.store).getBlockCount(clientId)
- };
- }, [clientId]);
- const classes = classnames_default()({
- [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
- [`is-not-stacked-on-mobile`]: !isStackedOnMobile
- });
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classes
- });
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- allowedBlocks: edit_ALLOWED_BLOCKS,
- orientation: 'horizontal',
- renderAppender: false
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, {
- onChange: updateAlignment,
- value: verticalAlignment
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
- value: count,
- onChange: value => updateColumns(count, value),
- min: 1,
- max: Math.max(6, count)
- }), count > 6 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
- status: "warning",
- isDismissible: false
- }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'),
- checked: isStackedOnMobile,
- onChange: () => setAttributes({
- isStackedOnMobile: !isStackedOnMobile
- })
- }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
- }
- const ColumnsEditContainerWrapper = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => ({
- /**
- * Update all child Column blocks with a new vertical alignment setting
- * based on whatever alignment is passed in. This allows change to parent
- * to overide anything set on a individual column basis.
- *
- * @param {string} verticalAlignment the vertical alignment setting
- */
- updateAlignment(verticalAlignment) {
- const {
- clientId,
- setAttributes
- } = ownProps;
- const {
- updateBlockAttributes
- } = dispatch(external_wp_blockEditor_namespaceObject.store);
- const {
- getBlockOrder
- } = registry.select(external_wp_blockEditor_namespaceObject.store); // Update own alignment.
- setAttributes({
- verticalAlignment
- }); // Update all child Column Blocks to match.
- const innerBlockClientIds = getBlockOrder(clientId);
- innerBlockClientIds.forEach(innerBlockClientId => {
- updateBlockAttributes(innerBlockClientId, {
- verticalAlignment
- });
- });
- },
- /**
- * Updates the column count, including necessary revisions to child Column
- * blocks to grant required or redistribute available space.
- *
- * @param {number} previousColumns Previous column count.
- * @param {number} newColumns New column count.
- */
- updateColumns(previousColumns, newColumns) {
- const {
- clientId
- } = ownProps;
- const {
- replaceInnerBlocks
- } = dispatch(external_wp_blockEditor_namespaceObject.store);
- const {
- getBlocks
- } = registry.select(external_wp_blockEditor_namespaceObject.store);
- let innerBlocks = getBlocks(clientId);
- const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); // Redistribute available width for existing inner blocks.
- const isAddingColumn = newColumns > previousColumns;
- if (isAddingColumn && hasExplicitWidths) {
- // If adding a new column, assign width to the new column equal to
- // as if it were `1 / columns` of the total available space.
- const newColumnWidth = toWidthPrecision(100 / newColumns); // Redistribute in consideration of pending block insertion as
- // constraining the available working width.
- const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth);
- innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...(0,external_lodash_namespaceObject.times)(newColumns - previousColumns, () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {
- width: `${newColumnWidth}%`
- });
- })];
- } else if (isAddingColumn) {
- innerBlocks = [...innerBlocks, ...(0,external_lodash_namespaceObject.times)(newColumns - previousColumns, () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/column');
- })];
- } else {
- // The removed column will be the last of the inner blocks.
- innerBlocks = (0,external_lodash_namespaceObject.dropRight)(innerBlocks, previousColumns - newColumns);
- if (hasExplicitWidths) {
- // Redistribute as if block is already removed.
- const widths = getRedistributedColumnWidths(innerBlocks, 100);
- innerBlocks = getMappedColumnWidths(innerBlocks, widths);
- }
- }
- replaceInnerBlocks(clientId, innerBlocks);
- }
- }))(ColumnsEditContainer);
- function Placeholder(_ref2) {
- let {
- clientId,
- name,
- setAttributes
- } = _ref2;
- const {
- blockType,
- defaultVariation,
- variations
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlockVariations,
- getBlockType,
- getDefaultBlockVariation
- } = select(external_wp_blocks_namespaceObject.store);
- return {
- blockType: getBlockType(name),
- defaultVariation: getDefaultBlockVariation(name, 'block'),
- variations: getBlockVariations(name, 'block')
- };
- }, [name]);
- const {
- replaceInnerBlocks
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
- icon: (0,external_lodash_namespaceObject.get)(blockType, ['icon', 'src']),
- label: (0,external_lodash_namespaceObject.get)(blockType, ['title']),
- variations: variations,
- onSelect: function () {
- let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation;
- if (nextVariation.attributes) {
- setAttributes(nextVariation.attributes);
- }
- if (nextVariation.innerBlocks) {
- replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true);
- }
- },
- allowSkip: true
- }));
- }
- const ColumnsEdit = props => {
- const {
- clientId
- } = props;
- const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0, [clientId]);
- const Component = hasInnerBlocks ? ColumnsEditContainerWrapper : Placeholder;
- return (0,external_wp_element_namespaceObject.createElement)(Component, props);
- };
- /* harmony default export */ var columns_edit = (ColumnsEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function columns_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- isStackedOnMobile,
- verticalAlignment
- } = attributes;
- const className = classnames_default()({
- [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
- [`is-not-stacked-on-mobile`]: !isStackedOnMobile
- });
- const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- });
- const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
- return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/variations.js
- /**
- * WordPress dependencies
- */
- /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
- /**
- * Template option choices for predefined columns layouts.
- *
- * @type {WPBlockVariation[]}
- */
- const variations = [{
- name: 'one-column-full',
- title: (0,external_wp_i18n_namespaceObject.__)('100'),
- description: (0,external_wp_i18n_namespaceObject.__)('One column'),
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- width: "48",
- height: "48",
- viewBox: "0 0 48 48",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"
- })),
- innerBlocks: [['core/column']],
- scope: ['block']
- }, {
- name: 'two-columns-equal',
- title: (0,external_wp_i18n_namespaceObject.__)('50 / 50'),
- description: (0,external_wp_i18n_namespaceObject.__)('Two columns; equal split'),
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- width: "48",
- height: "48",
- viewBox: "0 0 48 48",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"
- })),
- isDefault: true,
- innerBlocks: [['core/column'], ['core/column']],
- scope: ['block']
- }, {
- name: 'two-columns-one-third-two-thirds',
- title: (0,external_wp_i18n_namespaceObject.__)('30 / 70'),
- description: (0,external_wp_i18n_namespaceObject.__)('Two columns; one-third, two-thirds split'),
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- width: "48",
- height: "48",
- viewBox: "0 0 48 48",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"
- })),
- innerBlocks: [['core/column', {
- width: '33.33%'
- }], ['core/column', {
- width: '66.66%'
- }]],
- scope: ['block']
- }, {
- name: 'two-columns-two-thirds-one-third',
- title: (0,external_wp_i18n_namespaceObject.__)('70 / 30'),
- description: (0,external_wp_i18n_namespaceObject.__)('Two columns; two-thirds, one-third split'),
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- width: "48",
- height: "48",
- viewBox: "0 0 48 48",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"
- })),
- innerBlocks: [['core/column', {
- width: '66.66%'
- }], ['core/column', {
- width: '33.33%'
- }]],
- scope: ['block']
- }, {
- name: 'three-columns-equal',
- title: (0,external_wp_i18n_namespaceObject.__)('33 / 33 / 33'),
- description: (0,external_wp_i18n_namespaceObject.__)('Three columns; equal split'),
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- width: "48",
- height: "48",
- viewBox: "0 0 48 48",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- fillRule: "evenodd",
- d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"
- })),
- innerBlocks: [['core/column'], ['core/column'], ['core/column']],
- scope: ['block']
- }, {
- name: 'three-columns-wider-center',
- title: (0,external_wp_i18n_namespaceObject.__)('25 / 50 / 25'),
- description: (0,external_wp_i18n_namespaceObject.__)('Three columns; wide center column'),
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- width: "48",
- height: "48",
- viewBox: "0 0 48 48",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- fillRule: "evenodd",
- d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"
- })),
- innerBlocks: [['core/column', {
- width: '25%'
- }], ['core/column', {
- width: '50%'
- }], ['core/column', {
- width: '25%'
- }]],
- scope: ['block']
- }];
- /* harmony default export */ var columns_variations = (variations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/transforms.js
- /**
- * WordPress dependencies
- */
- const MAXIMUM_SELECTED_BLOCKS = 6;
- const columns_transforms_transforms = {
- from: [{
- type: 'block',
- isMultiBlock: true,
- blocks: ['*'],
- __experimentalConvert: blocks => {
- const columnWidth = +(100 / blocks.length).toFixed(2);
- const innerBlocksTemplate = blocks.map(_ref => {
- let {
- name,
- attributes,
- innerBlocks
- } = _ref;
- return ['core/column', {
- width: `${columnWidth}%`
- }, [[name, { ...attributes
- }, innerBlocks]]];
- });
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
- },
- isMatch: _ref2 => {
- let {
- length: selectedBlocksLength
- } = _ref2;
- return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS;
- }
- }, {
- type: 'block',
- blocks: ['core/media-text'],
- priority: 1,
- transform: (attributes, innerBlocks) => {
- const {
- align,
- backgroundColor,
- textColor,
- style,
- mediaAlt: alt,
- mediaId: id,
- mediaPosition,
- mediaSizeSlug: sizeSlug,
- mediaType,
- mediaUrl: url,
- mediaWidth,
- verticalAlignment
- } = attributes;
- let media;
- if (mediaType === 'image' || !mediaType) {
- const imageAttrs = {
- id,
- alt,
- url,
- sizeSlug
- };
- const linkAttrs = {
- href: attributes.href,
- linkClass: attributes.linkClass,
- linkDestination: attributes.linkDestination,
- linkTarget: attributes.linkTarget,
- rel: attributes.rel
- };
- media = ['core/image', { ...imageAttrs,
- ...linkAttrs
- }];
- } else {
- media = ['core/video', {
- id,
- src: url
- }];
- }
- const innerBlocksTemplate = [['core/column', {
- width: `${mediaWidth}%`
- }, [media]], ['core/column', {
- width: `${100 - mediaWidth}%`
- }, innerBlocks]];
- if (mediaPosition === 'right') {
- innerBlocksTemplate.reverse();
- }
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {
- align,
- backgroundColor,
- textColor,
- style,
- verticalAlignment
- }, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
- }
- }]
- };
- /* harmony default export */ var columns_transforms = (columns_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const columns_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/columns",
- title: "Columns",
- category: "design",
- description: "Display content in multiple columns, with blocks added to each column.",
- textdomain: "default",
- attributes: {
- verticalAlignment: {
- type: "string"
- },
- isStackedOnMobile: {
- type: "boolean",
- "default": true
- }
- },
- supports: {
- anchor: true,
- align: ["wide", "full"],
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- spacing: {
- blockGap: {
- __experimentalDefault: "2em"
- },
- margin: ["top", "bottom"],
- padding: true,
- __experimentalDefaultControls: {
- padding: true
- }
- },
- __experimentalLayout: {
- allowSwitching: false,
- allowInheriting: false,
- allowEditing: false,
- "default": {
- type: "flex",
- flexWrap: "nowrap"
- }
- },
- __experimentalBorder: {
- color: true,
- radius: true,
- style: true,
- width: true,
- __experimentalDefaultControls: {
- color: true,
- radius: true,
- style: true,
- width: true
- }
- }
- },
- editorStyle: "wp-block-columns-editor",
- style: "wp-block-columns"
- };
- const {
- name: columns_name
- } = columns_metadata;
- const columns_settings = {
- icon: library_columns,
- variations: columns_variations,
- example: {
- viewportWidth: 600,
- // Columns collapse "@media (max-width: 599px)".
- innerBlocks: [{
- name: 'core/column',
- innerBlocks: [{
- name: 'core/paragraph',
- attributes: {
- /* translators: example text. */
- content: (0,external_wp_i18n_namespaceObject.__)('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.')
- }
- }, {
- name: 'core/image',
- attributes: {
- url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
- }
- }, {
- name: 'core/paragraph',
- attributes: {
- /* translators: example text. */
- content: (0,external_wp_i18n_namespaceObject.__)('Suspendisse commodo neque lacus, a dictum orci interdum et.')
- }
- }]
- }, {
- name: 'core/column',
- innerBlocks: [{
- name: 'core/paragraph',
- attributes: {
- /* translators: example text. */
- content: (0,external_wp_i18n_namespaceObject.__)('Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.')
- }
- }, {
- name: 'core/paragraph',
- attributes: {
- /* translators: example text. */
- content: (0,external_wp_i18n_namespaceObject.__)('Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.')
- }
- }]
- }]
- },
- deprecated: columns_deprecated,
- edit: columns_edit,
- save: columns_save_save,
- transforms: columns_transforms
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-name.js
- /**
- * WordPress dependencies
- */
- const commentAuthorName = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z",
- fillRule: "evenodd",
- clipRule: "evenodd"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15",
- fillRule: "evenodd",
- clipRule: "evenodd"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, {
- cx: "12",
- cy: "9",
- r: "2",
- fillRule: "evenodd",
- clipRule: "evenodd"
- }));
- /* harmony default export */ var comment_author_name = (commentAuthorName);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Renders the `core/comment-author-name` block on the editor.
- *
- * @param {Object} props React props.
- * @param {Object} props.setAttributes Callback for updating block attributes.
- * @param {Object} props.attributes Block attributes.
- * @param {string} props.attributes.isLink Whether the author name should be linked.
- * @param {string} props.attributes.linkTarget Target of the link.
- * @param {string} props.attributes.textAlign Text alignment.
- * @param {Object} props.context Inherited context.
- * @param {string} props.context.commentId The comment ID.
- *
- * @return {JSX.Element} React element.
- */
- function edit_Edit(_ref) {
- let {
- attributes: {
- isLink,
- linkTarget,
- textAlign
- },
- context: {
- commentId
- },
- setAttributes
- } = _ref;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- let displayName = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getEntityRecord
- } = select(external_wp_coreData_namespaceObject.store);
- const comment = getEntityRecord('root', 'comment', commentId);
- const authorName = comment === null || comment === void 0 ? void 0 : comment.author_name; // eslint-disable-line camelcase
- if (comment && !authorName) {
- var _user$name;
- const user = getEntityRecord('root', 'user', comment.author);
- return (_user$name = user === null || user === void 0 ? void 0 : user.name) !== null && _user$name !== void 0 ? _user$name : (0,external_wp_i18n_namespaceObject.__)('Anonymous');
- }
- return authorName !== null && authorName !== void 0 ? authorName : '';
- }, [commentId]);
- const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: newAlign => setAttributes({
- textAlign: newAlign
- })
- }));
- const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Link to authors URL'),
- onChange: () => setAttributes({
- isLink: !isLink
- }),
- checked: isLink
- }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
- onChange: value => setAttributes({
- linkTarget: value ? '_blank' : '_self'
- }),
- checked: linkTarget === '_blank'
- })));
- if (!commentId || !displayName) {
- displayName = (0,external_wp_i18n_namespaceObject._x)('Comment Author', 'block title');
- }
- const displayAuthor = isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#comment-author-pseudo-link",
- onClick: event => event.preventDefault()
- }, displayName) : displayName;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, displayAuthor));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/deprecated.js
- /**
- * Internal dependencies
- */
- const v1 = {
- attributes: {
- isLink: {
- type: 'boolean',
- default: false
- },
- linkTarget: {
- type: 'string',
- default: '_self'
- }
- },
- supports: {
- html: false,
- color: {
- gradients: true,
- link: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true
- }
- },
- save() {
- return null;
- },
- migrate: migrate_font_family,
- isEligible(_ref) {
- var _style$typography;
- let {
- style
- } = _ref;
- return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
- }
- };
- /**
- * New deprecations need to be placed first
- * for them to have higher priority.
- *
- * Old deprecations may need to be updated as well.
- *
- * See block-deprecation.md
- */
- /* harmony default export */ var comment_author_name_deprecated = ([v1]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comment_author_name_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comment-author-name",
- title: "Comment Author Name",
- category: "theme",
- ancestor: ["core/comment-template"],
- description: "Displays the name of the author of the comment.",
- textdomain: "default",
- attributes: {
- isLink: {
- type: "boolean",
- "default": true
- },
- linkTarget: {
- type: "string",
- "default": "_self"
- },
- textAlign: {
- type: "string"
- }
- },
- usesContext: ["commentId"],
- supports: {
- html: false,
- spacing: {
- margin: true,
- padding: true
- },
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true
- }
- }
- };
- const {
- name: comment_author_name_name
- } = comment_author_name_metadata;
- const comment_author_name_settings = {
- icon: comment_author_name,
- edit: edit_Edit,
- deprecated: comment_author_name_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-content.js
- /**
- * WordPress dependencies
- */
- const commentContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"
- }));
- /* harmony default export */ var comment_content = (commentContent);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Renders the `core/comment-content` block on the editor.
- *
- * @param {Object} props React props.
- * @param {Object} props.setAttributes Callback for updating block attributes.
- * @param {Object} props.attributes Block attributes.
- * @param {string} props.attributes.textAlign The `textAlign` attribute.
- * @param {Object} props.context Inherited context.
- * @param {string} props.context.commentId The comment ID.
- *
- * @return {JSX.Element} React element.
- */
- function comment_content_edit_Edit(_ref) {
- let {
- setAttributes,
- attributes: {
- textAlign
- },
- context: {
- commentId
- }
- } = _ref;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- const [content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'content', commentId);
- const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: newAlign => setAttributes({
- textAlign: newAlign
- })
- }));
- if (!commentId || !content) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject._x)('Comment Content', 'block title'))));
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
- key: "html"
- }, content.rendered))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comment_content_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comment-content",
- title: "Comment Content",
- category: "theme",
- ancestor: ["core/comment-template"],
- description: "Displays the contents of a comment.",
- textdomain: "default",
- usesContext: ["commentId"],
- attributes: {
- textAlign: {
- type: "string"
- }
- },
- supports: {
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true
- },
- spacing: {
- padding: ["horizontal", "vertical"],
- __experimentalDefaultControls: {
- padding: true
- }
- },
- html: false
- }
- };
- const {
- name: comment_content_name
- } = comment_content_metadata;
- const comment_content_settings = {
- icon: comment_content,
- edit: comment_content_edit_Edit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-date.js
- /**
- * WordPress dependencies
- */
- const postDate = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var post_date = (postDate);
- ;// CONCATENATED MODULE: external ["wp","date"]
- var external_wp_date_namespaceObject = window["wp"]["date"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/edit.js
- /**
- * WordPress dependencies
- */
- /**
- * Renders the `core/comment-date` block on the editor.
- *
- * @param {Object} props React props.
- * @param {Object} props.setAttributes Callback for updating block attributes.
- * @param {Object} props.attributes Block attributes.
- * @param {string} props.attributes.format Format of the date.
- * @param {string} props.attributes.isLink Whether the author name should be linked.
- * @param {Object} props.context Inherited context.
- * @param {string} props.context.commentId The comment ID.
- *
- * @return {JSX.Element} React element.
- */
- function comment_date_edit_Edit(_ref) {
- let {
- attributes: {
- format,
- isLink
- },
- context: {
- commentId
- },
- setAttributes
- } = _ref;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- let [date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'date', commentId);
- const [siteFormat = (0,external_wp_date_namespaceObject.__experimentalGetSettings)().formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
- const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
- format: format,
- defaultFormat: siteFormat,
- onChange: nextFormat => setAttributes({
- format: nextFormat
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Link to comment'),
- onChange: () => setAttributes({
- isLink: !isLink
- }),
- checked: isLink
- })));
- if (!commentId || !date) {
- date = (0,external_wp_i18n_namespaceObject._x)('Comment Date', 'block title');
- }
- let commentDate = date instanceof Date ? (0,external_wp_element_namespaceObject.createElement)("time", {
- dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date)
- }, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)) : (0,external_wp_element_namespaceObject.createElement)("time", null, date);
- if (isLink) {
- commentDate = (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#comment-date-pseudo-link",
- onClick: event => event.preventDefault()
- }, commentDate);
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, commentDate));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/deprecated.js
- /**
- * Internal dependencies
- */
- const deprecated_v1 = {
- attributes: {
- format: {
- type: 'string'
- },
- isLink: {
- type: 'boolean',
- default: false
- }
- },
- supports: {
- html: false,
- color: {
- gradients: true,
- link: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true
- }
- },
- save() {
- return null;
- },
- migrate: migrate_font_family,
- isEligible(_ref) {
- var _style$typography;
- let {
- style
- } = _ref;
- return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
- }
- };
- /**
- * New deprecations need to be placed first
- * for them to have higher priority.
- *
- * Old deprecations may need to be updated as well.
- *
- * See block-deprecation.md
- */
- /* harmony default export */ var comment_date_deprecated = ([deprecated_v1]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comment_date_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comment-date",
- title: "Comment Date",
- category: "theme",
- ancestor: ["core/comment-template"],
- description: "Displays the date on which the comment was posted.",
- textdomain: "default",
- attributes: {
- format: {
- type: "string"
- },
- isLink: {
- type: "boolean",
- "default": true
- }
- },
- usesContext: ["commentId"],
- supports: {
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- }
- };
- const {
- name: comment_date_name
- } = comment_date_metadata;
- const comment_date_settings = {
- icon: post_date,
- edit: comment_date_edit_Edit,
- deprecated: comment_date_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-edit-link.js
- /**
- * WordPress dependencies
- */
- const commentEditLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "m6.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z"
- }));
- /* harmony default export */ var comment_edit_link = (commentEditLink);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function comment_edit_link_edit_Edit(_ref) {
- let {
- attributes: {
- linkTarget,
- textAlign
- },
- setAttributes
- } = _ref;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: newAlign => setAttributes({
- textAlign: newAlign
- })
- }));
- const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
- onChange: value => setAttributes({
- linkTarget: value ? '_blank' : '_self'
- }),
- checked: linkTarget === '_blank'
- })));
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#edit-comment-pseudo-link",
- onClick: event => event.preventDefault()
- }, (0,external_wp_i18n_namespaceObject.__)('Edit'))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comment_edit_link_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comment-edit-link",
- title: "Comment Edit Link",
- category: "theme",
- ancestor: ["core/comment-template"],
- description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.",
- textdomain: "default",
- usesContext: ["commentId"],
- attributes: {
- linkTarget: {
- type: "string",
- "default": "_self"
- },
- textAlign: {
- type: "string"
- }
- },
- supports: {
- html: false,
- color: {
- link: true,
- gradients: true,
- text: false,
- __experimentalDefaultControls: {
- background: true,
- link: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true
- }
- }
- };
- const {
- name: comment_edit_link_name
- } = comment_edit_link_metadata;
- const comment_edit_link_settings = {
- icon: comment_edit_link,
- edit: comment_edit_link_edit_Edit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js
- /**
- * WordPress dependencies
- */
- const commentReplyLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"
- }));
- /* harmony default export */ var comment_reply_link = (commentReplyLink);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Renders the `core/comment-reply-link` block on the editor.
- *
- * @param {Object} props React props.
- * @param {Object} props.setAttributes Callback for updating block attributes.
- * @param {Object} props.attributes Block attributes.
- * @param {string} props.attributes.textAlign The `textAlign` attribute.
- *
- * @return {JSX.Element} React element.
- */
- function comment_reply_link_edit_Edit(_ref) {
- let {
- setAttributes,
- attributes: {
- textAlign
- }
- } = _ref;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: newAlign => setAttributes({
- textAlign: newAlign
- })
- }));
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#comment-reply-pseudo-link",
- onClick: event => event.preventDefault()
- }, (0,external_wp_i18n_namespaceObject.__)('Reply'))));
- }
- /* harmony default export */ var comment_reply_link_edit = (comment_reply_link_edit_Edit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comment_reply_link_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comment-reply-link",
- title: "Comment Reply Link",
- category: "theme",
- ancestor: ["core/comment-template"],
- description: "Displays a link to reply to a comment.",
- textdomain: "default",
- usesContext: ["commentId"],
- attributes: {
- textAlign: {
- type: "string"
- }
- },
- supports: {
- color: {
- gradients: true,
- link: true,
- text: false,
- __experimentalDefaultControls: {
- background: true,
- link: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true
- },
- html: false
- }
- };
- const {
- name: comment_reply_link_name
- } = comment_reply_link_metadata;
- const comment_reply_link_settings = {
- edit: comment_reply_link_edit,
- icon: comment_reply_link
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
- /**
- * WordPress dependencies
- */
- const layout = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var library_layout = (layout);
- ;// CONCATENATED MODULE: external ["wp","apiFetch"]
- var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
- var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/hooks.js
- /**
- * WordPress dependencies
- */
- // This is limited by WP REST API
- const MAX_COMMENTS_PER_PAGE = 100;
- /**
- * Return an object with the query args needed to fetch the default page of
- * comments.
- *
- * @param {Object} props Hook props.
- * @param {number} props.postId ID of the post that contains the comments.
- * discussion settings.
- *
- * @return {Object} Query args to retrieve the comments.
- */
- const useCommentQueryArgs = _ref => {
- let {
- postId
- } = _ref;
- // Initialize the query args that are not going to change.
- const queryArgs = {
- status: 'approve',
- order: 'asc',
- context: 'embed',
- parent: 0,
- _embed: 'children'
- }; // Get the Discussion settings that may be needed to query the comments.
- const {
- pageComments,
- commentsPerPage,
- defaultCommentsPage: defaultPage
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- const {
- __experimentalDiscussionSettings
- } = getSettings();
- return __experimentalDiscussionSettings;
- }); // WP REST API doesn't allow fetching more than max items limit set per single page of data.
- // As for the editor performance is more important than completeness of data and fetching only the
- // max allowed for single page should be enough for the purpose of design and laying out the page.
- // Fetching over the limit would return an error here but would work with backend query.
- const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; // Get the number of the default page.
- const page = useDefaultPageIndex({
- defaultPage,
- postId,
- perPage,
- queryArgs
- }); // Merge, memoize and return all query arguments, unless the default page's
- // number is not known yet.
- return (0,external_wp_element_namespaceObject.useMemo)(() => {
- return page ? { ...queryArgs,
- post: postId,
- per_page: perPage,
- page
- } : null;
- }, [postId, perPage, page]);
- };
- /**
- * Return the index of the default page, depending on whether `defaultPage` is
- * `newest` or `oldest`. In the first case, the only way to know the page's
- * index is by using the `X-WP-TotalPages` header, which forces to make an
- * additional request.
- *
- * @param {Object} props Hook props.
- * @param {string} props.defaultPage Page shown by default (newest/oldest).
- * @param {number} props.postId ID of the post that contains the comments.
- * @param {number} props.perPage The number of comments included per page.
- * @param {Object} props.queryArgs Other query args.
- *
- * @return {number} Index of the default comments page.
- */
- const useDefaultPageIndex = _ref2 => {
- let {
- defaultPage,
- postId,
- perPage,
- queryArgs
- } = _ref2;
- // Store the default page indices.
- const [defaultPages, setDefaultPages] = (0,external_wp_element_namespaceObject.useState)({});
- const key = `${postId}_${perPage}`;
- const page = defaultPages[key] || 0;
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // Do nothing if the page is already known or not the newest page.
- if (page || defaultPage !== 'newest') {
- return;
- } // We need to fetch comments to know the index. Use HEAD and limit
- // fields just to ID, to make this call as light as possible.
- external_wp_apiFetch_default()({
- path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { ...queryArgs,
- post: postId,
- per_page: perPage,
- _fields: 'id'
- }),
- method: 'HEAD',
- parse: false
- }).then(res => {
- const pages = parseInt(res.headers.get('X-WP-TotalPages'));
- setDefaultPages({ ...defaultPages,
- [key]: pages <= 1 ? 1 : pages // If there are 0 pages, it means that there are no comments, but there is no 0th page.
- });
- });
- }, [defaultPage, postId, perPage, setDefaultPages]); // The oldest one is always the first one.
- return defaultPage === 'newest' ? page : 1;
- };
- /**
- * Generate a tree structure of comment IDs from a list of comment entities. The
- * children of each comment are obtained from `_embedded`.
- *
- * @typedef {{ commentId: number, children: CommentNode }} CommentNode
- *
- * @param {Object[]} topLevelComments List of comment entities.
- * @return {{ commentTree: CommentNode[]}} Tree of comment IDs.
- */
- const useCommentTree = topLevelComments => {
- const commentTree = (0,external_wp_element_namespaceObject.useMemo)(() => topLevelComments === null || topLevelComments === void 0 ? void 0 : topLevelComments.map(_ref3 => {
- let {
- id,
- _embedded
- } = _ref3;
- const [children] = (_embedded === null || _embedded === void 0 ? void 0 : _embedded.children) || [[]];
- return {
- commentId: id,
- children: children.map(child => ({
- commentId: child.id
- }))
- };
- }), [topLevelComments]);
- return commentTree;
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/edit.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']];
- /**
- * Function that returns a comment structure that will be rendered with default placehoders.
- *
- * Each comment has a `commentId` property that is always a negative number in
- * case of the placeholders. This is to ensure that the comment does not
- * conflict with the actual (real) comments.
- *
- * @param {Object} settings Discussion Settings.
- * @param {number} [settings.perPage] - Comments per page setting or block attribute.
- * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting.
- * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments.
- *
- * @typedef {{id: null, children: EmptyComment[]}} EmptyComment
- * @return {EmptyComment[]} Inner blocks of the Comment Template
- */
- const getCommentsPlaceholder = _ref => {
- let {
- perPage,
- threadComments,
- threadCommentsDepth
- } = _ref;
- // In case that `threadCommentsDepth` is falsy, we default to a somewhat
- // arbitrary value of 3.
- // In case that the value is set but larger than 3 we truncate it to 3.
- const commentsDepth = Math.min(threadCommentsDepth || 3, 3); // We set a limit in order not to overload the editor of empty comments.
- const defaultCommentsToShow = perPage <= commentsDepth ? perPage : commentsDepth;
- if (!threadComments || defaultCommentsToShow === 1) {
- // If displaying threaded comments is disabled, we only show one comment
- // A commentId is negative in order to avoid conflicts with the actual comments.
- return [{
- commentId: -1,
- children: []
- }];
- } else if (defaultCommentsToShow === 2) {
- return [{
- commentId: -1,
- children: [{
- commentId: -2,
- children: []
- }]
- }];
- } // In case that the value is set but larger than 3 we truncate it to 3.
- return [{
- commentId: -1,
- children: [{
- commentId: -2,
- children: [{
- commentId: -3,
- children: []
- }]
- }]
- }];
- };
- /**
- * Component which renders the inner blocks of the Comment Template.
- *
- * @param {Object} props Component props.
- * @param {Array} [props.comment] - A comment object.
- * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.
- * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.
- * @param {Array} [props.firstCommentId] - ID of the first comment in the array.
- * @param {Array} [props.blocks] - Array of blocks returned from
- * getBlocks() in parent .
- * @return {WPElement} Inner blocks of the Comment Template
- */
- function CommentTemplateInnerBlocks(_ref2) {
- var _comment$children;
- let {
- comment,
- activeCommentId,
- setActiveCommentId,
- firstCommentId,
- blocks
- } = _ref2;
- const {
- children,
- ...innerBlocksProps
- } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
- template: TEMPLATE
- });
- return (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps, comment.commentId === (activeCommentId || firstCommentId) ? children : null, (0,external_wp_element_namespaceObject.createElement)(MemoizedCommentTemplatePreview, {
- blocks: blocks,
- commentId: comment.commentId,
- setActiveCommentId: setActiveCommentId,
- isHidden: comment.commentId === (activeCommentId || firstCommentId)
- }), (comment === null || comment === void 0 ? void 0 : (_comment$children = comment.children) === null || _comment$children === void 0 ? void 0 : _comment$children.length) > 0 ? (0,external_wp_element_namespaceObject.createElement)(CommentsList, {
- comments: comment.children,
- activeCommentId: activeCommentId,
- setActiveCommentId: setActiveCommentId,
- blocks: blocks,
- firstCommentId: firstCommentId
- }) : null);
- }
- const CommentTemplatePreview = _ref3 => {
- let {
- blocks,
- commentId,
- setActiveCommentId,
- isHidden
- } = _ref3;
- const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
- blocks
- });
- const handleOnClick = () => {
- setActiveCommentId(commentId);
- }; // We have to hide the preview block if the `comment` props points to
- // the curently active block!
- // Or, to put it differently, every preview block is visible unless it is the
- // currently active block - in this case we render its inner blocks.
- const style = {
- display: isHidden ? 'none' : undefined
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockPreviewProps, {
- tabIndex: 0,
- role: "button",
- style: style // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
- ,
- onClick: handleOnClick,
- onKeyPress: handleOnClick
- }));
- };
- const MemoizedCommentTemplatePreview = (0,external_wp_element_namespaceObject.memo)(CommentTemplatePreview);
- /**
- * Component that renders a list of (nested) comments. It is called recursively.
- *
- * @param {Object} props Component props.
- * @param {Array} [props.comments] - Array of comment objects.
- * @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`.
- * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.
- * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.
- * @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent.
- * @param {Object} [props.firstCommentId] - The ID of the first comment in the array of
- * comment objects.
- * @return {WPElement} List of comments.
- */
- const CommentsList = _ref4 => {
- let {
- comments,
- blockProps,
- activeCommentId,
- setActiveCommentId,
- blocks,
- firstCommentId
- } = _ref4;
- return (0,external_wp_element_namespaceObject.createElement)("ol", blockProps, comments && comments.map((_ref5, index) => {
- let {
- commentId,
- ...comment
- } = _ref5;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
- key: comment.commentId || index,
- value: {
- // If the commentId is negative it means that this comment is a
- // "placeholder" and that the block is most likely being used in the
- // site editor. In this case, we have to set the commentId to `null`
- // because otherwise the (non-existent) comment with a negative ID
- // would be reqested from the REST API.
- commentId: commentId < 0 ? null : commentId
- }
- }, (0,external_wp_element_namespaceObject.createElement)(CommentTemplateInnerBlocks, {
- comment: {
- commentId,
- ...comment
- },
- activeCommentId: activeCommentId,
- setActiveCommentId: setActiveCommentId,
- blocks: blocks,
- firstCommentId: firstCommentId
- }));
- }));
- };
- function CommentTemplateEdit(_ref6) {
- var _commentTree$;
- let {
- clientId,
- context: {
- postId
- }
- } = _ref6;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const [activeCommentId, setActiveCommentId] = (0,external_wp_element_namespaceObject.useState)();
- const {
- commentOrder,
- threadCommentsDepth,
- threadComments,
- commentsPerPage
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- return getSettings().__experimentalDiscussionSettings;
- });
- const commentQuery = useCommentQueryArgs({
- postId
- });
- const {
- topLevelComments,
- blocks
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getEntityRecords
- } = select(external_wp_coreData_namespaceObject.store);
- const {
- getBlocks
- } = select(external_wp_blockEditor_namespaceObject.store);
- return {
- // Request only top-level comments. Replies are embedded.
- topLevelComments: commentQuery ? getEntityRecords('root', 'comment', commentQuery) : null,
- blocks: getBlocks(clientId)
- };
- }, [clientId, commentQuery]); // Generate a tree structure of comment IDs.
- let commentTree = useCommentTree( // Reverse the order of top comments if needed.
- commentOrder === 'desc' && topLevelComments ? [...topLevelComments].reverse() : topLevelComments);
- if (!topLevelComments) {
- return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
- }
- if (!postId) {
- commentTree = getCommentsPlaceholder({
- perPage: commentsPerPage,
- threadComments,
- threadCommentsDepth
- });
- }
- if (!commentTree.length) {
- return (0,external_wp_element_namespaceObject.createElement)("p", _extends({}, blockProps, {
- "data-testid": "noresults"
- }), (0,external_wp_i18n_namespaceObject.__)('No results found.'));
- }
- return (0,external_wp_element_namespaceObject.createElement)(CommentsList, {
- comments: commentTree,
- blockProps: blockProps,
- blocks: blocks,
- activeCommentId: activeCommentId,
- setActiveCommentId: setActiveCommentId,
- firstCommentId: (_commentTree$ = commentTree[0]) === null || _commentTree$ === void 0 ? void 0 : _commentTree$.commentId
- });
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/save.js
- /**
- * WordPress dependencies
- */
- function CommentTemplateSave() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comment_template_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comment-template",
- title: "Comment Template",
- category: "design",
- parent: ["core/comments-query-loop"],
- description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.",
- textdomain: "default",
- usesContext: ["postId"],
- supports: {
- reusable: false,
- html: false,
- align: true
- },
- style: "wp-block-comment-template"
- };
- const {
- name: comment_template_name
- } = comment_template_metadata;
- const comment_template_settings = {
- icon: library_layout,
- edit: CommentTemplateEdit,
- save: CommentTemplateSave
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js
- /**
- * WordPress dependencies
- */
- const queryPaginationPrevious = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z"
- }));
- /* harmony default export */ var query_pagination_previous = (queryPaginationPrevious);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/edit.js
- /**
- * WordPress dependencies
- */
- const arrowMap = {
- none: '',
- arrow: '←',
- chevron: '«'
- };
- function CommentsPaginationPreviousEdit(_ref) {
- let {
- attributes: {
- label
- },
- setAttributes,
- context: {
- 'comments/paginationArrow': paginationArrow
- }
- } = _ref;
- const displayArrow = arrowMap[paginationArrow];
- return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
- href: "#comments-pagination-previous-pseudo-link",
- onClick: event => event.preventDefault()
- }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
- className: `wp-block-comments-pagination-previous-arrow is-arrow-${paginationArrow}`
- }, displayArrow), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
- __experimentalVersion: 2,
- tagName: "span",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Older comments page link'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Older Comments'),
- value: label,
- onChange: newLabel => setAttributes({
- label: newLabel
- })
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comments_pagination_previous_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comments-pagination-previous",
- title: "Previous Page",
- category: "theme",
- parent: ["core/comments-pagination"],
- description: "Displays the previous comment's page link.",
- textdomain: "default",
- attributes: {
- label: {
- type: "string"
- }
- },
- usesContext: ["postId", "comments/paginationArrow"],
- supports: {
- reusable: false,
- html: false,
- color: {
- gradients: true,
- text: false,
- __experimentalDefaultControls: {
- background: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- }
- };
- const {
- name: comments_pagination_previous_name
- } = comments_pagination_previous_metadata;
- const comments_pagination_previous_settings = {
- icon: query_pagination_previous,
- edit: CommentsPaginationPreviousEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments.js
- /**
- * WordPress dependencies
- */
- const postComments = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"
- }));
- /* harmony default export */ var post_comments = (postComments);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/edit/comments-inspector-controls.js
- /**
- * WordPress dependencies
- */
- function CommentsInspectorControls(_ref) {
- let {
- attributes: {
- TagName
- },
- setAttributes
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "advanced"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
- options: [{
- label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
- value: 'div'
- }, {
- label: '<section>',
- value: 'section'
- }, {
- label: '<aside>',
- value: 'aside'
- }],
- value: TagName,
- onChange: value => setAttributes({
- tagName: value
- })
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/edit.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const edit_TEMPLATE = [['core/comments-title'], ['core/comment-template', {}, [['core/columns', {}, [['core/column', {
- width: '40px'
- }, [['core/avatar', {
- size: 40,
- style: {
- border: {
- radius: '20px'
- }
- }
- }]]], ['core/column', {}, [['core/comment-author-name', {
- fontSize: 'small'
- }], ['core/group', {
- layout: {
- type: 'flex'
- },
- style: {
- spacing: {
- margin: {
- top: '0px',
- bottom: '0px'
- }
- }
- }
- }, [['core/comment-date', {
- fontSize: 'small'
- }], ['core/comment-edit-link', {
- fontSize: 'small'
- }]]], ['core/comment-content'], ['core/comment-reply-link', {
- fontSize: 'small'
- }]]]]]]], ['core/comments-pagination'], ['core/post-comments-form']];
- function CommentsQueryLoopEdit(_ref) {
- let {
- attributes,
- setAttributes
- } = _ref;
- const {
- tagName: TagName
- } = attributes;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- template: edit_TEMPLATE
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(CommentsInspectorControls, {
- attributes: attributes,
- setAttributes: setAttributes
- }), (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/save.js
- /**
- * WordPress dependencies
- */
- function CommentsQueryLoopSave(_ref) {
- let {
- attributes: {
- tagName: Tag
- }
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comments_query_loop_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comments-query-loop",
- title: "Comments Query Loop",
- category: "theme",
- description: "An advanced block that allows displaying post comments using different visual configurations.",
- textdomain: "default",
- attributes: {
- tagName: {
- type: "string",
- "default": "div"
- }
- },
- supports: {
- align: ["wide", "full"],
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- }
- },
- editorStyle: "wp-block-comments-editor"
- };
- const {
- name: comments_query_loop_name
- } = comments_query_loop_metadata;
- const comments_query_loop_settings = {
- icon: post_comments,
- edit: CommentsQueryLoopEdit,
- save: CommentsQueryLoopSave
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination.js
- /**
- * WordPress dependencies
- */
- const queryPagination = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z"
- }));
- /* harmony default export */ var query_pagination = (queryPagination);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js
- /**
- * WordPress dependencies
- */
- function CommentsPaginationArrowControls(_ref) {
- let {
- value,
- onChange
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
- value: value,
- onChange: onChange,
- help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous comments link.'),
- isBlock: true
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "none",
- label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Comments Pagination Next/Previous blocks')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "arrow",
- label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Comments Pagination Next/Previous blocks')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "chevron",
- label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Comments Pagination Next/Previous blocks')
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/edit.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comments_pagination_edit_TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']];
- const getDefaultBlockLayout = blockTypeOrName => {
- const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
- return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
- };
- function QueryPaginationEdit(_ref) {
- let {
- attributes: {
- paginationArrow,
- layout
- },
- setAttributes,
- clientId,
- name
- } = _ref;
- const usedLayout = layout || getDefaultBlockLayout(name);
- const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlocks
- } = select(external_wp_blockEditor_namespaceObject.store);
- const innerBlocks = getBlocks(clientId);
- /**
- * Show the `paginationArrow` control only if a
- * Comments Pagination Next or Comments Pagination Previous
- * block exists.
- */
- return innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.find(innerBlock => {
- return ['core/comments-pagination-previous', 'core/comments-pagination-next'].includes(innerBlock.name);
- });
- }, []);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- template: comments_pagination_edit_TEMPLATE,
- allowedBlocks: ['core/comments-pagination-previous', 'core/comments-pagination-numbers', 'core/comments-pagination-next'],
- __experimentalLayout: usedLayout
- }); // Get the Discussion settings
- const pageComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- const {
- __experimentalDiscussionSettings
- } = getSettings();
- return __experimentalDiscussionSettings === null || __experimentalDiscussionSettings === void 0 ? void 0 : __experimentalDiscussionSettings.pageComments;
- }, []); // If paging comments is not enabled in the Discussion Settings then hide the pagination
- // controls. We don't want to remove them from the template so that when the user enables
- // paging comments, the controls will be visible.
- if (!pageComments) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Comments Pagination block: paging comments is disabled in the Discussion Settings'));
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Settings')
- }, (0,external_wp_element_namespaceObject.createElement)(CommentsPaginationArrowControls, {
- value: paginationArrow,
- onChange: value => {
- setAttributes({
- paginationArrow: value
- });
- }
- }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/save.js
- /**
- * WordPress dependencies
- */
- function comments_pagination_save_save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comments_pagination_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comments-pagination",
- title: "Comments Pagination",
- category: "theme",
- parent: ["core/comments-query-loop"],
- description: "Displays a paginated navigation to next/previous set of comments, when applicable.",
- textdomain: "default",
- attributes: {
- paginationArrow: {
- type: "string",
- "default": "none"
- }
- },
- providesContext: {
- "comments/paginationArrow": "paginationArrow"
- },
- supports: {
- align: true,
- reusable: false,
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- __experimentalLayout: {
- allowSwitching: false,
- allowInheriting: false,
- "default": {
- type: "flex"
- }
- }
- },
- editorStyle: "wp-block-comments-pagination-editor",
- style: "wp-block-comments-pagination"
- };
- const {
- name: comments_pagination_name
- } = comments_pagination_metadata;
- const comments_pagination_settings = {
- icon: query_pagination,
- edit: QueryPaginationEdit,
- save: comments_pagination_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js
- /**
- * WordPress dependencies
- */
- const queryPaginationNext = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z"
- }));
- /* harmony default export */ var query_pagination_next = (queryPaginationNext);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/edit.js
- /**
- * WordPress dependencies
- */
- const edit_arrowMap = {
- none: '',
- arrow: '→',
- chevron: '»'
- };
- function CommentsPaginationNextEdit(_ref) {
- let {
- attributes: {
- label
- },
- setAttributes,
- context: {
- 'comments/paginationArrow': paginationArrow
- }
- } = _ref;
- const displayArrow = edit_arrowMap[paginationArrow];
- return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
- href: "#comments-pagination-next-pseudo-link",
- onClick: event => event.preventDefault()
- }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
- __experimentalVersion: 2,
- tagName: "span",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Newer comments page link'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Newer Comments'),
- value: label,
- onChange: newLabel => setAttributes({
- label: newLabel
- })
- }), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
- className: `wp-block-comments-pagination-next-arrow is-arrow-${paginationArrow}`
- }, displayArrow));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comments_pagination_next_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comments-pagination-next",
- title: "Next Page",
- category: "theme",
- parent: ["core/comments-pagination"],
- description: "Displays the next comment's page link.",
- textdomain: "default",
- attributes: {
- label: {
- type: "string"
- }
- },
- usesContext: ["postId", "comments/paginationArrow"],
- supports: {
- reusable: false,
- html: false,
- color: {
- gradients: true,
- text: false,
- __experimentalDefaultControls: {
- background: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- }
- };
- const {
- name: comments_pagination_next_name
- } = comments_pagination_next_metadata;
- const comments_pagination_next_settings = {
- icon: query_pagination_next,
- edit: CommentsPaginationNextEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js
- /**
- * WordPress dependencies
- */
- const queryPaginationNumbers = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z"
- }));
- /* harmony default export */ var query_pagination_numbers = (queryPaginationNumbers);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/edit.js
- /**
- * WordPress dependencies
- */
- const PaginationItem = _ref => {
- let {
- content,
- tag: Tag = 'a',
- extraClass = ''
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(Tag, {
- className: `page-numbers ${extraClass}`
- }, content);
- };
- function CommentsPaginationNumbersEdit() {
- return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
- content: "1"
- }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
- content: "2"
- }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
- content: "3",
- tag: "span",
- extraClass: "current"
- }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
- content: "4"
- }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
- content: "5"
- }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
- content: "...",
- tag: "span",
- extraClass: "dots"
- }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
- content: "8"
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comments_pagination_numbers_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comments-pagination-numbers",
- title: "Page Numbers",
- category: "theme",
- parent: ["core/comments-pagination"],
- description: "Displays a list of page numbers for comments pagination.",
- textdomain: "default",
- usesContext: ["postId"],
- supports: {
- reusable: false,
- html: false
- }
- };
- const {
- name: comments_pagination_numbers_name
- } = comments_pagination_numbers_metadata;
- const comments_pagination_numbers_settings = {
- icon: query_pagination_numbers,
- edit: CommentsPaginationNumbersEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-title.js
- /**
- * WordPress dependencies
- */
- const commentTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6 11.9c.6.3 1.3.5 2.1.5.4 0 .8 0 1.2-.1.4-.1.7-.2 1-.3l-.1-1.3c-.3.1-.6.3-.9.3-.3.1-.7.1-1.1.1-.6 0-1.1-.1-1.5-.4-.4-.3-.7-.6-.9-1-.2-.5-.3-1-.3-1.5 0-.6.1-1.1.3-1.5.2-.4.5-.8.9-1 .4-.3.9-.4 1.5-.4.4 0 .7 0 1.1.1l.9.3.1-1.3c-.3-.1-.6-.2-1-.3C9 4 8.6 4 8.2 4c-.9 0-1.6.2-2.2.5-.6.4-1.1.8-1.5 1.5-.3.6-.5 1.3-.5 2.2s.2 1.6.5 2.2c.4.6.9 1.1 1.5 1.5zm-2 2.6V16h16v-1.5H4zM4 20h9v-1.5H4V20z"
- }));
- /* harmony default export */ var comment_title = (commentTitle);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-icon.js
- /**
- * WordPress dependencies
- */
- /** @typedef {import('@wordpress/element').WPComponent} WPComponent */
- /**
- * HeadingLevelIcon props.
- *
- * @typedef WPHeadingLevelIconProps
- *
- * @property {number} level The heading level to show an icon for.
- * @property {?boolean} isPressed Whether or not the icon should appear pressed; default: false.
- */
- /**
- * Heading level icon.
- *
- * @param {WPHeadingLevelIconProps} props Component props.
- *
- * @return {?WPComponent} The icon.
- */
- function HeadingLevelIcon(_ref) {
- let {
- level,
- isPressed = false
- } = _ref;
- const levelToPath = {
- 1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
- 2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z',
- 3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z',
- 4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z',
- 5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
- 6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z'
- };
- if (!levelToPath.hasOwnProperty(level)) {
- return null;
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 20 20",
- xmlns: "http://www.w3.org/2000/svg",
- isPressed: isPressed
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: levelToPath[level]
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-dropdown.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
- const POPOVER_PROPS = {
- className: 'block-library-heading-level-dropdown'
- };
- /** @typedef {import('@wordpress/element').WPComponent} WPComponent */
- /**
- * HeadingLevelDropdown props.
- *
- * @typedef WPHeadingLevelDropdownProps
- *
- * @property {number} selectedLevel The chosen heading level.
- * @property {(newValue:number)=>any} onChange Callback to run when
- * toolbar value is changed.
- */
- /**
- * Dropdown for selecting a heading level (1 through 6).
- *
- * @param {WPHeadingLevelDropdownProps} props Component props.
- *
- * @return {WPComponent} The toolbar.
- */
- function HeadingLevelDropdown(_ref) {
- let {
- selectedLevel,
- onChange
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
- popoverProps: POPOVER_PROPS,
- icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
- level: selectedLevel
- }),
- label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
- controls: HEADING_LEVELS.map(targetLevel => {
- {
- const isActive = targetLevel === selectedLevel;
- return {
- icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
- level: targetLevel,
- isPressed: isActive
- }),
- label: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: heading level e.g: "1", "2", "3"
- (0,external_wp_i18n_namespaceObject.__)('Heading %d'), targetLevel),
- isActive,
- onClick() {
- onChange(targetLevel);
- }
- };
- }
- })
- });
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function comments_title_edit_Edit(_ref) {
- let {
- attributes: {
- textAlign,
- showPostTitle,
- showCommentsCount,
- level
- },
- setAttributes,
- context: {
- postType,
- postId
- }
- } = _ref;
- const TagName = 'h' + level;
- const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
- const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
- const isSiteEditor = typeof postId === 'undefined';
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (isSiteEditor) {
- setCommentsCount(3);
- return;
- }
- const currentPostId = postId;
- external_wp_apiFetch_default()({
- path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', {
- post: postId,
- _fields: 'id'
- }),
- method: 'HEAD',
- parse: false
- }).then(res => {
- // Stale requests will have the `currentPostId` of an older closure.
- if (currentPostId === postId) {
- setCommentsCount(parseInt(res.headers.get('X-WP-Total')));
- }
- }).catch(() => {
- setCommentsCount(0);
- });
- }, [postId]);
- const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: newAlign => setAttributes({
- textAlign: newAlign
- })
- }), (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
- selectedLevel: level,
- onChange: newLevel => setAttributes({
- level: newLevel
- })
- }));
- const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show post title'),
- checked: showPostTitle,
- onChange: value => setAttributes({
- showPostTitle: value
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show comments count'),
- checked: showCommentsCount,
- onChange: value => setAttributes({
- showCommentsCount: value
- })
- })));
- const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)('"Post Title"') : `"${rawTitle}"`;
- let placeholder;
- if (showCommentsCount && commentsCount !== undefined) {
- if (showPostTitle) {
- if (commentsCount === 1) {
- /* translators: %s: Post title. */
- placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle);
- } else {
- placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: 1: Number of comments, 2: Post title. */
- (0,external_wp_i18n_namespaceObject._n)('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle);
- }
- } else if (commentsCount === 1) {
- placeholder = (0,external_wp_i18n_namespaceObject.__)('One response');
- } else {
- placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: Number of comments. */
- (0,external_wp_i18n_namespaceObject._n)('%s responses', '%s responses', commentsCount), commentsCount);
- }
- } else if (showPostTitle) {
- if (commentsCount === 1) {
- /* translators: %s: Post title. */
- placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Response to %s'), postTitle);
- } else {
- /* translators: %s: Post title. */
- placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Responses to %s'), postTitle);
- }
- } else if (commentsCount === 1) {
- placeholder = (0,external_wp_i18n_namespaceObject.__)('Response');
- } else {
- placeholder = (0,external_wp_i18n_namespaceObject.__)('Responses');
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, placeholder));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js
- /**
- * Internal dependencies
- */
- const deprecated_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comments-title",
- title: "Comments Title",
- category: "theme",
- ancestor: ["core/comments-query-loop"],
- description: "Displays a title with the number of comments",
- textdomain: "default",
- usesContext: ["postId", "postType"],
- attributes: {
- textAlign: {
- type: "string"
- },
- showPostTitle: {
- type: "boolean",
- "default": true
- },
- showCommentsCount: {
- type: "boolean",
- "default": true
- },
- level: {
- type: "number",
- "default": 2
- }
- },
- supports: {
- anchor: false,
- align: true,
- html: false,
- __experimentalBorder: {
- radius: true,
- color: true,
- width: true,
- style: true
- },
- color: {
- gradients: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- spacing: {
- margin: true,
- padding: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalFontFamily: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true,
- __experimentalFontFamily: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true
- }
- }
- }
- };
- const {
- attributes,
- supports
- } = deprecated_metadata;
- /* harmony default export */ var comments_title_deprecated = ([{
- attributes: { ...attributes,
- singleCommentLabel: {
- type: 'string'
- },
- multipleCommentsLabel: {
- type: 'string'
- }
- },
- supports,
- migrate: oldAttributes => {
- /* eslint-disable no-unused-vars */
- const {
- singleCommentLabel,
- multipleCommentsLabel,
- ...newAttributes
- } = oldAttributes;
- /* eslint-enable no-unused-vars */
- return newAttributes;
- },
- isEligible: _ref => {
- let {
- multipleCommentsLabel,
- singleCommentLabel
- } = _ref;
- return multipleCommentsLabel || singleCommentLabel;
- },
- save: () => null
- }]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const comments_title_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/comments-title",
- title: "Comments Title",
- category: "theme",
- ancestor: ["core/comments-query-loop"],
- description: "Displays a title with the number of comments",
- textdomain: "default",
- usesContext: ["postId", "postType"],
- attributes: {
- textAlign: {
- type: "string"
- },
- showPostTitle: {
- type: "boolean",
- "default": true
- },
- showCommentsCount: {
- type: "boolean",
- "default": true
- },
- level: {
- type: "number",
- "default": 2
- }
- },
- supports: {
- anchor: false,
- align: true,
- html: false,
- __experimentalBorder: {
- radius: true,
- color: true,
- width: true,
- style: true
- },
- color: {
- gradients: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- spacing: {
- margin: true,
- padding: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalFontFamily: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true,
- __experimentalFontFamily: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true
- }
- }
- }
- };
- const {
- name: comments_title_name
- } = comments_title_metadata;
- const comments_title_settings = {
- icon: comment_title,
- edit: comments_title_edit_Edit,
- deprecated: comments_title_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cover.js
- /**
- * WordPress dependencies
- */
- const cover = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z"
- }));
- /* harmony default export */ var library_cover = (cover);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/shared.js
- /**
- * WordPress dependencies
- */
- const POSITION_CLASSNAMES = {
- 'top left': 'is-position-top-left',
- 'top center': 'is-position-top-center',
- 'top right': 'is-position-top-right',
- 'center left': 'is-position-center-left',
- 'center center': 'is-position-center-center',
- center: 'is-position-center-center',
- 'center right': 'is-position-center-right',
- 'bottom left': 'is-position-bottom-left',
- 'bottom center': 'is-position-bottom-center',
- 'bottom right': 'is-position-bottom-right'
- };
- const IMAGE_BACKGROUND_TYPE = 'image';
- const VIDEO_BACKGROUND_TYPE = 'video';
- const COVER_MIN_HEIGHT = 50;
- const COVER_MAX_HEIGHT = 1000;
- const COVER_DEFAULT_HEIGHT = 300;
- function backgroundImageStyles(url) {
- return url ? {
- backgroundImage: `url(${url})`
- } : {};
- }
- const shared_ALLOWED_MEDIA_TYPES = ['image', 'video'];
- function dimRatioToClass(ratio) {
- return ratio === 50 || !ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
- }
- function attributesFromMedia(setAttributes, dimRatio) {
- return media => {
- if (!media || !media.url) {
- setAttributes({
- url: undefined,
- id: undefined
- });
- return;
- }
- if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
- media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url);
- }
- let mediaType; // For media selections originated from a file upload.
- if (media.media_type) {
- if (media.media_type === IMAGE_BACKGROUND_TYPE) {
- mediaType = IMAGE_BACKGROUND_TYPE;
- } else {
- // only images and videos are accepted so if the media_type is not an image we can assume it is a video.
- // Videos contain the media type of 'file' in the object returned from the rest api.
- mediaType = VIDEO_BACKGROUND_TYPE;
- }
- } else {
- // For media selections originated from existing files in the media library.
- if (media.type !== IMAGE_BACKGROUND_TYPE && media.type !== VIDEO_BACKGROUND_TYPE) {
- return;
- }
- mediaType = media.type;
- }
- setAttributes({
- dimRatio: dimRatio === 100 ? 50 : dimRatio,
- url: media.url,
- id: media.id,
- alt: media === null || media === void 0 ? void 0 : media.alt,
- backgroundType: mediaType,
- ...(mediaType === VIDEO_BACKGROUND_TYPE ? {
- focalPoint: undefined,
- hasParallax: undefined
- } : {})
- });
- };
- }
- /**
- * Checks of the contentPosition is the center (default) position.
- *
- * @param {string} contentPosition The current content position.
- * @return {boolean} Whether the contentPosition is center.
- */
- function isContentPositionCenter(contentPosition) {
- return !contentPosition || contentPosition === 'center center' || contentPosition === 'center';
- }
- /**
- * Retrieves the className for the current contentPosition.
- * The default position (center) will not have a className.
- *
- * @param {string} contentPosition The current content position.
- * @return {string} The className assigned to the contentPosition.
- */
- function getPositionClassName(contentPosition) {
- /*
- * Only render a className if the contentPosition is not center (the default).
- */
- if (isContentPositionCenter(contentPosition)) return '';
- return POSITION_CLASSNAMES[contentPosition];
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Original function to determine the background opacity classname
- *
- * Used in deprecations: v1-7.
- *
- * @param {number} ratio ratio to use for opacity.
- * @return {string} background opacity class .
- */
- function dimRatioToClassV1(ratio) {
- return ratio === 0 || ratio === 50 || !ratio ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
- }
- function migrateDimRatio(attributes) {
- return { ...attributes,
- dimRatio: !attributes.url ? 100 : attributes.dimRatio
- };
- }
- const deprecated_blockAttributes = {
- url: {
- type: 'string'
- },
- id: {
- type: 'number'
- },
- hasParallax: {
- type: 'boolean',
- default: false
- },
- dimRatio: {
- type: 'number',
- default: 50
- },
- overlayColor: {
- type: 'string'
- },
- customOverlayColor: {
- type: 'string'
- },
- backgroundType: {
- type: 'string',
- default: 'image'
- },
- focalPoint: {
- type: 'object'
- }
- }; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`.
- const v9 = {
- attributes: {
- url: {
- type: 'string'
- },
- id: {
- type: 'number'
- },
- alt: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'alt',
- default: ''
- },
- hasParallax: {
- type: 'boolean',
- default: false
- },
- isRepeated: {
- type: 'boolean',
- default: false
- },
- dimRatio: {
- type: 'number',
- default: 100
- },
- overlayColor: {
- type: 'string'
- },
- customOverlayColor: {
- type: 'string'
- },
- backgroundType: {
- type: 'string',
- default: 'image'
- },
- focalPoint: {
- type: 'object'
- },
- minHeight: {
- type: 'number'
- },
- minHeightUnit: {
- type: 'string'
- },
- gradient: {
- type: 'string'
- },
- customGradient: {
- type: 'string'
- },
- contentPosition: {
- type: 'string'
- },
- isDark: {
- type: 'boolean',
- default: true
- },
- allowedBlocks: {
- type: 'array'
- },
- templateLock: {
- type: ['string', 'boolean'],
- enum: ['all', 'insert', false]
- }
- },
- supports: {
- anchor: true,
- align: true,
- html: false,
- spacing: {
- padding: true,
- __experimentalDefaultControls: {
- padding: true
- }
- },
- color: {
- __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
- text: false,
- background: false
- }
- },
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- backgroundType,
- gradient,
- contentPosition,
- customGradient,
- customOverlayColor,
- dimRatio,
- focalPoint,
- hasParallax,
- isDark,
- isRepeated,
- overlayColor,
- url,
- alt,
- id,
- minHeight: minHeightProp,
- minHeightUnit
- } = attributes;
- const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
- const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
- const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
- const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
- const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
- const isImgElement = !(hasParallax || isRepeated);
- const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
- minHeight: minHeight || undefined
- };
- const bgStyle = {
- backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
- background: customGradient ? customGradient : undefined
- };
- const objectPosition = // prettier-ignore
- focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
- const classes = classnames_default()({
- 'is-light': !isDark,
- 'has-parallax': hasParallax,
- 'is-repeated': isRepeated,
- 'has-custom-content-position': !isContentPositionCenter(contentPosition)
- }, getPositionClassName(contentPosition));
- const gradientValue = gradient || customGradient;
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: classes,
- style
- }), (0,external_wp_element_namespaceObject.createElement)("span", {
- "aria-hidden": "true",
- className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
- 'has-background-dim': dimRatio !== undefined,
- // For backwards compatibility. Former versions of the Cover Block applied
- // `.wp-block-cover__gradient-background` in the presence of
- // media, a gradient and a dim.
- 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
- 'has-background-gradient': gradientValue,
- [gradientClass]: gradientClass
- }),
- style: bgStyle
- }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
- className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
- alt: alt,
- src: url,
- style: {
- objectPosition
- },
- "data-object-fit": "cover",
- "data-object-position": objectPosition
- }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
- className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
- autoPlay: true,
- muted: true,
- loop: true,
- playsInline: true,
- src: url,
- style: {
- objectPosition
- },
- "data-object-fit": "cover",
- "data-object-position": objectPosition
- }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
- className: 'wp-block-cover__inner-container'
- })));
- }
- }; // v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`.
- const v8 = {
- attributes: {
- url: {
- type: 'string'
- },
- id: {
- type: 'number'
- },
- alt: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'alt',
- default: ''
- },
- hasParallax: {
- type: 'boolean',
- default: false
- },
- isRepeated: {
- type: 'boolean',
- default: false
- },
- dimRatio: {
- type: 'number',
- default: 100
- },
- overlayColor: {
- type: 'string'
- },
- customOverlayColor: {
- type: 'string'
- },
- backgroundType: {
- type: 'string',
- default: 'image'
- },
- focalPoint: {
- type: 'object'
- },
- minHeight: {
- type: 'number'
- },
- minHeightUnit: {
- type: 'string'
- },
- gradient: {
- type: 'string'
- },
- customGradient: {
- type: 'string'
- },
- contentPosition: {
- type: 'string'
- },
- isDark: {
- type: 'boolean',
- default: true
- },
- allowedBlocks: {
- type: 'array'
- },
- templateLock: {
- type: ['string', 'boolean'],
- enum: ['all', 'insert', false]
- }
- },
- supports: {
- anchor: true,
- align: true,
- html: false,
- spacing: {
- padding: true,
- __experimentalDefaultControls: {
- padding: true
- }
- },
- color: {
- __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
- text: false,
- background: false
- }
- },
- save(_ref2) {
- let {
- attributes
- } = _ref2;
- const {
- backgroundType,
- gradient,
- contentPosition,
- customGradient,
- customOverlayColor,
- dimRatio,
- focalPoint,
- hasParallax,
- isDark,
- isRepeated,
- overlayColor,
- url,
- alt,
- id,
- minHeight: minHeightProp,
- minHeightUnit
- } = attributes;
- const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
- const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
- const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
- const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
- const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
- const isImgElement = !(hasParallax || isRepeated);
- const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
- minHeight: minHeight || undefined
- };
- const bgStyle = {
- backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
- background: customGradient ? customGradient : undefined
- };
- const objectPosition = // prettier-ignore
- focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
- const classes = classnames_default()({
- 'is-light': !isDark,
- 'has-parallax': hasParallax,
- 'is-repeated': isRepeated,
- 'has-custom-content-position': !isContentPositionCenter(contentPosition)
- }, getPositionClassName(contentPosition));
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: classes,
- style
- }), (0,external_wp_element_namespaceObject.createElement)("span", {
- "aria-hidden": "true",
- className: classnames_default()(overlayColorClass, dimRatioToClass(dimRatio), 'wp-block-cover__gradient-background', gradientClass, {
- 'has-background-dim': dimRatio !== undefined,
- 'has-background-gradient': gradient || customGradient,
- [gradientClass]: !url && gradientClass
- }),
- style: bgStyle
- }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
- className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
- alt: alt,
- src: url,
- style: {
- objectPosition
- },
- "data-object-fit": "cover",
- "data-object-position": objectPosition
- }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
- className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
- autoPlay: true,
- muted: true,
- loop: true,
- playsInline: true,
- src: url,
- style: {
- objectPosition
- },
- "data-object-fit": "cover",
- "data-object-position": objectPosition
- }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
- className: 'wp-block-cover__inner-container'
- })));
- }
- };
- const v7 = {
- attributes: { ...deprecated_blockAttributes,
- isRepeated: {
- type: 'boolean',
- default: false
- },
- minHeight: {
- type: 'number'
- },
- minHeightUnit: {
- type: 'string'
- },
- gradient: {
- type: 'string'
- },
- customGradient: {
- type: 'string'
- },
- contentPosition: {
- type: 'string'
- },
- alt: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'alt',
- default: ''
- }
- },
- supports: {
- anchor: true,
- align: true,
- html: false,
- spacing: {
- padding: true,
- __experimentalDefaultControls: {
- padding: true
- }
- },
- color: {
- __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
- text: false,
- background: false
- }
- },
- save(_ref3) {
- let {
- attributes
- } = _ref3;
- const {
- backgroundType,
- gradient,
- contentPosition,
- customGradient,
- customOverlayColor,
- dimRatio,
- focalPoint,
- hasParallax,
- isRepeated,
- overlayColor,
- url,
- alt,
- id,
- minHeight: minHeightProp,
- minHeightUnit
- } = attributes;
- const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
- const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
- const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
- const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
- const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
- const isImgElement = !(hasParallax || isRepeated);
- const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
- backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
- background: customGradient && !url ? customGradient : undefined,
- minHeight: minHeight || undefined
- };
- const objectPosition = // prettier-ignore
- focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
- const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
- 'has-background-dim': dimRatio !== 0,
- 'has-parallax': hasParallax,
- 'is-repeated': isRepeated,
- 'has-background-gradient': gradient || customGradient,
- [gradientClass]: !url && gradientClass,
- 'has-custom-content-position': !isContentPositionCenter(contentPosition)
- }, getPositionClassName(contentPosition));
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: classes,
- style
- }), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
- "aria-hidden": "true",
- className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
- style: customGradient ? {
- background: customGradient
- } : undefined
- }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
- className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
- alt: alt,
- src: url,
- style: {
- objectPosition
- },
- "data-object-fit": "cover",
- "data-object-position": objectPosition
- }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
- className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
- autoPlay: true,
- muted: true,
- loop: true,
- playsInline: true,
- src: url,
- style: {
- objectPosition
- },
- "data-object-fit": "cover",
- "data-object-position": objectPosition
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-cover__inner-container"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
- },
- migrate: migrateDimRatio
- };
- const v6 = {
- attributes: { ...deprecated_blockAttributes,
- isRepeated: {
- type: 'boolean',
- default: false
- },
- minHeight: {
- type: 'number'
- },
- minHeightUnit: {
- type: 'string'
- },
- gradient: {
- type: 'string'
- },
- customGradient: {
- type: 'string'
- },
- contentPosition: {
- type: 'string'
- }
- },
- supports: {
- align: true
- },
- save(_ref4) {
- let {
- attributes
- } = _ref4;
- const {
- backgroundType,
- gradient,
- contentPosition,
- customGradient,
- customOverlayColor,
- dimRatio,
- focalPoint,
- hasParallax,
- isRepeated,
- overlayColor,
- url,
- minHeight: minHeightProp,
- minHeightUnit
- } = attributes;
- const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
- const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
- const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
- const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
- const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
- const style = isImageBackground ? backgroundImageStyles(url) : {};
- const videoStyle = {};
- if (!overlayColorClass) {
- style.backgroundColor = customOverlayColor;
- }
- if (customGradient && !url) {
- style.background = customGradient;
- }
- style.minHeight = minHeight || undefined;
- let positionValue;
- if (focalPoint) {
- positionValue = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`;
- if (isImageBackground && !hasParallax) {
- style.backgroundPosition = positionValue;
- }
- if (isVideoBackground) {
- videoStyle.objectPosition = positionValue;
- }
- }
- const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
- 'has-background-dim': dimRatio !== 0,
- 'has-parallax': hasParallax,
- 'is-repeated': isRepeated,
- 'has-background-gradient': gradient || customGradient,
- [gradientClass]: !url && gradientClass,
- 'has-custom-content-position': !isContentPositionCenter(contentPosition)
- }, getPositionClassName(contentPosition));
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: classes,
- style
- }), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
- "aria-hidden": "true",
- className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
- style: customGradient ? {
- background: customGradient
- } : undefined
- }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
- className: "wp-block-cover__video-background",
- autoPlay: true,
- muted: true,
- loop: true,
- playsInline: true,
- src: url,
- style: videoStyle
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-cover__inner-container"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
- },
- migrate: migrateDimRatio
- };
- const v5 = {
- attributes: { ...deprecated_blockAttributes,
- minHeight: {
- type: 'number'
- },
- gradient: {
- type: 'string'
- },
- customGradient: {
- type: 'string'
- }
- },
- supports: {
- align: true
- },
- save(_ref5) {
- let {
- attributes
- } = _ref5;
- const {
- backgroundType,
- gradient,
- customGradient,
- customOverlayColor,
- dimRatio,
- focalPoint,
- hasParallax,
- overlayColor,
- url,
- minHeight
- } = attributes;
- const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
- const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
- const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
- if (!overlayColorClass) {
- style.backgroundColor = customOverlayColor;
- }
- if (focalPoint && !hasParallax) {
- style.backgroundPosition = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`;
- }
- if (customGradient && !url) {
- style.background = customGradient;
- }
- style.minHeight = minHeight || undefined;
- const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
- 'has-background-dim': dimRatio !== 0,
- 'has-parallax': hasParallax,
- 'has-background-gradient': customGradient,
- [gradientClass]: !url && gradientClass
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: classes,
- style: style
- }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
- "aria-hidden": "true",
- className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
- style: customGradient ? {
- background: customGradient
- } : undefined
- }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
- className: "wp-block-cover__video-background",
- autoPlay: true,
- muted: true,
- loop: true,
- src: url
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-cover__inner-container"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
- },
- migrate: migrateDimRatio
- };
- const v4 = {
- attributes: { ...deprecated_blockAttributes,
- minHeight: {
- type: 'number'
- },
- gradient: {
- type: 'string'
- },
- customGradient: {
- type: 'string'
- }
- },
- supports: {
- align: true
- },
- save(_ref6) {
- let {
- attributes
- } = _ref6;
- const {
- backgroundType,
- gradient,
- customGradient,
- customOverlayColor,
- dimRatio,
- focalPoint,
- hasParallax,
- overlayColor,
- url,
- minHeight
- } = attributes;
- const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
- const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
- const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
- if (!overlayColorClass) {
- style.backgroundColor = customOverlayColor;
- }
- if (focalPoint && !hasParallax) {
- style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
- }
- if (customGradient && !url) {
- style.background = customGradient;
- }
- style.minHeight = minHeight || undefined;
- const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
- 'has-background-dim': dimRatio !== 0,
- 'has-parallax': hasParallax,
- 'has-background-gradient': customGradient,
- [gradientClass]: !url && gradientClass
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: classes,
- style: style
- }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
- "aria-hidden": "true",
- className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
- style: customGradient ? {
- background: customGradient
- } : undefined
- }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
- className: "wp-block-cover__video-background",
- autoPlay: true,
- muted: true,
- loop: true,
- src: url
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-cover__inner-container"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
- },
- migrate: migrateDimRatio
- };
- const v3 = {
- attributes: { ...deprecated_blockAttributes,
- title: {
- type: 'string',
- source: 'html',
- selector: 'p'
- },
- contentAlign: {
- type: 'string',
- default: 'center'
- }
- },
- supports: {
- align: true
- },
- save(_ref7) {
- let {
- attributes
- } = _ref7;
- const {
- backgroundType,
- contentAlign,
- customOverlayColor,
- dimRatio,
- focalPoint,
- hasParallax,
- overlayColor,
- title,
- url
- } = attributes;
- const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
- const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
- if (!overlayColorClass) {
- style.backgroundColor = customOverlayColor;
- }
- if (focalPoint && !hasParallax) {
- style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
- }
- const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
- 'has-background-dim': dimRatio !== 0,
- 'has-parallax': hasParallax,
- [`has-${contentAlign}-content`]: contentAlign !== 'center'
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: classes,
- style: style
- }, VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
- className: "wp-block-cover__video-background",
- autoPlay: true,
- muted: true,
- loop: true,
- src: url
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "p",
- className: "wp-block-cover-text",
- value: title
- }));
- },
- migrate(attributes) {
- const newAttribs = { ...attributes,
- dimRatio: !attributes.url ? 100 : attributes.dimRatio
- };
- return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: attributes.title,
- align: attributes.contentAlign,
- fontSize: 'large',
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
- })]];
- }
- };
- const v2 = {
- attributes: { ...deprecated_blockAttributes,
- title: {
- type: 'string',
- source: 'html',
- selector: 'p'
- },
- contentAlign: {
- type: 'string',
- default: 'center'
- },
- align: {
- type: 'string'
- }
- },
- supports: {
- className: false
- },
- save(_ref8) {
- let {
- attributes
- } = _ref8;
- const {
- url,
- title,
- hasParallax,
- dimRatio,
- align,
- contentAlign,
- overlayColor,
- customOverlayColor
- } = attributes;
- const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
- const style = backgroundImageStyles(url);
- if (!overlayColorClass) {
- style.backgroundColor = customOverlayColor;
- }
- const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), overlayColorClass, {
- 'has-background-dim': dimRatio !== 0,
- 'has-parallax': hasParallax,
- [`has-${contentAlign}-content`]: contentAlign !== 'center'
- }, align ? `align${align}` : null);
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: classes,
- style: style
- }, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "p",
- className: "wp-block-cover-image-text",
- value: title
- }));
- },
- migrate(attributes) {
- const newAttribs = { ...attributes,
- dimRatio: !attributes.url ? 100 : attributes.dimRatio
- };
- return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign', 'align']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: attributes.title,
- align: attributes.contentAlign,
- fontSize: 'large',
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
- })]];
- }
- };
- const cover_deprecated_v1 = {
- attributes: { ...deprecated_blockAttributes,
- title: {
- type: 'string',
- source: 'html',
- selector: 'h2'
- },
- align: {
- type: 'string'
- },
- contentAlign: {
- type: 'string',
- default: 'center'
- }
- },
- supports: {
- className: false
- },
- save(_ref9) {
- let {
- attributes
- } = _ref9;
- const {
- url,
- title,
- hasParallax,
- dimRatio,
- align
- } = attributes;
- const style = backgroundImageStyles(url);
- const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), {
- 'has-background-dim': dimRatio !== 0,
- 'has-parallax': hasParallax
- }, align ? `align${align}` : null);
- return (0,external_wp_element_namespaceObject.createElement)("section", {
- className: classes,
- style: style
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "h2",
- value: title
- }));
- },
- migrate(attributes) {
- const newAttribs = { ...attributes,
- dimRatio: !attributes.url ? 100 : attributes.dimRatio
- };
- return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign', 'align']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: attributes.title,
- align: attributes.contentAlign,
- fontSize: 'large',
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
- })]];
- }
- };
- /* harmony default export */ var cover_deprecated = ([v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1]);
- // EXTERNAL MODULE: ./node_modules/fast-average-color/dist/index.js
- var dist = __webpack_require__(5027);
- var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
- ;// CONCATENATED MODULE: ./node_modules/colord/index.mjs
- var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
- ;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs
- /* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js
- /**
- * WordPress dependencies
- */
- const postFeaturedImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"
- }));
- /* harmony default export */ var post_featured_image = (postFeaturedImage);
- ;// CONCATENATED MODULE: external ["wp","notices"]
- var external_wp_notices_namespaceObject = window["wp"]["notices"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- k([names]);
- const {
- __Visualizer: BoxControlVisualizer
- } = external_wp_components_namespaceObject.__experimentalBoxControl;
- function getInnerBlocksTemplate(attributes) {
- return [['core/paragraph', {
- align: 'center',
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…'),
- ...attributes
- }]];
- }
- function retrieveFastAverageColor() {
- if (!retrieveFastAverageColor.fastAverageColor) {
- retrieveFastAverageColor.fastAverageColor = new (dist_default())();
- }
- return retrieveFastAverageColor.fastAverageColor;
- }
- function CoverHeightInput(_ref) {
- let {
- onChange,
- onUnitChange,
- unit = 'px',
- value = ''
- } = _ref;
- const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
- const inputId = `block-cover-height-input-${instanceId}`;
- const isPx = unit === 'px';
- const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
- availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['px', 'em', 'rem', 'vw', 'vh'],
- defaultValues: {
- px: 430,
- '%': 20,
- em: 20,
- rem: 20,
- vw: 20,
- vh: 50
- }
- });
- const handleOnChange = unprocessedValue => {
- const inputValue = unprocessedValue !== '' ? parseFloat(unprocessedValue) : undefined;
- if (isNaN(inputValue) && inputValue !== undefined) {
- return;
- }
- onChange(inputValue);
- };
- const computedValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
- const [parsedQuantity] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
- return [parsedQuantity, unit].join('');
- }, [unit, value]);
- const min = isPx ? COVER_MIN_HEIGHT : 0;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Minimum height of cover'),
- id: inputId
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
- id: inputId,
- isResetValueOnUnitChange: true,
- min: min,
- onChange: handleOnChange,
- onUnitChange: onUnitChange,
- style: {
- maxWidth: 80
- },
- units: units,
- value: computedValue
- }));
- }
- const RESIZABLE_BOX_ENABLE_OPTION = {
- top: false,
- right: false,
- bottom: true,
- left: false,
- topRight: false,
- bottomRight: false,
- bottomLeft: false,
- topLeft: false
- };
- function ResizableCover(_ref2) {
- let {
- className,
- onResizeStart,
- onResize,
- onResizeStop,
- ...props
- } = _ref2;
- const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
- className: classnames_default()(className, {
- 'is-resizing': isResizing
- }),
- enable: RESIZABLE_BOX_ENABLE_OPTION,
- onResizeStart: (_event, _direction, elt) => {
- onResizeStart(elt.clientHeight);
- onResize(elt.clientHeight);
- },
- onResize: (_event, _direction, elt) => {
- onResize(elt.clientHeight);
- if (!isResizing) {
- setIsResizing(true);
- }
- },
- onResizeStop: (_event, _direction, elt) => {
- onResizeStop(elt.clientHeight);
- setIsResizing(false);
- }
- }, props));
- }
- /**
- * useCoverIsDark is a hook that returns a boolean variable specifying if the cover
- * background is dark or not.
- *
- * @param {?string} url Url of the media background.
- * @param {?number} dimRatio Transparency of the overlay color. If an image and
- * color are set, dimRatio is used to decide what is used
- * for background darkness checking purposes.
- * @param {?string} overlayColor String containing the overlay color value if one exists.
- * @param {?Object} elementRef If a media background is set, elementRef should contain a reference to a
- * dom element that renders that media.
- *
- * @return {boolean} True if the cover background is considered "dark" and false otherwise.
- */
- function useCoverIsDark(url) {
- let dimRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50;
- let overlayColor = arguments.length > 2 ? arguments[2] : undefined;
- let elementRef = arguments.length > 3 ? arguments[3] : undefined;
- const [isDark, setIsDark] = (0,external_wp_element_namespaceObject.useState)(false);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // If opacity is lower than 50 the dominant color is the image or video color,
- // so use that color for the dark mode computation.
- if (url && dimRatio <= 50 && elementRef.current) {
- retrieveFastAverageColor().getColorAsync(elementRef.current, color => {
- setIsDark(color.isDark);
- });
- }
- }, [url, url && dimRatio <= 50 && elementRef.current, setIsDark]);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // If opacity is greater than 50 the dominant color is the overlay color,
- // so use that color for the dark mode computation.
- if (dimRatio > 50 || !url) {
- if (!overlayColor) {
- // If no overlay color exists the overlay color is black (isDark )
- setIsDark(true);
- return;
- }
- setIsDark(w(overlayColor).isDark());
- }
- }, [overlayColor, dimRatio > 50 || !url, setIsDark]);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!url && !overlayColor) {
- // Reset isDark.
- setIsDark(false);
- }
- }, [!url && !overlayColor, setIsDark]);
- return isDark;
- }
- function mediaPosition(_ref3) {
- let {
- x,
- y
- } = _ref3;
- return `${Math.round(x * 100)}% ${Math.round(y * 100)}%`;
- }
- /**
- * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while
- * the media (image or video) is being uploaded and will not have an id allocated yet.
- *
- * @param {number} id The id of the media.
- * @param {string} url The url of the media.
- *
- * @return {boolean} Is the URL a Blob URL.
- */
- const isTemporaryMedia = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
- function CoverPlaceholder(_ref4) {
- let {
- disableMediaButtons = false,
- children,
- onSelectMedia,
- onError,
- style
- } = _ref4;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: library_cover
- }),
- labels: {
- title: (0,external_wp_i18n_namespaceObject.__)('Cover'),
- instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop onto this block, upload, or select existing media from your library.')
- },
- onSelect: onSelectMedia,
- accept: "image/*,video/*",
- allowedTypes: shared_ALLOWED_MEDIA_TYPES,
- disableMediaButtons: disableMediaButtons,
- onError: onError,
- style: style
- }, children);
- }
- function CoverEdit(_ref5) {
- var _useSetting, _styleAttribute$spaci, _styleAttribute$visua;
- let {
- attributes,
- clientId,
- isSelected,
- overlayColor,
- setAttributes,
- setOverlayColor,
- toggleSelection,
- context: {
- postId,
- postType
- }
- } = _ref5;
- const {
- contentPosition,
- id,
- useFeaturedImage,
- dimRatio,
- focalPoint,
- hasParallax,
- isDark,
- isRepeated,
- minHeight,
- minHeightUnit,
- style: styleAttribute,
- alt,
- allowedBlocks,
- templateLock
- } = attributes;
- const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId);
- const media = (0,external_wp_data_namespaceObject.useSelect)(select => featuredImage && select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, {
- context: 'view'
- }), [featuredImage]);
- const mediaUrl = media === null || media === void 0 ? void 0 : media.source_url; // instead of destructuring the attributes
- // we define the url and background type
- // depending on the value of the useFeaturedImage flag
- // to preview in edit the dynamic featured image
- const url = useFeaturedImage ? mediaUrl : attributes.url;
- const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : attributes.backgroundType;
- const {
- __unstableMarkNextChangeAsNotPersistent
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const {
- createErrorNotice
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
- const {
- gradientClass,
- gradientValue,
- setGradient
- } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
- const onSelectMedia = attributesFromMedia(setAttributes, dimRatio);
- const isUploadingMedia = isTemporaryMedia(id, url);
- const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight);
- const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit);
- const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100;
- const toggleMinFullHeight = () => {
- if (isMinFullHeight) {
- // If there aren't previous values, take the default ones.
- if (prevMinHeightUnit === 'vh' && prevMinHeightValue === 100) {
- return setAttributes({
- minHeight: undefined,
- minHeightUnit: undefined
- });
- } // Set the previous values of height.
- return setAttributes({
- minHeight: prevMinHeightValue,
- minHeightUnit: prevMinHeightUnit
- });
- }
- setPrevMinHeightValue(minHeight);
- setPrevMinHeightUnit(minHeightUnit); // Set full height.
- return setAttributes({
- minHeight: 100,
- minHeightUnit: 'vh'
- });
- };
- const toggleParallax = () => {
- setAttributes({
- hasParallax: !hasParallax,
- ...(!hasParallax ? {
- focalPoint: undefined
- } : {})
- });
- };
- const toggleIsRepeated = () => {
- setAttributes({
- isRepeated: !isRepeated
- });
- };
- const toggleUseFeaturedImage = () => {
- setAttributes({
- id: undefined,
- url: undefined,
- useFeaturedImage: !useFeaturedImage,
- dimRatio: dimRatio === 100 ? 50 : dimRatio,
- backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined
- });
- };
- const onUploadError = message => {
- createErrorNotice(Array.isArray(message) ? message[2] : message, {
- type: 'snackbar'
- });
- };
- const isDarkElement = (0,external_wp_element_namespaceObject.useRef)();
- const isCoverDark = useCoverIsDark(url, dimRatio, overlayColor.color, isDarkElement);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // This side-effect should not create an undo level.
- __unstableMarkNextChangeAsNotPersistent();
- setAttributes({
- isDark: isCoverDark
- });
- }, [isCoverDark]);
- const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
- const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
- const minHeightWithUnit = minHeight && minHeightUnit ? `${minHeight}${minHeightUnit}` : minHeight;
- const isImgElement = !(hasParallax || isRepeated);
- const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : undefined),
- minHeight: minHeightWithUnit || undefined
- };
- const bgStyle = {
- backgroundColor: overlayColor.color
- };
- const mediaStyle = {
- objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined
- };
- const hasBackground = !!(url || overlayColor.color || gradientValue);
- const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated);
- const imperativeFocalPointPreview = value => {
- const [styleOfRef, property] = isDarkElement.current ? [isDarkElement.current.style, 'objectPosition'] : [ref.current.style, 'backgroundPosition'];
- styleOfRef[property] = mediaPosition(value);
- };
- const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]);
- const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Change content position'),
- value: contentPosition,
- onChange: nextPosition => setAttributes({
- contentPosition: nextPosition
- }),
- isDisabled: !hasInnerBlocks
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, {
- isActive: isMinFullHeight,
- onToggle: toggleMinFullHeight,
- isDisabled: !hasInnerBlocks
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- icon: post_featured_image,
- label: (0,external_wp_i18n_namespaceObject.__)('Use featured image'),
- isPressed: useFeaturedImage,
- onClick: toggleUseFeaturedImage
- }), !useFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
- mediaId: id,
- mediaURL: url,
- allowedTypes: shared_ALLOWED_MEDIA_TYPES,
- accept: "image/*,video/*",
- onSelect: onSelectMedia,
- name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add Media') : (0,external_wp_i18n_namespaceObject.__)('Replace')
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, !!url && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Media settings')
- }, isImageBackground && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'),
- checked: hasParallax,
- onChange: toggleParallax
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'),
- checked: isRepeated,
- onChange: toggleIsRepeated
- })), showFocalPointPicker && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, {
- label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'),
- url: url,
- value: focalPoint,
- onDragStart: imperativeFocalPointPreview,
- onDrag: imperativeFocalPointPreview,
- onChange: newFocalPoint => setAttributes({
- focalPoint: newFocalPoint
- })
- }), !useFeaturedImage && url && isImageBackground && isImgElement && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
- value: alt,
- onChange: newAlt => setAttributes({
- alt: newAlt
- }),
- help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
- href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
- }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "secondary",
- isSmall: true,
- className: "block-library-cover__reset-button",
- onClick: () => setAttributes({
- url: undefined,
- id: undefined,
- backgroundType: undefined,
- focalPoint: undefined,
- hasParallax: undefined,
- isRepeated: undefined,
- useFeaturedImage: false
- })
- }, (0,external_wp_i18n_namespaceObject.__)('Clear Media')))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalPanelColorGradientSettings, {
- __experimentalHasMultipleOrigins: true,
- __experimentalIsRenderedInSidebar: true,
- title: (0,external_wp_i18n_namespaceObject.__)('Overlay'),
- initialOpen: true,
- settings: [{
- colorValue: overlayColor.color,
- gradientValue,
- onColorChange: setOverlayColor,
- onGradientChange: setGradient,
- label: (0,external_wp_i18n_namespaceObject.__)('Color')
- }]
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Opacity'),
- value: dimRatio,
- onChange: newDimRation => setAttributes({
- dimRatio: newDimRation
- }),
- min: 0,
- max: 100,
- step: 10,
- required: true
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "dimensions"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
- hasValue: () => !!minHeight,
- label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'),
- onDeselect: () => setAttributes({
- minHeight: undefined,
- minHeightUnit: undefined
- }),
- resetAllFilter: () => ({
- minHeight: undefined,
- minHeightUnit: undefined
- }),
- isShownByDefault: true,
- panelId: clientId
- }, (0,external_wp_element_namespaceObject.createElement)(CoverHeightInput, {
- value: minHeight,
- unit: minHeightUnit,
- onChange: newMinHeight => setAttributes({
- minHeight: newMinHeight
- }),
- onUnitChange: nextUnit => setAttributes({
- minHeightUnit: nextUnit
- })
- }))));
- const ref = (0,external_wp_element_namespaceObject.useRef)();
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- ref
- }); // Check for fontSize support before we pass a fontSize attribute to the innerBlocks.
- const hasFontSizes = !!((_useSetting = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.fontSizes')) !== null && _useSetting !== void 0 && _useSetting.length);
- const innerBlocksTemplate = getInnerBlocksTemplate({
- fontSize: hasFontSizes ? 'large' : undefined
- });
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
- className: 'wp-block-cover__inner-container'
- }, {
- template: innerBlocksTemplate,
- templateInsertUpdatesSelection: true,
- allowedBlocks,
- templateLock
- });
- if (!hasInnerBlocks && !hasBackground) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
- className: classnames_default()('is-placeholder', blockProps.className)
- }), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, {
- onSelectMedia: onSelectMedia,
- onError: onUploadError,
- style: {
- minHeight: minHeightWithUnit || undefined
- }
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-cover__placeholder-background-options"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ColorPalette, {
- disableCustomColors: true,
- value: overlayColor.color,
- onChange: setOverlayColor,
- clearable: false
- }))), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, {
- className: "block-library-cover__resize-container",
- onResizeStart: () => {
- setAttributes({
- minHeightUnit: 'px'
- });
- toggleSelection(false);
- },
- onResize: value => {
- setAttributes({
- minHeight: value
- });
- },
- onResizeStop: newMinHeight => {
- toggleSelection(true);
- setAttributes({
- minHeight: newMinHeight
- });
- },
- showHandle: isSelected
- })));
- }
- const classes = classnames_default()({
- 'is-dark-theme': isDark,
- 'is-light': !isDark,
- 'is-transient': isUploadingMedia,
- 'has-parallax': hasParallax,
- 'is-repeated': isRepeated,
- 'has-custom-content-position': !isContentPositionCenter(contentPosition)
- }, getPositionClassName(contentPosition));
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
- className: classnames_default()(classes, blockProps.className),
- style: { ...style,
- ...blockProps.style
- },
- "data-url": url
- }), (0,external_wp_element_namespaceObject.createElement)(BoxControlVisualizer, {
- values: styleAttribute === null || styleAttribute === void 0 ? void 0 : (_styleAttribute$spaci = styleAttribute.spacing) === null || _styleAttribute$spaci === void 0 ? void 0 : _styleAttribute$spaci.padding,
- showValues: styleAttribute === null || styleAttribute === void 0 ? void 0 : (_styleAttribute$visua = styleAttribute.visualizers) === null || _styleAttribute$visua === void 0 ? void 0 : _styleAttribute$visua.padding,
- className: "block-library-cover__padding-visualizer"
- }), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, {
- className: "block-library-cover__resize-container",
- onResizeStart: () => {
- setAttributes({
- minHeightUnit: 'px'
- });
- toggleSelection(false);
- },
- onResize: value => {
- setAttributes({
- minHeight: value
- });
- },
- onResizeStop: newMinHeight => {
- toggleSelection(true);
- setAttributes({
- minHeight: newMinHeight
- });
- },
- showHandle: isSelected
- }), (0,external_wp_element_namespaceObject.createElement)("span", {
- "aria-hidden": "true",
- className: classnames_default()('wp-block-cover__background', dimRatioToClass(dimRatio), {
- [overlayColor.class]: overlayColor.class,
- 'has-background-dim': dimRatio !== undefined,
- // For backwards compatibility. Former versions of the Cover Block applied
- // `.wp-block-cover__gradient-background` in the presence of
- // media, a gradient and a dim.
- 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
- 'has-background-gradient': gradientValue,
- [gradientClass]: gradientClass
- }),
- style: {
- backgroundImage: gradientValue,
- ...bgStyle
- }
- }), url && isImageBackground && isImgElement && (0,external_wp_element_namespaceObject.createElement)("img", {
- ref: isDarkElement,
- className: "wp-block-cover__image-background",
- alt: alt,
- src: url,
- style: mediaStyle
- }), url && isVideoBackground && (0,external_wp_element_namespaceObject.createElement)("video", {
- ref: isDarkElement,
- className: "wp-block-cover__video-background",
- autoPlay: true,
- muted: true,
- loop: true,
- src: url,
- style: mediaStyle
- }), isUploadingMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, {
- disableMediaButtons: true,
- onSelectMedia: onSelectMedia,
- onError: onUploadError
- }), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
- }
- /* harmony default export */ var cover_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({
- overlayColor: 'background-color'
- })])(CoverEdit));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function cover_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- backgroundType,
- gradient,
- contentPosition,
- customGradient,
- customOverlayColor,
- dimRatio,
- focalPoint,
- useFeaturedImage,
- hasParallax,
- isDark,
- isRepeated,
- overlayColor,
- url,
- alt,
- id,
- minHeight: minHeightProp,
- minHeightUnit
- } = attributes;
- const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
- const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
- const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
- const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
- const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
- const isImgElement = !(hasParallax || isRepeated);
- const style = { ...(isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}),
- minHeight: minHeight || undefined
- };
- const bgStyle = {
- backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
- background: customGradient ? customGradient : undefined
- };
- const objectPosition = // prettier-ignore
- focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
- const classes = classnames_default()({
- 'is-light': !isDark,
- 'has-parallax': hasParallax,
- 'is-repeated': isRepeated,
- 'has-custom-content-position': !isContentPositionCenter(contentPosition)
- }, getPositionClassName(contentPosition));
- const gradientValue = gradient || customGradient;
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: classes,
- style
- }), (0,external_wp_element_namespaceObject.createElement)("span", {
- "aria-hidden": "true",
- className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
- 'has-background-dim': dimRatio !== undefined,
- // For backwards compatibility. Former versions of the Cover Block applied
- // `.wp-block-cover__gradient-background` in the presence of
- // media, a gradient and a dim.
- 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
- 'has-background-gradient': gradientValue,
- [gradientClass]: gradientClass
- }),
- style: bgStyle
- }), !useFeaturedImage && isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
- className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
- alt: alt,
- src: url,
- style: {
- objectPosition
- },
- "data-object-fit": "cover",
- "data-object-position": objectPosition
- }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
- className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
- autoPlay: true,
- muted: true,
- loop: true,
- playsInline: true,
- src: url,
- style: {
- objectPosition
- },
- "data-object-fit": "cover",
- "data-object-position": objectPosition
- }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
- className: 'wp-block-cover__inner-container'
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/transforms.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const cover_transforms_transforms = {
- from: [{
- type: 'block',
- blocks: ['core/image'],
- transform: _ref => {
- var _style$color;
- let {
- caption,
- url,
- alt,
- align,
- id,
- anchor,
- style
- } = _ref;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', {
- dimRatio: 50,
- url,
- alt,
- align,
- id,
- anchor,
- style: {
- color: {
- duotone: style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone
- }
- }
- }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: caption,
- fontSize: 'large',
- align: 'center'
- })]);
- }
- }, {
- type: 'block',
- blocks: ['core/video'],
- transform: _ref2 => {
- let {
- caption,
- src,
- align,
- id,
- anchor
- } = _ref2;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', {
- dimRatio: 50,
- url: src,
- align,
- id,
- backgroundType: VIDEO_BACKGROUND_TYPE,
- anchor
- }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: caption,
- fontSize: 'large',
- align: 'center'
- })]);
- }
- }, {
- type: 'block',
- blocks: ['core/group'],
- transform: (attributes, innerBlocks) => {
- var _style$color2, _style$color3, _style$color4, _style$color5, _attributes$style;
- const {
- align,
- anchor,
- backgroundColor,
- gradient,
- style
- } = attributes; // If no background or gradient color is provided, default to 50% opacity.
- // This matches the styling of a Cover block with a background image,
- // in the state where a background image has been removed.
- const dimRatio = backgroundColor || gradient || style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background || style !== null && style !== void 0 && (_style$color3 = style.color) !== null && _style$color3 !== void 0 && _style$color3.gradient ? undefined : 50; // Move the background or gradient color to the parent Cover block.
- const parentAttributes = {
- align,
- anchor,
- dimRatio,
- overlayColor: backgroundColor,
- customOverlayColor: style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.background,
- gradient,
- customGradient: style === null || style === void 0 ? void 0 : (_style$color5 = style.color) === null || _style$color5 === void 0 ? void 0 : _style$color5.gradient
- };
- const attributesWithoutBackgroundColors = { ...attributes,
- backgroundColor: undefined,
- gradient: undefined,
- style: { ...(attributes === null || attributes === void 0 ? void 0 : attributes.style),
- color: { ...(attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.color),
- background: undefined,
- gradient: undefined
- }
- }
- }; // Preserve the block by nesting it within the Cover block,
- // instead of converting the Group block directly to the Cover block.
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', parentAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/group', attributesWithoutBackgroundColors, innerBlocks)]);
- }
- }],
- to: [{
- type: 'block',
- blocks: ['core/image'],
- isMatch: _ref3 => {
- let {
- backgroundType,
- url,
- overlayColor,
- customOverlayColor,
- gradient,
- customGradient
- } = _ref3;
- if (url) {
- // If a url exists the transform could happen if that URL represents an image background.
- return backgroundType === IMAGE_BACKGROUND_TYPE;
- } // If a url is not set the transform could happen if the cover has no background color or gradient;
- return !overlayColor && !customOverlayColor && !gradient && !customGradient;
- },
- transform: _ref4 => {
- var _style$color6;
- let {
- title,
- url,
- alt,
- align,
- id,
- anchor,
- style
- } = _ref4;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- caption: title,
- url,
- alt,
- align,
- id,
- anchor,
- style: {
- color: {
- duotone: style === null || style === void 0 ? void 0 : (_style$color6 = style.color) === null || _style$color6 === void 0 ? void 0 : _style$color6.duotone
- }
- }
- });
- }
- }, {
- type: 'block',
- blocks: ['core/video'],
- isMatch: _ref5 => {
- let {
- backgroundType,
- url,
- overlayColor,
- customOverlayColor,
- gradient,
- customGradient
- } = _ref5;
- if (url) {
- // If a url exists the transform could happen if that URL represents a video background.
- return backgroundType === VIDEO_BACKGROUND_TYPE;
- } // If a url is not set the transform could happen if the cover has no background color or gradient;
- return !overlayColor && !customOverlayColor && !gradient && !customGradient;
- },
- transform: _ref6 => {
- let {
- title,
- url,
- align,
- id,
- anchor
- } = _ref6;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
- caption: title,
- src: url,
- id,
- align,
- anchor
- });
- }
- }]
- };
- /* harmony default export */ var cover_transforms = (cover_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const cover_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/cover",
- title: "Cover",
- category: "media",
- description: "Add an image or video with a text overlay \u2014 great for headers.",
- textdomain: "default",
- attributes: {
- url: {
- type: "string"
- },
- useFeaturedImage: {
- type: "boolean",
- "default": false
- },
- id: {
- type: "number"
- },
- alt: {
- type: "string",
- source: "attribute",
- selector: "img",
- attribute: "alt",
- "default": ""
- },
- hasParallax: {
- type: "boolean",
- "default": false
- },
- isRepeated: {
- type: "boolean",
- "default": false
- },
- dimRatio: {
- type: "number",
- "default": 100
- },
- overlayColor: {
- type: "string"
- },
- customOverlayColor: {
- type: "string"
- },
- backgroundType: {
- type: "string",
- "default": "image"
- },
- focalPoint: {
- type: "object"
- },
- minHeight: {
- type: "number"
- },
- minHeightUnit: {
- type: "string"
- },
- gradient: {
- type: "string"
- },
- customGradient: {
- type: "string"
- },
- contentPosition: {
- type: "string"
- },
- isDark: {
- type: "boolean",
- "default": true
- },
- allowedBlocks: {
- type: "array"
- },
- templateLock: {
- type: ["string", "boolean"],
- "enum": ["all", "insert", false]
- }
- },
- usesContext: ["postId", "postType"],
- supports: {
- anchor: true,
- align: true,
- html: false,
- spacing: {
- padding: true,
- __experimentalDefaultControls: {
- padding: true
- }
- },
- color: {
- __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
- text: false,
- background: false
- }
- },
- editorStyle: "wp-block-cover-editor",
- style: "wp-block-cover"
- };
- const {
- name: cover_name
- } = cover_metadata;
- const cover_settings = {
- icon: library_cover,
- example: {
- attributes: {
- customOverlayColor: '#065174',
- dimRatio: 40,
- url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
- },
- innerBlocks: [{
- name: 'core/paragraph',
- attributes: {
- customFontSize: 48,
- content: (0,external_wp_i18n_namespaceObject.__)('<strong>Snow Patrol</strong>'),
- align: 'center'
- }
- }]
- },
- transforms: cover_transforms,
- save: cover_save_save,
- edit: cover_edit,
- deprecated: cover_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js
- /**
- * WordPress dependencies
- */
- const pencil = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var library_pencil = (pencil);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
- /**
- * Internal dependencies
- */
- /* harmony default export */ var library_edit = (library_pencil);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js
- /**
- * WordPress dependencies
- */
- function getResponsiveHelp(checked) {
- return checked ? (0,external_wp_i18n_namespaceObject.__)('This embed will preserve its aspect ratio when the browser is resized.') : (0,external_wp_i18n_namespaceObject.__)('This embed may not preserve its aspect ratio when the browser is resized.');
- }
- const EmbedControls = _ref => {
- let {
- blockSupportsResponsive,
- showEditButton,
- themeSupportsResponsive,
- allowResponsive,
- toggleResponsive,
- switchBackToURLInput
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, showEditButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- className: "components-toolbar__control",
- label: (0,external_wp_i18n_namespaceObject.__)('Edit URL'),
- icon: library_edit,
- onClick: switchBackToURLInput
- }))), themeSupportsResponsive && blockSupportsResponsive && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Media settings'),
- className: "blocks-responsive"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Resize for smaller devices'),
- checked: allowResponsive,
- help: getResponsiveHelp,
- onChange: toggleResponsive
- }))));
- };
- /* harmony default export */ var embed_controls = (EmbedControls);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/icons.js
- /**
- * WordPress dependencies
- */
- const embedContentIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"
- }));
- const embedAudioIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z"
- }));
- const embedPhotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"
- }));
- const embedVideoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z"
- }));
- const embedTwitterIcon = {
- foreground: '#1da1f2',
- src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z"
- })))
- };
- const embedYouTubeIcon = {
- foreground: '#ff0000',
- src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"
- }))
- };
- const embedFacebookIcon = {
- foreground: '#3b5998',
- src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z"
- }))
- };
- const embedInstagramIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z"
- })));
- const embedWordPressIcon = {
- foreground: '#0073AA',
- src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z"
- })))
- };
- const embedSpotifyIcon = {
- foreground: '#1db954',
- src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325"
- }))
- };
- const embedFlickrIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z"
- }));
- const embedVimeoIcon = {
- foreground: '#1ab7ea',
- src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z"
- })))
- };
- const embedRedditIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M22 11.816c0-1.256-1.02-2.277-2.277-2.277-.593 0-1.122.24-1.526.613-1.48-.965-3.455-1.594-5.647-1.69l1.17-3.702 3.18.75c.01 1.027.847 1.86 1.877 1.86 1.035 0 1.877-.84 1.877-1.877 0-1.035-.842-1.877-1.877-1.877-.77 0-1.43.466-1.72 1.13L13.55 3.92c-.204-.047-.4.067-.46.26l-1.35 4.27c-2.317.037-4.412.67-5.97 1.67-.402-.355-.917-.58-1.493-.58C3.02 9.54 2 10.56 2 11.815c0 .814.433 1.523 1.078 1.925-.037.222-.06.445-.06.673 0 3.292 4.01 5.97 8.94 5.97s8.94-2.678 8.94-5.97c0-.214-.02-.424-.052-.632.687-.39 1.154-1.12 1.154-1.964zm-3.224-7.422c.606 0 1.1.493 1.1 1.1s-.493 1.1-1.1 1.1-1.1-.494-1.1-1.1.493-1.1 1.1-1.1zm-16 7.422c0-.827.673-1.5 1.5-1.5.313 0 .598.103.838.27-.85.675-1.477 1.478-1.812 2.36-.32-.274-.525-.676-.525-1.13zm9.183 7.79c-4.502 0-8.165-2.33-8.165-5.193S7.457 9.22 11.96 9.22s8.163 2.33 8.163 5.193-3.663 5.193-8.164 5.193zM20.635 13c-.326-.89-.948-1.7-1.797-2.383.247-.186.55-.3.882-.3.827 0 1.5.672 1.5 1.5 0 .482-.23.91-.586 1.184zm-11.64 1.704c-.76 0-1.397-.616-1.397-1.376 0-.76.636-1.397 1.396-1.397.76 0 1.376.638 1.376 1.398 0 .76-.616 1.376-1.376 1.376zm7.405-1.376c0 .76-.615 1.376-1.375 1.376s-1.4-.616-1.4-1.376c0-.76.64-1.397 1.4-1.397.76 0 1.376.638 1.376 1.398zm-1.17 3.38c.15.152.15.398 0 .55-.675.674-1.728 1.002-3.22 1.002l-.01-.002-.012.002c-1.492 0-2.544-.328-3.218-1.002-.152-.152-.152-.398 0-.55.152-.152.4-.15.55 0 .52.52 1.394.775 2.67.775l.01.002.01-.002c1.276 0 2.15-.253 2.67-.775.15-.152.398-.152.55 0z"
- }));
- const embedTumblrIcon = {
- foreground: '#35465c',
- src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z"
- }))
- };
- const embedAmazonIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z"
- }));
- const embedAnimotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",
- fill: "#4bc7ee"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z",
- fill: "#d4cdcb"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",
- fill: "#c3d82e"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z",
- fill: "#e4ecb0"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z",
- fill: "#209dbd"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",
- fill: "#7cb3c9"
- }));
- const embedDailymotionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "m12.1479 18.5957c-2.4949 0-4.28131-1.7558-4.28131-4.0658 0-2.2176 1.78641-4.0965 4.09651-4.0965 2.2793 0 4.0349 1.7864 4.0349 4.1581 0 2.2794-1.7556 4.0042-3.8501 4.0042zm8.3521-18.5957-4.5329 1v7c-1.1088-1.41691-2.8028-1.8787-4.8049-1.8787-2.09443 0-3.97329.76993-5.5133 2.27917-1.72483 1.66323-2.6489 3.78863-2.6489 6.16033 0 2.5873.98562 4.8049 2.89526 6.499 1.44763 1.2936 3.17251 1.9402 5.17454 1.9402 1.9713 0 3.4498-.5236 4.8973-1.9402v1.9402h4.5329c0-7.6359 0-15.3641 0-23z",
- fill: "#333436"
- }));
- const embedPinterestIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"
- }));
- const embedWolframIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- viewBox: "0 0 44 44"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js
- /**
- * WordPress dependencies
- */
- const EmbedLoading = () => (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-embed is-loading"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
- /* harmony default export */ var embed_loading = (EmbedLoading);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js
- /**
- * WordPress dependencies
- */
- const EmbedPlaceholder = _ref => {
- let {
- icon,
- label,
- value,
- onSubmit,
- onChange,
- cannotEmbed,
- fallback,
- tryAgain
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: icon,
- showColors: true
- }),
- label: label,
- className: "wp-block-embed",
- instructions: (0,external_wp_i18n_namespaceObject.__)('Paste a link to the content you want to display on your site.')
- }, (0,external_wp_element_namespaceObject.createElement)("form", {
- onSubmit: onSubmit
- }, (0,external_wp_element_namespaceObject.createElement)("input", {
- type: "url",
- value: value || '',
- className: "components-placeholder__input",
- "aria-label": label,
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL to embed here…'),
- onChange: onChange
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "primary",
- type: "submit"
- }, (0,external_wp_i18n_namespaceObject._x)('Embed', 'button label'))), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "components-placeholder__learn-more"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
- href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/embeds/')
- }, (0,external_wp_i18n_namespaceObject.__)('Learn more about embeds'))), cannotEmbed && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "components-placeholder__error"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "components-placeholder__instructions"
- }, (0,external_wp_i18n_namespaceObject.__)('Sorry, this content could not be embedded.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "secondary",
- onClick: tryAgain
- }, (0,external_wp_i18n_namespaceObject._x)('Try again', 'button label')), ' ', (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "secondary",
- onClick: fallback
- }, (0,external_wp_i18n_namespaceObject._x)('Convert to link', 'button label'))));
- };
- /* harmony default export */ var embed_placeholder = (EmbedPlaceholder);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js
- /**
- * WordPress dependencies
- */
- /** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */
- const attributeMap = {
- class: 'className',
- frameborder: 'frameBorder',
- marginheight: 'marginHeight',
- marginwidth: 'marginWidth'
- };
- function WpEmbedPreview(_ref) {
- let {
- html
- } = _ref;
- const ref = (0,external_wp_element_namespaceObject.useRef)();
- const props = (0,external_wp_element_namespaceObject.useMemo)(() => {
- const doc = new window.DOMParser().parseFromString(html, 'text/html');
- const iframe = doc.querySelector('iframe');
- const iframeProps = {};
- if (!iframe) return iframeProps;
- Array.from(iframe.attributes).forEach(_ref2 => {
- let {
- name,
- value
- } = _ref2;
- if (name === 'style') return;
- iframeProps[attributeMap[name] || name] = value;
- });
- return iframeProps;
- }, [html]);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- const {
- ownerDocument
- } = ref.current;
- const {
- defaultView
- } = ownerDocument;
- /**
- * Checks for WordPress embed events signaling the height change when
- * iframe content loads or iframe's window is resized. The event is
- * sent from WordPress core via the window.postMessage API.
- *
- * References:
- * window.postMessage:
- * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
- * WordPress core embed-template on load:
- * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143
- * WordPress core embed-template on resize:
- * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187
- *
- * @param {MessageEvent} event Message event.
- */
- function resizeWPembeds(_ref3) {
- let {
- data: {
- secret,
- message,
- value
- } = {}
- } = _ref3;
- if (message !== 'height' || secret !== props['data-secret']) {
- return;
- }
- ref.current.height = value;
- }
- defaultView.addEventListener('message', resizeWPembeds);
- return () => {
- defaultView.removeEventListener('message', resizeWPembeds);
- };
- }, []);
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-embed__wrapper"
- }, (0,external_wp_element_namespaceObject.createElement)("iframe", _extends({
- ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]),
- title: props.title
- }, props)));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js
- /**
- * Internal dependencies
- */
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- class EmbedPreview extends external_wp_element_namespaceObject.Component {
- constructor() {
- super(...arguments);
- this.hideOverlay = this.hideOverlay.bind(this);
- this.state = {
- interactive: false
- };
- }
- static getDerivedStateFromProps(nextProps, state) {
- if (!nextProps.isSelected && state.interactive) {
- // We only want to change this when the block is not selected, because changing it when
- // the block becomes selected makes the overlap disappear too early. Hiding the overlay
- // happens on mouseup when the overlay is clicked.
- return {
- interactive: false
- };
- }
- return null;
- }
- hideOverlay() {
- // This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop
- // changing, because that happens on mouse down, and the overlay immediately disappears,
- // and the mouse event can end up in the preview content. We can't use onClick on
- // the overlay to hide it either, because then the editor misses the mouseup event, and
- // thinks we're multi-selecting blocks.
- this.setState({
- interactive: true
- });
- }
- render() {
- const {
- preview,
- previewable,
- url,
- type,
- caption,
- onCaptionChange,
- isSelected,
- className,
- icon,
- label,
- insertBlocksAfter
- } = this.props;
- const {
- scripts
- } = preview;
- const {
- interactive
- } = this.state;
- const html = 'photo' === type ? getPhotoHtml(preview) : preview.html;
- const parsedHost = new URL(url).host.split('.');
- const parsedHostBaseUrl = parsedHost.splice(parsedHost.length - 2, parsedHost.length - 1).join('.');
- const iframeTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: host providing embed content e.g: www.youtube.com
- (0,external_wp_i18n_namespaceObject.__)('Embedded content from %s'), parsedHostBaseUrl);
- const sandboxClassnames = dedupe_default()(type, className, 'wp-block-embed__wrapper'); // Disabled because the overlay div doesn't actually have a role or functionality
- // as far as the user is concerned. We're just catching the first click so that
- // the block can be selected without interacting with the embed preview that the overlay covers.
- /* eslint-disable jsx-a11y/no-static-element-interactions */
- const embedWrapper = 'wp-embed' === type ? (0,external_wp_element_namespaceObject.createElement)(WpEmbedPreview, {
- html: html
- }) : (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-embed__wrapper"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, {
- html: html,
- scripts: scripts,
- title: iframeTitle,
- type: sandboxClassnames,
- onFocus: this.hideOverlay
- }), !interactive && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "block-library-embed__interactive-overlay",
- onMouseUp: this.hideOverlay
- }));
- /* eslint-enable jsx-a11y/no-static-element-interactions */
- return (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: dedupe_default()(className, 'wp-block-embed', {
- 'is-type-video': 'video' === type
- })
- }, previewable ? embedWrapper : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: icon,
- showColors: true
- }),
- label: label
- }, (0,external_wp_element_namespaceObject.createElement)("p", {
- className: "components-placeholder__error"
- }, (0,external_wp_element_namespaceObject.createElement)("a", {
- href: url
- }, url)), (0,external_wp_element_namespaceObject.createElement)("p", {
- className: "components-placeholder__error"
- }, (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: host providing embed content e.g: www.youtube.com */
- (0,external_wp_i18n_namespaceObject.__)("Embedded content from %s can't be previewed in the editor."), parsedHostBaseUrl))), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: "figcaption",
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
- value: caption,
- onChange: onCaptionChange,
- inlineToolbar: true,
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
- }));
- }
- }
- /* harmony default export */ var embed_preview = (EmbedPreview);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/edit.js
- /**
- * Internal dependencies
- */
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const EmbedEdit = props => {
- const {
- attributes: {
- providerNameSlug,
- previewable,
- responsive,
- url: attributesUrl
- },
- attributes,
- isSelected,
- onReplace,
- setAttributes,
- insertBlocksAfter,
- onFocus
- } = props;
- const defaultEmbedInfo = {
- title: (0,external_wp_i18n_namespaceObject._x)('Embed', 'block title'),
- icon: embedContentIcon
- };
- const {
- icon,
- title
- } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo;
- const [url, setURL] = (0,external_wp_element_namespaceObject.useState)(attributesUrl);
- const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
- const {
- invalidateResolution
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
- const {
- preview,
- fetching,
- themeSupportsResponsive,
- cannotEmbed
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _embedPreview$data;
- const {
- getEmbedPreview,
- isPreviewEmbedFallback,
- isRequestingEmbedPreview,
- getThemeSupports
- } = select(external_wp_coreData_namespaceObject.store);
- if (!attributesUrl) {
- return {
- fetching: false,
- cannotEmbed: false
- };
- }
- const embedPreview = getEmbedPreview(attributesUrl);
- const previewIsFallback = isPreviewEmbedFallback(attributesUrl); // The external oEmbed provider does not exist. We got no type info and no html.
- const badEmbedProvider = (embedPreview === null || embedPreview === void 0 ? void 0 : embedPreview.html) === false && (embedPreview === null || embedPreview === void 0 ? void 0 : embedPreview.type) === undefined; // Some WordPress URLs that can't be embedded will cause the API to return
- // a valid JSON response with no HTML and `data.status` set to 404, rather
- // than generating a fallback response as other embeds do.
- const wordpressCantEmbed = (embedPreview === null || embedPreview === void 0 ? void 0 : (_embedPreview$data = embedPreview.data) === null || _embedPreview$data === void 0 ? void 0 : _embedPreview$data.status) === 404;
- const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed;
- return {
- preview: validPreview ? embedPreview : undefined,
- fetching: isRequestingEmbedPreview(attributesUrl),
- themeSupportsResponsive: getThemeSupports()['responsive-embeds'],
- cannotEmbed: !validPreview || previewIsFallback
- };
- }, [attributesUrl]);
- /**
- * @return {Object} Attributes derived from the preview, merged with the current attributes.
- */
- const getMergedAttributes = () => {
- const {
- allowResponsive,
- className
- } = attributes;
- return { ...attributes,
- ...getAttributesFromPreview(preview, title, className, responsive, allowResponsive)
- };
- };
- const toggleResponsive = () => {
- const {
- allowResponsive,
- className
- } = attributes;
- const {
- html
- } = preview;
- const newAllowResponsive = !allowResponsive;
- setAttributes({
- allowResponsive: newAllowResponsive,
- className: getClassNames(html, className, responsive && newAllowResponsive)
- });
- };
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!(preview !== null && preview !== void 0 && preview.html) || !cannotEmbed || fetching) {
- return;
- } // At this stage, we're not fetching the preview and know it can't be embedded,
- // so try removing any trailing slash, and resubmit.
- const newURL = attributesUrl.replace(/\/$/, '');
- setURL(newURL);
- setIsEditingURL(false);
- setAttributes({
- url: newURL
- });
- }, [preview === null || preview === void 0 ? void 0 : preview.html, attributesUrl]); // Handle incoming preview.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (preview && !isEditingURL) {
- // Even though we set attributes that get derived from the preview,
- // we don't access them directly because for the initial render,
- // the `setAttributes` call will not have taken effect. If we're
- // rendering responsive content, setting the responsive classes
- // after the preview has been rendered can result in unwanted
- // clipping or scrollbars. The `getAttributesFromPreview` function
- // that `getMergedAttributes` uses is memoized so that we're not
- // calculating them on every render.
- setAttributes(getMergedAttributes());
- if (onReplace) {
- const upgradedBlock = createUpgradedEmbedBlock(props, getMergedAttributes());
- if (upgradedBlock) {
- onReplace(upgradedBlock);
- }
- }
- }
- }, [preview, isEditingURL]);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- if (fetching) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_loading, null));
- } // translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists
- const label = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s URL'), title); // No preview, or we can't embed the current URL, or we've clicked the edit button.
- const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL;
- if (showEmbedPlaceholder) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_placeholder, {
- icon: icon,
- label: label,
- onFocus: onFocus,
- onSubmit: event => {
- if (event) {
- event.preventDefault();
- }
- setIsEditingURL(false);
- setAttributes({
- url
- });
- },
- value: url,
- cannotEmbed: cannotEmbed,
- onChange: event => setURL(event.target.value),
- fallback: () => fallback(url, onReplace),
- tryAgain: () => {
- invalidateResolution('getEmbedPreview', [url]);
- }
- }));
- } // Even though we set attributes that get derived from the preview,
- // we don't access them directly because for the initial render,
- // the `setAttributes` call will not have taken effect. If we're
- // rendering responsive content, setting the responsive classes
- // after the preview has been rendered can result in unwanted
- // clipping or scrollbars. The `getAttributesFromPreview` function
- // that `getMergedAttributes` uses is memoized so that we're not
- // calculating them on every render.
- const {
- caption,
- type,
- allowResponsive,
- className: classFromPreview
- } = getMergedAttributes();
- const className = classnames_default()(classFromPreview, props.className);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(embed_controls, {
- showEditButton: preview && !cannotEmbed,
- themeSupportsResponsive: themeSupportsResponsive,
- blockSupportsResponsive: responsive,
- allowResponsive: allowResponsive,
- toggleResponsive: toggleResponsive,
- switchBackToURLInput: () => setIsEditingURL(true)
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_preview, {
- preview: preview,
- previewable: previewable,
- className: className,
- url: url,
- type: type,
- caption: caption,
- onCaptionChange: value => setAttributes({
- caption: value
- }),
- isSelected: isSelected,
- icon: icon,
- label: label,
- insertBlocksAfter: insertBlocksAfter
- })));
- };
- /* harmony default export */ var embed_edit = (EmbedEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function embed_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- url,
- caption,
- type,
- providerNameSlug
- } = attributes;
- if (!url) {
- return null;
- }
- const className = dedupe_default()('wp-block-embed', {
- [`is-type-${type}`]: type,
- [`is-provider-${providerNameSlug}`]: providerNameSlug,
- [`wp-block-embed-${providerNameSlug}`]: providerNameSlug
- });
- return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-embed__wrapper"
- }, `\n${url}\n`
- /* URL needs to be on its own line. */
- ), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/transforms.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const transforms_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/embed",
- title: "Embed",
- category: "embed",
- description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
- textdomain: "default",
- attributes: {
- url: {
- type: "string"
- },
- caption: {
- type: "string",
- source: "html",
- selector: "figcaption"
- },
- type: {
- type: "string"
- },
- providerNameSlug: {
- type: "string"
- },
- allowResponsive: {
- type: "boolean",
- "default": true
- },
- responsive: {
- type: "boolean",
- "default": false
- },
- previewable: {
- type: "boolean",
- "default": true
- }
- },
- supports: {
- align: true
- },
- editorStyle: "wp-block-embed-editor",
- style: "wp-block-embed"
- };
- const {
- name: EMBED_BLOCK
- } = transforms_metadata;
- /**
- * Default transforms for generic embeds.
- */
- const embed_transforms_transforms = {
- from: [{
- type: 'raw',
- isMatch: node => {
- var _node$textContent, _node$textContent$mat;
- return node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && ((_node$textContent = node.textContent) === null || _node$textContent === void 0 ? void 0 : (_node$textContent$mat = _node$textContent.match(/https/gi)) === null || _node$textContent$mat === void 0 ? void 0 : _node$textContent$mat.length) === 1;
- },
- transform: node => {
- return (0,external_wp_blocks_namespaceObject.createBlock)(EMBED_BLOCK, {
- url: node.textContent.trim()
- });
- }
- }],
- to: [{
- type: 'block',
- blocks: ['core/paragraph'],
- isMatch: _ref => {
- let {
- url
- } = _ref;
- return !!url;
- },
- transform: _ref2 => {
- let {
- url,
- caption
- } = _ref2;
- let value = `<a href="${url}">${url}</a>`;
- if (caption !== null && caption !== void 0 && caption.trim()) {
- value += `<br />${caption}`;
- }
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: value
- });
- }
- }]
- };
- /* harmony default export */ var embed_transforms = (embed_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/variations.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
- /**
- * Template option choices for predefined columns layouts.
- *
- * @type {WPBlockVariation[]}
- */
- const variations_variations = [{
- name: 'twitter',
- title: 'Twitter',
- icon: embedTwitterIcon,
- keywords: ['tweet', (0,external_wp_i18n_namespaceObject.__)('social')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a tweet.'),
- patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i],
- attributes: {
- providerNameSlug: 'twitter',
- responsive: true
- }
- }, {
- name: 'youtube',
- title: 'YouTube',
- icon: embedYouTubeIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('video')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a YouTube video.'),
- patterns: [/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, /^https?:\/\/youtu\.be\/.+/i],
- attributes: {
- providerNameSlug: 'youtube',
- responsive: true
- }
- }, {
- // Deprecate Facebook Embed per FB policy
- // See: https://developers.facebook.com/docs/plugins/oembed-legacy
- name: 'facebook',
- title: 'Facebook',
- icon: embedFacebookIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('social')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a Facebook post.'),
- scope: ['block'],
- patterns: [],
- attributes: {
- providerNameSlug: 'facebook',
- previewable: false,
- responsive: true
- }
- }, {
- // Deprecate Instagram per FB policy
- // See: https://developers.facebook.com/docs/instagram/oembed-legacy
- name: 'instagram',
- title: 'Instagram',
- icon: embedInstagramIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('image'), (0,external_wp_i18n_namespaceObject.__)('social')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed an Instagram post.'),
- scope: ['block'],
- patterns: [],
- attributes: {
- providerNameSlug: 'instagram',
- responsive: true
- }
- }, {
- name: 'wordpress',
- title: 'WordPress',
- icon: embedWordPressIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('post'), (0,external_wp_i18n_namespaceObject.__)('blog')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress post.'),
- attributes: {
- providerNameSlug: 'wordpress'
- }
- }, {
- name: 'soundcloud',
- title: 'SoundCloud',
- icon: embedAudioIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed SoundCloud content.'),
- patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],
- attributes: {
- providerNameSlug: 'soundcloud',
- responsive: true
- }
- }, {
- name: 'spotify',
- title: 'Spotify',
- icon: embedSpotifyIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Spotify content.'),
- patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i],
- attributes: {
- providerNameSlug: 'spotify',
- responsive: true
- }
- }, {
- name: 'flickr',
- title: 'Flickr',
- icon: embedFlickrIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('image')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Flickr content.'),
- patterns: [/^https?:\/\/(www\.)?flickr\.com\/.+/i, /^https?:\/\/flic\.kr\/.+/i],
- attributes: {
- providerNameSlug: 'flickr',
- responsive: true
- }
- }, {
- name: 'vimeo',
- title: 'Vimeo',
- icon: embedVimeoIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a Vimeo video.'),
- patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i],
- attributes: {
- providerNameSlug: 'vimeo',
- responsive: true
- }
- }, {
- name: 'animoto',
- title: 'Animoto',
- icon: embedAnimotoIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed an Animoto video.'),
- patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],
- attributes: {
- providerNameSlug: 'animoto',
- responsive: true
- }
- }, {
- name: 'cloudup',
- title: 'Cloudup',
- icon: embedContentIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Cloudup content.'),
- patterns: [/^https?:\/\/cloudup\.com\/.+/i],
- attributes: {
- providerNameSlug: 'cloudup',
- responsive: true
- }
- }, {
- // Deprecated since CollegeHumor content is now powered by YouTube.
- name: 'collegehumor',
- title: 'CollegeHumor',
- icon: embedVideoIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed CollegeHumor content.'),
- scope: ['block'],
- patterns: [],
- attributes: {
- providerNameSlug: 'collegehumor',
- responsive: true
- }
- }, {
- name: 'crowdsignal',
- title: 'Crowdsignal',
- icon: embedContentIcon,
- keywords: ['polldaddy', (0,external_wp_i18n_namespaceObject.__)('survey')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Crowdsignal (formerly Polldaddy) content.'),
- patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i],
- attributes: {
- providerNameSlug: 'crowdsignal',
- responsive: true
- }
- }, {
- name: 'dailymotion',
- title: 'Dailymotion',
- icon: embedDailymotionIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a Dailymotion video.'),
- patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],
- attributes: {
- providerNameSlug: 'dailymotion',
- responsive: true
- }
- }, {
- name: 'imgur',
- title: 'Imgur',
- icon: embedPhotoIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Imgur content.'),
- patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i],
- attributes: {
- providerNameSlug: 'imgur',
- responsive: true
- }
- }, {
- name: 'issuu',
- title: 'Issuu',
- icon: embedContentIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Issuu content.'),
- patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i],
- attributes: {
- providerNameSlug: 'issuu',
- responsive: true
- }
- }, {
- name: 'kickstarter',
- title: 'Kickstarter',
- icon: embedContentIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Kickstarter content.'),
- patterns: [/^https?:\/\/(www\.)?kickstarter\.com\/.+/i, /^https?:\/\/kck\.st\/.+/i],
- attributes: {
- providerNameSlug: 'kickstarter',
- responsive: true
- }
- }, {
- name: 'mixcloud',
- title: 'Mixcloud',
- icon: embedAudioIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Mixcloud content.'),
- patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],
- attributes: {
- providerNameSlug: 'mixcloud',
- responsive: true
- }
- }, {
- name: 'reddit',
- title: 'Reddit',
- icon: embedRedditIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a Reddit thread.'),
- patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i],
- attributes: {
- providerNameSlug: 'reddit',
- responsive: true
- }
- }, {
- name: 'reverbnation',
- title: 'ReverbNation',
- icon: embedAudioIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed ReverbNation content.'),
- patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],
- attributes: {
- providerNameSlug: 'reverbnation',
- responsive: true
- }
- }, {
- name: 'screencast',
- title: 'Screencast',
- icon: embedVideoIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Screencast content.'),
- patterns: [/^https?:\/\/(www\.)?screencast\.com\/.+/i],
- attributes: {
- providerNameSlug: 'screencast',
- responsive: true
- }
- }, {
- name: 'scribd',
- title: 'Scribd',
- icon: embedContentIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Scribd content.'),
- patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i],
- attributes: {
- providerNameSlug: 'scribd',
- responsive: true
- }
- }, {
- name: 'slideshare',
- title: 'Slideshare',
- icon: embedContentIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Slideshare content.'),
- patterns: [/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i],
- attributes: {
- providerNameSlug: 'slideshare',
- responsive: true
- }
- }, {
- name: 'smugmug',
- title: 'SmugMug',
- icon: embedPhotoIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed SmugMug content.'),
- patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],
- attributes: {
- providerNameSlug: 'smugmug',
- previewable: false,
- responsive: true
- }
- }, {
- name: 'speaker-deck',
- title: 'Speaker Deck',
- icon: embedContentIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Speaker Deck content.'),
- patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],
- attributes: {
- providerNameSlug: 'speaker-deck',
- responsive: true
- }
- }, {
- name: 'tiktok',
- title: 'TikTok',
- icon: embedVideoIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a TikTok video.'),
- patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i],
- attributes: {
- providerNameSlug: 'tiktok',
- responsive: true
- }
- }, {
- name: 'ted',
- title: 'TED',
- icon: embedVideoIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a TED video.'),
- patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],
- attributes: {
- providerNameSlug: 'ted',
- responsive: true
- }
- }, {
- name: 'tumblr',
- title: 'Tumblr',
- icon: embedTumblrIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('social')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a Tumblr post.'),
- patterns: [/^https?:\/\/(www\.)?tumblr\.com\/.+/i],
- attributes: {
- providerNameSlug: 'tumblr',
- responsive: true
- }
- }, {
- name: 'videopress',
- title: 'VideoPress',
- icon: embedVideoIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a VideoPress video.'),
- patterns: [/^https?:\/\/videopress\.com\/.+/i],
- attributes: {
- providerNameSlug: 'videopress',
- responsive: true
- }
- }, {
- name: 'wordpress-tv',
- title: 'WordPress.tv',
- icon: embedVideoIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress.tv video.'),
- patterns: [/^https?:\/\/wordpress\.tv\/.+/i],
- attributes: {
- providerNameSlug: 'wordpress-tv',
- responsive: true
- }
- }, {
- name: 'amazon-kindle',
- title: 'Amazon Kindle',
- icon: embedAmazonIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('ebook')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Amazon Kindle content.'),
- patterns: [/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i],
- attributes: {
- providerNameSlug: 'amazon-kindle'
- }
- }, {
- name: 'pinterest',
- title: 'Pinterest',
- icon: embedPinterestIcon,
- keywords: [(0,external_wp_i18n_namespaceObject.__)('social'), (0,external_wp_i18n_namespaceObject.__)('bookmark')],
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Pinterest pins, boards, and profiles.'),
- patterns: [/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i],
- attributes: {
- providerNameSlug: 'pinterest'
- }
- }, {
- name: 'wolfram-cloud',
- title: 'Wolfram',
- icon: embedWolframIcon,
- description: (0,external_wp_i18n_namespaceObject.__)('Embed Wolfram notebook content.'),
- patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i],
- attributes: {
- providerNameSlug: 'wolfram-cloud',
- responsive: true
- }
- }];
- /**
- * Add `isActive` function to all `embed` variations, if not defined.
- * `isActive` function is used to find a variation match from a created
- * Block by providing its attributes.
- */
- variations_variations.forEach(variation => {
- if (variation.isActive) return;
- variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.providerNameSlug === variationAttributes.providerNameSlug;
- });
- /* harmony default export */ var embed_variations = (variations_variations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/deprecated.js
- /**
- * External dependencies
- */
- /**
- * Internal dependencies
- */
- const embed_deprecated_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/embed",
- title: "Embed",
- category: "embed",
- description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
- textdomain: "default",
- attributes: {
- url: {
- type: "string"
- },
- caption: {
- type: "string",
- source: "html",
- selector: "figcaption"
- },
- type: {
- type: "string"
- },
- providerNameSlug: {
- type: "string"
- },
- allowResponsive: {
- type: "boolean",
- "default": true
- },
- responsive: {
- type: "boolean",
- "default": false
- },
- previewable: {
- type: "boolean",
- "default": true
- }
- },
- supports: {
- align: true
- },
- editorStyle: "wp-block-embed-editor",
- style: "wp-block-embed"
- };
- /**
- * WordPress dependencies
- */
- const {
- attributes: embed_deprecated_blockAttributes
- } = embed_deprecated_metadata;
- const embed_deprecated_deprecated = [{
- attributes: embed_deprecated_blockAttributes,
- save(_ref) {
- let {
- attributes: {
- url,
- caption,
- type,
- providerNameSlug
- }
- } = _ref;
- if (!url) {
- return null;
- }
- const embedClassName = classnames_default()('wp-block-embed', {
- [`is-type-${type}`]: type,
- [`is-provider-${providerNameSlug}`]: providerNameSlug
- });
- return (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: embedClassName
- }, `\n${url}\n`
- /* URL needs to be on its own line. */
- , !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- }
- }];
- /* harmony default export */ var embed_deprecated = (embed_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/index.js
- /**
- * Internal dependencies
- */
- const embed_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/embed",
- title: "Embed",
- category: "embed",
- description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
- textdomain: "default",
- attributes: {
- url: {
- type: "string"
- },
- caption: {
- type: "string",
- source: "html",
- selector: "figcaption"
- },
- type: {
- type: "string"
- },
- providerNameSlug: {
- type: "string"
- },
- allowResponsive: {
- type: "boolean",
- "default": true
- },
- responsive: {
- type: "boolean",
- "default": false
- },
- previewable: {
- type: "boolean",
- "default": true
- }
- },
- supports: {
- align: true
- },
- editorStyle: "wp-block-embed-editor",
- style: "wp-block-embed"
- };
- const {
- name: embed_name
- } = embed_metadata;
- const embed_settings = {
- icon: embedContentIcon,
- edit: embed_edit,
- save: embed_save_save,
- transforms: embed_transforms,
- variations: embed_variations,
- deprecated: embed_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/file.js
- /**
- * WordPress dependencies
- */
- const file = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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.5z"
- }));
- /* harmony default export */ var library_file = (file);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/deprecated.js
- /**
- * WordPress dependencies
- */
- // Version of the file block without PR#28062 accessibility fix.
- const file_deprecated_deprecated = [{
- attributes: {
- id: {
- type: 'number'
- },
- href: {
- type: 'string'
- },
- fileName: {
- type: 'string',
- source: 'html',
- selector: 'a:not([download])'
- },
- textLinkHref: {
- type: 'string',
- source: 'attribute',
- selector: 'a:not([download])',
- attribute: 'href'
- },
- textLinkTarget: {
- type: 'string',
- source: 'attribute',
- selector: 'a:not([download])',
- attribute: 'target'
- },
- showDownloadButton: {
- type: 'boolean',
- default: true
- },
- downloadButtonText: {
- type: 'string',
- source: 'html',
- selector: 'a[download]'
- },
- displayPreview: {
- type: 'boolean'
- },
- previewHeight: {
- type: 'number',
- default: 600
- }
- },
- supports: {
- anchor: true,
- align: true
- },
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- href,
- fileName,
- textLinkHref,
- textLinkTarget,
- showDownloadButton,
- downloadButtonText,
- displayPreview,
- previewHeight
- } = attributes;
- const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: filename. */
- (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName);
- return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", {
- className: "wp-block-file__embed",
- data: href,
- type: "application/pdf",
- style: {
- width: '100%',
- height: `${previewHeight}px`
- },
- "aria-label": pdfEmbedLabel
- })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) && (0,external_wp_element_namespaceObject.createElement)("a", {
- href: textLinkHref,
- target: textLinkTarget,
- rel: textLinkTarget ? 'noreferrer noopener' : undefined
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: fileName
- })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href,
- className: "wp-block-file__button",
- download: true
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: downloadButtonText
- })));
- }
- }];
- /* harmony default export */ var file_deprecated = (file_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/inspector.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function FileBlockInspector(_ref) {
- let {
- hrefs,
- openInNewWindow,
- showDownloadButton,
- changeLinkDestinationOption,
- changeOpenInNewWindow,
- changeShowDownloadButton,
- displayPreview,
- changeDisplayPreview,
- previewHeight,
- changePreviewHeight
- } = _ref;
- const {
- href,
- textLinkHref,
- attachmentPage
- } = hrefs;
- let linkDestinationOptions = [{
- value: href,
- label: (0,external_wp_i18n_namespaceObject.__)('URL')
- }];
- if (attachmentPage) {
- linkDestinationOptions = [{
- value: href,
- label: (0,external_wp_i18n_namespaceObject.__)('Media file')
- }, {
- value: attachmentPage,
- label: (0,external_wp_i18n_namespaceObject.__)('Attachment page')
- }];
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, href.endsWith('.pdf') && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('PDF settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show inline embed'),
- help: displayPreview ? (0,external_wp_i18n_namespaceObject.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null,
- checked: !!displayPreview,
- onChange: changeDisplayPreview
- }), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Height in pixels'),
- min: MIN_PREVIEW_HEIGHT,
- max: Math.max(MAX_PREVIEW_HEIGHT, previewHeight),
- value: previewHeight,
- onChange: changePreviewHeight
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Text link settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
- value: textLinkHref,
- options: linkDestinationOptions,
- onChange: changeLinkDestinationOption
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
- checked: openInNewWindow,
- onChange: changeOpenInNewWindow
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Download button settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show download button'),
- checked: showDownloadButton,
- onChange: changeShowDownloadButton
- }))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils.js
- /**
- * Uses a combination of user agent matching and feature detection to determine whether
- * the current browser supports rendering PDFs inline.
- *
- * @return {boolean} Whether or not the browser supports inline PDFs.
- */
- const browserSupportsPdfs = () => {
- // Most mobile devices include "Mobi" in their UA.
- if (window.navigator.userAgent.indexOf('Mobi') > -1) {
- return false;
- } // Android tablets are the noteable exception.
- if (window.navigator.userAgent.indexOf('Android') > -1) {
- return false;
- } // iPad pretends to be a Mac.
- if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) {
- return false;
- } // IE only supports PDFs when there's an ActiveX object available for it.
- if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) {
- return false;
- }
- return true;
- };
- /**
- * Helper function for creating ActiveX objects, catching any errors that are thrown
- * when it's generated.
- *
- * @param {string} type The name of the ActiveX object to create.
- * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.
- */
- const createActiveXObject = type => {
- let ax;
- try {
- ax = new window.ActiveXObject(type);
- } catch (e) {
- ax = undefined;
- }
- return ax;
- };
- /**
- * Hides all .wp-block-file__embed elements on the document. This function is only intended
- * to be run on the front-end, it may have weird side effects running in the block editor.
- */
- const hidePdfEmbedsOnUnsupportedBrowsers = () => {
- if (!browserSupportsPdfs()) {
- const embeds = document.getElementsByClassName('wp-block-file__embed');
- Array.from(embeds).forEach(embed => {
- embed.style.display = 'none';
- });
- }
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const MIN_PREVIEW_HEIGHT = 200;
- const MAX_PREVIEW_HEIGHT = 2000;
- function ClipboardToolbarButton(_ref) {
- let {
- text,
- disabled
- } = _ref;
- const {
- createNotice
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
- const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => {
- createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied URL to clipboard.'), {
- isDismissible: true,
- type: 'snackbar'
- });
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- className: "components-clipboard-toolbar-button",
- ref: ref,
- disabled: disabled
- }, (0,external_wp_i18n_namespaceObject.__)('Copy URL'));
- }
- function FileEdit(_ref2) {
- let {
- attributes,
- isSelected,
- setAttributes,
- noticeUI,
- noticeOperations,
- clientId
- } = _ref2;
- const {
- id,
- fileId,
- fileName,
- href,
- textLinkHref,
- textLinkTarget,
- showDownloadButton,
- downloadButtonText,
- displayPreview,
- previewHeight
- } = attributes;
- const {
- media,
- mediaUpload
- } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
- media: id === undefined ? undefined : select(external_wp_coreData_namespaceObject.store).getMedia(id),
- mediaUpload: select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload
- }), [id]);
- const {
- toggleSelection,
- __unstableMarkNextChangeAsNotPersistent
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // Upload a file drag-and-dropped into the editor.
- if ((0,external_wp_blob_namespaceObject.isBlobURL)(href)) {
- const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(href);
- mediaUpload({
- filesList: [file],
- onFileChange: _ref3 => {
- let [newMedia] = _ref3;
- return onSelectFile(newMedia);
- },
- onError: onUploadError
- });
- (0,external_wp_blob_namespaceObject.revokeBlobURL)(href);
- }
- if (downloadButtonText === undefined) {
- changeDownloadButtonText((0,external_wp_i18n_namespaceObject._x)('Download', 'button label'));
- }
- }, []);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!fileId && href) {
- // Add a unique fileId to each file block.
- __unstableMarkNextChangeAsNotPersistent();
- setAttributes({
- fileId: `wp-block-file--media-${clientId}`
- });
- }
- }, [href, fileId, clientId]);
- function onSelectFile(newMedia) {
- if (newMedia && newMedia.url) {
- const isPdf = newMedia.url.endsWith('.pdf');
- setAttributes({
- href: newMedia.url,
- fileName: newMedia.title,
- textLinkHref: newMedia.url,
- id: newMedia.id,
- displayPreview: isPdf ? true : undefined,
- previewHeight: isPdf ? 600 : undefined
- });
- }
- }
- function onUploadError(message) {
- setAttributes({
- href: undefined
- });
- noticeOperations.removeAllNotices();
- noticeOperations.createErrorNotice(message);
- }
- function changeLinkDestinationOption(newHref) {
- // Choose Media File or Attachment Page (when file is in Media Library).
- setAttributes({
- textLinkHref: newHref
- });
- }
- function changeOpenInNewWindow(newValue) {
- setAttributes({
- textLinkTarget: newValue ? '_blank' : false
- });
- }
- function changeShowDownloadButton(newValue) {
- setAttributes({
- showDownloadButton: newValue
- });
- }
- function changeDownloadButtonText(newValue) {
- // Remove anchor tags from button text content.
- setAttributes({
- downloadButtonText: newValue.replace(/<\/?a[^>]*>/g, '')
- });
- }
- function changeDisplayPreview(newValue) {
- setAttributes({
- displayPreview: newValue
- });
- }
- function handleOnResizeStop(event, direction, elt, delta) {
- toggleSelection(true);
- const newHeight = parseInt(previewHeight + delta.height, 10);
- setAttributes({
- previewHeight: newHeight
- });
- }
- function changePreviewHeight(newValue) {
- const newHeight = Math.max(parseInt(newValue, 10), MIN_PREVIEW_HEIGHT);
- setAttributes({
- previewHeight: newHeight
- });
- }
- const attachmentPage = media && media.link;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()((0,external_wp_blob_namespaceObject.isBlobURL)(href) && (0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({
- type: 'loading'
- }), {
- 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(href)
- })
- });
- const displayPreviewInEditor = browserSupportsPdfs() && displayPreview;
- if (!href) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: library_file
- }),
- labels: {
- title: (0,external_wp_i18n_namespaceObject.__)('File'),
- instructions: (0,external_wp_i18n_namespaceObject.__)('Upload a file or pick one from your media library.')
- },
- onSelect: onSelectFile,
- notices: noticeUI,
- onError: onUploadError,
- accept: "*"
- }));
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(FileBlockInspector, {
- hrefs: {
- href,
- textLinkHref,
- attachmentPage
- },
- openInNewWindow: !!textLinkTarget,
- showDownloadButton,
- changeLinkDestinationOption,
- changeOpenInNewWindow,
- changeShowDownloadButton,
- displayPreview,
- changeDisplayPreview,
- previewHeight,
- changePreviewHeight
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
- mediaId: id,
- mediaURL: href,
- accept: "*",
- onSelect: onSelectFile,
- onError: onUploadError
- }), (0,external_wp_element_namespaceObject.createElement)(ClipboardToolbarButton, {
- text: href,
- disabled: (0,external_wp_blob_namespaceObject.isBlobURL)(href)
- })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, displayPreviewInEditor && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
- size: {
- height: previewHeight
- },
- minHeight: MIN_PREVIEW_HEIGHT,
- maxHeight: MAX_PREVIEW_HEIGHT,
- minWidth: "100%",
- grid: [10, 10],
- enable: {
- top: false,
- right: false,
- bottom: true,
- left: false,
- topRight: false,
- bottomRight: false,
- bottomLeft: false,
- topLeft: false
- },
- onResizeStart: () => toggleSelection(false),
- onResizeStop: handleOnResizeStop,
- showHandle: isSelected
- }, (0,external_wp_element_namespaceObject.createElement)("object", {
- className: "wp-block-file__preview",
- data: href,
- type: "application/pdf",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Embed of the selected PDF file.')
- }), !isSelected && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-file__preview-overlay"
- })), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: 'wp-block-file__content-wrapper'
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: "a",
- value: fileName,
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write file name…'),
- withoutInteractiveFormatting: true,
- onChange: text => setAttributes({
- fileName: text
- }),
- href: textLinkHref
- }), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: 'wp-block-file__button-richtext-wrapper'
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: "div" // Must be block-level or else cursor disappears.
- ,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Download button text'),
- className: 'wp-block-file__button',
- value: downloadButtonText,
- withoutInteractiveFormatting: true,
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text…'),
- onChange: text => changeDownloadButtonText(text)
- })))));
- }
- /* harmony default export */ var file_edit = ((0,external_wp_components_namespaceObject.withNotices)(FileEdit));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/save.js
- /**
- * WordPress dependencies
- */
- function file_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- href,
- fileId,
- fileName,
- textLinkHref,
- textLinkTarget,
- showDownloadButton,
- downloadButtonText,
- displayPreview,
- previewHeight
- } = attributes;
- const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: filename. */
- (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName);
- const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is
- // actually rendered.
- const describedById = hasFilename ? fileId : undefined;
- return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", {
- className: "wp-block-file__embed",
- data: href,
- type: "application/pdf",
- style: {
- width: '100%',
- height: `${previewHeight}px`
- },
- "aria-label": pdfEmbedLabel
- })), hasFilename && (0,external_wp_element_namespaceObject.createElement)("a", {
- id: describedById,
- href: textLinkHref,
- target: textLinkTarget,
- rel: textLinkTarget ? 'noreferrer noopener' : undefined
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: fileName
- })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href,
- className: "wp-block-file__button",
- download: true,
- "aria-describedby": describedById
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: downloadButtonText
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/transforms.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const file_transforms_transforms = {
- from: [{
- type: 'files',
- isMatch(files) {
- return files.length > 0;
- },
- // We define a lower priorty (higher number) than the default of 10. This
- // ensures that the File block is only created as a fallback.
- priority: 15,
- transform: files => {
- const blocks = [];
- files.forEach(file => {
- const blobURL = (0,external_wp_blob_namespaceObject.createBlobURL)(file); // File will be uploaded in componentDidMount()
- blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
- href: blobURL,
- fileName: file.name,
- textLinkHref: blobURL
- }));
- });
- return blocks;
- }
- }, {
- type: 'block',
- blocks: ['core/audio'],
- transform: attributes => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
- href: attributes.src,
- fileName: attributes.caption,
- textLinkHref: attributes.src,
- id: attributes.id,
- anchor: attributes.anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/video'],
- transform: attributes => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
- href: attributes.src,
- fileName: attributes.caption,
- textLinkHref: attributes.src,
- id: attributes.id,
- anchor: attributes.anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/image'],
- transform: attributes => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
- href: attributes.url,
- fileName: attributes.caption || (0,external_wp_url_namespaceObject.getFilename)(attributes.url),
- textLinkHref: attributes.url,
- id: attributes.id,
- anchor: attributes.anchor
- });
- }
- }],
- to: [{
- type: 'block',
- blocks: ['core/audio'],
- isMatch: _ref => {
- let {
- id
- } = _ref;
- if (!id) {
- return false;
- }
- const {
- getMedia
- } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
- const media = getMedia(id);
- return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'audio');
- },
- transform: attributes => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', {
- src: attributes.href,
- caption: attributes.fileName,
- id: attributes.id,
- anchor: attributes.anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/video'],
- isMatch: _ref2 => {
- let {
- id
- } = _ref2;
- if (!id) {
- return false;
- }
- const {
- getMedia
- } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
- const media = getMedia(id);
- return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'video');
- },
- transform: attributes => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
- src: attributes.href,
- caption: attributes.fileName,
- id: attributes.id,
- anchor: attributes.anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/image'],
- isMatch: _ref3 => {
- let {
- id
- } = _ref3;
- if (!id) {
- return false;
- }
- const {
- getMedia
- } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
- const media = getMedia(id);
- return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'image');
- },
- transform: attributes => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- url: attributes.href,
- caption: attributes.fileName,
- id: attributes.id,
- anchor: attributes.anchor
- });
- }
- }]
- };
- /* harmony default export */ var file_transforms = (file_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const file_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/file",
- title: "File",
- category: "media",
- description: "Add a link to a downloadable file.",
- keywords: ["document", "pdf", "download"],
- textdomain: "default",
- attributes: {
- id: {
- type: "number"
- },
- href: {
- type: "string"
- },
- fileId: {
- type: "string",
- source: "attribute",
- selector: "a:not([download])",
- attribute: "id"
- },
- fileName: {
- type: "string",
- source: "html",
- selector: "a:not([download])"
- },
- textLinkHref: {
- type: "string",
- source: "attribute",
- selector: "a:not([download])",
- attribute: "href"
- },
- textLinkTarget: {
- type: "string",
- source: "attribute",
- selector: "a:not([download])",
- attribute: "target"
- },
- showDownloadButton: {
- type: "boolean",
- "default": true
- },
- downloadButtonText: {
- type: "string",
- source: "html",
- selector: "a[download]"
- },
- displayPreview: {
- type: "boolean"
- },
- previewHeight: {
- type: "number",
- "default": 600
- }
- },
- supports: {
- anchor: true,
- align: true
- },
- viewScript: "file:./view.min.js",
- editorStyle: "wp-block-file-editor",
- style: "wp-block-file"
- };
- const {
- name: file_name
- } = file_metadata;
- const file_settings = {
- icon: library_file,
- example: {
- attributes: {
- href: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',
- fileName: (0,external_wp_i18n_namespaceObject._x)('Armstrong_Small_Step', 'Name of the file')
- }
- },
- transforms: file_transforms,
- deprecated: file_deprecated,
- edit: file_edit,
- save: file_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/gallery.js
- /**
- * WordPress dependencies
- */
- const gallery = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"
- }));
- /* harmony default export */ var library_gallery = (gallery);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/constants.js
- const LINK_DESTINATION_NONE = 'none';
- const LINK_DESTINATION_MEDIA = 'media';
- const LINK_DESTINATION_ATTACHMENT = 'attachment';
- const LINK_DESTINATION_MEDIA_WP_CORE = 'file';
- const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post';
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared.js
- /**
- * External dependencies
- */
- function defaultColumnsNumber(imageCount) {
- return imageCount ? Math.min(3, imageCount) : 3;
- }
- const pickRelevantMediaFiles = function (image) {
- let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large';
- const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
- imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', sizeSlug, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url;
- const fullUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', 'full', 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', 'full', 'source_url']);
- if (fullUrl) {
- imageProps.fullUrl = fullUrl;
- }
- return imageProps;
- };
- /**
- * The new gallery block format is not compatible with the use_BalanceTags option
- * in WP versions <= 5.8 https://core.trac.wordpress.org/ticket/54130. The
- * window.wp.galleryBlockV2Enabled flag is set in lib/compat.php. This method
- * can be removed when minimum supported WP version >=5.9.
- */
- function isGalleryV2Enabled() {
- // Only run the Gallery version compat check if the plugin is running, otherwise
- // assume we are in 5.9 core and enable by default.
- if (false) {}
- return true;
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const DEPRECATED_LINK_DESTINATION_MEDIA = 'file';
- const DEPRECATED_LINK_DESTINATION_ATTACHMENT = 'post';
- /**
- * Original function to determine default number of columns from a block's
- * attributes.
- *
- * Used in deprecations: v1-6, for versions of the gallery block that didn't use inner blocks.
- *
- * @param {Object} attributes Block attributes.
- * @return {number} Default number of columns for the gallery.
- */
- function defaultColumnsNumberV1(attributes) {
- var _attributes$images;
- return Math.min(3, attributes === null || attributes === void 0 ? void 0 : (_attributes$images = attributes.images) === null || _attributes$images === void 0 ? void 0 : _attributes$images.length);
- }
- /**
- * Original function to determine new href and linkDestination values for an image block from the
- * supplied Gallery link destination.
- *
- * Used in deprecations: v1-6.
- *
- * @param {Object} image Gallery image.
- * @param {string} destination Gallery's selected link destination.
- * @return {Object} New attributes to assign to image block.
- */
- function getHrefAndDestination(image, destination) {
- // Need to determine the URL that the selected destination maps to.
- // Gutenberg and WordPress use different constants so the new link
- // destination also needs to be tweaked.
- switch (destination) {
- case DEPRECATED_LINK_DESTINATION_MEDIA:
- return {
- href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
- // eslint-disable-line camelcase
- linkDestination: LINK_DESTINATION_MEDIA
- };
- case DEPRECATED_LINK_DESTINATION_ATTACHMENT:
- return {
- href: image === null || image === void 0 ? void 0 : image.link,
- linkDestination: LINK_DESTINATION_ATTACHMENT
- };
- case LINK_DESTINATION_MEDIA:
- return {
- href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
- // eslint-disable-line camelcase
- linkDestination: LINK_DESTINATION_MEDIA
- };
- case LINK_DESTINATION_ATTACHMENT:
- return {
- href: image === null || image === void 0 ? void 0 : image.link,
- linkDestination: LINK_DESTINATION_ATTACHMENT
- };
- case LINK_DESTINATION_NONE:
- return {
- href: undefined,
- linkDestination: LINK_DESTINATION_NONE
- };
- }
- return {};
- }
- function runV2Migration(attributes) {
- let linkTo = attributes.linkTo ? attributes.linkTo : 'none';
- if (linkTo === 'post') {
- linkTo = 'attachment';
- } else if (linkTo === 'file') {
- linkTo = 'media';
- }
- const imageBlocks = attributes.images.map(image => {
- return getImageBlock(image, attributes.sizeSlug, linkTo);
- });
- return [{ ...(0,external_lodash_namespaceObject.omit)(attributes, ['images', 'ids']),
- linkTo,
- allowResize: false
- }, imageBlocks];
- }
- /**
- * Gets an Image block from gallery image data
- *
- * Used to migrate Galleries to nested Image InnerBlocks.
- *
- * @param {Object} image Image properties.
- * @param {string} sizeSlug Gallery sizeSlug attribute.
- * @param {string} linkTo Gallery linkTo attribute.
- * @return {Object} Image block.
- */
- function getImageBlock(image, sizeSlug, linkTo) {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { ...(image.id && {
- id: parseInt(image.id)
- }),
- url: image.url,
- alt: image.alt,
- caption: image.caption,
- sizeSlug,
- ...getHrefAndDestination(image, linkTo)
- });
- }
- const deprecated_v6 = {
- attributes: {
- images: {
- type: 'array',
- default: [],
- source: 'query',
- selector: '.blocks-gallery-item',
- query: {
- url: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'src'
- },
- fullUrl: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'data-full-url'
- },
- link: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'data-link'
- },
- alt: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'alt',
- default: ''
- },
- id: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'data-id'
- },
- caption: {
- type: 'string',
- source: 'html',
- selector: '.blocks-gallery-item__caption'
- }
- }
- },
- ids: {
- type: 'array',
- items: {
- type: 'number'
- },
- default: []
- },
- columns: {
- type: 'number',
- minimum: 1,
- maximum: 8
- },
- caption: {
- type: 'string',
- source: 'html',
- selector: '.blocks-gallery-caption'
- },
- imageCrop: {
- type: 'boolean',
- default: true
- },
- fixedHeight: {
- type: 'boolean',
- default: true
- },
- linkTo: {
- type: 'string'
- },
- sizeSlug: {
- type: 'string',
- default: 'large'
- }
- },
- supports: {
- anchor: true,
- align: true
- },
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- images,
- columns = defaultColumnsNumberV1(attributes),
- imageCrop,
- caption,
- linkTo
- } = attributes;
- const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`;
- return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- }), (0,external_wp_element_namespaceObject.createElement)("ul", {
- className: "blocks-gallery-grid"
- }, images.map(image => {
- let href;
- switch (linkTo) {
- case DEPRECATED_LINK_DESTINATION_MEDIA:
- href = image.fullUrl || image.url;
- break;
- case DEPRECATED_LINK_DESTINATION_ATTACHMENT:
- href = image.link;
- break;
- }
- const img = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: image.url,
- alt: image.alt,
- "data-id": image.id,
- "data-full-url": image.fullUrl,
- "data-link": image.link,
- className: image.id ? `wp-image-${image.id}` : null
- });
- return (0,external_wp_element_namespaceObject.createElement)("li", {
- key: image.id || image.url,
- className: "blocks-gallery-item"
- }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- className: "blocks-gallery-item__caption",
- value: image.caption
- })));
- })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- className: "blocks-gallery-caption",
- value: caption
- }));
- },
- migrate(attributes) {
- if (isGalleryV2Enabled()) {
- return runV2Migration(attributes);
- }
- return attributes;
- }
- };
- const deprecated_v5 = {
- attributes: {
- images: {
- type: 'array',
- default: [],
- source: 'query',
- selector: '.blocks-gallery-item',
- query: {
- url: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'src'
- },
- fullUrl: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'data-full-url'
- },
- link: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'data-link'
- },
- alt: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'alt',
- default: ''
- },
- id: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'data-id'
- },
- caption: {
- type: 'string',
- source: 'html',
- selector: '.blocks-gallery-item__caption'
- }
- }
- },
- ids: {
- type: 'array',
- items: {
- type: 'number'
- },
- default: []
- },
- columns: {
- type: 'number',
- minimum: 1,
- maximum: 8
- },
- caption: {
- type: 'string',
- source: 'html',
- selector: '.blocks-gallery-caption'
- },
- imageCrop: {
- type: 'boolean',
- default: true
- },
- linkTo: {
- type: 'string',
- default: 'none'
- },
- sizeSlug: {
- type: 'string',
- default: 'large'
- }
- },
- supports: {
- align: true
- },
- isEligible(_ref2) {
- let {
- linkTo
- } = _ref2;
- return !linkTo || linkTo === 'attachment' || linkTo === 'media';
- },
- migrate(attributes) {
- if (isGalleryV2Enabled()) {
- return runV2Migration(attributes);
- }
- let linkTo = attributes.linkTo;
- if (!attributes.linkTo) {
- linkTo = 'none';
- } else if (attributes.linkTo === 'attachment') {
- linkTo = 'post';
- } else if (attributes.linkTo === 'media') {
- linkTo = 'file';
- }
- return { ...attributes,
- linkTo
- };
- },
- save(_ref3) {
- let {
- attributes
- } = _ref3;
- const {
- images,
- columns = defaultColumnsNumberV1(attributes),
- imageCrop,
- caption,
- linkTo
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
- }, (0,external_wp_element_namespaceObject.createElement)("ul", {
- className: "blocks-gallery-grid"
- }, images.map(image => {
- let href;
- switch (linkTo) {
- case 'media':
- href = image.fullUrl || image.url;
- break;
- case 'attachment':
- href = image.link;
- break;
- }
- const img = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: image.url,
- alt: image.alt,
- "data-id": image.id,
- "data-full-url": image.fullUrl,
- "data-link": image.link,
- className: image.id ? `wp-image-${image.id}` : null
- });
- return (0,external_wp_element_namespaceObject.createElement)("li", {
- key: image.id || image.url,
- className: "blocks-gallery-item"
- }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- className: "blocks-gallery-item__caption",
- value: image.caption
- })));
- })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- className: "blocks-gallery-caption",
- value: caption
- }));
- }
- };
- const deprecated_v4 = {
- attributes: {
- images: {
- type: 'array',
- default: [],
- source: 'query',
- selector: '.blocks-gallery-item',
- query: {
- url: {
- source: 'attribute',
- selector: 'img',
- attribute: 'src'
- },
- fullUrl: {
- source: 'attribute',
- selector: 'img',
- attribute: 'data-full-url'
- },
- link: {
- source: 'attribute',
- selector: 'img',
- attribute: 'data-link'
- },
- alt: {
- source: 'attribute',
- selector: 'img',
- attribute: 'alt',
- default: ''
- },
- id: {
- source: 'attribute',
- selector: 'img',
- attribute: 'data-id'
- },
- caption: {
- type: 'string',
- source: 'html',
- selector: '.blocks-gallery-item__caption'
- }
- }
- },
- ids: {
- type: 'array',
- default: []
- },
- columns: {
- type: 'number'
- },
- caption: {
- type: 'string',
- source: 'html',
- selector: '.blocks-gallery-caption'
- },
- imageCrop: {
- type: 'boolean',
- default: true
- },
- linkTo: {
- type: 'string',
- default: 'none'
- }
- },
- supports: {
- align: true
- },
- isEligible(_ref4) {
- let {
- ids
- } = _ref4;
- return ids && ids.some(id => typeof id === 'string');
- },
- migrate(attributes) {
- if (isGalleryV2Enabled()) {
- return runV2Migration(attributes);
- }
- return { ...attributes,
- ids: (0,external_lodash_namespaceObject.map)(attributes.ids, id => {
- const parsedId = parseInt(id, 10);
- return Number.isInteger(parsedId) ? parsedId : null;
- })
- };
- },
- save(_ref5) {
- let {
- attributes
- } = _ref5;
- const {
- images,
- columns = defaultColumnsNumberV1(attributes),
- imageCrop,
- caption,
- linkTo
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
- }, (0,external_wp_element_namespaceObject.createElement)("ul", {
- className: "blocks-gallery-grid"
- }, images.map(image => {
- let href;
- switch (linkTo) {
- case 'media':
- href = image.fullUrl || image.url;
- break;
- case 'attachment':
- href = image.link;
- break;
- }
- const img = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: image.url,
- alt: image.alt,
- "data-id": image.id,
- "data-full-url": image.fullUrl,
- "data-link": image.link,
- className: image.id ? `wp-image-${image.id}` : null
- });
- return (0,external_wp_element_namespaceObject.createElement)("li", {
- key: image.id || image.url,
- className: "blocks-gallery-item"
- }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- className: "blocks-gallery-item__caption",
- value: image.caption
- })));
- })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- className: "blocks-gallery-caption",
- value: caption
- }));
- }
- };
- const deprecated_v3 = {
- attributes: {
- images: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'ul.wp-block-gallery .blocks-gallery-item',
- query: {
- url: {
- source: 'attribute',
- selector: 'img',
- attribute: 'src'
- },
- fullUrl: {
- source: 'attribute',
- selector: 'img',
- attribute: 'data-full-url'
- },
- alt: {
- source: 'attribute',
- selector: 'img',
- attribute: 'alt',
- default: ''
- },
- id: {
- source: 'attribute',
- selector: 'img',
- attribute: 'data-id'
- },
- link: {
- source: 'attribute',
- selector: 'img',
- attribute: 'data-link'
- },
- caption: {
- type: 'array',
- source: 'children',
- selector: 'figcaption'
- }
- }
- },
- ids: {
- type: 'array',
- default: []
- },
- columns: {
- type: 'number'
- },
- imageCrop: {
- type: 'boolean',
- default: true
- },
- linkTo: {
- type: 'string',
- default: 'none'
- }
- },
- supports: {
- align: true
- },
- save(_ref6) {
- let {
- attributes
- } = _ref6;
- const {
- images,
- columns = defaultColumnsNumberV1(attributes),
- imageCrop,
- linkTo
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("ul", {
- className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
- }, images.map(image => {
- let href;
- switch (linkTo) {
- case 'media':
- href = image.fullUrl || image.url;
- break;
- case 'attachment':
- href = image.link;
- break;
- }
- const img = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: image.url,
- alt: image.alt,
- "data-id": image.id,
- "data-full-url": image.fullUrl,
- "data-link": image.link,
- className: image.id ? `wp-image-${image.id}` : null
- });
- return (0,external_wp_element_namespaceObject.createElement)("li", {
- key: image.id || image.url,
- className: "blocks-gallery-item"
- }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, img) : img, image.caption && image.caption.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: image.caption
- })));
- }));
- },
- migrate(attributes) {
- if (isGalleryV2Enabled()) {
- return runV2Migration(attributes);
- }
- return attributes;
- }
- };
- const deprecated_v2 = {
- attributes: {
- images: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'ul.wp-block-gallery .blocks-gallery-item',
- query: {
- url: {
- source: 'attribute',
- selector: 'img',
- attribute: 'src'
- },
- alt: {
- source: 'attribute',
- selector: 'img',
- attribute: 'alt',
- default: ''
- },
- id: {
- source: 'attribute',
- selector: 'img',
- attribute: 'data-id'
- },
- link: {
- source: 'attribute',
- selector: 'img',
- attribute: 'data-link'
- },
- caption: {
- type: 'array',
- source: 'children',
- selector: 'figcaption'
- }
- }
- },
- columns: {
- type: 'number'
- },
- imageCrop: {
- type: 'boolean',
- default: true
- },
- linkTo: {
- type: 'string',
- default: 'none'
- }
- },
- isEligible(_ref7) {
- let {
- images,
- ids
- } = _ref7;
- return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || (0,external_lodash_namespaceObject.some)(images, (id, index) => {
- if (!id && ids[index] !== null) {
- return true;
- }
- return parseInt(id, 10) !== ids[index];
- }));
- },
- migrate(attributes) {
- if (isGalleryV2Enabled()) {
- return runV2Migration(attributes);
- }
- return { ...attributes,
- ids: (0,external_lodash_namespaceObject.map)(attributes.images, _ref8 => {
- let {
- id
- } = _ref8;
- if (!id) {
- return null;
- }
- return parseInt(id, 10);
- })
- };
- },
- supports: {
- align: true
- },
- save(_ref9) {
- let {
- attributes
- } = _ref9;
- const {
- images,
- columns = defaultColumnsNumberV1(attributes),
- imageCrop,
- linkTo
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("ul", {
- className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
- }, images.map(image => {
- let href;
- switch (linkTo) {
- case 'media':
- href = image.url;
- break;
- case 'attachment':
- href = image.link;
- break;
- }
- const img = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: image.url,
- alt: image.alt,
- "data-id": image.id,
- "data-link": image.link,
- className: image.id ? `wp-image-${image.id}` : null
- });
- return (0,external_wp_element_namespaceObject.createElement)("li", {
- key: image.id || image.url,
- className: "blocks-gallery-item"
- }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, img) : img, image.caption && image.caption.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: image.caption
- })));
- }));
- }
- };
- const gallery_deprecated_v1 = {
- attributes: {
- images: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'div.wp-block-gallery figure.blocks-gallery-image img',
- query: {
- url: {
- source: 'attribute',
- attribute: 'src'
- },
- alt: {
- source: 'attribute',
- attribute: 'alt',
- default: ''
- },
- id: {
- source: 'attribute',
- attribute: 'data-id'
- }
- }
- },
- columns: {
- type: 'number'
- },
- imageCrop: {
- type: 'boolean',
- default: true
- },
- linkTo: {
- type: 'string',
- default: 'none'
- },
- align: {
- type: 'string',
- default: 'none'
- }
- },
- supports: {
- align: true
- },
- save(_ref10) {
- let {
- attributes
- } = _ref10;
- const {
- images,
- columns = defaultColumnsNumberV1(attributes),
- align,
- imageCrop,
- linkTo
- } = attributes;
- const className = classnames_default()(`columns-${columns}`, {
- alignnone: align === 'none',
- 'is-cropped': imageCrop
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: className
- }, images.map(image => {
- let href;
- switch (linkTo) {
- case 'media':
- href = image.url;
- break;
- case 'attachment':
- href = image.link;
- break;
- }
- const img = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: image.url,
- alt: image.alt,
- "data-id": image.id
- });
- return (0,external_wp_element_namespaceObject.createElement)("figure", {
- key: image.id || image.url,
- className: "blocks-gallery-image"
- }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, img) : img);
- }));
- },
- migrate(attributes) {
- if (isGalleryV2Enabled()) {
- return runV2Migration(attributes);
- }
- return attributes;
- }
- };
- /* harmony default export */ var gallery_deprecated = ([deprecated_v6, deprecated_v5, deprecated_v4, deprecated_v3, deprecated_v2, gallery_deprecated_v1]);
- ;// CONCATENATED MODULE: external ["wp","viewport"]
- var external_wp_viewport_namespaceObject = window["wp"]["viewport"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared-icon.js
- /**
- * WordPress dependencies
- */
- const sharedIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: library_gallery
- });
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/constants.js
- const MIN_SIZE = 20;
- const constants_LINK_DESTINATION_NONE = 'none';
- const constants_LINK_DESTINATION_MEDIA = 'media';
- const constants_LINK_DESTINATION_ATTACHMENT = 'attachment';
- const LINK_DESTINATION_CUSTOM = 'custom';
- const constants_NEW_TAB_REL = ['noreferrer', 'noopener'];
- const constants_ALLOWED_MEDIA_TYPES = ['image'];
- const MEDIA_ID_NO_FEATURED_IMAGE_SET = 0;
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/utils.js
- /**
- * Internal dependencies
- */
- /**
- * Determines new href and linkDestination values for an image block from the
- * supplied Gallery link destination.
- *
- * @param {Object} image Gallery image.
- * @param {string} destination Gallery's selected link destination.
- * @return {Object} New attributes to assign to image block.
- */
- function utils_getHrefAndDestination(image, destination) {
- // Gutenberg and WordPress use different constants so if image_default_link_type
- // option is set we need to map from the WP Core values.
- switch (destination) {
- case LINK_DESTINATION_MEDIA_WP_CORE:
- case LINK_DESTINATION_MEDIA:
- return {
- href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
- // eslint-disable-line camelcase
- linkDestination: constants_LINK_DESTINATION_MEDIA
- };
- case LINK_DESTINATION_ATTACHMENT_WP_CORE:
- case LINK_DESTINATION_ATTACHMENT:
- return {
- href: image === null || image === void 0 ? void 0 : image.link,
- linkDestination: constants_LINK_DESTINATION_ATTACHMENT
- };
- case LINK_DESTINATION_NONE:
- return {
- href: undefined,
- linkDestination: constants_LINK_DESTINATION_NONE
- };
- }
- return {};
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/utils.js
- /**
- * External dependencies
- */
- /**
- * Internal dependencies
- */
- function removeNewTabRel(currentRel) {
- let newRel = currentRel;
- if (currentRel !== undefined && !(0,external_lodash_namespaceObject.isEmpty)(newRel)) {
- if (!(0,external_lodash_namespaceObject.isEmpty)(newRel)) {
- (0,external_lodash_namespaceObject.each)(constants_NEW_TAB_REL, relVal => {
- const regExp = new RegExp('\\b' + relVal + '\\b', 'gi');
- newRel = newRel.replace(regExp, '');
- }); // Only trim if NEW_TAB_REL values was replaced.
- if (newRel !== currentRel) {
- newRel = newRel.trim();
- }
- if ((0,external_lodash_namespaceObject.isEmpty)(newRel)) {
- newRel = undefined;
- }
- }
- }
- return newRel;
- }
- /**
- * Helper to get the link target settings to be stored.
- *
- * @param {boolean} value The new link target value.
- * @param {Object} attributes Block attributes.
- * @param {Object} attributes.rel Image block's rel attribute.
- *
- * @return {Object} Updated link target settings.
- */
- function getUpdatedLinkTargetSettings(value, _ref) {
- let {
- rel
- } = _ref;
- const linkTarget = value ? '_blank' : undefined;
- let updatedRel;
- if (!linkTarget && !rel) {
- updatedRel = undefined;
- } else {
- updatedRel = removeNewTabRel(rel);
- }
- return {
- linkTarget,
- rel: updatedRel
- };
- }
- /**
- * Determines new Image block attributes size selection.
- *
- * @param {Object} image Media file object for gallery image.
- * @param {string} size Selected size slug to apply.
- */
- function getImageSizeAttributes(image, size) {
- const url = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size, 'source_url']);
- if (url) {
- return {
- url,
- width: undefined,
- height: undefined,
- sizeSlug: size
- };
- }
- return {};
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gallery.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const allowedBlocks = ['core/image'];
- const Gallery = props => {
- const {
- attributes,
- isSelected,
- setAttributes,
- mediaPlaceholder,
- insertBlocksAfter,
- blockProps
- } = props;
- const {
- align,
- columns,
- caption,
- imageCrop
- } = attributes;
- const {
- children,
- ...innerBlocksProps
- } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- allowedBlocks,
- orientation: 'horizontal',
- renderAppender: false,
- __experimentalLayout: {
- type: 'default',
- alignments: []
- }
- });
- const [captionFocused, setCaptionFocused] = (0,external_wp_element_namespaceObject.useState)(false);
- function onFocusCaption() {
- if (!captionFocused) {
- setCaptionFocused(true);
- }
- }
- function removeCaptionFocus() {
- if (captionFocused) {
- setCaptionFocused(false);
- }
- }
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isSelected) {
- setCaptionFocused(false);
- }
- }, [isSelected]);
- return (0,external_wp_element_namespaceObject.createElement)("figure", _extends({}, innerBlocksProps, {
- className: classnames_default()(blockProps.className, 'blocks-gallery-grid', {
- [`align${align}`]: align,
- [`columns-${columns}`]: columns !== undefined,
- [`columns-default`]: columns === undefined,
- 'is-cropped': imageCrop
- })
- }), children, isSelected && !children && (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, {
- className: "blocks-gallery-media-placeholder-wrapper",
- onClick: removeCaptionFocus
- }, mediaPlaceholder), (0,external_wp_element_namespaceObject.createElement)(RichTextVisibilityHelper, {
- isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption),
- captionFocused: captionFocused,
- onFocusCaption: onFocusCaption,
- tagName: "figcaption",
- className: "blocks-gallery-caption",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'),
- value: caption,
- onChange: value => setAttributes({
- caption: value
- }),
- inlineToolbar: true,
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
- }));
- };
- function RichTextVisibilityHelper(_ref) {
- let {
- isHidden,
- captionFocused,
- onFocusCaption,
- className,
- value,
- placeholder,
- tagName,
- captionRef,
- ...richTextProps
- } = _ref;
- if (isHidden) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, _extends({
- as: external_wp_blockEditor_namespaceObject.RichText
- }, richTextProps));
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
- ref: captionRef,
- value: value,
- placeholder: placeholder,
- className: className,
- tagName: tagName,
- isSelected: captionFocused,
- onClick: onFocusCaption
- }, richTextProps));
- }
- /* harmony default export */ var gallery_gallery = (Gallery);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-image-sizes.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Calculates the image sizes that are avaible for the current gallery images in order to
- * populate the 'Image size' selector.
- *
- * @param {Array} images Basic image block data taken from current gallery innerBlock
- * @param {boolean} isSelected Is the block currently selected in the editor.
- * @param {Function} getSettings Block editor store selector.
- *
- * @return {Array} An array of image size options.
- */
- function useImageSizes(images, isSelected, getSettings) {
- return (0,external_wp_element_namespaceObject.useMemo)(() => getImageSizing(), [images, isSelected]);
- function getImageSizing() {
- if (!images || images.length === 0) {
- return;
- }
- const {
- imageSizes
- } = getSettings();
- let resizedImages = {};
- if (isSelected) {
- resizedImages = images.reduce((currentResizedImages, img) => {
- if (!img.id) {
- return currentResizedImages;
- }
- const sizes = imageSizes.reduce((currentSizes, size) => {
- const defaultUrl = (0,external_lodash_namespaceObject.get)(img, ['sizes', size.slug, 'url']);
- const mediaDetailsUrl = (0,external_lodash_namespaceObject.get)(img, ['media_details', 'sizes', size.slug, 'source_url']);
- return { ...currentSizes,
- [size.slug]: defaultUrl || mediaDetailsUrl
- };
- }, {});
- return { ...currentResizedImages,
- [parseInt(img.id, 10)]: sizes
- };
- }, {});
- }
- return imageSizes.filter(_ref => {
- let {
- slug
- } = _ref;
- return (0,external_lodash_namespaceObject.some)(resizedImages, sizes => sizes[slug]);
- }).map(_ref2 => {
- let {
- name,
- slug
- } = _ref2;
- return {
- value: slug,
- label: name
- };
- });
- }
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-short-code-transform.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Shortcode transforms don't currently have a tranform method and so can't use a selector to
- * retrieve the data for each image being transformer, so this selector handle this post transformation.
- *
- * @param {Array} shortCodeTransforms An array of image data passed from the shortcode transform.
- *
- * @return {Array} An array of extended image data objects for each of the shortcode transform images.
- */
- function useShortCodeTransform(shortCodeTransforms) {
- const newImageData = (0,external_wp_data_namespaceObject.useSelect)(select => {
- if (!shortCodeTransforms || shortCodeTransforms.length === 0) {
- return;
- }
- const getMedia = select(external_wp_coreData_namespaceObject.store).getMedia;
- return shortCodeTransforms.map(image => {
- const imageData = getMedia(image.id);
- if (imageData) {
- return {
- id: imageData.id,
- type: 'image',
- url: imageData.source_url,
- mime: imageData.mime_type,
- alt: imageData.alt_text,
- link: imageData.link
- };
- }
- return undefined;
- });
- }, [shortCodeTransforms]);
- if (!newImageData) {
- return;
- }
- if ((0,external_lodash_namespaceObject.every)(newImageData, img => img && img.url)) {
- return newImageData;
- }
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-new-images.js
- /**
- * WordPress dependencies
- */
- /**
- * Keeps track of images already in the gallery to allow new innerBlocks to be identified. This
- * is required so default gallery attributes can be applied without overwriting any custom
- * attributes applied to existing images.
- *
- * @param {Array} images Basic image block data taken from current gallery innerBlock
- * @param {Array} imageData The related image data for each of the current gallery images.
- *
- * @return {Array} An array of any new images that have been added to the gallery.
- */
- function useGetNewImages(images, imageData) {
- const [currentImages, setCurrentImages] = (0,external_wp_element_namespaceObject.useState)([]);
- return (0,external_wp_element_namespaceObject.useMemo)(() => getNewImages(), [images, imageData]);
- function getNewImages() {
- let imagesUpdated = false; // First lets check if any images have been deleted.
- const newCurrentImages = currentImages.filter(currentImg => images.find(img => {
- return currentImg.clientId === img.clientId;
- }));
- if (newCurrentImages.length < currentImages.length) {
- imagesUpdated = true;
- } // Now lets see if we have any images hydrated from saved content and if so
- // add them to currentImages state.
- images.forEach(image => {
- if (image.fromSavedContent && !newCurrentImages.find(currentImage => currentImage.id === image.id)) {
- imagesUpdated = true;
- newCurrentImages.push(image);
- }
- }); // Now check for any new images that have been added to InnerBlocks and for which
- // we have the imageData we need for setting default block attributes.
- const newImages = images.filter(image => !newCurrentImages.find(currentImage => image.clientId && currentImage.clientId === image.clientId) && (imageData === null || imageData === void 0 ? void 0 : imageData.find(img => img.id === image.id)) && !image.fromSavedConent);
- if (imagesUpdated || (newImages === null || newImages === void 0 ? void 0 : newImages.length) > 0) {
- setCurrentImages([...newCurrentImages, ...newImages]);
- }
- return newImages.length > 0 ? newImages : null;
- }
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-media.js
- /**
- * WordPress dependencies
- */
- /**
- * Retrieves the extended media info for each gallery image from the store. This is used to
- * determine which image size options are available for the current gallery.
- *
- * @param {Array} innerBlockImages An array of the innerBlock images currently in the gallery.
- *
- * @return {Array} An array of media info options for each gallery image.
- */
- function useGetMedia(innerBlockImages) {
- const [currentImageMedia, setCurrentImageMedia] = (0,external_wp_element_namespaceObject.useState)([]);
- const imageMedia = (0,external_wp_data_namespaceObject.useSelect)(select => {
- if (!(innerBlockImages !== null && innerBlockImages !== void 0 && innerBlockImages.length)) {
- return currentImageMedia;
- }
- const imageIds = innerBlockImages.map(imageBlock => imageBlock.attributes.id).filter(id => id !== undefined);
- if (imageIds.length === 0) {
- return currentImageMedia;
- }
- return select(external_wp_coreData_namespaceObject.store).getMediaItems({
- include: imageIds.join(','),
- per_page: -1
- });
- }, [innerBlockImages]);
- if ((imageMedia === null || imageMedia === void 0 ? void 0 : imageMedia.length) !== (currentImageMedia === null || currentImageMedia === void 0 ? void 0 : currentImageMedia.length) || imageMedia !== null && imageMedia !== void 0 && imageMedia.some(newImage => !currentImageMedia.find(currentImage => currentImage.id === newImage.id))) {
- setCurrentImageMedia(imageMedia);
- return imageMedia;
- }
- return currentImageMedia;
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gap-styles.js
- /**
- * WordPress dependencies
- */
- function GapStyles(_ref) {
- let {
- blockGap,
- clientId
- } = _ref;
- const styleElement = (0,external_wp_element_namespaceObject.useContext)(external_wp_blockEditor_namespaceObject.BlockList.__unstableElementContext); // --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default
- // gap on the gallery.
- const fallbackValue = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;
- let gapValue = fallbackValue;
- let column = fallbackValue;
- let row; // Check for the possibility of split block gap values. See: https://github.com/WordPress/gutenberg/pull/37736
- if (!!blockGap) {
- row = typeof blockGap === 'string' ? blockGap : (blockGap === null || blockGap === void 0 ? void 0 : blockGap.top) || fallbackValue;
- column = typeof blockGap === 'string' ? blockGap : (blockGap === null || blockGap === void 0 ? void 0 : blockGap.left) || fallbackValue;
- gapValue = row === column ? row : `${row} ${column}`;
- }
- const gap = `#block-${clientId} {
- --wp--style--unstable-gallery-gap: ${column};
- gap: ${gapValue}
- }`;
- const GapStyle = () => {
- return (0,external_wp_element_namespaceObject.createElement)("style", null, gap);
- };
- return gap && styleElement ? (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(GapStyle, null), styleElement) : null;
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const MAX_COLUMNS = 8;
- const linkOptions = [{
- value: LINK_DESTINATION_ATTACHMENT,
- label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page')
- }, {
- value: LINK_DESTINATION_MEDIA,
- label: (0,external_wp_i18n_namespaceObject.__)('Media File')
- }, {
- value: LINK_DESTINATION_NONE,
- label: (0,external_wp_i18n_namespaceObject._x)('None', 'Media item link option')
- }];
- const edit_ALLOWED_MEDIA_TYPES = ['image'];
- const PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.isNative ? (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA') : (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.');
- const MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.isNative ? {
- type: 'stepper'
- } : {};
- function GalleryEdit(props) {
- var _attributes$style, _attributes$style$spa;
- const {
- setAttributes,
- attributes,
- className,
- clientId,
- noticeOperations,
- isSelected,
- noticeUI,
- insertBlocksAfter
- } = props;
- const {
- columns,
- imageCrop,
- linkTarget,
- linkTo,
- shortCodeTransforms,
- sizeSlug
- } = attributes;
- const {
- __unstableMarkNextChangeAsNotPersistent,
- replaceInnerBlocks,
- updateBlockAttributes,
- selectBlock,
- clearSelectedBlock
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const {
- createSuccessNotice
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
- const {
- getBlock,
- getSettings,
- preferredStyle
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _preferredStyleVariat;
- const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
- const preferredStyleVariations = settings.__experimentalPreferredStyleVariations;
- return {
- getBlock: select(external_wp_blockEditor_namespaceObject.store).getBlock,
- getSettings: select(external_wp_blockEditor_namespaceObject.store).getSettings,
- preferredStyle: preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat['core/image']
- };
- }, []);
- const innerBlockImages = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _select$getBlock;
- return (_select$getBlock = select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId)) === null || _select$getBlock === void 0 ? void 0 : _select$getBlock.innerBlocks;
- }, [clientId]);
- const wasBlockJustInserted = (0,external_wp_data_namespaceObject.useSelect)(select => {
- return select(external_wp_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu');
- }, [clientId]);
- const images = (0,external_wp_element_namespaceObject.useMemo)(() => innerBlockImages === null || innerBlockImages === void 0 ? void 0 : innerBlockImages.map(block => ({
- clientId: block.clientId,
- id: block.attributes.id,
- url: block.attributes.url,
- attributes: block.attributes,
- fromSavedContent: Boolean(block.originalContent)
- })), [innerBlockImages]);
- const imageData = useGetMedia(innerBlockImages);
- const newImages = useGetNewImages(images, imageData);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- newImages === null || newImages === void 0 ? void 0 : newImages.forEach(newImage => {
- updateBlockAttributes(newImage.clientId, { ...buildImageAttributes(newImage.attributes),
- id: newImage.id,
- align: undefined
- });
- });
- if ((newImages === null || newImages === void 0 ? void 0 : newImages.length) > 0) {
- clearSelectedBlock();
- }
- }, [newImages]);
- const shortCodeImages = useShortCodeTransform(shortCodeTransforms);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!shortCodeTransforms || !shortCodeImages) {
- return;
- }
- updateImages(shortCodeImages);
- setAttributes({
- shortCodeTransforms: undefined
- });
- }, [shortCodeTransforms, shortCodeImages]);
- const imageSizeOptions = useImageSizes(imageData, isSelected, getSettings);
- /**
- * Determines the image attributes that should be applied to an image block
- * after the gallery updates.
- *
- * The gallery will receive the full collection of images when a new image
- * is added. As a result we need to reapply the image's original settings if
- * it already existed in the gallery. If the image is in fact new, we need
- * to apply the gallery's current settings to the image.
- *
- * @param {Object} imageAttributes Media object for the actual image.
- * @return {Object} Attributes to set on the new image block.
- */
- function buildImageAttributes(imageAttributes) {
- const image = imageAttributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
- id: imageAttributes.id
- }) : null;
- let newClassName;
- if (imageAttributes.className && imageAttributes.className !== '') {
- newClassName = imageAttributes.className;
- } else {
- newClassName = preferredStyle ? `is-style-${preferredStyle}` : undefined;
- }
- return { ...pickRelevantMediaFiles(imageAttributes, sizeSlug),
- ...utils_getHrefAndDestination(image, linkTo),
- ...getUpdatedLinkTargetSettings(linkTarget, attributes),
- className: newClassName,
- sizeSlug
- };
- }
- function isValidFileType(file) {
- var _file$url;
- return edit_ALLOWED_MEDIA_TYPES.some(mediaType => {
- var _file$type;
- return ((_file$type = file.type) === null || _file$type === void 0 ? void 0 : _file$type.indexOf(mediaType)) === 0;
- }) || ((_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.indexOf('blob:')) === 0;
- }
- function updateImages(selectedImages) {
- const newFileUploads = Object.prototype.toString.call(selectedImages) === '[object FileList]';
- const imageArray = newFileUploads ? Array.from(selectedImages).map(file => {
- if (!file.url) {
- return pickRelevantMediaFiles({
- url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
- });
- }
- return file;
- }) : selectedImages;
- if (!imageArray.every(isValidFileType)) {
- noticeOperations.removeAllNotices();
- noticeOperations.createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), {
- id: 'gallery-upload-invalid-file'
- });
- }
- const processedImages = imageArray.filter(file => file.url || isValidFileType(file)).map(file => {
- if (!file.url) {
- return pickRelevantMediaFiles({
- url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
- });
- }
- return file;
- }); // Because we are reusing existing innerImage blocks any reordering
- // done in the media library will be lost so we need to reapply that ordering
- // once the new image blocks are merged in with existing.
- const newOrderMap = processedImages.reduce((result, image, index) => (result[image.id] = index, result), {});
- const existingImageBlocks = !newFileUploads ? innerBlockImages.filter(block => processedImages.find(img => img.id === block.attributes.id)) : innerBlockImages;
- const newImageList = processedImages.filter(img => !existingImageBlocks.find(existingImg => img.id === existingImg.attributes.id));
- const newBlocks = newImageList.map(image => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- id: image.id,
- url: image.url,
- caption: image.caption,
- alt: image.alt
- });
- });
- if ((newBlocks === null || newBlocks === void 0 ? void 0 : newBlocks.length) > 0) {
- selectBlock(newBlocks[0].clientId);
- }
- replaceInnerBlocks(clientId, (0,external_lodash_namespaceObject.concat)(existingImageBlocks, newBlocks).sort((a, b) => newOrderMap[a.attributes.id] - newOrderMap[b.attributes.id]));
- }
- function onUploadError(message) {
- noticeOperations.removeAllNotices();
- noticeOperations.createErrorNotice(message);
- }
- function setLinkTo(value) {
- setAttributes({
- linkTo: value
- });
- const changedAttributes = {};
- const blocks = [];
- getBlock(clientId).innerBlocks.forEach(block => {
- blocks.push(block.clientId);
- const image = block.attributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
- id: block.attributes.id
- }) : null;
- changedAttributes[block.clientId] = utils_getHrefAndDestination(image, value);
- });
- updateBlockAttributes(blocks, changedAttributes, true);
- const linkToText = [...linkOptions].find(linkType => linkType.value === value);
- createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: image size settings */
- (0,external_wp_i18n_namespaceObject.__)('All gallery image links updated to: %s'), linkToText.label), {
- id: 'gallery-attributes-linkTo',
- type: 'snackbar'
- });
- }
- function setColumnsNumber(value) {
- setAttributes({
- columns: value
- });
- }
- function toggleImageCrop() {
- setAttributes({
- imageCrop: !imageCrop
- });
- }
- function getImageCropHelp(checked) {
- return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.');
- }
- function toggleOpenInNewTab(openInNewTab) {
- const newLinkTarget = openInNewTab ? '_blank' : undefined;
- setAttributes({
- linkTarget: newLinkTarget
- });
- const changedAttributes = {};
- const blocks = [];
- getBlock(clientId).innerBlocks.forEach(block => {
- blocks.push(block.clientId);
- changedAttributes[block.clientId] = getUpdatedLinkTargetSettings(newLinkTarget, block.attributes);
- });
- updateBlockAttributes(blocks, changedAttributes, true);
- const noticeText = openInNewTab ? (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to open in new tab') : (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to not open in new tab');
- createSuccessNotice(noticeText, {
- id: 'gallery-attributes-openInNewTab',
- type: 'snackbar'
- });
- }
- function updateImagesSize(newSizeSlug) {
- setAttributes({
- sizeSlug: newSizeSlug
- });
- const changedAttributes = {};
- const blocks = [];
- getBlock(clientId).innerBlocks.forEach(block => {
- blocks.push(block.clientId);
- const image = block.attributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
- id: block.attributes.id
- }) : null;
- changedAttributes[block.clientId] = getImageSizeAttributes(image, newSizeSlug);
- });
- updateBlockAttributes(blocks, changedAttributes, true);
- const imageSize = imageSizeOptions.find(size => size.value === newSizeSlug);
- createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: image size settings */
- (0,external_wp_i18n_namespaceObject.__)('All gallery image sizes updated to: %s'), imageSize.label), {
- id: 'gallery-attributes-sizeSlug',
- type: 'snackbar'
- });
- }
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php.
- if (!linkTo) {
- var _window, _window$wp, _window$wp$media, _window$wp$media$view, _window$wp$media$view2, _window$wp$media$view3;
- __unstableMarkNextChangeAsNotPersistent();
- setAttributes({
- linkTo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : (_window$wp$media = _window$wp.media) === null || _window$wp$media === void 0 ? void 0 : (_window$wp$media$view = _window$wp$media.view) === null || _window$wp$media$view === void 0 ? void 0 : (_window$wp$media$view2 = _window$wp$media$view.settings) === null || _window$wp$media$view2 === void 0 ? void 0 : (_window$wp$media$view3 = _window$wp$media$view2.defaultProps) === null || _window$wp$media$view3 === void 0 ? void 0 : _window$wp$media$view3.link) || LINK_DESTINATION_NONE
- });
- }
- }, [linkTo]);
- const hasImages = !!images.length;
- const hasImageIds = hasImages && images.some(image => !!image.id);
- const imagesUploading = images.some(img => {
- var _img$url;
- return !img.id && ((_img$url = img.url) === null || _img$url === void 0 ? void 0 : _img$url.indexOf('blob:')) === 0;
- }); // MediaPlaceholder props are different between web and native hence, we provide a platform-specific set.
- const mediaPlaceholderProps = external_wp_element_namespaceObject.Platform.select({
- web: {
- addToGallery: false,
- disableMediaButtons: imagesUploading,
- value: {}
- },
- native: {
- addToGallery: hasImageIds,
- isAppender: hasImages,
- disableMediaButtons: hasImages && !isSelected || imagesUploading,
- value: hasImageIds ? images : {},
- autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted
- }
- });
- const mediaPlaceholder = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, _extends({
- handleUpload: false,
- icon: sharedIcon,
- labels: {
- title: (0,external_wp_i18n_namespaceObject.__)('Gallery'),
- instructions: PLACEHOLDER_TEXT
- },
- onSelect: updateImages,
- accept: "image/*",
- allowedTypes: edit_ALLOWED_MEDIA_TYPES,
- multiple: true,
- onError: onUploadError,
- notices: noticeUI
- }, mediaPlaceholderProps));
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()(className, 'has-nested-images')
- });
- if (!hasImages) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, mediaPlaceholder);
- }
- const hasLinkTo = linkTo && linkTo !== 'none';
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Gallery settings')
- }, images.length > 1 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, _extends({
- label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
- value: columns ? columns : defaultColumnsNumber(images.length),
- onChange: setColumnsNumber,
- min: 1,
- max: Math.min(MAX_COLUMNS, images.length)
- }, MOBILE_CONTROL_PROPS_RANGE_CONTROL, {
- required: true
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Crop images'),
- checked: !!imageCrop,
- onChange: toggleImageCrop,
- help: getImageCropHelp
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
- value: linkTo,
- onChange: setLinkTo,
- options: linkOptions,
- hideCancelButton: true
- }), hasLinkTo && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
- checked: linkTarget === '_blank',
- onChange: toggleOpenInNewTab
- }), (imageSizeOptions === null || imageSizeOptions === void 0 ? void 0 : imageSizeOptions.length) > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
- value: sizeSlug,
- options: imageSizeOptions,
- onChange: updateImagesSize,
- hideCancelButton: true
- }), external_wp_element_namespaceObject.Platform.isWeb && !imageSizeOptions && hasImageIds && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
- className: 'gallery-image-sizes'
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image size')), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, {
- className: 'gallery-image-sizes__loading'
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_i18n_namespaceObject.__)('Loading options…'))))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
- allowedTypes: edit_ALLOWED_MEDIA_TYPES,
- accept: "image/*",
- handleUpload: false,
- onSelect: updateImages,
- name: (0,external_wp_i18n_namespaceObject.__)('Add'),
- multiple: true,
- mediaIds: images.map(image => image.id),
- addToGallery: hasImageIds
- })), noticeUI, external_wp_element_namespaceObject.Platform.isWeb && (0,external_wp_element_namespaceObject.createElement)(GapStyles, {
- blockGap: (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$spa = _attributes$style.spacing) === null || _attributes$style$spa === void 0 ? void 0 : _attributes$style$spa.blockGap,
- clientId: clientId
- }), (0,external_wp_element_namespaceObject.createElement)(gallery_gallery, _extends({}, props, {
- images: images,
- mediaPlaceholder: !hasImages || external_wp_element_namespaceObject.Platform.isNative ? mediaPlaceholder : undefined,
- blockProps: blockProps,
- insertBlocksAfter: insertBlocksAfter
- })));
- }
- /* harmony default export */ var gallery_edit = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices, (0,external_wp_viewport_namespaceObject.withViewportMatch)({
- isNarrow: '< small'
- })])(GalleryEdit));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/shared.js
- /**
- * External dependencies
- */
- const shared_pickRelevantMediaFiles = function (image) {
- let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large';
- const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
- imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', sizeSlug, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url;
- const fullUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', 'full', 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', 'full', 'source_url']);
- if (fullUrl) {
- imageProps.fullUrl = fullUrl;
- }
- return imageProps;
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/image.js
- /**
- * WordPress dependencies
- */
- const image_image = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"
- }));
- /* harmony default export */ var library_image = (image_image);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
- /**
- * WordPress dependencies
- */
- const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
- }));
- /* harmony default export */ var chevron_left = (chevronLeft);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
- /**
- * WordPress dependencies
- */
- const chevronRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
- }));
- /* harmony default export */ var chevron_right = (chevronRight);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
- /**
- * WordPress dependencies
- */
- const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var close_small = (closeSmall);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/constants.js
- const v1_constants_LINK_DESTINATION_NONE = 'none';
- const v1_constants_LINK_DESTINATION_MEDIA = 'file';
- const v1_constants_LINK_DESTINATION_ATTACHMENT = 'post';
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery-image.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
- class GalleryImage extends external_wp_element_namespaceObject.Component {
- constructor() {
- super(...arguments);
- this.onSelectImage = this.onSelectImage.bind(this);
- this.onRemoveImage = this.onRemoveImage.bind(this);
- this.bindContainer = this.bindContainer.bind(this);
- this.onEdit = this.onEdit.bind(this);
- this.onSelectImageFromLibrary = this.onSelectImageFromLibrary.bind(this);
- this.onSelectCustomURL = this.onSelectCustomURL.bind(this);
- this.state = {
- isEditing: false
- };
- }
- bindContainer(ref) {
- this.container = ref;
- }
- onSelectImage() {
- if (!this.props.isSelected) {
- this.props.onSelect();
- }
- }
- onRemoveImage(event) {
- if (this.container === this.container.ownerDocument.activeElement && this.props.isSelected && [external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].indexOf(event.keyCode) !== -1) {
- event.preventDefault();
- this.props.onRemove();
- }
- }
- onEdit() {
- this.setState({
- isEditing: true
- });
- }
- componentDidUpdate() {
- const {
- image,
- url,
- __unstableMarkNextChangeAsNotPersistent
- } = this.props;
- if (image && !url) {
- __unstableMarkNextChangeAsNotPersistent();
- this.props.setAttributes({
- url: image.source_url,
- alt: image.alt_text
- });
- }
- }
- deselectOnBlur() {
- this.props.onDeselect();
- }
- onSelectImageFromLibrary(media) {
- const {
- setAttributes,
- id,
- url,
- alt,
- caption,
- sizeSlug
- } = this.props;
- if (!media || !media.url) {
- return;
- }
- let mediaAttributes = shared_pickRelevantMediaFiles(media, sizeSlug); // If the current image is temporary but an alt text was meanwhile
- // written by the user, make sure the text is not overwritten.
- if (isTemporaryImage(id, url)) {
- if (alt) {
- mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['alt']);
- }
- } // If a caption text was meanwhile written by the user,
- // make sure the text is not overwritten by empty captions.
- if (caption && !(0,external_lodash_namespaceObject.get)(mediaAttributes, ['caption'])) {
- mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['caption']);
- }
- setAttributes(mediaAttributes);
- this.setState({
- isEditing: false
- });
- }
- onSelectCustomURL(newURL) {
- const {
- setAttributes,
- url
- } = this.props;
- if (newURL !== url) {
- setAttributes({
- url: newURL,
- id: undefined
- });
- this.setState({
- isEditing: false
- });
- }
- }
- render() {
- const {
- url,
- alt,
- id,
- linkTo,
- link,
- isFirstItem,
- isLastItem,
- isSelected,
- caption,
- onRemove,
- onMoveForward,
- onMoveBackward,
- setAttributes,
- 'aria-label': ariaLabel
- } = this.props;
- const {
- isEditing
- } = this.state;
- let href;
- switch (linkTo) {
- case v1_constants_LINK_DESTINATION_MEDIA:
- href = url;
- break;
- case v1_constants_LINK_DESTINATION_ATTACHMENT:
- href = link;
- break;
- }
- const img = // Disable reason: Image itself is not meant to be interactive, but should
- // direct image selection and unfocus caption fields.
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
- (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("img", {
- src: url,
- alt: alt,
- "data-id": id,
- onKeyDown: this.onRemoveImage,
- tabIndex: "0",
- "aria-label": ariaLabel,
- ref: this.bindContainer
- }), (0,external_wp_blob_namespaceObject.isBlobURL)(url) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))
- /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
- ;
- const className = classnames_default()({
- 'is-selected': isSelected,
- 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(url)
- });
- return (// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
- (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: className,
- onClick: this.onSelectImage,
- onFocus: this.onSelectImage
- }, !isEditing && (href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, img) : img), isEditing && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
- labels: {
- title: (0,external_wp_i18n_namespaceObject.__)('Edit gallery image')
- },
- icon: library_image,
- onSelect: this.onSelectImageFromLibrary,
- onSelectURL: this.onSelectCustomURL,
- accept: "image/*",
- allowedTypes: ['image'],
- value: {
- id,
- src: url
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
- className: "block-library-gallery-item__inline-menu is-left"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- icon: chevron_left,
- onClick: isFirstItem ? undefined : onMoveBackward,
- label: (0,external_wp_i18n_namespaceObject.__)('Move image backward'),
- "aria-disabled": isFirstItem,
- disabled: !isSelected
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- icon: chevron_right,
- onClick: isLastItem ? undefined : onMoveForward,
- label: (0,external_wp_i18n_namespaceObject.__)('Move image forward'),
- "aria-disabled": isLastItem,
- disabled: !isSelected
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
- className: "block-library-gallery-item__inline-menu is-right"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- icon: library_edit,
- onClick: this.onEdit,
- label: (0,external_wp_i18n_namespaceObject.__)('Replace image'),
- disabled: !isSelected
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- icon: close_small,
- onClick: onRemove,
- label: (0,external_wp_i18n_namespaceObject.__)('Remove image'),
- disabled: !isSelected
- })), !isEditing && (isSelected || caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: "figcaption",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image caption text'),
- placeholder: isSelected ? (0,external_wp_i18n_namespaceObject.__)('Add caption') : null,
- value: caption,
- onChange: newCaption => setAttributes({
- caption: newCaption
- }),
- inlineToolbar: true
- }))
- );
- }
- }
- /* harmony default export */ var gallery_image = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, ownProps) => {
- const {
- getMedia
- } = select(external_wp_coreData_namespaceObject.store);
- const {
- id
- } = ownProps;
- return {
- image: id ? getMedia(parseInt(id, 10)) : null
- };
- }), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => {
- const {
- __unstableMarkNextChangeAsNotPersistent
- } = dispatch(external_wp_blockEditor_namespaceObject.store);
- return {
- __unstableMarkNextChangeAsNotPersistent
- };
- })])(GalleryImage));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const gallery_Gallery = props => {
- const {
- attributes,
- isSelected,
- setAttributes,
- selectedImage,
- mediaPlaceholder,
- onMoveBackward,
- onMoveForward,
- onRemoveImage,
- onSelectImage,
- onDeselectImage,
- onSetImageAttributes,
- insertBlocksAfter,
- blockProps
- } = props;
- const {
- align,
- columns = defaultColumnsNumberV1(attributes),
- caption,
- imageCrop,
- images
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("figure", _extends({}, blockProps, {
- className: classnames_default()(blockProps.className, {
- [`align${align}`]: align,
- [`columns-${columns}`]: columns,
- 'is-cropped': imageCrop
- })
- }), (0,external_wp_element_namespaceObject.createElement)("ul", {
- className: "blocks-gallery-grid"
- }, images.map((img, index) => {
- const ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: 1: the order number of the image. 2: the total number of images. */
- (0,external_wp_i18n_namespaceObject.__)('image %1$d of %2$d in gallery'), index + 1, images.length);
- return (0,external_wp_element_namespaceObject.createElement)("li", {
- className: "blocks-gallery-item",
- key: img.id ? `${img.id}-${index}` : img.url
- }, (0,external_wp_element_namespaceObject.createElement)(gallery_image, {
- url: img.url,
- alt: img.alt,
- id: img.id,
- isFirstItem: index === 0,
- isLastItem: index + 1 === images.length,
- isSelected: isSelected && selectedImage === index,
- onMoveBackward: onMoveBackward(index),
- onMoveForward: onMoveForward(index),
- onRemove: onRemoveImage(index),
- onSelect: onSelectImage(index),
- onDeselect: onDeselectImage(index),
- setAttributes: attrs => onSetImageAttributes(index, attrs),
- caption: img.caption,
- "aria-label": ariaLabel,
- sizeSlug: attributes.sizeSlug
- }));
- })), mediaPlaceholder, (0,external_wp_element_namespaceObject.createElement)(gallery_RichTextVisibilityHelper, {
- isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption),
- tagName: "figcaption",
- className: "blocks-gallery-caption",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'),
- value: caption,
- onChange: value => setAttributes({
- caption: value
- }),
- inlineToolbar: true,
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
- }));
- };
- function gallery_RichTextVisibilityHelper(_ref) {
- let {
- isHidden,
- ...richTextProps
- } = _ref;
- return isHidden ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, _extends({
- as: external_wp_blockEditor_namespaceObject.RichText
- }, richTextProps)) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, richTextProps);
- }
- /* harmony default export */ var v1_gallery = (gallery_Gallery);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const edit_MAX_COLUMNS = 8;
- const edit_linkOptions = [{
- value: v1_constants_LINK_DESTINATION_ATTACHMENT,
- label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page')
- }, {
- value: v1_constants_LINK_DESTINATION_MEDIA,
- label: (0,external_wp_i18n_namespaceObject.__)('Media File')
- }, {
- value: v1_constants_LINK_DESTINATION_NONE,
- label: (0,external_wp_i18n_namespaceObject.__)('None')
- }];
- const v1_edit_ALLOWED_MEDIA_TYPES = ['image'];
- const edit_PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.select({
- web: (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.'),
- native: (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA')
- });
- const edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.select({
- web: {},
- native: {
- type: 'stepper'
- }
- });
- function edit_GalleryEdit(props) {
- const {
- attributes,
- clientId,
- isSelected,
- noticeUI,
- noticeOperations,
- onFocus
- } = props;
- const {
- columns = defaultColumnsNumberV1(attributes),
- imageCrop,
- images,
- linkTo,
- sizeSlug
- } = attributes;
- const [selectedImage, setSelectedImage] = (0,external_wp_element_namespaceObject.useState)();
- const [attachmentCaptions, setAttachmentCaptions] = (0,external_wp_element_namespaceObject.useState)();
- const {
- __unstableMarkNextChangeAsNotPersistent
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const {
- imageSizes,
- mediaUpload,
- getMedia,
- wasBlockJustInserted
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
- return {
- imageSizes: settings.imageSizes,
- mediaUpload: settings.mediaUpload,
- getMedia: select(external_wp_coreData_namespaceObject.store).getMedia,
- wasBlockJustInserted: select(external_wp_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu')
- };
- });
- const resizedImages = (0,external_wp_element_namespaceObject.useMemo)(() => {
- if (isSelected) {
- return (0,external_lodash_namespaceObject.reduce)(attributes.ids, (currentResizedImages, id) => {
- if (!id) {
- return currentResizedImages;
- }
- const image = getMedia(id);
- const sizes = (0,external_lodash_namespaceObject.reduce)(imageSizes, (currentSizes, size) => {
- const defaultUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', size.slug, 'url']);
- const mediaDetailsUrl = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size.slug, 'source_url']);
- return { ...currentSizes,
- [size.slug]: defaultUrl || mediaDetailsUrl
- };
- }, {});
- return { ...currentResizedImages,
- [parseInt(id, 10)]: sizes
- };
- }, {});
- }
- return {};
- }, [isSelected, attributes.ids, imageSizes]);
- function onFocusGalleryCaption() {
- setSelectedImage();
- }
- function setAttributes(newAttrs) {
- if (newAttrs.ids) {
- throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');
- }
- if (newAttrs.images) {
- newAttrs = { ...newAttrs,
- // Unlike images[ n ].id which is a string, always ensure the
- // ids array contains numbers as per its attribute type.
- ids: (0,external_lodash_namespaceObject.map)(newAttrs.images, _ref => {
- let {
- id
- } = _ref;
- return parseInt(id, 10);
- })
- };
- }
- props.setAttributes(newAttrs);
- }
- function onSelectImage(index) {
- return () => {
- setSelectedImage(index);
- };
- }
- function onDeselectImage() {
- return () => {
- setSelectedImage();
- };
- }
- function onMove(oldIndex, newIndex) {
- const newImages = [...images];
- newImages.splice(newIndex, 1, images[oldIndex]);
- newImages.splice(oldIndex, 1, images[newIndex]);
- setSelectedImage(newIndex);
- setAttributes({
- images: newImages
- });
- }
- function onMoveForward(oldIndex) {
- return () => {
- if (oldIndex === images.length - 1) {
- return;
- }
- onMove(oldIndex, oldIndex + 1);
- };
- }
- function onMoveBackward(oldIndex) {
- return () => {
- if (oldIndex === 0) {
- return;
- }
- onMove(oldIndex, oldIndex - 1);
- };
- }
- function onRemoveImage(index) {
- return () => {
- const newImages = (0,external_lodash_namespaceObject.filter)(images, (img, i) => index !== i);
- setSelectedImage();
- setAttributes({
- images: newImages,
- columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns
- });
- };
- }
- function selectCaption(newImage) {
- // The image id in both the images and attachmentCaptions arrays is a
- // string, so ensure comparison works correctly by converting the
- // newImage.id to a string.
- const newImageId = (0,external_lodash_namespaceObject.toString)(newImage.id);
- const currentImage = (0,external_lodash_namespaceObject.find)(images, {
- id: newImageId
- });
- const currentImageCaption = currentImage ? currentImage.caption : newImage.caption;
- if (!attachmentCaptions) {
- return currentImageCaption;
- }
- const attachment = (0,external_lodash_namespaceObject.find)(attachmentCaptions, {
- id: newImageId
- }); // If the attachment caption is updated.
- if (attachment && attachment.caption !== newImage.caption) {
- return newImage.caption;
- }
- return currentImageCaption;
- }
- function onSelectImages(newImages) {
- setAttachmentCaptions(newImages.map(newImage => ({
- // Store the attachmentCaption id as a string for consistency
- // with the type of the id in the images attribute.
- id: (0,external_lodash_namespaceObject.toString)(newImage.id),
- caption: newImage.caption
- })));
- setAttributes({
- images: newImages.map(newImage => ({ ...shared_pickRelevantMediaFiles(newImage, sizeSlug),
- caption: selectCaption(newImage, images, attachmentCaptions),
- // The id value is stored in a data attribute, so when the
- // block is parsed it's converted to a string. Converting
- // to a string here ensures it's type is consistent.
- id: (0,external_lodash_namespaceObject.toString)(newImage.id)
- })),
- columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns
- });
- }
- function onUploadError(message) {
- noticeOperations.removeAllNotices();
- noticeOperations.createErrorNotice(message);
- }
- function setLinkTo(value) {
- setAttributes({
- linkTo: value
- });
- }
- function setColumnsNumber(value) {
- setAttributes({
- columns: value
- });
- }
- function toggleImageCrop() {
- setAttributes({
- imageCrop: !imageCrop
- });
- }
- function getImageCropHelp(checked) {
- return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.');
- }
- function setImageAttributes(index, newAttributes) {
- if (!images[index]) {
- return;
- }
- setAttributes({
- images: [...images.slice(0, index), { ...images[index],
- ...newAttributes
- }, ...images.slice(index + 1)]
- });
- }
- function getImagesSizeOptions() {
- return (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref2 => {
- let {
- slug
- } = _ref2;
- return (0,external_lodash_namespaceObject.some)(resizedImages, sizes => sizes[slug]);
- }), _ref3 => {
- let {
- name,
- slug
- } = _ref3;
- return {
- value: slug,
- label: name
- };
- });
- }
- function updateImagesSize(newSizeSlug) {
- const updatedImages = (0,external_lodash_namespaceObject.map)(images, image => {
- if (!image.id) {
- return image;
- }
- const url = (0,external_lodash_namespaceObject.get)(resizedImages, [parseInt(image.id, 10), newSizeSlug]);
- return { ...image,
- ...(url && {
- url
- })
- };
- });
- setAttributes({
- images: updatedImages,
- sizeSlug: newSizeSlug
- });
- }
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (external_wp_element_namespaceObject.Platform.OS === 'web' && images && images.length > 0 && (0,external_lodash_namespaceObject.every)(images, _ref4 => {
- let {
- url
- } = _ref4;
- return (0,external_wp_blob_namespaceObject.isBlobURL)(url);
- })) {
- const filesList = (0,external_lodash_namespaceObject.map)(images, _ref5 => {
- let {
- url
- } = _ref5;
- return (0,external_wp_blob_namespaceObject.getBlobByURL)(url);
- });
- (0,external_lodash_namespaceObject.forEach)(images, _ref6 => {
- let {
- url
- } = _ref6;
- return (0,external_wp_blob_namespaceObject.revokeBlobURL)(url);
- });
- mediaUpload({
- filesList,
- onFileChange: onSelectImages,
- allowedTypes: ['image']
- });
- }
- }, []);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // Deselect images when deselecting the block.
- if (!isSelected) {
- setSelectedImage();
- }
- }, [isSelected]);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // linkTo attribute must be saved so blocks don't break when changing
- // image_default_link_type in options.php.
- if (!linkTo) {
- var _window, _window$wp, _window$wp$media, _window$wp$media$view, _window$wp$media$view2, _window$wp$media$view3;
- __unstableMarkNextChangeAsNotPersistent();
- setAttributes({
- linkTo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : (_window$wp$media = _window$wp.media) === null || _window$wp$media === void 0 ? void 0 : (_window$wp$media$view = _window$wp$media.view) === null || _window$wp$media$view === void 0 ? void 0 : (_window$wp$media$view2 = _window$wp$media$view.settings) === null || _window$wp$media$view2 === void 0 ? void 0 : (_window$wp$media$view3 = _window$wp$media$view2.defaultProps) === null || _window$wp$media$view3 === void 0 ? void 0 : _window$wp$media$view3.link) || v1_constants_LINK_DESTINATION_NONE
- });
- }
- }, [linkTo]);
- const hasImages = !!images.length;
- const hasImageIds = hasImages && images.some(image => !!image.id);
- const mediaPlaceholder = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
- addToGallery: hasImageIds,
- isAppender: hasImages,
- disableMediaButtons: hasImages && !isSelected,
- icon: !hasImages && sharedIcon,
- labels: {
- title: !hasImages && (0,external_wp_i18n_namespaceObject.__)('Gallery'),
- instructions: !hasImages && edit_PLACEHOLDER_TEXT
- },
- onSelect: onSelectImages,
- accept: "image/*",
- allowedTypes: v1_edit_ALLOWED_MEDIA_TYPES,
- multiple: true,
- value: hasImageIds ? images : {},
- onError: onUploadError,
- notices: hasImages ? undefined : noticeUI,
- onFocus: onFocus,
- autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted
- });
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- if (!hasImages) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, mediaPlaceholder);
- }
- const imageSizeOptions = getImagesSizeOptions();
- const shouldShowSizeOptions = hasImages && !(0,external_lodash_namespaceObject.isEmpty)(imageSizeOptions);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Gallery settings')
- }, images.length > 1 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, _extends({
- label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
- value: columns,
- onChange: setColumnsNumber,
- min: 1,
- max: Math.min(edit_MAX_COLUMNS, images.length)
- }, edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL, {
- required: true
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Crop images'),
- checked: !!imageCrop,
- onChange: toggleImageCrop,
- help: getImageCropHelp
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
- value: linkTo,
- onChange: setLinkTo,
- options: edit_linkOptions,
- hideCancelButton: true
- }), shouldShowSizeOptions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
- value: sizeSlug,
- options: imageSizeOptions,
- onChange: updateImagesSize,
- hideCancelButton: true
- }))), noticeUI, (0,external_wp_element_namespaceObject.createElement)(v1_gallery, _extends({}, props, {
- selectedImage: selectedImage,
- mediaPlaceholder: mediaPlaceholder,
- onMoveBackward: onMoveBackward,
- onMoveForward: onMoveForward,
- onRemoveImage: onRemoveImage,
- onSelectImage: onSelectImage,
- onDeselectImage: onDeselectImage,
- onSetImageAttributes: setImageAttributes,
- blockProps: blockProps // This prop is used by gallery.native.js.
- ,
- onFocusGalleryCaption: onFocusGalleryCaption
- })));
- }
- /* harmony default export */ var v1_edit = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices, (0,external_wp_viewport_namespaceObject.withViewportMatch)({
- isNarrow: '< small'
- })])(edit_GalleryEdit));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit-wrapper.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /*
- * Using a wrapper around the logic to load the edit for v1 of Gallery block
- * or the refactored version with InnerBlocks. This is to prevent conditional
- * use of hooks lint errors if adding this logic to the top of the edit component.
- */
- function GalleryEditWrapper(props) {
- if (!isGalleryV2Enabled()) {
- return (0,external_wp_element_namespaceObject.createElement)(v1_edit, props);
- }
- return (0,external_wp_element_namespaceObject.createElement)(gallery_edit, props);
- }
- /* harmony default export */ var edit_wrapper = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices])(GalleryEditWrapper));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/save.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function saveV1(_ref) {
- let {
- attributes
- } = _ref;
- const {
- images,
- columns = defaultColumnsNumberV1(attributes),
- imageCrop,
- caption,
- linkTo
- } = attributes;
- const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`;
- return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- }), (0,external_wp_element_namespaceObject.createElement)("ul", {
- className: "blocks-gallery-grid"
- }, images.map(image => {
- let href;
- switch (linkTo) {
- case v1_constants_LINK_DESTINATION_MEDIA:
- href = image.fullUrl || image.url;
- break;
- case v1_constants_LINK_DESTINATION_ATTACHMENT:
- href = image.link;
- break;
- }
- const img = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: image.url,
- alt: image.alt,
- "data-id": image.id,
- "data-full-url": image.fullUrl,
- "data-link": image.link,
- className: image.id ? `wp-image-${image.id}` : null
- });
- return (0,external_wp_element_namespaceObject.createElement)("li", {
- key: image.id || image.url,
- className: "blocks-gallery-item"
- }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- className: "blocks-gallery-item__caption",
- value: image.caption
- })));
- })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- className: "blocks-gallery-caption",
- value: caption
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function saveWithInnerBlocks(_ref) {
- let {
- attributes
- } = _ref;
- if (!isGalleryV2Enabled()) {
- return saveV1({
- attributes
- });
- }
- const {
- caption,
- columns,
- imageCrop
- } = attributes;
- const className = classnames_default()('has-nested-images', {
- [`columns-${columns}`]: columns !== undefined,
- [`columns-default`]: columns === undefined,
- 'is-cropped': imageCrop
- });
- const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- });
- const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
- return (0,external_wp_element_namespaceObject.createElement)("figure", innerBlocksProps, innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- className: "blocks-gallery-caption",
- value: caption
- }));
- }
- ;// CONCATENATED MODULE: external ["wp","hooks"]
- var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/transforms.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const parseShortcodeIds = ids => {
- if (!ids) {
- return [];
- }
- return ids.split(',').map(id => parseInt(id, 10));
- };
- /**
- * Third party block plugins don't have an easy way to detect if the
- * innerBlocks version of the Gallery is running when they run a
- * 3rdPartyBlock -> GalleryBlock transform so this tranform filter
- * will handle this. Once the innerBlocks version is the default
- * in a core release, this could be deprecated and removed after
- * plugin authors have been given time to update transforms.
- *
- * @typedef {Object} Attributes
- * @typedef {Object} Block
- * @property {Attributes} attributes The attributes of the block.
- * @param {Block} block The transformed block.
- * @return {Block} The transformed block.
- */
- function updateThirdPartyTransformToGallery(block) {
- var _block$attributes;
- if (isGalleryV2Enabled() && block.name === 'core/gallery' && ((_block$attributes = block.attributes) === null || _block$attributes === void 0 ? void 0 : _block$attributes.images.length) > 0) {
- const innerBlocks = block.attributes.images.map(_ref => {
- let {
- url,
- id,
- alt
- } = _ref;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- url,
- id: id ? parseInt(id, 10) : null,
- alt,
- sizeSlug: block.attributes.sizeSlug,
- linkDestination: block.attributes.linkDestination
- });
- });
- delete block.attributes.ids;
- delete block.attributes.images;
- block.innerBlocks = innerBlocks;
- }
- return block;
- }
- (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-to', updateThirdPartyTransformToGallery);
- /**
- * Third party block plugins don't have an easy way to detect if the
- * innerBlocks version of the Gallery is running when they run a
- * GalleryBlock -> 3rdPartyBlock transform so this transform filter
- * will handle this. Once the innerBlocks version is the default
- * in a core release, this could be deprecated and removed after
- * plugin authors have been given time to update transforms.
- *
- * @typedef {Object} Attributes
- * @typedef {Object} Block
- * @property {Attributes} attributes The attributes of the block.
- * @param {Block} toBlock The block to transform to.
- * @param {Block[]} fromBlocks The blocks to transform from.
- * @return {Block} The transformed block.
- */
- function updateThirdPartyTransformFromGallery(toBlock, fromBlocks) {
- const from = Array.isArray(fromBlocks) ? fromBlocks : [fromBlocks];
- const galleryBlock = from.find(transformedBlock => {
- var _transformedBlock$att;
- return transformedBlock.name === 'core/gallery' && transformedBlock.innerBlocks.length > 0 && !((_transformedBlock$att = transformedBlock.attributes.images) !== null && _transformedBlock$att !== void 0 && _transformedBlock$att.length) > 0 && !toBlock.name.includes('core/');
- });
- if (galleryBlock) {
- const images = galleryBlock.innerBlocks.map(_ref2 => {
- let {
- attributes: {
- url,
- id,
- alt
- }
- } = _ref2;
- return {
- url,
- id: id ? parseInt(id, 10) : null,
- alt
- };
- });
- const ids = images.map(_ref3 => {
- let {
- id
- } = _ref3;
- return id;
- });
- galleryBlock.attributes.images = images;
- galleryBlock.attributes.ids = ids;
- }
- return toBlock;
- }
- (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-from', updateThirdPartyTransformFromGallery);
- const gallery_transforms_transforms = {
- from: [{
- type: 'block',
- isMultiBlock: true,
- blocks: ['core/image'],
- transform: attributes => {
- // Init the align and size from the first item which may be either the placeholder or an image.
- let {
- align,
- sizeSlug
- } = attributes[0]; // Loop through all the images and check if they have the same align and size.
- align = (0,external_lodash_namespaceObject.every)(attributes, ['align', align]) ? align : undefined;
- sizeSlug = (0,external_lodash_namespaceObject.every)(attributes, ['sizeSlug', sizeSlug]) ? sizeSlug : undefined;
- const validImages = (0,external_lodash_namespaceObject.filter)(attributes, _ref4 => {
- let {
- url
- } = _ref4;
- return url;
- });
- if (isGalleryV2Enabled()) {
- const innerBlocks = validImages.map(image => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', image);
- });
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
- align,
- sizeSlug
- }, innerBlocks);
- }
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
- images: validImages.map(_ref5 => {
- let {
- id,
- url,
- alt,
- caption
- } = _ref5;
- return {
- id: (0,external_lodash_namespaceObject.toString)(id),
- url,
- alt,
- caption
- };
- }),
- ids: validImages.map(_ref6 => {
- let {
- id
- } = _ref6;
- return parseInt(id, 10);
- }),
- align,
- sizeSlug
- });
- }
- }, {
- type: 'shortcode',
- tag: 'gallery',
- attributes: {
- images: {
- type: 'array',
- shortcode: _ref7 => {
- let {
- named: {
- ids
- }
- } = _ref7;
- if (!isGalleryV2Enabled()) {
- return parseShortcodeIds(ids).map(id => ({
- id: (0,external_lodash_namespaceObject.toString)(id)
- }));
- }
- }
- },
- ids: {
- type: 'array',
- shortcode: _ref8 => {
- let {
- named: {
- ids
- }
- } = _ref8;
- if (!isGalleryV2Enabled()) {
- return parseShortcodeIds(ids);
- }
- }
- },
- shortCodeTransforms: {
- type: 'array',
- shortcode: _ref9 => {
- let {
- named: {
- ids
- }
- } = _ref9;
- if (isGalleryV2Enabled()) {
- return parseShortcodeIds(ids).map(id => ({
- id: parseInt(id)
- }));
- }
- }
- },
- columns: {
- type: 'number',
- shortcode: _ref10 => {
- let {
- named: {
- columns = '3'
- }
- } = _ref10;
- return parseInt(columns, 10);
- }
- },
- linkTo: {
- type: 'string',
- shortcode: _ref11 => {
- let {
- named: {
- link
- }
- } = _ref11;
- if (!isGalleryV2Enabled()) {
- switch (link) {
- case 'post':
- return v1_constants_LINK_DESTINATION_ATTACHMENT;
- case 'file':
- return v1_constants_LINK_DESTINATION_MEDIA;
- default:
- return v1_constants_LINK_DESTINATION_ATTACHMENT;
- }
- }
- switch (link) {
- case 'post':
- return LINK_DESTINATION_ATTACHMENT;
- case 'file':
- return LINK_DESTINATION_MEDIA;
- default:
- return LINK_DESTINATION_NONE;
- }
- }
- }
- },
- isMatch(_ref12) {
- let {
- named
- } = _ref12;
- return undefined !== named.ids;
- }
- }, {
- // When created by drag and dropping multiple files on an insertion point. Because multiple
- // files must not be transformed to a gallery when dropped within a gallery there is another transform
- // within the image block to handle that case. Therefore this transform has to have priority 1
- // set so that it overrrides the image block transformation when mulitple images are dropped outside
- // of a gallery block.
- type: 'files',
- priority: 1,
- isMatch(files) {
- return files.length !== 1 && (0,external_lodash_namespaceObject.every)(files, file => file.type.indexOf('image/') === 0);
- },
- transform(files) {
- if (isGalleryV2Enabled()) {
- const innerBlocks = files.map(file => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
- }));
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {}, innerBlocks);
- }
- const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
- images: files.map(file => pickRelevantMediaFiles({
- url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
- }))
- });
- return block;
- }
- }],
- to: [{
- type: 'block',
- blocks: ['core/image'],
- transform: (_ref13, innerBlocks) => {
- let {
- align,
- images,
- ids,
- sizeSlug
- } = _ref13;
- if (isGalleryV2Enabled()) {
- if (innerBlocks.length > 0) {
- return innerBlocks.map(_ref14 => {
- let {
- attributes: {
- id,
- url,
- alt,
- caption,
- sizeSlug: imageSizeSlug,
- linkDestination,
- href,
- linkTarget
- }
- } = _ref14;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- id,
- url,
- alt,
- caption,
- sizeSlug: imageSizeSlug,
- align,
- linkDestination,
- href,
- linkTarget
- });
- });
- }
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- align
- });
- }
- if (images.length > 0) {
- return images.map((_ref15, index) => {
- let {
- url,
- alt,
- caption
- } = _ref15;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- id: ids[index],
- url,
- alt,
- caption,
- align,
- sizeSlug
- });
- });
- }
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- align
- });
- }
- }]
- };
- /* harmony default export */ var gallery_transforms = (gallery_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const gallery_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/gallery",
- title: "Gallery",
- category: "media",
- description: "Display multiple images in a rich gallery.",
- keywords: ["images", "photos"],
- textdomain: "default",
- attributes: {
- images: {
- type: "array",
- "default": [],
- source: "query",
- selector: ".blocks-gallery-item",
- query: {
- url: {
- type: "string",
- source: "attribute",
- selector: "img",
- attribute: "src"
- },
- fullUrl: {
- type: "string",
- source: "attribute",
- selector: "img",
- attribute: "data-full-url"
- },
- link: {
- type: "string",
- source: "attribute",
- selector: "img",
- attribute: "data-link"
- },
- alt: {
- type: "string",
- source: "attribute",
- selector: "img",
- attribute: "alt",
- "default": ""
- },
- id: {
- type: "string",
- source: "attribute",
- selector: "img",
- attribute: "data-id"
- },
- caption: {
- type: "string",
- source: "html",
- selector: ".blocks-gallery-item__caption"
- }
- }
- },
- ids: {
- type: "array",
- items: {
- type: "number"
- },
- "default": []
- },
- shortCodeTransforms: {
- type: "array",
- "default": [],
- items: {
- type: "object"
- }
- },
- columns: {
- type: "number",
- minimum: 1,
- maximum: 8
- },
- caption: {
- type: "string",
- source: "html",
- selector: ".blocks-gallery-caption"
- },
- imageCrop: {
- type: "boolean",
- "default": true
- },
- fixedHeight: {
- type: "boolean",
- "default": true
- },
- linkTarget: {
- type: "string"
- },
- linkTo: {
- type: "string"
- },
- sizeSlug: {
- type: "string",
- "default": "large"
- },
- allowResize: {
- type: "boolean",
- "default": false
- }
- },
- providesContext: {
- allowResize: "allowResize",
- imageCrop: "imageCrop",
- fixedHeight: "fixedHeight"
- },
- supports: {
- anchor: true,
- align: true,
- html: false,
- units: ["px", "em", "rem", "vh", "vw"],
- spacing: {
- blockGap: true,
- __experimentalSkipSerialization: ["blockGap"],
- __experimentalDefaultControls: {
- blockGap: true
- }
- },
- __experimentalLayout: {
- allowSwitching: false,
- allowInheriting: false,
- allowEditing: false,
- "default": {
- type: "flex"
- }
- }
- },
- editorStyle: "wp-block-gallery-editor",
- style: "wp-block-gallery"
- };
- const {
- name: gallery_name
- } = gallery_metadata;
- const gallery_settings = {
- icon: library_gallery,
- example: {
- attributes: {
- columns: 2
- },
- innerBlocks: [{
- name: 'core/image',
- attributes: {
- url: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg'
- }
- }, {
- name: 'core/image',
- attributes: {
- url: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg'
- }
- }]
- },
- transforms: gallery_transforms,
- edit: edit_wrapper,
- save: saveWithInnerBlocks,
- deprecated: gallery_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/group.js
- /**
- * WordPress dependencies
- */
- const group = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"
- }));
- /* harmony default export */ var library_group = (group);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const migrateAttributes = attributes => {
- if (!attributes.tagName) {
- attributes = { ...attributes,
- tagName: 'div'
- };
- }
- if (!attributes.customTextColor && !attributes.customBackgroundColor) {
- return attributes;
- }
- const style = {
- color: {}
- };
- if (attributes.customTextColor) {
- style.color.text = attributes.customTextColor;
- }
- if (attributes.customBackgroundColor) {
- style.color.background = attributes.customBackgroundColor;
- }
- return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor']),
- style
- };
- };
- const group_deprecated_deprecated = [// Version of the block with the double div.
- {
- attributes: {
- tagName: {
- type: 'string',
- default: 'div'
- },
- templateLock: {
- type: 'string'
- }
- },
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- color: {
- gradients: true,
- link: true
- },
- spacing: {
- padding: true
- },
- __experimentalBorder: {
- radius: true
- }
- },
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- tagName: Tag
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-group__inner-container"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
- }
- }, // Version of the block without global styles support
- {
- attributes: {
- backgroundColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- }
- },
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- html: false
- },
- migrate: migrateAttributes,
- save(_ref2) {
- let {
- attributes
- } = _ref2;
- const {
- backgroundColor,
- customBackgroundColor,
- textColor,
- customTextColor
- } = attributes;
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const className = classnames_default()(backgroundClass, textClass, {
- 'has-text-color': textColor || customTextColor,
- 'has-background': backgroundColor || customBackgroundColor
- });
- const styles = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- color: textClass ? undefined : customTextColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: className,
- style: styles
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-group__inner-container"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
- }
- }, // Version of the group block with a bug that made text color class not applied.
- {
- attributes: {
- backgroundColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- }
- },
- migrate: migrateAttributes,
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- html: false
- },
- save(_ref3) {
- let {
- attributes
- } = _ref3;
- const {
- backgroundColor,
- customBackgroundColor,
- textColor,
- customTextColor
- } = attributes;
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const className = classnames_default()(backgroundClass, {
- 'has-text-color': textColor || customTextColor,
- 'has-background': backgroundColor || customBackgroundColor
- });
- const styles = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- color: textClass ? undefined : customTextColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: className,
- style: styles
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-group__inner-container"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
- }
- }, // v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`.
- {
- attributes: {
- backgroundColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- }
- },
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- html: false
- },
- migrate: migrateAttributes,
- save(_ref4) {
- let {
- attributes
- } = _ref4;
- const {
- backgroundColor,
- customBackgroundColor
- } = attributes;
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const className = classnames_default()(backgroundClass, {
- 'has-background': backgroundColor || customBackgroundColor
- });
- const styles = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: className,
- style: styles
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
- }
- }];
- /* harmony default export */ var group_deprecated = (group_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/edit.js
- /**
- * WordPress dependencies
- */
- const htmlElementMessages = {
- header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
- main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only. '),
- section: (0,external_wp_i18n_namespaceObject.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
- article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self contained, syndicatable portion of the document.'),
- aside: (0,external_wp_i18n_namespaceObject.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
- footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).')
- };
- function GroupEdit(_ref) {
- let {
- attributes,
- setAttributes,
- clientId
- } = _ref;
- const {
- hasInnerBlocks,
- themeSupportsLayout
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getSettings;
- const {
- getBlock,
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- const block = getBlock(clientId);
- return {
- hasInnerBlocks: !!(block && block.innerBlocks.length),
- themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
- };
- }, [clientId]);
- const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
- const {
- tagName: TagName = 'div',
- templateLock,
- layout = {}
- } = attributes;
- const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
- const {
- type = 'default'
- } = usedLayout;
- const layoutSupportEnabled = themeSupportsLayout || type !== 'default';
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: `is-layout-${type}`
- });
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : {
- className: 'wp-block-group__inner-container'
- }, {
- templateLock,
- renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
- __experimentalLayout: layoutSupportEnabled ? usedLayout : undefined
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "advanced"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
- options: [{
- label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
- value: 'div'
- }, {
- label: '<header>',
- value: 'header'
- }, {
- label: '<main>',
- value: 'main'
- }, {
- label: '<section>',
- value: 'section'
- }, {
- label: '<article>',
- value: 'article'
- }, {
- label: '<aside>',
- value: 'aside'
- }, {
- label: '<footer>',
- value: 'footer'
- }],
- value: TagName,
- onChange: value => setAttributes({
- tagName: value
- }),
- help: htmlElementMessages[TagName]
- })), layoutSupportEnabled && (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps), !layoutSupportEnabled && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
- }
- /* harmony default export */ var group_edit = (GroupEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/save.js
- /**
- * WordPress dependencies
- */
- function group_save_save(_ref) {
- let {
- attributes: {
- tagName: Tag
- }
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/transforms.js
- /**
- * WordPress dependencies
- */
- const group_transforms_transforms = {
- from: [{
- type: 'block',
- isMultiBlock: true,
- blocks: ['*'],
- __experimentalConvert(blocks) {
- const alignments = ['wide', 'full']; // Determine the widest setting of all the blocks to be grouped
- const widestAlignment = blocks.reduce((accumulator, block) => {
- const {
- align
- } = block.attributes;
- return alignments.indexOf(align) > alignments.indexOf(accumulator) ? align : accumulator;
- }, undefined); // Clone the Blocks to be Grouped
- // Failing to create new block references causes the original blocks
- // to be replaced in the switchToBlockType call thereby meaning they
- // are removed both from their original location and within the
- // new group block.
- const groupInnerBlocks = blocks.map(block => {
- return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks);
- });
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
- align: widestAlignment
- }, groupInnerBlocks);
- }
- }]
- };
- /* harmony default export */ var group_transforms = (group_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/row.js
- /**
- * WordPress dependencies
- */
- const row = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"
- }));
- /* harmony default export */ var library_row = (row);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/stack.js
- /**
- * WordPress dependencies
- */
- const stack = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"
- }));
- /* harmony default export */ var library_stack = (stack);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/variations.js
- /**
- * WordPress dependencies
- */
- const group_variations_variations = [{
- name: 'group',
- title: (0,external_wp_i18n_namespaceObject.__)('Group'),
- description: (0,external_wp_i18n_namespaceObject.__)('Gather blocks in a layout container.'),
- attributes: {
- layout: {
- type: 'default'
- }
- },
- scope: ['transform'],
- isActive: blockAttributes => {
- var _blockAttributes$layo, _blockAttributes$layo2;
- return !blockAttributes.layout || !((_blockAttributes$layo = blockAttributes.layout) !== null && _blockAttributes$layo !== void 0 && _blockAttributes$layo.type) || ((_blockAttributes$layo2 = blockAttributes.layout) === null || _blockAttributes$layo2 === void 0 ? void 0 : _blockAttributes$layo2.type) === 'default';
- },
- icon: library_group
- }, {
- name: 'group-row',
- title: (0,external_wp_i18n_namespaceObject.__)('Row'),
- description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks horizontally.'),
- attributes: {
- layout: {
- type: 'flex',
- flexWrap: 'nowrap'
- }
- },
- scope: ['inserter', 'transform'],
- isActive: blockAttributes => {
- var _blockAttributes$layo3, _blockAttributes$layo4, _blockAttributes$layo5;
- return ((_blockAttributes$layo3 = blockAttributes.layout) === null || _blockAttributes$layo3 === void 0 ? void 0 : _blockAttributes$layo3.type) === 'flex' && (!((_blockAttributes$layo4 = blockAttributes.layout) !== null && _blockAttributes$layo4 !== void 0 && _blockAttributes$layo4.orientation) || ((_blockAttributes$layo5 = blockAttributes.layout) === null || _blockAttributes$layo5 === void 0 ? void 0 : _blockAttributes$layo5.orientation) === 'horizontal');
- },
- icon: library_row
- }, {
- name: 'group-stack',
- title: (0,external_wp_i18n_namespaceObject.__)('Stack'),
- description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks vertically.'),
- attributes: {
- layout: {
- type: 'flex',
- orientation: 'vertical'
- }
- },
- scope: ['inserter', 'transform'],
- isActive: blockAttributes => {
- var _blockAttributes$layo6, _blockAttributes$layo7;
- return ((_blockAttributes$layo6 = blockAttributes.layout) === null || _blockAttributes$layo6 === void 0 ? void 0 : _blockAttributes$layo6.type) === 'flex' && ((_blockAttributes$layo7 = blockAttributes.layout) === null || _blockAttributes$layo7 === void 0 ? void 0 : _blockAttributes$layo7.orientation) === 'vertical';
- },
- icon: library_stack
- }];
- /* harmony default export */ var group_variations = (group_variations_variations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const group_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/group",
- title: "Group",
- category: "design",
- description: "Gather blocks in a layout container.",
- keywords: ["container", "wrapper", "row", "section"],
- textdomain: "default",
- attributes: {
- tagName: {
- type: "string",
- "default": "div"
- },
- templateLock: {
- type: ["string", "boolean"],
- "enum": ["all", "insert", false]
- }
- },
- supports: {
- align: ["wide", "full"],
- anchor: true,
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- spacing: {
- margin: ["top", "bottom"],
- padding: true,
- blockGap: true,
- __experimentalDefaultControls: {
- padding: true,
- blockGap: true
- }
- },
- __experimentalBorder: {
- color: true,
- radius: true,
- style: true,
- width: true,
- __experimentalDefaultControls: {
- color: true,
- radius: true,
- style: true,
- width: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- __experimentalLayout: true
- },
- editorStyle: "wp-block-group-editor",
- style: "wp-block-group"
- };
- const {
- name: group_name
- } = group_metadata;
- const group_settings = {
- icon: library_group,
- example: {
- attributes: {
- style: {
- color: {
- text: '#000000',
- background: '#ffffff'
- }
- }
- },
- innerBlocks: [{
- name: 'core/paragraph',
- attributes: {
- customTextColor: '#cf2e2e',
- fontSize: 'large',
- content: (0,external_wp_i18n_namespaceObject.__)('One.')
- }
- }, {
- name: 'core/paragraph',
- attributes: {
- customTextColor: '#ff6900',
- fontSize: 'large',
- content: (0,external_wp_i18n_namespaceObject.__)('Two.')
- }
- }, {
- name: 'core/paragraph',
- attributes: {
- customTextColor: '#fcb900',
- fontSize: 'large',
- content: (0,external_wp_i18n_namespaceObject.__)('Three.')
- }
- }, {
- name: 'core/paragraph',
- attributes: {
- customTextColor: '#00d084',
- fontSize: 'large',
- content: (0,external_wp_i18n_namespaceObject.__)('Four.')
- }
- }, {
- name: 'core/paragraph',
- attributes: {
- customTextColor: '#0693e3',
- fontSize: 'large',
- content: (0,external_wp_i18n_namespaceObject.__)('Five.')
- }
- }, {
- name: 'core/paragraph',
- attributes: {
- customTextColor: '#9b51e0',
- fontSize: 'large',
- content: (0,external_wp_i18n_namespaceObject.__)('Six.')
- }
- }]
- },
- transforms: group_transforms,
- edit: group_edit,
- save: group_save_save,
- deprecated: group_deprecated,
- variations: group_variations
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/heading.js
- /**
- * WordPress dependencies
- */
- const heading = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z"
- }));
- /* harmony default export */ var library_heading = (heading);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const blockSupports = {
- className: false,
- anchor: true
- };
- const heading_deprecated_blockAttributes = {
- align: {
- type: 'string'
- },
- content: {
- type: 'string',
- source: 'html',
- selector: 'h1,h2,h3,h4,h5,h6',
- default: ''
- },
- level: {
- type: 'number',
- default: 2
- },
- placeholder: {
- type: 'string'
- }
- };
- const deprecated_migrateCustomColors = attributes => {
- if (!attributes.customTextColor) {
- return attributes;
- }
- const style = {
- color: {
- text: attributes.customTextColor
- }
- };
- return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor']),
- style
- };
- };
- const TEXT_ALIGN_OPTIONS = ['left', 'right', 'center'];
- const migrateTextAlign = attributes => {
- const {
- align,
- ...rest
- } = attributes;
- return TEXT_ALIGN_OPTIONS.includes(align) ? { ...rest,
- textAlign: align
- } : attributes;
- };
- const heading_deprecated_deprecated = [{
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- className: false,
- color: {
- link: true
- },
- fontSize: true,
- lineHeight: true,
- __experimentalSelector: {
- 'core/heading/h1': 'h1',
- 'core/heading/h2': 'h2',
- 'core/heading/h3': 'h3',
- 'core/heading/h4': 'h4',
- 'core/heading/h5': 'h5',
- 'core/heading/h6': 'h6'
- },
- __unstablePasteTextInline: true
- },
- attributes: heading_deprecated_blockAttributes,
- isEligible: _ref => {
- let {
- align
- } = _ref;
- return TEXT_ALIGN_OPTIONS.includes(align);
- },
- migrate: migrateTextAlign,
- save(_ref2) {
- let {
- attributes
- } = _ref2;
- const {
- align,
- content,
- level
- } = attributes;
- const TagName = 'h' + level;
- const className = classnames_default()({
- [`has-text-align-${align}`]: align
- });
- return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: content
- }));
- }
- }, {
- supports: blockSupports,
- attributes: { ...heading_deprecated_blockAttributes,
- customTextColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- }
- },
- migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
- save(_ref3) {
- let {
- attributes
- } = _ref3;
- const {
- align,
- content,
- customTextColor,
- level,
- textColor
- } = attributes;
- const tagName = 'h' + level;
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const className = classnames_default()({
- [textClass]: textClass,
- 'has-text-color': textColor || customTextColor,
- [`has-text-align-${align}`]: align
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- className: className ? className : undefined,
- tagName: tagName,
- style: {
- color: textClass ? undefined : customTextColor
- },
- value: content
- });
- }
- }, {
- attributes: { ...heading_deprecated_blockAttributes,
- customTextColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- }
- },
- migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
- save(_ref4) {
- let {
- attributes
- } = _ref4;
- const {
- align,
- content,
- customTextColor,
- level,
- textColor
- } = attributes;
- const tagName = 'h' + level;
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const className = classnames_default()({
- [textClass]: textClass,
- [`has-text-align-${align}`]: align
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- className: className ? className : undefined,
- tagName: tagName,
- style: {
- color: textClass ? undefined : customTextColor
- },
- value: content
- });
- },
- supports: blockSupports
- }, {
- supports: blockSupports,
- attributes: { ...heading_deprecated_blockAttributes,
- customTextColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- }
- },
- migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
- save(_ref5) {
- let {
- attributes
- } = _ref5;
- const {
- align,
- level,
- content,
- textColor,
- customTextColor
- } = attributes;
- const tagName = 'h' + level;
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const className = classnames_default()({
- [textClass]: textClass
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- className: className ? className : undefined,
- tagName: tagName,
- style: {
- textAlign: align,
- color: textClass ? undefined : customTextColor
- },
- value: content
- });
- }
- }];
- /* harmony default export */ var heading_deprecated = (heading_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/autogenerate-anchors.js
- /**
- * External dependencies
- */
- /**
- * Object map tracking anchors.
- *
- * @type {Record<string, string | null>}
- */
- const autogenerate_anchors_anchors = {};
- /**
- * Returns the text without markup.
- *
- * @param {string} text The text.
- *
- * @return {string} The text without markup.
- */
- const getTextWithoutMarkup = text => {
- const dummyElement = document.createElement('div');
- dummyElement.innerHTML = text;
- return dummyElement.innerText;
- };
- /**
- * Get the slug from the content.
- *
- * @param {string} content The block content.
- *
- * @return {string} Returns the slug.
- */
- const getSlug = content => {
- // Get the slug.
- return (0,external_lodash_namespaceObject.trim)((0,external_lodash_namespaceObject.deburr)(getTextWithoutMarkup(content)).replace(/[^\p{L}\p{N}]+/gu, '-').toLowerCase(), '-');
- };
- /**
- * Generate the anchor for a heading.
- *
- * @param {string} clientId The block ID.
- * @param {string} content The block content.
- *
- * @return {string|null} Return the heading anchor.
- */
- const generateAnchor = (clientId, content) => {
- const slug = getSlug(content); // If slug is empty, then return null.
- // Returning null instead of an empty string allows us to check again when the content changes.
- if ('' === slug) {
- return null;
- }
- delete autogenerate_anchors_anchors[clientId];
- let anchor = slug;
- let i = 0; // If the anchor already exists in another heading, append -i.
- while (Object.values(autogenerate_anchors_anchors).includes(anchor)) {
- i += 1;
- anchor = slug + '-' + i;
- }
- return anchor;
- };
- /**
- * Set the anchor for a heading.
- *
- * @param {string} clientId The block ID.
- * @param {string|null} anchor The block anchor.
- */
- const setAnchor = (clientId, anchor) => {
- autogenerate_anchors_anchors[clientId] = anchor;
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function HeadingEdit(_ref) {
- let {
- attributes,
- setAttributes,
- mergeBlocks,
- onReplace,
- style,
- clientId
- } = _ref;
- const {
- textAlign,
- content,
- level,
- placeholder,
- anchor
- } = attributes;
- const tagName = 'h' + level;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- }),
- style
- });
- const {
- canGenerateAnchors
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
- return {
- canGenerateAnchors: !!settings.generateAnchors
- };
- }, []);
- const {
- __unstableMarkNextChangeAsNotPersistent
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Initially set anchor for headings that have content but no anchor set.
- // This is used when transforming a block to heading, or for legacy anchors.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!canGenerateAnchors) {
- return;
- }
- if (!anchor && content) {
- // This side-effect should not create an undo level.
- __unstableMarkNextChangeAsNotPersistent();
- setAttributes({
- anchor: generateAnchor(clientId, content)
- });
- }
- setAnchor(clientId, anchor); // Remove anchor map when block unmounts.
- return () => setAnchor(clientId, null);
- }, [anchor, content, clientId, canGenerateAnchors]);
- const onContentChange = value => {
- const newAttrs = {
- content: value
- };
- if (canGenerateAnchors && (!anchor || !value || generateAnchor(clientId, content) === anchor)) {
- newAttrs.anchor = generateAnchor(clientId, value);
- }
- setAttributes(newAttrs);
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
- selectedLevel: level,
- onChange: newLevel => setAttributes({
- level: newLevel
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
- identifier: "content",
- tagName: tagName,
- value: content,
- onChange: onContentChange,
- onMerge: mergeBlocks,
- onSplit: (value, isOriginal) => {
- let block;
- if (isOriginal || value) {
- block = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { ...attributes,
- content: value
- });
- } else {
- var _getDefaultBlockName;
- block = (0,external_wp_blocks_namespaceObject.createBlock)((_getDefaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)()) !== null && _getDefaultBlockName !== void 0 ? _getDefaultBlockName : 'core/heading');
- }
- if (isOriginal) {
- block.clientId = clientId;
- }
- return block;
- },
- onReplace: onReplace,
- onRemove: () => onReplace([]),
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading text'),
- placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Heading'),
- textAlign: textAlign
- }, external_wp_element_namespaceObject.Platform.isNative && {
- deleteEnter: true
- }, blockProps)));
- }
- /* harmony default export */ var heading_edit = (HeadingEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function heading_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- textAlign,
- content,
- level
- } = attributes;
- const TagName = 'h' + level;
- const className = classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- });
- return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: content
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/shared.js
- /**
- * Given a node name string for a heading node, returns its numeric level.
- *
- * @param {string} nodeName Heading node name.
- *
- * @return {number} Heading level.
- */
- function getLevelFromHeadingNodeName(nodeName) {
- return Number(nodeName.substr(1));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/transforms.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const {
- name: heading_transforms_name
- } = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/heading",
- title: "Heading",
- category: "text",
- description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",
- keywords: ["title", "subtitle"],
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- },
- content: {
- type: "string",
- source: "html",
- selector: "h1,h2,h3,h4,h5,h6",
- "default": "",
- __experimentalRole: "content"
- },
- level: {
- type: "number",
- "default": 2
- },
- placeholder: {
- type: "string"
- }
- },
- supports: {
- align: ["wide", "full"],
- anchor: true,
- className: false,
- color: {
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- spacing: {
- margin: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true,
- fontAppearance: true,
- textTransform: true
- }
- },
- __experimentalSelector: "h1,h2,h3,h4,h5,h6",
- __unstablePasteTextInline: true,
- __experimentalSlashInserter: true
- },
- editorStyle: "wp-block-heading-editor",
- style: "wp-block-heading"
- };
- const heading_transforms_transforms = {
- from: [{
- type: 'block',
- isMultiBlock: true,
- blocks: ['core/paragraph'],
- transform: attributes => attributes.map(_ref => {
- let {
- content,
- anchor
- } = _ref;
- return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
- content,
- anchor
- });
- })
- }, {
- type: 'raw',
- selector: 'h1,h2,h3,h4,h5,h6',
- schema: _ref2 => {
- let {
- phrasingContentSchema,
- isPaste
- } = _ref2;
- const schema = {
- children: phrasingContentSchema,
- attributes: isPaste ? [] : ['style', 'id']
- };
- return {
- h1: schema,
- h2: schema,
- h3: schema,
- h4: schema,
- h5: schema,
- h6: schema
- };
- },
- transform(node) {
- const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(heading_transforms_name, node.outerHTML);
- const {
- textAlign
- } = node.style || {};
- attributes.level = getLevelFromHeadingNodeName(node.nodeName);
- if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
- attributes.align = textAlign;
- }
- return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, attributes);
- }
- }, ...[1, 2, 3, 4, 5, 6].map(level => ({
- type: 'prefix',
- prefix: Array(level + 1).join('#'),
- transform(content) {
- return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
- level,
- content
- });
- }
- })), ...[1, 2, 3, 4, 5, 6].map(level => ({
- type: 'enter',
- regExp: new RegExp(`^/(h|H)${level}$`),
- transform(content) {
- return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
- level,
- content
- });
- }
- }))],
- to: [{
- type: 'block',
- isMultiBlock: true,
- blocks: ['core/paragraph'],
- transform: attributes => attributes.map(_ref3 => {
- let {
- content
- } = _ref3;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content
- });
- })
- }]
- };
- /* harmony default export */ var heading_transforms = (heading_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/index.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const heading_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/heading",
- title: "Heading",
- category: "text",
- description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",
- keywords: ["title", "subtitle"],
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- },
- content: {
- type: "string",
- source: "html",
- selector: "h1,h2,h3,h4,h5,h6",
- "default": "",
- __experimentalRole: "content"
- },
- level: {
- type: "number",
- "default": 2
- },
- placeholder: {
- type: "string"
- }
- },
- supports: {
- align: ["wide", "full"],
- anchor: true,
- className: false,
- color: {
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- spacing: {
- margin: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true,
- fontAppearance: true,
- textTransform: true
- }
- },
- __experimentalSelector: "h1,h2,h3,h4,h5,h6",
- __unstablePasteTextInline: true,
- __experimentalSlashInserter: true
- },
- editorStyle: "wp-block-heading-editor",
- style: "wp-block-heading"
- };
- const {
- name: heading_name
- } = heading_metadata;
- const heading_settings = {
- icon: library_heading,
- example: {
- attributes: {
- content: (0,external_wp_i18n_namespaceObject.__)('Code is Poetry'),
- level: 2
- }
- },
- __experimentalLabel(attributes, _ref) {
- let {
- context
- } = _ref;
- if (context === 'accessibility') {
- const {
- content,
- level
- } = attributes;
- return (0,external_lodash_namespaceObject.isEmpty)(content) ? (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: accessibility text. %s: heading level. */
- (0,external_wp_i18n_namespaceObject.__)('Level %s. Empty.'), level) : (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: accessibility text. 1: heading level. 2: heading content. */
- (0,external_wp_i18n_namespaceObject.__)('Level %1$s. %2$s'), level, content);
- }
- },
- transforms: heading_transforms,
- deprecated: heading_deprecated,
- merge(attributes, attributesToMerge) {
- return {
- content: (attributes.content || '') + (attributesToMerge.content || '')
- };
- },
- edit: heading_edit,
- save: heading_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/home.js
- /**
- * WordPress dependencies
- */
- const home = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"
- }));
- /* harmony default export */ var library_home = (home);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const preventDefault = event => event.preventDefault();
- function HomeEdit(_ref) {
- var _style$color, _style$color2, _style$color3, _style$color4;
- let {
- attributes,
- setAttributes,
- context,
- clientId
- } = _ref;
- const {
- homeUrl
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getUnstableBase;
- const {
- getUnstableBase // Site index.
- } = select(external_wp_coreData_namespaceObject.store);
- return {
- homeUrl: (_getUnstableBase = getUnstableBase()) === null || _getUnstableBase === void 0 ? void 0 : _getUnstableBase.home
- };
- }, [clientId]);
- const {
- textColor,
- backgroundColor,
- style
- } = context;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()('wp-block-navigation-item', {
- 'has-text-color': !!textColor || !!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text),
- [`has-${textColor}-color`]: !!textColor,
- 'has-background': !!backgroundColor || !!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background),
- [`has-${backgroundColor}-background-color`]: !!backgroundColor
- }),
- style: {
- color: style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.text,
- backgroundColor: style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.background
- }
- });
- const {
- label
- } = attributes;
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (label === undefined) {
- setAttributes({
- label: (0,external_wp_i18n_namespaceObject.__)('Home')
- });
- }
- }, [clientId, label]);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
- className: "wp-block-home-link__content wp-block-navigation-item__content",
- href: homeUrl,
- onClick: preventDefault
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- identifier: "label",
- className: "wp-block-home-link__label",
- value: label,
- onChange: labelValue => {
- setAttributes({
- label: labelValue
- });
- },
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Home link text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add home link'),
- withoutInteractiveFormatting: true,
- allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough']
- }))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/save.js
- /**
- * WordPress dependencies
- */
- function home_link_save_save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const home_link_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/home-link",
- category: "design",
- parent: ["core/navigation"],
- title: "Home Link",
- description: "Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.",
- textdomain: "default",
- attributes: {
- label: {
- type: "string"
- }
- },
- usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "fontSize", "customFontSize", "style"],
- supports: {
- reusable: false,
- html: false
- },
- editorStyle: "wp-block-home-link-editor",
- style: "wp-block-home-link"
- };
- const {
- name: home_link_name
- } = home_link_metadata;
- const home_link_settings = {
- icon: library_home,
- edit: HomeEdit,
- save: home_link_save_save,
- example: {
- attributes: {
- label: (0,external_wp_i18n_namespaceObject._x)('Home Link', 'block example')
- }
- }
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/html.js
- /**
- * WordPress dependencies
- */
- const html = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z"
- }));
- /* harmony default export */ var library_html = (html);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/edit.js
- /**
- * WordPress dependencies
- */
- function HTMLEdit(_ref) {
- let {
- attributes,
- setAttributes,
- isSelected
- } = _ref;
- const [isPreview, setIsPreview] = (0,external_wp_element_namespaceObject.useState)();
- const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context);
- const styles = (0,external_wp_data_namespaceObject.useSelect)(select => {
- // Default styles used to unset some of the styles
- // that might be inherited from the editor style.
- const defaultStyles = `
- html,body,:root {
- margin: 0 !important;
- padding: 0 !important;
- overflow: visible !important;
- min-height: auto !important;
- }
- `;
- return [defaultStyles, ...(0,external_wp_blockEditor_namespaceObject.transformStyles)(select(external_wp_blockEditor_namespaceObject.store).getSettings().styles)];
- }, []);
- function switchToPreview() {
- setIsPreview(true);
- }
- function switchToHTML() {
- setIsPreview(false);
- }
- return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: 'block-library-html__edit'
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- className: "components-tab-button",
- isPressed: !isPreview,
- onClick: switchToHTML
- }, (0,external_wp_element_namespaceObject.createElement)("span", null, "HTML")), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- className: "components-tab-button",
- isPressed: isPreview,
- onClick: switchToPreview
- }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Preview'))))), isPreview || isDisabled ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, {
- html: attributes.content,
- styles: styles
- }), !isSelected && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "block-library-html__preview-overlay"
- })) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
- value: attributes.content,
- onChange: content => setAttributes({
- content
- }),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write HTML…'),
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('HTML')
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/save.js
- /**
- * WordPress dependencies
- */
- function html_save_save(_ref) {
- let {
- attributes
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/transforms.js
- /**
- * WordPress dependencies
- */
- const html_transforms_transforms = {
- from: [{
- type: 'block',
- blocks: ['core/code'],
- transform: _ref => {
- let {
- content
- } = _ref;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
- content
- });
- }
- }]
- };
- /* harmony default export */ var html_transforms = (html_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const html_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/html",
- title: "Custom HTML",
- category: "widgets",
- description: "Add custom HTML code and preview it as you edit.",
- keywords: ["embed"],
- textdomain: "default",
- attributes: {
- content: {
- type: "string",
- source: "html"
- }
- },
- supports: {
- customClassName: false,
- className: false,
- html: false
- },
- editorStyle: "wp-block-html-editor"
- };
- const {
- name: html_name
- } = html_metadata;
- const html_settings = {
- icon: library_html,
- example: {
- attributes: {
- content: '<marquee>' + (0,external_wp_i18n_namespaceObject.__)('Welcome to the wonderful world of blocks…') + '</marquee>'
- }
- },
- edit: HTMLEdit,
- save: html_save_save,
- transforms: html_transforms
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const image_deprecated_blockAttributes = {
- align: {
- type: 'string'
- },
- url: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'src'
- },
- alt: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'alt',
- default: ''
- },
- caption: {
- type: 'string',
- source: 'html',
- selector: 'figcaption'
- },
- href: {
- type: 'string',
- source: 'attribute',
- selector: 'figure > a',
- attribute: 'href'
- },
- rel: {
- type: 'string',
- source: 'attribute',
- selector: 'figure > a',
- attribute: 'rel'
- },
- linkClass: {
- type: 'string',
- source: 'attribute',
- selector: 'figure > a',
- attribute: 'class'
- },
- id: {
- type: 'number'
- },
- width: {
- type: 'number'
- },
- height: {
- type: 'number'
- },
- linkDestination: {
- type: 'string'
- },
- linkTarget: {
- type: 'string',
- source: 'attribute',
- selector: 'figure > a',
- attribute: 'target'
- }
- };
- const deprecated_blockSupports = {
- anchor: true,
- color: {
- __experimentalDuotone: 'img',
- text: false,
- background: false
- },
- __experimentalBorder: {
- radius: true,
- __experimentalDefaultControls: {
- radius: true
- }
- }
- };
- const image_deprecated_deprecated = [{
- attributes: { ...image_deprecated_blockAttributes,
- title: {
- type: 'string',
- source: 'attribute',
- selector: 'img',
- attribute: 'title'
- },
- sizeSlug: {
- type: 'string'
- }
- },
- supports: deprecated_blockSupports,
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- url,
- alt,
- caption,
- align,
- href,
- rel,
- linkClass,
- width,
- height,
- id,
- linkTarget,
- sizeSlug,
- title
- } = attributes;
- const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
- const classes = classnames_default()({
- [`align${align}`]: align,
- [`size-${sizeSlug}`]: sizeSlug,
- 'is-resized': width || height
- });
- const image = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: url,
- alt: alt,
- className: id ? `wp-image-${id}` : null,
- width: width,
- height: height,
- title: title
- });
- const figure = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- className: linkClass,
- href: href,
- target: linkTarget,
- rel: newRel
- }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- if ('left' === align || 'right' === align || 'center' === align) {
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: classes
- }, figure));
- }
- return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: classes
- }), figure);
- }
- }, {
- attributes: image_deprecated_blockAttributes,
- save(_ref2) {
- let {
- attributes
- } = _ref2;
- const {
- url,
- alt,
- caption,
- align,
- href,
- width,
- height,
- id
- } = attributes;
- const classes = classnames_default()({
- [`align${align}`]: align,
- 'is-resized': width || height
- });
- const image = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: url,
- alt: alt,
- className: id ? `wp-image-${id}` : null,
- width: width,
- height: height
- });
- return (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: classes
- }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- }
- }, {
- attributes: image_deprecated_blockAttributes,
- save(_ref3) {
- let {
- attributes
- } = _ref3;
- const {
- url,
- alt,
- caption,
- align,
- href,
- width,
- height,
- id
- } = attributes;
- const image = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: url,
- alt: alt,
- className: id ? `wp-image-${id}` : null,
- width: width,
- height: height
- });
- return (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: align ? `align${align}` : null
- }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- }
- }, {
- attributes: image_deprecated_blockAttributes,
- save(_ref4) {
- let {
- attributes
- } = _ref4;
- const {
- url,
- alt,
- caption,
- align,
- href,
- width,
- height
- } = attributes;
- const extraImageProps = width || height ? {
- width,
- height
- } : {};
- const image = (0,external_wp_element_namespaceObject.createElement)("img", _extends({
- src: url,
- alt: alt
- }, extraImageProps));
- let figureStyle = {};
- if (width) {
- figureStyle = {
- width
- };
- } else if (align === 'left' || align === 'right') {
- figureStyle = {
- maxWidth: '50%'
- };
- }
- return (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: align ? `align${align}` : null,
- style: figureStyle
- }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: href
- }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- }
- }];
- /* harmony default export */ var image_deprecated = (image_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/crop.js
- /**
- * WordPress dependencies
- */
- const crop = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"
- }));
- /* harmony default export */ var library_crop = (crop);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js
- /**
- * WordPress dependencies
- */
- const upload = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"
- }));
- /* harmony default export */ var library_upload = (upload);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/overlay-text.js
- /**
- * WordPress dependencies
- */
- const overlayText = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"
- }));
- /* harmony default export */ var overlay_text = (overlayText);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/use-client-width.js
- /**
- * WordPress dependencies
- */
- function useClientWidth(ref, dependencies) {
- const [clientWidth, setClientWidth] = (0,external_wp_element_namespaceObject.useState)();
- function calculateClientWidth() {
- setClientWidth(ref.current.clientWidth);
- }
- (0,external_wp_element_namespaceObject.useEffect)(calculateClientWidth, dependencies);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- const {
- defaultView
- } = ref.current.ownerDocument;
- defaultView.addEventListener('resize', calculateClientWidth);
- return () => {
- defaultView.removeEventListener('resize', calculateClientWidth);
- };
- }, []);
- return clientWidth;
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Module constants
- */
- function Image(_ref) {
- var _imageRef$current3;
- let {
- temporaryURL,
- attributes: {
- url = '',
- alt,
- caption,
- align,
- id,
- href,
- rel,
- linkClass,
- linkDestination,
- title,
- width,
- height,
- linkTarget,
- sizeSlug
- },
- setAttributes,
- isSelected,
- insertBlocksAfter,
- onReplace,
- onSelectImage,
- onSelectURL,
- onUploadError,
- containerRef,
- context,
- clientId
- } = _ref;
- const imageRef = (0,external_wp_element_namespaceObject.useRef)();
- const captionRef = (0,external_wp_element_namespaceObject.useRef)();
- const prevUrl = (0,external_wp_compose_namespaceObject.usePrevious)(url);
- const {
- allowResize = true
- } = context;
- const {
- getBlock
- } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
- const {
- image,
- multiImageSelection
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getMedia
- } = select(external_wp_coreData_namespaceObject.store);
- const {
- getMultiSelectedBlockClientIds,
- getBlockName
- } = select(external_wp_blockEditor_namespaceObject.store);
- const multiSelectedClientIds = getMultiSelectedBlockClientIds();
- return {
- image: id && isSelected ? getMedia(id, {
- context: 'view'
- }) : null,
- multiImageSelection: multiSelectedClientIds.length && multiSelectedClientIds.every(_clientId => getBlockName(_clientId) === 'core/image')
- };
- }, [id, isSelected]);
- const {
- canInsertCover,
- imageEditing,
- imageSizes,
- maxWidth,
- mediaUpload
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlockRootClientId,
- getSettings,
- canInsertBlockType
- } = select(external_wp_blockEditor_namespaceObject.store);
- const rootClientId = getBlockRootClientId(clientId);
- const settings = (0,external_lodash_namespaceObject.pick)(getSettings(), ['imageEditing', 'imageSizes', 'maxWidth', 'mediaUpload']);
- return { ...settings,
- canInsertCover: canInsertBlockType('core/cover', rootClientId)
- };
- }, [clientId]);
- const {
- replaceBlocks,
- toggleSelection
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const {
- createErrorNotice,
- createSuccessNotice
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
- const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
- const isWideAligned = (0,external_lodash_namespaceObject.includes)(['wide', 'full'], align);
- const [{
- loadedNaturalWidth,
- loadedNaturalHeight
- }, setLoadedNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
- const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
- const [externalBlob, setExternalBlob] = (0,external_wp_element_namespaceObject.useState)();
- const clientWidth = useClientWidth(containerRef, [align]);
- const isResizable = allowResize && !(isWideAligned && isLargeViewport);
- const imageSizeOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref2 => {
- let {
- slug
- } = _ref2;
- return (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', slug, 'source_url']);
- }), _ref3 => {
- let {
- name,
- slug
- } = _ref3;
- return {
- value: slug,
- label: name
- };
- }); // If an image is externally hosted, try to fetch the image data. This may
- // fail if the image host doesn't allow CORS with the domain. If it works,
- // we can enable a button in the toolbar to upload the image.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isExternalImage(id, url) || !isSelected || externalBlob) {
- return;
- }
- window.fetch(url).then(response => response.blob()).then(blob => setExternalBlob(blob)) // Do nothing, cannot upload.
- .catch(() => {});
- }, [id, url, isSelected, externalBlob]); // Focus the caption after inserting an image from the placeholder. This is
- // done to preserve the behaviour of focussing the first tabbable element
- // when a block is mounted. Previously, the image block would remount when
- // the placeholder is removed. Maybe this behaviour could be removed.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (url && !prevUrl && isSelected) {
- captionRef.current.focus();
- }
- }, [url, prevUrl]); // Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural
- // width and height. This resolves an issue in Safari where the loaded natural
- // witdth and height is otherwise lost when switching between alignments.
- // See: https://github.com/WordPress/gutenberg/pull/37210.
- const {
- naturalWidth,
- naturalHeight
- } = (0,external_wp_element_namespaceObject.useMemo)(() => {
- var _imageRef$current, _imageRef$current2;
- return {
- naturalWidth: ((_imageRef$current = imageRef.current) === null || _imageRef$current === void 0 ? void 0 : _imageRef$current.naturalWidth) || loadedNaturalWidth || undefined,
- naturalHeight: ((_imageRef$current2 = imageRef.current) === null || _imageRef$current2 === void 0 ? void 0 : _imageRef$current2.naturalHeight) || loadedNaturalHeight || undefined
- };
- }, [loadedNaturalWidth, loadedNaturalHeight, (_imageRef$current3 = imageRef.current) === null || _imageRef$current3 === void 0 ? void 0 : _imageRef$current3.complete]);
- function onResizeStart() {
- toggleSelection(false);
- }
- function onResizeStop() {
- toggleSelection(true);
- }
- function onImageError() {
- // Check if there's an embed block that handles this URL.
- const embedBlock = createUpgradedEmbedBlock({
- attributes: {
- url
- }
- });
- if (undefined !== embedBlock) {
- onReplace(embedBlock);
- }
- }
- function onSetHref(props) {
- setAttributes(props);
- }
- function onSetTitle(value) {
- // This is the HTML title attribute, separate from the media object
- // title.
- setAttributes({
- title: value
- });
- }
- function updateAlt(newAlt) {
- setAttributes({
- alt: newAlt
- });
- }
- function updateImage(newSizeSlug) {
- const newUrl = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', newSizeSlug, 'source_url']);
- if (!newUrl) {
- return null;
- }
- setAttributes({
- url: newUrl,
- width: undefined,
- height: undefined,
- sizeSlug: newSizeSlug
- });
- }
- function uploadExternal() {
- mediaUpload({
- filesList: [externalBlob],
- onFileChange(_ref4) {
- let [img] = _ref4;
- onSelectImage(img);
- if ((0,external_wp_blob_namespaceObject.isBlobURL)(img.url)) {
- return;
- }
- setExternalBlob();
- createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Image uploaded.'), {
- type: 'snackbar'
- });
- },
- allowedTypes: constants_ALLOWED_MEDIA_TYPES,
- onError(message) {
- createErrorNotice(message, {
- type: 'snackbar'
- });
- }
- });
- }
- function updateAlignment(nextAlign) {
- const extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? {
- width: undefined,
- height: undefined
- } : {};
- setAttributes({ ...extraUpdatedAttributes,
- align: nextAlign
- });
- }
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isSelected) {
- setIsEditingImage(false);
- }
- }, [isSelected]);
- const canEditImage = id && naturalWidth && naturalHeight && imageEditing;
- const allowCrop = !multiImageSelection && canEditImage && !isEditingImage;
- function switchToCover() {
- replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), 'core/cover'));
- }
- const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentControl, {
- value: align,
- onChange: updateAlignment
- }), !multiImageSelection && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, {
- url: href || '',
- onChangeUrl: onSetHref,
- linkDestination: linkDestination,
- mediaUrl: image && image.source_url || url,
- mediaLink: image && image.link,
- linkTarget: linkTarget,
- linkClass: linkClass,
- rel: rel
- }), allowCrop && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- onClick: () => setIsEditingImage(true),
- icon: library_crop,
- label: (0,external_wp_i18n_namespaceObject.__)('Crop')
- }), externalBlob && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- onClick: uploadExternal,
- icon: library_upload,
- label: (0,external_wp_i18n_namespaceObject.__)('Upload external image')
- }), !multiImageSelection && canInsertCover && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- icon: overlay_text,
- label: (0,external_wp_i18n_namespaceObject.__)('Add text over image'),
- onClick: switchToCover
- })), !multiImageSelection && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
- mediaId: id,
- mediaURL: url,
- allowedTypes: constants_ALLOWED_MEDIA_TYPES,
- accept: "image/*",
- onSelect: onSelectImage,
- onSelectURL: onSelectURL,
- onError: onUploadError
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Image settings')
- }, !multiImageSelection && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
- value: alt,
- onChange: updateAlt,
- help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
- href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
- }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
- onChangeImage: updateImage,
- onChange: value => setAttributes(value),
- slug: sizeSlug,
- width: width,
- height: height,
- imageSizeOptions: imageSizeOptions,
- isResizable: isResizable,
- imageWidth: naturalWidth,
- imageHeight: naturalHeight
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "advanced"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'),
- value: title || '',
- onChange: onSetTitle,
- help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Describe the role of this image on the page.'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
- href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute"
- }, (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)')))
- })));
- const filename = (0,external_wp_url_namespaceObject.getFilename)(url);
- let defaultedAlt;
- if (alt) {
- defaultedAlt = alt;
- } else if (filename) {
- defaultedAlt = (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: file name */
- (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute; its file name is %s'), filename);
- } else {
- defaultedAlt = (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute');
- }
- let img = // Disable reason: Image itself is not meant to be interactive, but
- // should direct focus to block.
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
- (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("img", {
- src: temporaryURL || url,
- alt: defaultedAlt,
- onError: () => onImageError(),
- onLoad: event => {
- var _event$target, _event$target2;
- setLoadedNaturalSize({
- loadedNaturalWidth: (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.naturalWidth,
- loadedNaturalHeight: (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.naturalHeight
- });
- },
- ref: imageRef
- }), temporaryURL && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))
- /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
- ;
- let imageWidthWithinContainer;
- let imageHeightWithinContainer;
- if (clientWidth && naturalWidth && naturalHeight) {
- const exceedMaxWidth = naturalWidth > clientWidth;
- const ratio = naturalHeight / naturalWidth;
- imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;
- imageHeightWithinContainer = exceedMaxWidth ? clientWidth * ratio : naturalHeight;
- }
- if (canEditImage && isEditingImage) {
- img = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
- url: url,
- width: width,
- height: height,
- clientWidth: clientWidth,
- naturalHeight: naturalHeight,
- naturalWidth: naturalWidth
- });
- } else if (!isResizable || !imageWidthWithinContainer) {
- img = (0,external_wp_element_namespaceObject.createElement)("div", {
- style: {
- width,
- height
- }
- }, img);
- } else {
- const currentWidth = width || imageWidthWithinContainer;
- const currentHeight = height || imageHeightWithinContainer;
- const ratio = naturalWidth / naturalHeight;
- const minWidth = naturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;
- const minHeight = naturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio; // With the current implementation of ResizableBox, an image needs an
- // explicit pixel value for the max-width. In absence of being able to
- // set the content-width, this max-width is currently dictated by the
- // vanilla editor style. The following variable adds a buffer to this
- // vanilla style, so 3rd party themes have some wiggleroom. This does,
- // in most cases, allow you to scale the image beyond the width of the
- // main column, though not infinitely.
- // @todo It would be good to revisit this once a content-width variable
- // becomes available.
- const maxWidthBuffer = maxWidth * 2.5;
- let showRightHandle = false;
- let showLeftHandle = false;
- /* eslint-disable no-lonely-if */
- // See https://github.com/WordPress/gutenberg/issues/7584.
- if (align === 'center') {
- // When the image is centered, show both handles.
- showRightHandle = true;
- showLeftHandle = true;
- } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
- // In RTL mode the image is on the right by default.
- // Show the right handle and hide the left handle only when it is
- // aligned left. Otherwise always show the left handle.
- if (align === 'left') {
- showRightHandle = true;
- } else {
- showLeftHandle = true;
- }
- } else {
- // Show the left handle and hide the right handle only when the
- // image is aligned right. Otherwise always show the right handle.
- if (align === 'right') {
- showLeftHandle = true;
- } else {
- showRightHandle = true;
- }
- }
- /* eslint-enable no-lonely-if */
- img = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
- size: {
- width: width !== null && width !== void 0 ? width : 'auto',
- height: height !== null && height !== void 0 ? height : 'auto'
- },
- showHandle: isSelected,
- minWidth: minWidth,
- maxWidth: maxWidthBuffer,
- minHeight: minHeight,
- maxHeight: maxWidthBuffer / ratio,
- lockAspectRatio: true,
- enable: {
- top: false,
- right: showRightHandle,
- bottom: true,
- left: showLeftHandle
- },
- onResizeStart: onResizeStart,
- onResizeStop: (event, direction, elt, delta) => {
- onResizeStop();
- setAttributes({
- width: parseInt(currentWidth + delta.width, 10),
- height: parseInt(currentHeight + delta.height, 10)
- });
- }
- }, img);
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditingProvider, {
- id: id,
- url: url,
- naturalWidth: naturalWidth,
- naturalHeight: naturalHeight,
- clientWidth: clientWidth,
- onSaveImage: imageAttributes => setAttributes(imageAttributes),
- isEditing: isEditingImage,
- onFinishEditing: () => setIsEditingImage(false)
- }, !temporaryURL && controls, img, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- ref: captionRef,
- tagName: "figcaption",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image caption text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
- value: caption,
- onChange: value => setAttributes({
- caption: value
- }),
- inlineToolbar: true,
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /* global wp */
- /**
- * Internal dependencies
- */
- /**
- * Module constants
- */
- const edit_pickRelevantMediaFiles = (image, size) => {
- const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
- imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', size, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size, 'source_url']) || image.url;
- return imageProps;
- };
- /**
- * Is the URL a temporary blob URL? A blob URL is one that is used temporarily
- * while the image is being uploaded and will not have an id yet allocated.
- *
- * @param {number=} id The id of the image.
- * @param {string=} url The url of the image.
- *
- * @return {boolean} Is the URL a Blob URL
- */
- const edit_isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
- /**
- * Is the url for the image hosted externally. An externally hosted image has no
- * id and is not a blob url.
- *
- * @param {number=} id The id of the image.
- * @param {string=} url The url of the image.
- *
- * @return {boolean} Is the url an externally hosted url?
- */
- const isExternalImage = (id, url) => url && !id && !(0,external_wp_blob_namespaceObject.isBlobURL)(url);
- /**
- * Checks if WP generated default image size. Size generation is skipped
- * when the image is smaller than the said size.
- *
- * @param {Object} image
- * @param {string} defaultSize
- *
- * @return {boolean} Whether or not it has default image size.
- */
- function hasDefaultSize(image, defaultSize) {
- return (0,external_lodash_namespaceObject.has)(image, ['sizes', defaultSize, 'url']) || (0,external_lodash_namespaceObject.has)(image, ['media_details', 'sizes', defaultSize, 'source_url']);
- }
- function ImageEdit(_ref) {
- let {
- attributes,
- setAttributes,
- isSelected,
- className,
- noticeUI,
- insertBlocksAfter,
- noticeOperations,
- onReplace,
- context,
- clientId
- } = _ref;
- const {
- url = '',
- alt,
- caption,
- align,
- id,
- width,
- height,
- sizeSlug
- } = attributes;
- const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)();
- const altRef = (0,external_wp_element_namespaceObject.useRef)();
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- altRef.current = alt;
- }, [alt]);
- const captionRef = (0,external_wp_element_namespaceObject.useRef)();
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- captionRef.current = caption;
- }, [caption]);
- const ref = (0,external_wp_element_namespaceObject.useRef)();
- const {
- imageDefaultSize,
- mediaUpload
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- return (0,external_lodash_namespaceObject.pick)(getSettings(), ['imageDefaultSize', 'mediaUpload']);
- }, []);
- function onUploadError(message) {
- noticeOperations.removeAllNotices();
- noticeOperations.createErrorNotice(message);
- setAttributes({
- src: undefined,
- id: undefined,
- url: undefined
- });
- setTemporaryURL(undefined);
- }
- function onSelectImage(media) {
- var _wp, _wp$media, _wp$media$view, _wp$media$view$settin, _wp$media$view$settin2;
- if (!media || !media.url) {
- setAttributes({
- url: undefined,
- alt: undefined,
- id: undefined,
- title: undefined,
- caption: undefined
- });
- return;
- }
- if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
- setTemporaryURL(media.url);
- return;
- }
- setTemporaryURL();
- let mediaAttributes = edit_pickRelevantMediaFiles(media, imageDefaultSize); // If a caption text was meanwhile written by the user,
- // make sure the text is not overwritten by empty captions.
- if (captionRef.current && !(0,external_lodash_namespaceObject.get)(mediaAttributes, ['caption'])) {
- mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['caption']);
- }
- let additionalAttributes; // Reset the dimension attributes if changing to a different image.
- if (!media.id || media.id !== id) {
- additionalAttributes = {
- width: undefined,
- height: undefined,
- // Fallback to size "full" if there's no default image size.
- // It means the image is smaller, and the block will use a full-size URL.
- sizeSlug: hasDefaultSize(media, imageDefaultSize) ? imageDefaultSize : 'full'
- };
- } else {
- // Keep the same url when selecting the same file, so "Image Size"
- // option is not changed.
- additionalAttributes = {
- url
- };
- } // Check if default link setting should be used.
- let linkDestination = attributes.linkDestination;
- if (!linkDestination) {
- // Use the WordPress option to determine the proper default.
- // The constants used in Gutenberg do not match WP options so a little more complicated than ideal.
- // TODO: fix this in a follow up PR, requires updating media-text and ui component.
- switch (((_wp = wp) === null || _wp === void 0 ? void 0 : (_wp$media = _wp.media) === null || _wp$media === void 0 ? void 0 : (_wp$media$view = _wp$media.view) === null || _wp$media$view === void 0 ? void 0 : (_wp$media$view$settin = _wp$media$view.settings) === null || _wp$media$view$settin === void 0 ? void 0 : (_wp$media$view$settin2 = _wp$media$view$settin.defaultProps) === null || _wp$media$view$settin2 === void 0 ? void 0 : _wp$media$view$settin2.link) || constants_LINK_DESTINATION_NONE) {
- case 'file':
- case constants_LINK_DESTINATION_MEDIA:
- linkDestination = constants_LINK_DESTINATION_MEDIA;
- break;
- case 'post':
- case constants_LINK_DESTINATION_ATTACHMENT:
- linkDestination = constants_LINK_DESTINATION_ATTACHMENT;
- break;
- case LINK_DESTINATION_CUSTOM:
- linkDestination = LINK_DESTINATION_CUSTOM;
- break;
- case constants_LINK_DESTINATION_NONE:
- linkDestination = constants_LINK_DESTINATION_NONE;
- break;
- }
- } // Check if the image is linked to it's media.
- let href;
- switch (linkDestination) {
- case constants_LINK_DESTINATION_MEDIA:
- href = media.url;
- break;
- case constants_LINK_DESTINATION_ATTACHMENT:
- href = media.link;
- break;
- }
- mediaAttributes.href = href;
- setAttributes({ ...mediaAttributes,
- ...additionalAttributes,
- linkDestination
- });
- }
- function onSelectURL(newURL) {
- if (newURL !== url) {
- setAttributes({
- url: newURL,
- id: undefined,
- width: undefined,
- height: undefined,
- sizeSlug: imageDefaultSize
- });
- }
- }
- function updateAlignment(nextAlign) {
- const extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? {
- width: undefined,
- height: undefined
- } : {};
- setAttributes({ ...extraUpdatedAttributes,
- align: nextAlign
- });
- }
- let isTemp = edit_isTemporaryImage(id, url); // Upload a temporary image on mount.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isTemp) {
- return;
- }
- const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(url);
- if (file) {
- mediaUpload({
- filesList: [file],
- onFileChange: _ref2 => {
- let [img] = _ref2;
- onSelectImage(img);
- },
- allowedTypes: constants_ALLOWED_MEDIA_TYPES,
- onError: message => {
- isTemp = false;
- onUploadError(message);
- }
- });
- }
- }, []); // If an image is temporary, revoke the Blob url when it is uploaded (and is
- // no longer temporary).
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (isTemp) {
- setTemporaryURL(url);
- return;
- }
- (0,external_wp_blob_namespaceObject.revokeBlobURL)(temporaryURL);
- }, [isTemp, url]);
- const isExternal = isExternalImage(id, url);
- const src = isExternal ? url : undefined;
- const mediaPreview = !!url && (0,external_wp_element_namespaceObject.createElement)("img", {
- alt: (0,external_wp_i18n_namespaceObject.__)('Edit image'),
- title: (0,external_wp_i18n_namespaceObject.__)('Edit image'),
- className: 'edit-image-preview',
- src: url
- });
- const classes = classnames_default()(className, {
- 'is-transient': temporaryURL,
- 'is-resized': !!width || !!height,
- [`size-${sizeSlug}`]: sizeSlug
- });
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- ref,
- className: classes
- });
- return (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (temporaryURL || url) && (0,external_wp_element_namespaceObject.createElement)(Image, {
- temporaryURL: temporaryURL,
- attributes: attributes,
- setAttributes: setAttributes,
- isSelected: isSelected,
- insertBlocksAfter: insertBlocksAfter,
- onReplace: onReplace,
- onSelectImage: onSelectImage,
- onSelectURL: onSelectURL,
- onUploadError: onUploadError,
- containerRef: ref,
- context: context,
- clientId: clientId
- }), !url && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentControl, {
- value: align,
- onChange: updateAlignment
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: library_image
- }),
- onSelect: onSelectImage,
- onSelectURL: onSelectURL,
- notices: noticeUI,
- onError: onUploadError,
- accept: "image/*",
- allowedTypes: constants_ALLOWED_MEDIA_TYPES,
- value: {
- id,
- src
- },
- mediaPreview: mediaPreview,
- disableMediaButtons: temporaryURL || url
- }));
- }
- /* harmony default export */ var image_edit = ((0,external_wp_components_namespaceObject.withNotices)(ImageEdit));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function image_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- url,
- alt,
- caption,
- align,
- href,
- rel,
- linkClass,
- width,
- height,
- id,
- linkTarget,
- sizeSlug,
- title
- } = attributes;
- const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
- const classes = classnames_default()({
- [`align${align}`]: align,
- [`size-${sizeSlug}`]: sizeSlug,
- 'is-resized': width || height
- });
- const image = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: url,
- alt: alt,
- className: id ? `wp-image-${id}` : null,
- width: width,
- height: height,
- title: title
- });
- const figure = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
- className: linkClass,
- href: href,
- target: linkTarget,
- rel: newRel
- }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: classes
- }), figure);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/transforms.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function stripFirstImage(attributes, _ref) {
- let {
- shortcode
- } = _ref;
- const {
- body
- } = document.implementation.createHTMLDocument('');
- body.innerHTML = shortcode.content;
- let nodeToRemove = body.querySelector('img'); // If an image has parents, find the topmost node to remove.
- while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) {
- nodeToRemove = nodeToRemove.parentNode;
- }
- if (nodeToRemove) {
- nodeToRemove.parentNode.removeChild(nodeToRemove);
- }
- return body.innerHTML.trim();
- }
- function getFirstAnchorAttributeFormHTML(html, attributeName) {
- const {
- body
- } = document.implementation.createHTMLDocument('');
- body.innerHTML = html;
- const {
- firstElementChild
- } = body;
- if (firstElementChild && firstElementChild.nodeName === 'A') {
- return firstElementChild.getAttribute(attributeName) || undefined;
- }
- }
- const imageSchema = {
- img: {
- attributes: ['src', 'alt', 'title'],
- classes: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\d+$/]
- }
- };
- const schema = _ref2 => {
- let {
- phrasingContentSchema
- } = _ref2;
- return {
- figure: {
- require: ['img'],
- children: { ...imageSchema,
- a: {
- attributes: ['href', 'rel', 'target'],
- children: imageSchema
- },
- figcaption: {
- children: phrasingContentSchema
- }
- }
- }
- };
- };
- const image_transforms_transforms = {
- from: [{
- type: 'raw',
- isMatch: node => node.nodeName === 'FIGURE' && !!node.querySelector('img'),
- schema,
- transform: node => {
- // Search both figure and image classes. Alignment could be
- // set on either. ID is set on the image.
- const className = node.className + ' ' + node.querySelector('img').className;
- const alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec(className);
- const anchor = node.id === '' ? undefined : node.id;
- const align = alignMatches ? alignMatches[1] : undefined;
- const idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(className);
- const id = idMatches ? Number(idMatches[1]) : undefined;
- const anchorElement = node.querySelector('a');
- const linkDestination = anchorElement && anchorElement.href ? 'custom' : undefined;
- const href = anchorElement && anchorElement.href ? anchorElement.href : undefined;
- const rel = anchorElement && anchorElement.rel ? anchorElement.rel : undefined;
- const linkClass = anchorElement && anchorElement.className ? anchorElement.className : undefined;
- const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/image', node.outerHTML, {
- align,
- id,
- linkDestination,
- href,
- rel,
- linkClass,
- anchor
- });
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', attributes);
- }
- }, {
- // Note: when dragging and dropping multiple files onto a gallery this overrides the
- // gallery transform in order to add new images to the gallery instead of
- // creating a new gallery.
- type: 'files',
- isMatch(files) {
- // The following check is intended to catch non-image files when dropped together with images.
- if (files.some(file => file.type.indexOf('image/') === 0) && files.some(file => file.type.indexOf('image/') !== 0)) {
- const {
- createErrorNotice
- } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store);
- createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), {
- id: 'gallery-transform-invalid-file'
- });
- }
- return (0,external_lodash_namespaceObject.every)(files, file => file.type.indexOf('image/') === 0);
- },
- transform(files) {
- const blocks = files.map(file => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
- });
- });
- return blocks;
- }
- }, {
- type: 'shortcode',
- tag: 'caption',
- attributes: {
- url: {
- type: 'string',
- source: 'attribute',
- attribute: 'src',
- selector: 'img'
- },
- alt: {
- type: 'string',
- source: 'attribute',
- attribute: 'alt',
- selector: 'img'
- },
- caption: {
- shortcode: stripFirstImage
- },
- href: {
- shortcode: (attributes, _ref3) => {
- let {
- shortcode
- } = _ref3;
- return getFirstAnchorAttributeFormHTML(shortcode.content, 'href');
- }
- },
- rel: {
- shortcode: (attributes, _ref4) => {
- let {
- shortcode
- } = _ref4;
- return getFirstAnchorAttributeFormHTML(shortcode.content, 'rel');
- }
- },
- linkClass: {
- shortcode: (attributes, _ref5) => {
- let {
- shortcode
- } = _ref5;
- return getFirstAnchorAttributeFormHTML(shortcode.content, 'class');
- }
- },
- id: {
- type: 'number',
- shortcode: _ref6 => {
- let {
- named: {
- id
- }
- } = _ref6;
- if (!id) {
- return;
- }
- return parseInt(id.replace('attachment_', ''), 10);
- }
- },
- align: {
- type: 'string',
- shortcode: _ref7 => {
- let {
- named: {
- align = 'alignnone'
- }
- } = _ref7;
- return align.replace('align', '');
- }
- }
- }
- }]
- };
- /* harmony default export */ var image_transforms = (image_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const image_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/image",
- title: "Image",
- category: "media",
- usesContext: ["allowResize", "imageCrop", "fixedHeight"],
- description: "Insert an image to make a visual statement.",
- keywords: ["img", "photo", "picture"],
- textdomain: "default",
- attributes: {
- align: {
- type: "string"
- },
- url: {
- type: "string",
- source: "attribute",
- selector: "img",
- attribute: "src"
- },
- alt: {
- type: "string",
- source: "attribute",
- selector: "img",
- attribute: "alt",
- "default": ""
- },
- caption: {
- type: "string",
- source: "html",
- selector: "figcaption"
- },
- title: {
- type: "string",
- source: "attribute",
- selector: "img",
- attribute: "title"
- },
- href: {
- type: "string",
- source: "attribute",
- selector: "figure > a",
- attribute: "href"
- },
- rel: {
- type: "string",
- source: "attribute",
- selector: "figure > a",
- attribute: "rel"
- },
- linkClass: {
- type: "string",
- source: "attribute",
- selector: "figure > a",
- attribute: "class"
- },
- id: {
- type: "number"
- },
- width: {
- type: "number"
- },
- height: {
- type: "number"
- },
- sizeSlug: {
- type: "string"
- },
- linkDestination: {
- type: "string"
- },
- linkTarget: {
- type: "string",
- source: "attribute",
- selector: "figure > a",
- attribute: "target"
- }
- },
- supports: {
- anchor: true,
- color: {
- __experimentalDuotone: "img",
- text: false,
- background: false
- },
- __experimentalBorder: {
- radius: true,
- __experimentalDefaultControls: {
- radius: true
- }
- }
- },
- styles: [{
- name: "default",
- label: "Default",
- isDefault: true
- }, {
- name: "rounded",
- label: "Rounded"
- }],
- editorStyle: "wp-block-image-editor",
- style: "wp-block-image"
- };
- const {
- name: image_name
- } = image_metadata;
- const image_settings = {
- icon: library_image,
- example: {
- attributes: {
- sizeSlug: 'large',
- url: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg',
- // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block.
- caption: (0,external_wp_i18n_namespaceObject.__)('Mont Blanc appears—still, snowy, and serene.')
- }
- },
- __experimentalLabel(attributes, _ref) {
- let {
- context
- } = _ref;
- if (context === 'accessibility') {
- const {
- caption,
- alt,
- url
- } = attributes;
- if (!url) {
- return (0,external_wp_i18n_namespaceObject.__)('Empty');
- }
- if (!alt) {
- return caption || '';
- } // This is intended to be read by a screen reader.
- // A period simply means a pause, no need to translate it.
- return alt + (caption ? '. ' + caption : '');
- }
- },
- getEditWrapperProps(attributes) {
- return {
- 'data-align': attributes.align
- };
- },
- transforms: image_transforms,
- edit: image_edit,
- save: image_save_save,
- deprecated: image_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment.js
- /**
- * WordPress dependencies
- */
- const comment = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"
- }));
- /* harmony default export */ var library_comment = (comment);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/edit.js
- /**
- * WordPress dependencies
- */
- /**
- * Minimum number of comments a user can show using this block.
- *
- * @type {number}
- */
- const MIN_COMMENTS = 1;
- /**
- * Maximum number of comments a user can show using this block.
- *
- * @type {number}
- */
- const MAX_COMMENTS = 100;
- function LatestComments(_ref) {
- let {
- attributes,
- setAttributes
- } = _ref;
- const {
- commentsToShow,
- displayAvatar,
- displayDate,
- displayExcerpt
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Latest comments settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display avatar'),
- checked: displayAvatar,
- onChange: () => setAttributes({
- displayAvatar: !displayAvatar
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
- checked: displayDate,
- onChange: () => setAttributes({
- displayDate: !displayDate
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
- checked: displayExcerpt,
- onChange: () => setAttributes({
- displayExcerpt: !displayExcerpt
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Number of comments'),
- value: commentsToShow,
- onChange: value => setAttributes({
- commentsToShow: value
- }),
- min: MIN_COMMENTS,
- max: MAX_COMMENTS,
- required: true
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
- block: "core/latest-comments",
- attributes: attributes // The preview uses the site's locale to make it more true to how
- // the block appears on the frontend. Setting the locale
- // explicitly prevents any middleware from setting it to 'user'.
- ,
- urlQueryArgs: {
- _locale: 'site'
- }
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const latest_comments_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/latest-comments",
- title: "Latest Comments",
- category: "widgets",
- description: "Display a list of your most recent comments.",
- keywords: ["recent comments"],
- textdomain: "default",
- attributes: {
- commentsToShow: {
- type: "number",
- "default": 5,
- minimum: 1,
- maximum: 100
- },
- displayAvatar: {
- type: "boolean",
- "default": true
- },
- displayDate: {
- type: "boolean",
- "default": true
- },
- displayExcerpt: {
- type: "boolean",
- "default": true
- }
- },
- supports: {
- align: true,
- html: false
- },
- editorStyle: "wp-block-latest-comments-editor",
- style: "wp-block-latest-comments"
- };
- const {
- name: latest_comments_name
- } = latest_comments_metadata;
- const latest_comments_settings = {
- icon: library_comment,
- example: {},
- edit: LatestComments
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-list.js
- /**
- * WordPress dependencies
- */
- const postList = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"
- }));
- /* harmony default export */ var post_list = (postList);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/deprecated.js
- /**
- * Internal dependencies
- */
- const latest_posts_deprecated_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/latest-posts",
- title: "Latest Posts",
- category: "widgets",
- description: "Display a list of your most recent posts.",
- keywords: ["recent posts"],
- textdomain: "default",
- attributes: {
- categories: {
- type: "array",
- items: {
- type: "object"
- }
- },
- selectedAuthor: {
- type: "number"
- },
- postsToShow: {
- type: "number",
- "default": 5
- },
- displayPostContent: {
- type: "boolean",
- "default": false
- },
- displayPostContentRadio: {
- type: "string",
- "default": "excerpt"
- },
- excerptLength: {
- type: "number",
- "default": 55
- },
- displayAuthor: {
- type: "boolean",
- "default": false
- },
- displayPostDate: {
- type: "boolean",
- "default": false
- },
- postLayout: {
- type: "string",
- "default": "list"
- },
- columns: {
- type: "number",
- "default": 3
- },
- order: {
- type: "string",
- "default": "desc"
- },
- orderBy: {
- type: "string",
- "default": "date"
- },
- displayFeaturedImage: {
- type: "boolean",
- "default": false
- },
- featuredImageAlign: {
- type: "string",
- "enum": ["left", "center", "right"]
- },
- featuredImageSizeSlug: {
- type: "string",
- "default": "thumbnail"
- },
- featuredImageSizeWidth: {
- type: "number",
- "default": null
- },
- featuredImageSizeHeight: {
- type: "number",
- "default": null
- },
- addLinkToFeaturedImage: {
- type: "boolean",
- "default": false
- }
- },
- supports: {
- align: true,
- html: false
- },
- editorStyle: "wp-block-latest-posts-editor",
- style: "wp-block-latest-posts"
- };
- const {
- attributes: deprecated_attributes
- } = latest_posts_deprecated_metadata;
- /* harmony default export */ var latest_posts_deprecated = ([{
- attributes: { ...deprecated_attributes,
- categories: {
- type: 'string'
- }
- },
- supports: {
- align: true,
- html: false
- },
- migrate: oldAttributes => {
- // This needs the full category object, not just the ID.
- return { ...oldAttributes,
- categories: [{
- id: Number(oldAttributes.categories)
- }]
- };
- },
- isEligible: _ref => {
- let {
- categories
- } = _ref;
- return categories && 'string' === typeof categories;
- },
- save: () => null
- }]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list.js
- /**
- * WordPress dependencies
- */
- const list = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var library_list = (list);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/grid.js
- /**
- * WordPress dependencies
- */
- const grid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",
- fillRule: "evenodd",
- clipRule: "evenodd"
- }));
- /* harmony default export */ var library_grid = (grid);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/constants.js
- const MIN_EXCERPT_LENGTH = 10;
- const MAX_EXCERPT_LENGTH = 100;
- const MAX_POSTS_COLUMNS = 6;
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Module Constants
- */
- const CATEGORIES_LIST_QUERY = {
- per_page: -1,
- context: 'view'
- };
- const USERS_LIST_QUERY = {
- per_page: -1,
- has_published_posts: ['post'],
- context: 'view'
- };
- function getFeaturedImageDetails(post, size) {
- var _image$media_details$, _image$media_details, _image$media_details$2, _image$media_details$3;
- const image = (0,external_lodash_namespaceObject.get)(post, ['_embedded', 'wp:featuredmedia', '0']);
- return {
- url: (_image$media_details$ = image === null || image === void 0 ? void 0 : (_image$media_details = image.media_details) === null || _image$media_details === void 0 ? void 0 : (_image$media_details$2 = _image$media_details.sizes) === null || _image$media_details$2 === void 0 ? void 0 : (_image$media_details$3 = _image$media_details$2[size]) === null || _image$media_details$3 === void 0 ? void 0 : _image$media_details$3.source_url) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : image === null || image === void 0 ? void 0 : image.source_url,
- alt: image === null || image === void 0 ? void 0 : image.alt_text
- };
- }
- function LatestPostsEdit(_ref) {
- var _categoriesList$reduc;
- let {
- attributes,
- setAttributes
- } = _ref;
- const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(LatestPostsEdit);
- const {
- postsToShow,
- order,
- orderBy,
- categories,
- selectedAuthor,
- displayFeaturedImage,
- displayPostContentRadio,
- displayPostContent,
- displayPostDate,
- displayAuthor,
- postLayout,
- columns,
- excerptLength,
- featuredImageAlign,
- featuredImageSizeSlug,
- featuredImageSizeWidth,
- featuredImageSizeHeight,
- addLinkToFeaturedImage
- } = attributes;
- const {
- imageSizes,
- latestPosts,
- defaultImageWidth,
- defaultImageHeight,
- categoriesList,
- authorList
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getEntityRecords,
- getUsers
- } = select(external_wp_coreData_namespaceObject.store);
- const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
- const catIds = categories && categories.length > 0 ? categories.map(cat => cat.id) : [];
- const latestPostsQuery = (0,external_lodash_namespaceObject.pickBy)({
- categories: catIds,
- author: selectedAuthor,
- order,
- orderby: orderBy,
- per_page: postsToShow,
- _embed: 'wp:featuredmedia'
- }, value => !(0,external_lodash_namespaceObject.isUndefined)(value));
- return {
- defaultImageWidth: (0,external_lodash_namespaceObject.get)(settings.imageDimensions, [featuredImageSizeSlug, 'width'], 0),
- defaultImageHeight: (0,external_lodash_namespaceObject.get)(settings.imageDimensions, [featuredImageSizeSlug, 'height'], 0),
- imageSizes: settings.imageSizes,
- latestPosts: getEntityRecords('postType', 'post', latestPostsQuery),
- categoriesList: getEntityRecords('taxonomy', 'category', CATEGORIES_LIST_QUERY),
- authorList: getUsers(USERS_LIST_QUERY)
- };
- }, [featuredImageSizeSlug, postsToShow, order, orderBy, categories, selectedAuthor]); // If a user clicks to a link prevent redirection and show a warning.
- const {
- createWarningNotice,
- removeNotice
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
- let noticeId;
- const showRedirectionPreventedNotice = event => {
- event.preventDefault(); // Remove previous warning if any, to show one at a time per block.
- removeNotice(noticeId);
- noticeId = `block-library/core/latest-posts/redirection-prevented/${instanceId}`;
- createWarningNotice((0,external_wp_i18n_namespaceObject.__)('Links are disabled in the editor.'), {
- id: noticeId,
- type: 'snackbar'
- });
- };
- const imageSizeOptions = imageSizes.filter(_ref2 => {
- let {
- slug
- } = _ref2;
- return slug !== 'full';
- }).map(_ref3 => {
- let {
- name,
- slug
- } = _ref3;
- return {
- value: slug,
- label: name
- };
- });
- const categorySuggestions = (_categoriesList$reduc = categoriesList === null || categoriesList === void 0 ? void 0 : categoriesList.reduce((accumulator, category) => ({ ...accumulator,
- [category.name]: category
- }), {})) !== null && _categoriesList$reduc !== void 0 ? _categoriesList$reduc : {};
- const selectCategories = tokens => {
- const hasNoSuggestion = tokens.some(token => typeof token === 'string' && !categorySuggestions[token]);
- if (hasNoSuggestion) {
- return;
- } // Categories that are already will be objects, while new additions will be strings (the name).
- // allCategories nomalizes the array so that they are all objects.
- const allCategories = tokens.map(token => {
- return typeof token === 'string' ? categorySuggestions[token] : token;
- }); // We do nothing if the category is not selected
- // from suggestions.
- if ((0,external_lodash_namespaceObject.includes)(allCategories, null)) {
- return false;
- }
- setAttributes({
- categories: allCategories
- });
- };
- const hasPosts = !!(latestPosts !== null && latestPosts !== void 0 && latestPosts.length);
- const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Post content settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Post content'),
- checked: displayPostContent,
- onChange: value => setAttributes({
- displayPostContent: value
- })
- }), displayPostContent && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RadioControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show:'),
- selected: displayPostContentRadio,
- options: [{
- label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'),
- value: 'excerpt'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Full post'),
- value: 'full_post'
- }],
- onChange: value => setAttributes({
- displayPostContentRadio: value
- })
- }), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
- value: excerptLength,
- onChange: value => setAttributes({
- excerptLength: value
- }),
- min: MIN_EXCERPT_LENGTH,
- max: MAX_EXCERPT_LENGTH
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Post meta settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display author name'),
- checked: displayAuthor,
- onChange: value => setAttributes({
- displayAuthor: value
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display post date'),
- checked: displayPostDate,
- onChange: value => setAttributes({
- displayPostDate: value
- })
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Featured image settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display featured image'),
- checked: displayFeaturedImage,
- onChange: value => setAttributes({
- displayFeaturedImage: value
- })
- }), displayFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
- onChange: value => {
- const newAttrs = {};
- if (value.hasOwnProperty('width')) {
- newAttrs.featuredImageSizeWidth = value.width;
- }
- if (value.hasOwnProperty('height')) {
- newAttrs.featuredImageSizeHeight = value.height;
- }
- setAttributes(newAttrs);
- },
- slug: featuredImageSizeSlug,
- width: featuredImageSizeWidth,
- height: featuredImageSizeHeight,
- imageWidth: defaultImageWidth,
- imageHeight: defaultImageHeight,
- imageSizeOptions: imageSizeOptions,
- onChangeImage: value => setAttributes({
- featuredImageSizeSlug: value,
- featuredImageSizeWidth: undefined,
- featuredImageSizeHeight: undefined
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
- className: "editor-latest-posts-image-alignment-control"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image alignment')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, {
- value: featuredImageAlign,
- onChange: value => setAttributes({
- featuredImageAlign: value
- }),
- controls: ['left', 'center', 'right'],
- isCollapsed: false
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Add link to featured image'),
- checked: addLinkToFeaturedImage,
- onChange: value => setAttributes({
- addLinkToFeaturedImage: value
- })
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Sorting and filtering')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.QueryControls, {
- order,
- orderBy,
- numberOfItems: postsToShow,
- onOrderChange: value => setAttributes({
- order: value
- }),
- onOrderByChange: value => setAttributes({
- orderBy: value
- }),
- onNumberOfItemsChange: value => setAttributes({
- postsToShow: value
- }),
- categorySuggestions: categorySuggestions,
- onCategoryChange: selectCategories,
- selectedCategories: categories,
- onAuthorChange: value => setAttributes({
- selectedAuthor: '' !== value ? Number(value) : undefined
- }),
- authorList: authorList !== null && authorList !== void 0 ? authorList : [],
- selectedAuthorId: selectedAuthor
- }), postLayout === 'grid' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
- value: columns,
- onChange: value => setAttributes({
- columns: value
- }),
- min: 2,
- max: !hasPosts ? MAX_POSTS_COLUMNS : Math.min(MAX_POSTS_COLUMNS, latestPosts.length),
- required: true
- })));
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- 'wp-block-latest-posts__list': true,
- 'is-grid': postLayout === 'grid',
- 'has-dates': displayPostDate,
- 'has-author': displayAuthor,
- [`columns-${columns}`]: postLayout === 'grid'
- })
- });
- if (!hasPosts) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- icon: library_pin,
- label: (0,external_wp_i18n_namespaceObject.__)('Latest Posts')
- }, !Array.isArray(latestPosts) ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No posts found.')));
- } // Removing posts from display should be instant.
- const displayPosts = latestPosts.length > postsToShow ? latestPosts.slice(0, postsToShow) : latestPosts;
- const layoutControls = [{
- icon: library_list,
- title: (0,external_wp_i18n_namespaceObject.__)('List view'),
- onClick: () => setAttributes({
- postLayout: 'list'
- }),
- isActive: postLayout === 'list'
- }, {
- icon: library_grid,
- title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
- onClick: () => setAttributes({
- postLayout: 'grid'
- }),
- isActive: postLayout === 'grid'
- }];
- const dateFormat = (0,external_wp_date_namespaceObject.__experimentalGetSettings)().formats.date;
- return (0,external_wp_element_namespaceObject.createElement)("div", null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
- controls: layoutControls
- })), (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, displayPosts.map((post, i) => {
- const titleTrimmed = (0,external_lodash_namespaceObject.invoke)(post, ['title', 'rendered', 'trim']);
- let excerpt = post.excerpt.rendered;
- const currentAuthor = authorList === null || authorList === void 0 ? void 0 : authorList.find(author => author.id === post.author);
- const excerptElement = document.createElement('div');
- excerptElement.innerHTML = excerpt;
- excerpt = excerptElement.textContent || excerptElement.innerText || '';
- const {
- url: imageSourceUrl,
- alt: featuredImageAlt
- } = getFeaturedImageDetails(post, featuredImageSizeSlug);
- const imageClasses = classnames_default()({
- 'wp-block-latest-posts__featured-image': true,
- [`align${featuredImageAlign}`]: !!featuredImageAlign
- });
- const renderFeaturedImage = displayFeaturedImage && imageSourceUrl;
- const featuredImage = renderFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("img", {
- src: imageSourceUrl,
- alt: featuredImageAlt,
- style: {
- maxWidth: featuredImageSizeWidth,
- maxHeight: featuredImageSizeHeight
- }
- });
- const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === '';
- const postExcerpt = needsReadMore ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0,external_wp_i18n_namespaceObject.__)(' … '), (0,external_wp_element_namespaceObject.createElement)("a", {
- href: post.link,
- rel: "noopener noreferrer",
- onClick: showRedirectionPreventedNotice
- }, (0,external_wp_i18n_namespaceObject.__)('Read more'))) : excerpt;
- return (0,external_wp_element_namespaceObject.createElement)("li", {
- key: i
- }, renderFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: imageClasses
- }, addLinkToFeaturedImage ? (0,external_wp_element_namespaceObject.createElement)("a", {
- className: "wp-block-latest-posts__post-title",
- href: post.link,
- rel: "noreferrer noopener",
- onClick: showRedirectionPreventedNotice
- }, featuredImage) : featuredImage), (0,external_wp_element_namespaceObject.createElement)("a", {
- href: post.link,
- rel: "noreferrer noopener",
- dangerouslySetInnerHTML: !!titleTrimmed ? {
- __html: titleTrimmed
- } : undefined,
- onClick: showRedirectionPreventedNotice
- }, !titleTrimmed ? (0,external_wp_i18n_namespaceObject.__)('(no title)') : null), displayAuthor && currentAuthor && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-latest-posts__post-author"
- }, (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: byline. %s: current author. */
- (0,external_wp_i18n_namespaceObject.__)('by %s'), currentAuthor.name)), displayPostDate && post.date_gmt && (0,external_wp_element_namespaceObject.createElement)("time", {
- dateTime: (0,external_wp_date_namespaceObject.format)('c', post.date_gmt),
- className: "wp-block-latest-posts__post-date"
- }, (0,external_wp_date_namespaceObject.dateI18n)(dateFormat, post.date_gmt)), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-latest-posts__post-excerpt"
- }, postExcerpt), displayPostContent && displayPostContentRadio === 'full_post' && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-latest-posts__post-full-content",
- dangerouslySetInnerHTML: {
- __html: post.content.raw.trim()
- }
- }));
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const latest_posts_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/latest-posts",
- title: "Latest Posts",
- category: "widgets",
- description: "Display a list of your most recent posts.",
- keywords: ["recent posts"],
- textdomain: "default",
- attributes: {
- categories: {
- type: "array",
- items: {
- type: "object"
- }
- },
- selectedAuthor: {
- type: "number"
- },
- postsToShow: {
- type: "number",
- "default": 5
- },
- displayPostContent: {
- type: "boolean",
- "default": false
- },
- displayPostContentRadio: {
- type: "string",
- "default": "excerpt"
- },
- excerptLength: {
- type: "number",
- "default": 55
- },
- displayAuthor: {
- type: "boolean",
- "default": false
- },
- displayPostDate: {
- type: "boolean",
- "default": false
- },
- postLayout: {
- type: "string",
- "default": "list"
- },
- columns: {
- type: "number",
- "default": 3
- },
- order: {
- type: "string",
- "default": "desc"
- },
- orderBy: {
- type: "string",
- "default": "date"
- },
- displayFeaturedImage: {
- type: "boolean",
- "default": false
- },
- featuredImageAlign: {
- type: "string",
- "enum": ["left", "center", "right"]
- },
- featuredImageSizeSlug: {
- type: "string",
- "default": "thumbnail"
- },
- featuredImageSizeWidth: {
- type: "number",
- "default": null
- },
- featuredImageSizeHeight: {
- type: "number",
- "default": null
- },
- addLinkToFeaturedImage: {
- type: "boolean",
- "default": false
- }
- },
- supports: {
- align: true,
- html: false
- },
- editorStyle: "wp-block-latest-posts-editor",
- style: "wp-block-latest-posts"
- };
- const {
- name: latest_posts_name
- } = latest_posts_metadata;
- const latest_posts_settings = {
- icon: post_list,
- example: {},
- edit: LatestPostsEdit,
- deprecated: latest_posts_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/deprecated.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const v0 = {
- attributes: {
- ordered: {
- type: 'boolean',
- default: false,
- __experimentalRole: 'content'
- },
- values: {
- type: 'string',
- source: 'html',
- selector: 'ol,ul',
- multiline: 'li',
- __unstableMultilineWrapperTags: ['ol', 'ul'],
- default: '',
- __experimentalRole: 'content'
- },
- type: {
- type: 'string'
- },
- start: {
- type: 'number'
- },
- reversed: {
- type: 'boolean'
- },
- placeholder: {
- type: 'string'
- }
- },
- supports: {
- anchor: true,
- className: false,
- typography: {
- fontSize: true,
- __experimentalFontFamily: true
- },
- color: {
- gradients: true,
- link: true
- },
- __unstablePasteTextInline: true,
- __experimentalSelector: 'ol,ul',
- __experimentalSlashInserter: true
- },
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- ordered,
- values,
- type,
- reversed,
- start
- } = attributes;
- const TagName = ordered ? 'ol' : 'ul';
- return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
- type,
- reversed,
- start
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: values,
- multiline: "li"
- }));
- },
- migrate: migrate_font_family,
- isEligible(_ref2) {
- var _style$typography;
- let {
- style
- } = _ref2;
- return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
- }
- };
- /**
- * New deprecations need to be placed first
- * for them to have higher priority.
- *
- * Old deprecations may need to be updated as well.
- *
- * See block-deprecation.md
- */
- /* harmony default export */ var list_deprecated = ([v0]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js
- /**
- * WordPress dependencies
- */
- const formatListBulletsRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"
- }));
- /* harmony default export */ var format_list_bullets_rtl = (formatListBulletsRTL);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
- /**
- * WordPress dependencies
- */
- const formatListBullets = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
- }));
- /* harmony default export */ var format_list_bullets = (formatListBullets);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered-rtl.js
- /**
- * WordPress dependencies
- */
- const formatListNumberedRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"
- }));
- /* harmony default export */ var format_list_numbered_rtl = (formatListNumberedRTL);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered.js
- /**
- * WordPress dependencies
- */
- const formatListNumbered = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"
- }));
- /* harmony default export */ var format_list_numbered = (formatListNumbered);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent-rtl.js
- /**
- * WordPress dependencies
- */
- const formatOutdentRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"
- }));
- /* harmony default export */ var format_outdent_rtl = (formatOutdentRTL);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent.js
- /**
- * WordPress dependencies
- */
- const formatOutdent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"
- }));
- /* harmony default export */ var format_outdent = (formatOutdent);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent-rtl.js
- /**
- * WordPress dependencies
- */
- const formatIndentRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"
- }));
- /* harmony default export */ var format_indent_rtl = (formatIndentRTL);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent.js
- /**
- * WordPress dependencies
- */
- const formatIndent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"
- }));
- /* harmony default export */ var format_indent = (formatIndent);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/ordered-list-settings.js
- /**
- * WordPress dependencies
- */
- const OrderedListSettings = _ref => {
- let {
- setAttributes,
- reversed,
- start
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Ordered list settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Start value'),
- type: "number",
- onChange: value => {
- const int = parseInt(value, 10);
- setAttributes({
- // It should be possible to unset the value,
- // e.g. with an empty string.
- start: isNaN(int) ? undefined : int
- });
- },
- value: Number.isInteger(start) ? start.toString(10) : '',
- step: "1"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Reverse list numbering'),
- checked: reversed || false,
- onChange: value => {
- setAttributes({
- // Unset the attribute if not reversed.
- reversed: value || undefined
- });
- }
- })));
- };
- /* harmony default export */ var ordered_list_settings = (OrderedListSettings);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/edit.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function ListEdit(_ref) {
- let {
- attributes,
- setAttributes,
- mergeBlocks,
- onReplace,
- style
- } = _ref;
- const {
- ordered,
- values,
- type,
- reversed,
- start,
- placeholder
- } = attributes;
- const tagName = ordered ? 'ol' : 'ul';
- const controls = _ref2 => {
- let {
- value,
- onChange,
- onFocus
- } = _ref2;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "primary",
- character: "[",
- onUse: () => {
- onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "primary",
- character: "]",
- onUse: () => {
- onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
- type: tagName
- }));
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "primary",
- character: "m",
- onUse: () => {
- onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
- type: tagName
- }));
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "primaryShift",
- character: "m",
- onUse: () => {
- onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets,
- title: (0,external_wp_i18n_namespaceObject.__)('Unordered'),
- describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to unordered list'),
- isActive: (0,external_wp_richText_namespaceObject.__unstableIsActiveListType)(value, 'ul', tagName),
- onClick: () => {
- onChange((0,external_wp_richText_namespaceObject.__unstableChangeListType)(value, {
- type: 'ul'
- }));
- onFocus();
- if ((0,external_wp_richText_namespaceObject.__unstableIsListRootSelected)(value)) {
- setAttributes({
- ordered: false
- });
- }
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_numbered_rtl : format_list_numbered,
- title: (0,external_wp_i18n_namespaceObject.__)('Ordered'),
- describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to ordered list'),
- isActive: (0,external_wp_richText_namespaceObject.__unstableIsActiveListType)(value, 'ol', tagName),
- onClick: () => {
- onChange((0,external_wp_richText_namespaceObject.__unstableChangeListType)(value, {
- type: 'ol'
- }));
- onFocus();
- if ((0,external_wp_richText_namespaceObject.__unstableIsListRootSelected)(value)) {
- setAttributes({
- ordered: true
- });
- }
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent,
- title: (0,external_wp_i18n_namespaceObject.__)('Outdent'),
- describedBy: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'),
- shortcut: (0,external_wp_i18n_namespaceObject._x)('Backspace', 'keyboard key'),
- isDisabled: !(0,external_wp_richText_namespaceObject.__unstableCanOutdentListItems)(value),
- onClick: () => {
- onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
- onFocus();
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_indent_rtl : format_indent,
- title: (0,external_wp_i18n_namespaceObject.__)('Indent'),
- describedBy: (0,external_wp_i18n_namespaceObject.__)('Indent list item'),
- shortcut: (0,external_wp_i18n_namespaceObject._x)('Space', 'keyboard key'),
- isDisabled: !(0,external_wp_richText_namespaceObject.__unstableCanIndentListItems)(value),
- onClick: () => {
- onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
- type: tagName
- }));
- onFocus();
- }
- })));
- };
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- style
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
- identifier: "values",
- multiline: "li",
- tagName: tagName,
- onChange: nextValues => setAttributes({
- values: nextValues
- }),
- value: values,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('List text'),
- placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('List'),
- onMerge: mergeBlocks,
- onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)(list_name, { ...attributes,
- values: value
- }),
- __unstableOnSplitMiddle: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'),
- onReplace: onReplace,
- onRemove: () => onReplace([]),
- start: start,
- reversed: reversed,
- type: type
- }, blockProps), controls), ordered && (0,external_wp_element_namespaceObject.createElement)(ordered_list_settings, {
- setAttributes: setAttributes,
- ordered: ordered,
- reversed: reversed,
- start: start,
- placeholder: placeholder
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/save.js
- /**
- * WordPress dependencies
- */
- function list_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- ordered,
- values,
- type,
- reversed,
- start
- } = attributes;
- const TagName = ordered ? 'ol' : 'ul';
- return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
- type,
- reversed,
- start
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: values,
- multiline: "li"
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/transforms.js
- /**
- * WordPress dependencies
- */
- function getListContentSchema(_ref) {
- let {
- phrasingContentSchema
- } = _ref;
- const listContentSchema = { ...phrasingContentSchema,
- ul: {},
- ol: {
- attributes: ['type', 'start', 'reversed']
- }
- }; // Recursion is needed.
- // Possible: ul > li > ul.
- // Impossible: ul > ul.
- ['ul', 'ol'].forEach(tag => {
- listContentSchema[tag].children = {
- li: {
- children: listContentSchema
- }
- };
- });
- return listContentSchema;
- }
- const list_transforms_transforms = {
- from: [{
- type: 'block',
- isMultiBlock: true,
- blocks: ['core/paragraph', 'core/heading'],
- transform: blockAttributes => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
- values: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: (0,external_wp_richText_namespaceObject.join)(blockAttributes.map(_ref2 => {
- let {
- content
- } = _ref2;
- const value = (0,external_wp_richText_namespaceObject.create)({
- html: content
- });
- if (blockAttributes.length > 1) {
- return value;
- } // When converting only one block, transform
- // every line to a list item.
- return (0,external_wp_richText_namespaceObject.replace)(value, /\n/g, external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR);
- }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR),
- multilineTag: 'li'
- }),
- anchor: blockAttributes.anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/quote', 'core/pullquote'],
- transform: _ref3 => {
- let {
- value,
- anchor
- } = _ref3;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
- values: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: (0,external_wp_richText_namespaceObject.create)({
- html: value,
- multilineTag: 'p'
- }),
- multilineTag: 'li'
- }),
- anchor
- });
- }
- }, {
- type: 'raw',
- selector: 'ol,ul',
- schema: args => ({
- ol: getListContentSchema(args).ol,
- ul: getListContentSchema(args).ul
- }),
- transform(node) {
- const attributes = {
- ordered: node.nodeName === 'OL',
- anchor: node.id === '' ? undefined : node.id
- };
- if (attributes.ordered) {
- const type = node.getAttribute('type');
- if (type) {
- attributes.type = type;
- }
- if (node.getAttribute('reversed') !== null) {
- attributes.reversed = true;
- }
- const start = parseInt(node.getAttribute('start'), 10);
- if (!isNaN(start) && ( // start=1 only makes sense if the list is reversed.
- start !== 1 || attributes.reversed)) {
- attributes.start = start;
- }
- }
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { ...(0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/list', node.outerHTML),
- ...attributes
- });
- }
- }, ...['*', '-'].map(prefix => ({
- type: 'prefix',
- prefix,
- transform(content) {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
- values: `<li>${content}</li>`
- });
- }
- })), ...['1.', '1)'].map(prefix => ({
- type: 'prefix',
- prefix,
- transform(content) {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
- ordered: true,
- values: `<li>${content}</li>`
- });
- }
- }))],
- to: [{
- type: 'block',
- blocks: ['core/paragraph'],
- transform: _ref4 => {
- let {
- values
- } = _ref4;
- return (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
- html: values,
- multilineTag: 'li',
- multilineWrapperTags: ['ul', 'ol']
- }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR).map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: piece
- })
- }));
- }
- }, {
- type: 'block',
- blocks: ['core/heading'],
- transform: _ref5 => {
- let {
- values
- } = _ref5;
- return (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
- html: values,
- multilineTag: 'li',
- multilineWrapperTags: ['ul', 'ol']
- }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR).map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
- content: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: piece
- })
- }));
- }
- }, {
- type: 'block',
- blocks: ['core/quote'],
- transform: _ref6 => {
- let {
- values,
- anchor
- } = _ref6;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
- value: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: (0,external_wp_richText_namespaceObject.create)({
- html: values,
- multilineTag: 'li',
- multilineWrapperTags: ['ul', 'ol']
- }),
- multilineTag: 'p'
- }),
- anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/pullquote'],
- transform: _ref7 => {
- let {
- values,
- anchor
- } = _ref7;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
- value: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: (0,external_wp_richText_namespaceObject.create)({
- html: values,
- multilineTag: 'li',
- multilineWrapperTags: ['ul', 'ol']
- }),
- multilineTag: 'p'
- }),
- anchor
- });
- }
- }]
- };
- /* harmony default export */ var list_transforms = (list_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const list_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/list",
- title: "List",
- category: "text",
- description: "Create a bulleted or numbered list.",
- keywords: ["bullet list", "ordered list", "numbered list"],
- textdomain: "default",
- attributes: {
- ordered: {
- type: "boolean",
- "default": false,
- __experimentalRole: "content"
- },
- values: {
- type: "string",
- source: "html",
- selector: "ol,ul",
- multiline: "li",
- __unstableMultilineWrapperTags: ["ol", "ul"],
- "default": "",
- __experimentalRole: "content"
- },
- type: {
- type: "string"
- },
- start: {
- type: "number"
- },
- reversed: {
- type: "boolean"
- },
- placeholder: {
- type: "string"
- }
- },
- supports: {
- anchor: true,
- className: false,
- typography: {
- fontSize: true,
- __experimentalFontFamily: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- __unstablePasteTextInline: true,
- __experimentalSelector: "ol,ul",
- __experimentalSlashInserter: true
- },
- editorStyle: "wp-block-list-editor",
- style: "wp-block-list"
- };
- const {
- name: list_name
- } = list_metadata;
- const settingsV1 = {
- icon: library_list,
- example: {
- attributes: {
- values: '<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>'
- }
- },
- transforms: list_transforms,
- merge(attributes, attributesToMerge) {
- const {
- values
- } = attributesToMerge;
- if (!values || values === '<li></li>') {
- return attributes;
- }
- return { ...attributes,
- values: attributes.values + values
- };
- },
- edit: ListEdit,
- save: list_save_save,
- deprecated: list_deprecated
- };
- let list_settings = settingsV1;
- if (false) { var _window; }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/login.js
- /**
- * WordPress dependencies
- */
- const login = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"
- }));
- /* harmony default export */ var library_login = (login);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/edit.js
- /**
- * WordPress dependencies
- */
- function LoginOutEdit(_ref) {
- let {
- attributes,
- setAttributes
- } = _ref;
- const {
- displayLoginAsForm,
- redirectToCurrent
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Login/out settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display login as form'),
- checked: displayLoginAsForm,
- onChange: () => setAttributes({
- displayLoginAsForm: !displayLoginAsForm
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Redirect to current URL'),
- checked: redirectToCurrent,
- onChange: () => setAttributes({
- redirectToCurrent: !redirectToCurrent
- })
- }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: 'logged-in'
- }), (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#login-pseudo-link"
- }, (0,external_wp_i18n_namespaceObject.__)('Log out'))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const loginout_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/loginout",
- title: "Login/out",
- category: "theme",
- description: "Show login & logout links.",
- keywords: ["login", "logout", "form"],
- textdomain: "default",
- attributes: {
- displayLoginAsForm: {
- type: "boolean",
- "default": false
- },
- redirectToCurrent: {
- type: "boolean",
- "default": true
- }
- },
- supports: {
- className: true,
- typography: {
- fontSize: false
- }
- }
- };
- const {
- name: loginout_name
- } = loginout_metadata;
- const loginout_settings = {
- icon: library_login,
- edit: LoginOutEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media-and-text.js
- /**
- * WordPress dependencies
- */
- const mediaAndText = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M3 18h8V6H3v12zM14 7.5V9h7V7.5h-7zm0 5.3h7v-1.5h-7v1.5zm0 3.7h7V15h-7v1.5z"
- }));
- /* harmony default export */ var media_and_text = (mediaAndText);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container-icon.js
- /**
- * WordPress dependencies
- */
- /* harmony default export */ var media_container_icon = ((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"
- })));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Constants
- */
- const media_container_ALLOWED_MEDIA_TYPES = ['image', 'video'];
- function imageFillStyles(url, focalPoint) {
- return url ? {
- backgroundImage: `url(${url})`,
- backgroundPosition: focalPoint ? `${focalPoint.x * 100}% ${focalPoint.y * 100}%` : `50% 50%`
- } : {};
- }
- const ResizableBoxContainer = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => {
- let {
- isSelected,
- isStackedOnMobile,
- ...props
- } = _ref;
- const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<');
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
- ref: ref,
- showHandle: isSelected && (!isMobile || !isStackedOnMobile)
- }, props));
- });
- function ToolbarEditButton(_ref2) {
- let {
- mediaId,
- mediaUrl,
- onSelectMedia
- } = _ref2;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
- mediaId: mediaId,
- mediaURL: mediaUrl,
- allowedTypes: media_container_ALLOWED_MEDIA_TYPES,
- accept: "image/*,video/*",
- onSelect: onSelectMedia
- }));
- }
- function PlaceholderContainer(_ref3) {
- let {
- className,
- noticeOperations,
- noticeUI,
- mediaUrl,
- onSelectMedia
- } = _ref3;
- const onUploadError = message => {
- noticeOperations.removeAllNotices();
- noticeOperations.createErrorNotice(message);
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: media_container_icon
- }),
- labels: {
- title: (0,external_wp_i18n_namespaceObject.__)('Media area')
- },
- className: className,
- onSelect: onSelectMedia,
- accept: "image/*,video/*",
- allowedTypes: media_container_ALLOWED_MEDIA_TYPES,
- notices: noticeUI,
- onError: onUploadError,
- disableMediaButtons: mediaUrl
- });
- }
- function MediaContainer(props, ref) {
- const {
- className,
- commitWidthChange,
- focalPoint,
- imageFill,
- isSelected,
- isStackedOnMobile,
- mediaAlt,
- mediaId,
- mediaPosition,
- mediaType,
- mediaUrl,
- mediaWidth,
- onSelectMedia,
- onWidthChange
- } = props;
- const isTemporaryMedia = !mediaId && (0,external_wp_blob_namespaceObject.isBlobURL)(mediaUrl);
- const {
- toggleSelection
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- if (mediaUrl) {
- const onResizeStart = () => {
- toggleSelection(false);
- };
- const onResize = (event, direction, elt) => {
- onWidthChange(parseInt(elt.style.width));
- };
- const onResizeStop = (event, direction, elt) => {
- toggleSelection(true);
- commitWidthChange(parseInt(elt.style.width));
- };
- const enablePositions = {
- right: mediaPosition === 'left',
- left: mediaPosition === 'right'
- };
- const backgroundStyles = mediaType === 'image' && imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
- const mediaTypeRenderers = {
- image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
- src: mediaUrl,
- alt: mediaAlt
- }),
- video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
- controls: true,
- src: mediaUrl
- })
- };
- return (0,external_wp_element_namespaceObject.createElement)(ResizableBoxContainer, {
- as: "figure",
- className: classnames_default()(className, 'editor-media-container__resizer', {
- 'is-transient': isTemporaryMedia
- }),
- style: backgroundStyles,
- size: {
- width: mediaWidth + '%'
- },
- minWidth: "10%",
- maxWidth: "100%",
- enable: enablePositions,
- onResizeStart: onResizeStart,
- onResize: onResize,
- onResizeStop: onResizeStop,
- axis: "x",
- isSelected: isSelected,
- isStackedOnMobile: isStackedOnMobile,
- ref: ref
- }, (0,external_wp_element_namespaceObject.createElement)(ToolbarEditButton, {
- onSelectMedia: onSelectMedia,
- mediaUrl: mediaUrl,
- mediaId: mediaId
- }), (mediaTypeRenderers[mediaType] || external_lodash_namespaceObject.noop)(), isTemporaryMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(PlaceholderContainer, props));
- }
- return (0,external_wp_element_namespaceObject.createElement)(PlaceholderContainer, props);
- }
- /* harmony default export */ var media_container = ((0,external_wp_components_namespaceObject.withNotices)((0,external_wp_element_namespaceObject.forwardRef)(MediaContainer)));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const DEFAULT_MEDIA_WIDTH = 50;
- const media_text_deprecated_migrateCustomColors = attributes => {
- if (!attributes.customBackgroundColor) {
- return attributes;
- }
- const style = {
- color: {
- background: attributes.customBackgroundColor
- }
- };
- return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customBackgroundColor']),
- style
- };
- };
- const baseAttributes = {
- align: {
- type: 'string',
- default: 'wide'
- },
- backgroundColor: {
- type: 'string'
- },
- mediaAlt: {
- type: 'string',
- source: 'attribute',
- selector: 'figure img',
- attribute: 'alt',
- default: ''
- },
- mediaPosition: {
- type: 'string',
- default: 'left'
- },
- mediaId: {
- type: 'number'
- },
- mediaType: {
- type: 'string'
- },
- mediaWidth: {
- type: 'number',
- default: 50
- },
- isStackedOnMobile: {
- type: 'boolean',
- default: true
- }
- };
- /* harmony default export */ var media_text_deprecated = ([{
- attributes: { ...baseAttributes,
- customBackgroundColor: {
- type: 'string'
- },
- mediaLink: {
- type: 'string'
- },
- linkDestination: {
- type: 'string'
- },
- linkTarget: {
- type: 'string',
- source: 'attribute',
- selector: 'figure a',
- attribute: 'target'
- },
- href: {
- type: 'string',
- source: 'attribute',
- selector: 'figure a',
- attribute: 'href'
- },
- rel: {
- type: 'string',
- source: 'attribute',
- selector: 'figure a',
- attribute: 'rel'
- },
- linkClass: {
- type: 'string',
- source: 'attribute',
- selector: 'figure a',
- attribute: 'class'
- },
- verticalAlignment: {
- type: 'string'
- },
- imageFill: {
- type: 'boolean'
- },
- focalPoint: {
- type: 'object'
- }
- },
- migrate: media_text_deprecated_migrateCustomColors,
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- backgroundColor,
- customBackgroundColor,
- isStackedOnMobile,
- mediaAlt,
- mediaPosition,
- mediaType,
- mediaUrl,
- mediaWidth,
- mediaId,
- verticalAlignment,
- imageFill,
- focalPoint,
- linkClass,
- href,
- linkTarget,
- rel
- } = attributes;
- const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
- let image = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: mediaUrl,
- alt: mediaAlt,
- className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null
- });
- if (href) {
- image = (0,external_wp_element_namespaceObject.createElement)("a", {
- className: linkClass,
- href: href,
- target: linkTarget,
- rel: newRel
- }, image);
- }
- const mediaTypeRenders = {
- image: () => image,
- video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
- controls: true,
- src: mediaUrl
- })
- };
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const className = classnames_default()({
- 'has-media-on-the-right': 'right' === mediaPosition,
- 'has-background': backgroundClass || customBackgroundColor,
- [backgroundClass]: backgroundClass,
- 'is-stacked-on-mobile': isStackedOnMobile,
- [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
- 'is-image-fill': imageFill
- });
- const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
- let gridTemplateColumns;
- if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
- gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
- }
- const style = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- gridTemplateColumns
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: className,
- style: style
- }, (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: "wp-block-media-text__media",
- style: backgroundStyles
- }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-media-text__content"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
- }
- }, {
- attributes: { ...baseAttributes,
- customBackgroundColor: {
- type: 'string'
- },
- mediaUrl: {
- type: 'string',
- source: 'attribute',
- selector: 'figure video,figure img',
- attribute: 'src'
- },
- verticalAlignment: {
- type: 'string'
- },
- imageFill: {
- type: 'boolean'
- },
- focalPoint: {
- type: 'object'
- }
- },
- migrate: media_text_deprecated_migrateCustomColors,
- save(_ref2) {
- let {
- attributes
- } = _ref2;
- const {
- backgroundColor,
- customBackgroundColor,
- isStackedOnMobile,
- mediaAlt,
- mediaPosition,
- mediaType,
- mediaUrl,
- mediaWidth,
- mediaId,
- verticalAlignment,
- imageFill,
- focalPoint
- } = attributes;
- const mediaTypeRenders = {
- image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
- src: mediaUrl,
- alt: mediaAlt,
- className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null
- }),
- video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
- controls: true,
- src: mediaUrl
- })
- };
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const className = classnames_default()({
- 'has-media-on-the-right': 'right' === mediaPosition,
- [backgroundClass]: backgroundClass,
- 'is-stacked-on-mobile': isStackedOnMobile,
- [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
- 'is-image-fill': imageFill
- });
- const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
- let gridTemplateColumns;
- if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
- gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
- }
- const style = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- gridTemplateColumns
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: className,
- style: style
- }, (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: "wp-block-media-text__media",
- style: backgroundStyles
- }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-media-text__content"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
- }
- }, {
- attributes: { ...baseAttributes,
- customBackgroundColor: {
- type: 'string'
- },
- mediaUrl: {
- type: 'string',
- source: 'attribute',
- selector: 'figure video,figure img',
- attribute: 'src'
- }
- },
- save(_ref3) {
- let {
- attributes
- } = _ref3;
- const {
- backgroundColor,
- customBackgroundColor,
- isStackedOnMobile,
- mediaAlt,
- mediaPosition,
- mediaType,
- mediaUrl,
- mediaWidth
- } = attributes;
- const mediaTypeRenders = {
- image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
- src: mediaUrl,
- alt: mediaAlt
- }),
- video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
- controls: true,
- src: mediaUrl
- })
- };
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const className = classnames_default()({
- 'has-media-on-the-right': 'right' === mediaPosition,
- [backgroundClass]: backgroundClass,
- 'is-stacked-on-mobile': isStackedOnMobile
- });
- let gridTemplateColumns;
- if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
- gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
- }
- const style = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- gridTemplateColumns
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: className,
- style: style
- }, (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: "wp-block-media-text__media"
- }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-media-text__content"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
- }
- }]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-left.js
- /**
- * WordPress dependencies
- */
- const pullLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"
- }));
- /* harmony default export */ var pull_left = (pullLeft);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-right.js
- /**
- * WordPress dependencies
- */
- const pullRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"
- }));
- /* harmony default export */ var pull_right = (pullRight);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/constants.js
- const DEFAULT_MEDIA_SIZE_SLUG = 'full';
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Constants
- */
- const media_text_edit_TEMPLATE = [['core/paragraph', {
- placeholder: (0,external_wp_i18n_namespaceObject._x)('Content…', 'content placeholder')
- }]]; // this limits the resize to a safe zone to avoid making broken layouts
- const WIDTH_CONSTRAINT_PERCENTAGE = 15;
- const applyWidthConstraints = width => Math.max(WIDTH_CONSTRAINT_PERCENTAGE, Math.min(width, 100 - WIDTH_CONSTRAINT_PERCENTAGE));
- const edit_LINK_DESTINATION_MEDIA = 'media';
- const edit_LINK_DESTINATION_ATTACHMENT = 'attachment';
- function getImageSourceUrlBySizeSlug(image, slug) {
- var _image$media_details, _image$media_details$, _image$media_details$2;
- // eslint-disable-next-line camelcase
- return image === null || image === void 0 ? void 0 : (_image$media_details = image.media_details) === null || _image$media_details === void 0 ? void 0 : (_image$media_details$ = _image$media_details.sizes) === null || _image$media_details$ === void 0 ? void 0 : (_image$media_details$2 = _image$media_details$[slug]) === null || _image$media_details$2 === void 0 ? void 0 : _image$media_details$2.source_url;
- }
- function edit_attributesFromMedia(_ref) {
- let {
- attributes: {
- linkDestination,
- href
- },
- setAttributes
- } = _ref;
- return media => {
- if (!media || !media.url) {
- setAttributes({
- mediaAlt: undefined,
- mediaId: undefined,
- mediaType: undefined,
- mediaUrl: undefined,
- mediaLink: undefined,
- href: undefined,
- focalPoint: undefined
- });
- return;
- }
- if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
- media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url);
- }
- let mediaType;
- let src; // For media selections originated from a file upload.
- if (media.media_type) {
- if (media.media_type === 'image') {
- mediaType = 'image';
- } else {
- // only images and videos are accepted so if the media_type is not an image we can assume it is a video.
- // video contain the media type of 'file' in the object returned from the rest api.
- mediaType = 'video';
- }
- } else {
- // For media selections originated from existing files in the media library.
- mediaType = media.type;
- }
- if (mediaType === 'image') {
- var _media$sizes, _media$sizes$large, _media$media_details, _media$media_details$, _media$media_details$2;
- // Try the "large" size URL, falling back to the "full" size URL below.
- src = ((_media$sizes = media.sizes) === null || _media$sizes === void 0 ? void 0 : (_media$sizes$large = _media$sizes.large) === null || _media$sizes$large === void 0 ? void 0 : _media$sizes$large.url) || ( // eslint-disable-next-line camelcase
- (_media$media_details = media.media_details) === null || _media$media_details === void 0 ? void 0 : (_media$media_details$ = _media$media_details.sizes) === null || _media$media_details$ === void 0 ? void 0 : (_media$media_details$2 = _media$media_details$.large) === null || _media$media_details$2 === void 0 ? void 0 : _media$media_details$2.source_url);
- }
- let newHref = href;
- if (linkDestination === edit_LINK_DESTINATION_MEDIA) {
- // Update the media link.
- newHref = media.url;
- } // Check if the image is linked to the attachment page.
- if (linkDestination === edit_LINK_DESTINATION_ATTACHMENT) {
- // Update the media link.
- newHref = media.link;
- }
- setAttributes({
- mediaAlt: media.alt,
- mediaId: media.id,
- mediaType,
- mediaUrl: src || media.url,
- mediaLink: media.link || undefined,
- href: newHref,
- focalPoint: undefined
- });
- };
- }
- function MediaTextEdit(_ref2) {
- let {
- attributes,
- isSelected,
- setAttributes
- } = _ref2;
- const {
- focalPoint,
- href,
- imageFill,
- isStackedOnMobile,
- linkClass,
- linkDestination,
- linkTarget,
- mediaAlt,
- mediaId,
- mediaPosition,
- mediaType,
- mediaUrl,
- mediaWidth,
- rel,
- verticalAlignment
- } = attributes;
- const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
- const image = (0,external_wp_data_namespaceObject.useSelect)(select => mediaId && isSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(mediaId, {
- context: 'view'
- }) : null, [isSelected, mediaId]);
- const refMediaContainer = (0,external_wp_element_namespaceObject.useRef)();
- const imperativeFocalPointPreview = value => {
- const {
- style
- } = refMediaContainer.current.resizable;
- const {
- x,
- y
- } = value;
- style.backgroundPosition = `${x * 100}% ${y * 100}%`;
- };
- const [temporaryMediaWidth, setTemporaryMediaWidth] = (0,external_wp_element_namespaceObject.useState)(null);
- const onSelectMedia = edit_attributesFromMedia({
- attributes,
- setAttributes
- });
- const onSetHref = props => {
- setAttributes(props);
- };
- const onWidthChange = width => {
- setTemporaryMediaWidth(applyWidthConstraints(width));
- };
- const commitWidthChange = width => {
- setAttributes({
- mediaWidth: applyWidthConstraints(width)
- });
- setTemporaryMediaWidth(applyWidthConstraints(width));
- };
- const classNames = classnames_default()({
- 'has-media-on-the-right': 'right' === mediaPosition,
- 'is-selected': isSelected,
- 'is-stacked-on-mobile': isStackedOnMobile,
- [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
- 'is-image-fill': imageFill
- });
- const widthString = `${temporaryMediaWidth || mediaWidth}%`;
- const gridTemplateColumns = 'right' === mediaPosition ? `1fr ${widthString}` : `${widthString} 1fr`;
- const style = {
- gridTemplateColumns,
- msGridColumns: gridTemplateColumns
- };
- const onMediaAltChange = newMediaAlt => {
- setAttributes({
- mediaAlt: newMediaAlt
- });
- };
- const onVerticalAlignmentChange = alignment => {
- setAttributes({
- verticalAlignment: alignment
- });
- };
- const imageSizes = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
- return settings === null || settings === void 0 ? void 0 : settings.imageSizes;
- }, []);
- const imageSizeOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref3 => {
- let {
- slug
- } = _ref3;
- return getImageSourceUrlBySizeSlug(image, slug);
- }), _ref4 => {
- let {
- name,
- slug
- } = _ref4;
- return {
- value: slug,
- label: name
- };
- });
- const updateImage = newMediaSizeSlug => {
- const newUrl = getImageSourceUrlBySizeSlug(image, newMediaSizeSlug);
- if (!newUrl) {
- return null;
- }
- setAttributes({
- mediaUrl: newUrl,
- mediaSizeSlug: newMediaSizeSlug
- });
- };
- const mediaTextGeneralSettings = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Media & Text settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'),
- checked: isStackedOnMobile,
- onChange: () => setAttributes({
- isStackedOnMobile: !isStackedOnMobile
- })
- }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill entire column'),
- checked: imageFill,
- onChange: () => setAttributes({
- imageFill: !imageFill
- })
- }), imageFill && mediaUrl && mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, {
- label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'),
- url: mediaUrl,
- value: focalPoint,
- onChange: value => setAttributes({
- focalPoint: value
- }),
- onDragStart: imperativeFocalPointPreview,
- onDrag: imperativeFocalPointPreview
- }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
- value: mediaAlt,
- onChange: onMediaAltChange,
- help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
- href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
- }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
- }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
- onChangeImage: updateImage,
- slug: mediaSizeSlug,
- imageSizeOptions: imageSizeOptions,
- isResizable: false
- }), mediaUrl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Media width'),
- value: temporaryMediaWidth || mediaWidth,
- onChange: commitWidthChange,
- min: WIDTH_CONSTRAINT_PERCENTAGE,
- max: 100 - WIDTH_CONSTRAINT_PERCENTAGE
- }));
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classNames,
- style
- });
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
- className: 'wp-block-media-text__content'
- }, {
- template: media_text_edit_TEMPLATE
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, mediaTextGeneralSettings), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentControl, {
- onChange: onVerticalAlignmentChange,
- value: verticalAlignment
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- icon: pull_left,
- title: (0,external_wp_i18n_namespaceObject.__)('Show media on left'),
- isActive: mediaPosition === 'left',
- onClick: () => setAttributes({
- mediaPosition: 'left'
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- icon: pull_right,
- title: (0,external_wp_i18n_namespaceObject.__)('Show media on right'),
- isActive: mediaPosition === 'right',
- onClick: () => setAttributes({
- mediaPosition: 'right'
- })
- }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, {
- url: href || '',
- onChangeUrl: onSetHref,
- linkDestination: linkDestination,
- mediaType: mediaType,
- mediaUrl: image && image.source_url,
- mediaLink: image && image.link,
- linkTarget: linkTarget,
- linkClass: linkClass,
- rel: rel
- })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(media_container, {
- className: "wp-block-media-text__media",
- onSelectMedia: onSelectMedia,
- onWidthChange: onWidthChange,
- commitWidthChange: commitWidthChange,
- ref: refMediaContainer,
- focalPoint,
- imageFill,
- isSelected,
- isStackedOnMobile,
- mediaAlt,
- mediaId,
- mediaPosition,
- mediaType,
- mediaUrl,
- mediaWidth
- }), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
- }
- /* harmony default export */ var media_text_edit = (MediaTextEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const save_DEFAULT_MEDIA_WIDTH = 50;
- function media_text_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- isStackedOnMobile,
- mediaAlt,
- mediaPosition,
- mediaType,
- mediaUrl,
- mediaWidth,
- mediaId,
- verticalAlignment,
- imageFill,
- focalPoint,
- linkClass,
- href,
- linkTarget,
- rel
- } = attributes;
- const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
- const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
- const imageClasses = classnames_default()({
- [`wp-image-${mediaId}`]: mediaId && mediaType === 'image',
- [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
- });
- let image = (0,external_wp_element_namespaceObject.createElement)("img", {
- src: mediaUrl,
- alt: mediaAlt,
- className: imageClasses || null
- });
- if (href) {
- image = (0,external_wp_element_namespaceObject.createElement)("a", {
- className: linkClass,
- href: href,
- target: linkTarget,
- rel: newRel
- }, image);
- }
- const mediaTypeRenders = {
- image: () => image,
- video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
- controls: true,
- src: mediaUrl
- })
- };
- const className = classnames_default()({
- 'has-media-on-the-right': 'right' === mediaPosition,
- 'is-stacked-on-mobile': isStackedOnMobile,
- [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
- 'is-image-fill': imageFill
- });
- const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
- let gridTemplateColumns;
- if (mediaWidth !== save_DEFAULT_MEDIA_WIDTH) {
- gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
- }
- const style = {
- gridTemplateColumns
- };
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className,
- style
- }), (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: "wp-block-media-text__media",
- style: backgroundStyles
- }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
- className: 'wp-block-media-text__content'
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/transforms.js
- /**
- * WordPress dependencies
- */
- const media_text_transforms_transforms = {
- from: [{
- type: 'block',
- blocks: ['core/image'],
- transform: _ref => {
- let {
- alt,
- url,
- id,
- anchor
- } = _ref;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
- mediaAlt: alt,
- mediaId: id,
- mediaUrl: url,
- mediaType: 'image',
- anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/video'],
- transform: _ref2 => {
- let {
- src,
- id,
- anchor
- } = _ref2;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
- mediaId: id,
- mediaUrl: src,
- mediaType: 'video',
- anchor
- });
- }
- }],
- to: [{
- type: 'block',
- blocks: ['core/image'],
- isMatch: _ref3 => {
- let {
- mediaType,
- mediaUrl
- } = _ref3;
- return !mediaUrl || mediaType === 'image';
- },
- transform: _ref4 => {
- let {
- mediaAlt,
- mediaId,
- mediaUrl,
- anchor
- } = _ref4;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
- alt: mediaAlt,
- id: mediaId,
- url: mediaUrl,
- anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/video'],
- isMatch: _ref5 => {
- let {
- mediaType,
- mediaUrl
- } = _ref5;
- return !mediaUrl || mediaType === 'video';
- },
- transform: _ref6 => {
- let {
- mediaId,
- mediaUrl,
- anchor
- } = _ref6;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
- id: mediaId,
- src: mediaUrl,
- anchor
- });
- }
- }]
- };
- /* harmony default export */ var media_text_transforms = (media_text_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const media_text_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/media-text",
- title: "Media & Text",
- category: "media",
- description: "Set media and words side-by-side for a richer layout.",
- keywords: ["image", "video"],
- textdomain: "default",
- attributes: {
- align: {
- type: "string",
- "default": "wide"
- },
- mediaAlt: {
- type: "string",
- source: "attribute",
- selector: "figure img",
- attribute: "alt",
- "default": ""
- },
- mediaPosition: {
- type: "string",
- "default": "left"
- },
- mediaId: {
- type: "number"
- },
- mediaUrl: {
- type: "string",
- source: "attribute",
- selector: "figure video,figure img",
- attribute: "src"
- },
- mediaLink: {
- type: "string"
- },
- linkDestination: {
- type: "string"
- },
- linkTarget: {
- type: "string",
- source: "attribute",
- selector: "figure a",
- attribute: "target"
- },
- href: {
- type: "string",
- source: "attribute",
- selector: "figure a",
- attribute: "href"
- },
- rel: {
- type: "string",
- source: "attribute",
- selector: "figure a",
- attribute: "rel"
- },
- linkClass: {
- type: "string",
- source: "attribute",
- selector: "figure a",
- attribute: "class"
- },
- mediaType: {
- type: "string"
- },
- mediaWidth: {
- type: "number",
- "default": 50
- },
- mediaSizeSlug: {
- type: "string"
- },
- isStackedOnMobile: {
- type: "boolean",
- "default": true
- },
- verticalAlignment: {
- type: "string"
- },
- imageFill: {
- type: "boolean"
- },
- focalPoint: {
- type: "object"
- }
- },
- supports: {
- anchor: true,
- align: ["wide", "full"],
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- }
- },
- editorStyle: "wp-block-media-text-editor",
- style: "wp-block-media-text"
- };
- const {
- name: media_text_name
- } = media_text_metadata;
- const media_text_settings = {
- icon: media_and_text,
- example: {
- viewportWidth: 601,
- // Columns collapse "@media (max-width: 600px)".
- attributes: {
- mediaType: 'image',
- mediaUrl: 'https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg'
- },
- innerBlocks: [{
- name: 'core/paragraph',
- attributes: {
- content: (0,external_wp_i18n_namespaceObject.__)('The wren<br>Earns his living<br>Noiselessly.')
- }
- }, {
- name: 'core/paragraph',
- attributes: {
- content: (0,external_wp_i18n_namespaceObject.__)('— Kobayashi Issa (一茶)')
- }
- }]
- },
- transforms: media_text_transforms,
- edit: media_text_edit,
- save: media_text_save_save,
- deprecated: media_text_deprecated
- };
- ;// CONCATENATED MODULE: external ["wp","dom"]
- var external_wp_dom_namespaceObject = window["wp"]["dom"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/edit.js
- /**
- * WordPress dependencies
- */
- function MissingBlockWarning(_ref) {
- let {
- attributes,
- convertToHTML
- } = _ref;
- const {
- originalName,
- originalUndelimitedContent
- } = attributes;
- const hasContent = !!originalUndelimitedContent;
- const hasHTMLBlock = (0,external_wp_blocks_namespaceObject.getBlockType)('core/html');
- const actions = [];
- let messageHTML;
- if (hasContent && hasHTMLBlock) {
- messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: block name */
- (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'), originalName);
- actions.push((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- key: "convert",
- onClick: convertToHTML,
- variant: "primary"
- }, (0,external_wp_i18n_namespaceObject.__)('Keep as HTML')));
- } else {
- messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: block name */
- (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'), originalName);
- }
- return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: 'has-warning'
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
- actions: actions
- }, messageHTML), (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_wp_dom_namespaceObject.safeHTML)(originalUndelimitedContent)));
- }
- const MissingEdit = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref2) => {
- let {
- clientId,
- attributes
- } = _ref2;
- const {
- replaceBlock
- } = dispatch(external_wp_blockEditor_namespaceObject.store);
- return {
- convertToHTML() {
- replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
- content: attributes.originalUndelimitedContent
- }));
- }
- };
- })(MissingBlockWarning);
- /* harmony default export */ var missing_edit = (MissingEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/save.js
- /**
- * WordPress dependencies
- */
- function missing_save_save(_ref) {
- let {
- attributes
- } = _ref;
- // Preserve the missing block's content.
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.originalContent);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const missing_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/missing",
- title: "Unsupported",
- category: "text",
- description: "Your site doesn\u2019t include support for this block.",
- textdomain: "default",
- attributes: {
- originalName: {
- type: "string"
- },
- originalUndelimitedContent: {
- type: "string"
- },
- originalContent: {
- type: "string",
- source: "html"
- }
- },
- supports: {
- className: false,
- customClassName: false,
- inserter: false,
- html: false,
- reusable: false
- }
- };
- const {
- name: missing_name
- } = missing_metadata;
- const missing_settings = {
- name: missing_name,
- __experimentalLabel(attributes, _ref) {
- let {
- context
- } = _ref;
- if (context === 'accessibility') {
- const {
- originalName
- } = attributes;
- const originalBlockType = originalName ? (0,external_wp_blocks_namespaceObject.getBlockType)(originalName) : undefined;
- if (originalBlockType) {
- return originalBlockType.settings.title || originalName;
- }
- return '';
- }
- },
- edit: missing_edit,
- save: missing_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more.js
- /**
- * WordPress dependencies
- */
- const more = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"
- }));
- /* harmony default export */ var library_more = (more);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/edit.js
- /**
- * WordPress dependencies
- */
- const DEFAULT_TEXT = (0,external_wp_i18n_namespaceObject.__)('Read more');
- function MoreEdit(_ref) {
- let {
- attributes: {
- customText,
- noTeaser
- },
- insertBlocksAfter,
- setAttributes
- } = _ref;
- const onChangeInput = event => {
- setAttributes({
- customText: event.target.value !== '' ? event.target.value : undefined
- });
- };
- const onKeyDown = _ref2 => {
- let {
- keyCode
- } = _ref2;
- if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
- insertBlocksAfter([(0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())]);
- }
- };
- const getHideExcerptHelp = checked => checked ? (0,external_wp_i18n_namespaceObject.__)('The excerpt is hidden.') : (0,external_wp_i18n_namespaceObject.__)('The excerpt is visible.');
- const toggleHideExcerpt = () => setAttributes({
- noTeaser: !noTeaser
- });
- const style = {
- width: `${(customText ? customText : DEFAULT_TEXT).length + 1.2}em`
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Hide the excerpt on the full content page'),
- checked: !!noTeaser,
- onChange: toggleHideExcerpt,
- help: getHideExcerptHelp
- }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-more"
- }, (0,external_wp_element_namespaceObject.createElement)("input", {
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Read more link text'),
- type: "text",
- value: customText,
- placeholder: DEFAULT_TEXT,
- onChange: onChangeInput,
- onKeyDown: onKeyDown,
- style: style
- }))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function more_save_save(_ref) {
- let {
- attributes: {
- customText,
- noTeaser
- }
- } = _ref;
- const moreTag = customText ? `<!--more ${customText}-->` : '<!--more-->';
- const noTeaserTag = noTeaser ? '<!--noteaser-->' : '';
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_lodash_namespaceObject.compact)([moreTag, noTeaserTag]).join('\n'));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/transforms.js
- /**
- * WordPress dependencies
- */
- const more_transforms_transforms = {
- from: [{
- type: 'raw',
- schema: {
- 'wp-block': {
- attributes: ['data-block']
- }
- },
- isMatch: node => node.dataset && node.dataset.block === 'core/more',
- transform(node) {
- const {
- customText,
- noTeaser
- } = node.dataset;
- const attrs = {}; // Don't copy unless defined and not an empty string.
- if (customText) {
- attrs.customText = customText;
- } // Special handling for boolean.
- if (noTeaser === '') {
- attrs.noTeaser = true;
- }
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/more', attrs);
- }
- }]
- };
- /* harmony default export */ var more_transforms = (more_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const more_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/more",
- title: "More",
- category: "design",
- description: "Content before this block will be shown in the excerpt on your archives page.",
- keywords: ["read more"],
- textdomain: "default",
- attributes: {
- customText: {
- type: "string"
- },
- noTeaser: {
- type: "boolean",
- "default": false
- }
- },
- supports: {
- customClassName: false,
- className: false,
- html: false,
- multiple: false
- },
- editorStyle: "wp-block-more-editor"
- };
- const {
- name: more_name
- } = more_metadata;
- const more_settings = {
- icon: library_more,
- example: {},
- __experimentalLabel(attributes, _ref) {
- let {
- context
- } = _ref;
- if (context === 'accessibility') {
- return attributes.customText;
- }
- },
- transforms: more_transforms,
- edit: MoreEdit,
- save: more_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js
- /**
- * WordPress dependencies
- */
- const navigation = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"
- }));
- /* harmony default export */ var library_navigation = (navigation);
- ;// CONCATENATED MODULE: external ["wp","a11y"]
- var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-menu.js
- /**
- * WordPress dependencies
- */
- function useNavigationMenu(ref) {
- return (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _navigationMenu;
- const {
- getEntityRecord,
- getEditedEntityRecord,
- getEntityRecords,
- hasFinishedResolution,
- isResolving,
- canUser
- } = select(external_wp_coreData_namespaceObject.store);
- const navigationMenuSingleArgs = ['postType', 'wp_navigation', ref];
- const rawNavigationMenu = ref ? getEntityRecord(...navigationMenuSingleArgs) : null;
- let navigationMenu = ref ? getEditedEntityRecord(...navigationMenuSingleArgs) : null; // getEditedEntityRecord will return the post regardless of status.
- // Therefore if the found post is not published then we should ignore it.
- if (((_navigationMenu = navigationMenu) === null || _navigationMenu === void 0 ? void 0 : _navigationMenu.status) !== 'publish') {
- navigationMenu = null;
- }
- const hasResolvedNavigationMenu = ref ? hasFinishedResolution('getEditedEntityRecord', navigationMenuSingleArgs) : false;
- const navigationMenuMultipleArgs = ['postType', 'wp_navigation', {
- per_page: -1,
- status: 'publish'
- }];
- const navigationMenus = getEntityRecords(...navigationMenuMultipleArgs);
- const canSwitchNavigationMenu = ref ? (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 1 : (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 0;
- return {
- isNavigationMenuResolved: hasResolvedNavigationMenu,
- isNavigationMenuMissing: !ref || hasResolvedNavigationMenu && !rawNavigationMenu,
- canSwitchNavigationMenu,
- isResolvingNavigationMenus: isResolving('getEntityRecords', navigationMenuMultipleArgs),
- hasResolvedNavigationMenus: hasFinishedResolution('getEntityRecords', navigationMenuMultipleArgs),
- navigationMenu,
- navigationMenus,
- canUserUpdateNavigationMenu: ref ? canUser('update', 'navigation', ref) : undefined,
- hasResolvedCanUserUpdateNavigationMenu: hasFinishedResolution('canUser', ['update', 'navigation', ref]),
- canUserDeleteNavigationMenu: ref ? canUser('delete', 'navigation', ref) : undefined,
- hasResolvedCanUserDeleteNavigationMenu: hasFinishedResolution('canUser', ['delete', 'navigation', ref]),
- canUserCreateNavigationMenu: canUser('create', 'navigation'),
- isResolvingCanUserCreateNavigationMenu: isResolving('canUser', ['create', 'navigation']),
- hasResolvedCanUserCreateNavigationMenu: hasFinishedResolution('canUser', ['create', 'navigation'])
- };
- }, [ref]);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-entities.js
- /**
- * WordPress dependencies
- */
- /**
- * @typedef {Object} NavigationEntitiesData
- * @property {Array|undefined} pages - a collection of WP Post entity objects of post type "Page".
- * @property {boolean} isResolvingPages - indicates whether the request to fetch pages is currently resolving.
- * @property {boolean} hasResolvedPages - indicates whether the request to fetch pages has finished resolving.
- * @property {Array|undefined} menus - a collection of Menu entity objects.
- * @property {boolean} isResolvingMenus - indicates whether the request to fetch menus is currently resolving.
- * @property {boolean} hasResolvedMenus - indicates whether the request to fetch menus has finished resolving.
- * @property {Array|undefined} menusItems - a collection of Menu Item entity objects for the current menuId.
- * @property {boolean} hasResolvedMenuItems - indicates whether the request to fetch menuItems has finished resolving.
- * @property {boolean} hasPages - indicates whether there is currently any data for pages.
- * @property {boolean} hasMenus - indicates whether there is currently any data for menus.
- */
- /**
- * Manages fetching and resolution state for all entities required
- * for the Navigation block.
- *
- * @param {number} menuId the menu for which to retrieve menuItem data.
- * @return { NavigationEntitiesData } the entity data.
- */
- function useNavigationEntities(menuId) {
- const {
- records: menus,
- isResolving: isResolvingMenus,
- hasResolved: hasResolvedMenus
- } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('root', 'menu', {
- per_page: -1,
- context: 'view'
- });
- const {
- records: pages,
- isResolving: isResolvingPages,
- hasResolved: hasResolvedPages
- } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('postType', 'page', {
- parent: 0,
- order: 'asc',
- orderby: 'id',
- per_page: -1,
- context: 'view'
- });
- const {
- records: menuItems,
- hasResolved: hasResolvedMenuItems
- } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('root', 'menuItem', {
- menus: menuId,
- per_page: -1,
- context: 'view'
- }, {
- enabled: !!menuId
- });
- return {
- pages,
- isResolvingPages,
- hasResolvedPages,
- hasPages: !!(hasResolvedPages && pages !== null && pages !== void 0 && pages.length),
- menus,
- isResolvingMenus,
- hasResolvedMenus,
- hasMenus: !!(hasResolvedMenus && menus !== null && menus !== void 0 && menus.length),
- menuItems,
- hasResolvedMenuItems
- };
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
- /**
- * WordPress dependencies
- */
- /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
- /**
- * Return an SVG icon.
- *
- * @param {IconProps} props icon is the SVG component to render
- * size is a number specifiying the icon size in pixels
- * Other props will be passed to wrapped SVG component
- *
- * @return {JSX.Element} Icon component
- */
- function Icon(_ref) {
- let {
- icon,
- size = 24,
- ...props
- } = _ref;
- return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
- width: size,
- height: size,
- ...props
- });
- }
- /* harmony default export */ var icon = (Icon);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/placeholder-preview.js
- /**
- * WordPress dependencies
- */
- const PlaceholderPreview = _ref => {
- let {
- isVisible = true
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- "aria-hidden": !isVisible ? true : undefined,
- className: "wp-block-navigation-placeholder__preview"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-navigation-placeholder__actions__indicator"
- }, (0,external_wp_element_namespaceObject.createElement)(icon, {
- icon: library_navigation
- }), (0,external_wp_i18n_namespaceObject.__)('Navigation')));
- };
- /* harmony default export */ var placeholder_preview = (PlaceholderPreview);
- ;// CONCATENATED MODULE: external ["wp","htmlEntities"]
- var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-selector.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function NavigationMenuSelector(_ref, forwardedRef) {
- let {
- currentMenuId,
- onSelect,
- onCreateNew,
- showManageActions = false,
- actionLabel,
- toggleProps = {}
- } = _ref;
- /* translators: %s: The name of a menu. */
- const createActionLabel = (0,external_wp_i18n_namespaceObject.__)("Create from '%s'");
- actionLabel = actionLabel || createActionLabel;
- const {
- menus: classicMenus
- } = useNavigationEntities();
- const {
- navigationMenus,
- canUserCreateNavigationMenu,
- canUserUpdateNavigationMenu,
- canSwitchNavigationMenu
- } = useNavigationMenu();
- const handleSelect = (0,external_wp_element_namespaceObject.useCallback)(_onClose => selectedId => {
- _onClose();
- onSelect(navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.find(post => post.id === selectedId));
- }, [navigationMenus]);
- const handleSelectClassic = (0,external_wp_element_namespaceObject.useCallback)((_onClose, menu) => () => {
- _onClose();
- onSelect(menu);
- }, []);
- const menuChoices = (0,external_wp_element_namespaceObject.useMemo)(() => {
- return (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.map(_ref2 => {
- let {
- id,
- title
- } = _ref2;
- const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title.rendered);
- return {
- value: id,
- label,
- ariaLabel: (0,external_wp_i18n_namespaceObject.sprintf)(actionLabel, label)
- };
- })) || [];
- }, [navigationMenus]);
- const hasNavigationMenus = !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length);
- const hasClassicMenus = !!(classicMenus !== null && classicMenus !== void 0 && classicMenus.length);
- const showNavigationMenus = !!canSwitchNavigationMenu;
- const showClassicMenus = !!canUserCreateNavigationMenu;
- const hasManagePermissions = canUserCreateNavigationMenu || canUserUpdateNavigationMenu; // Show the selector if:
- // - has switch or create permissions and there are block or classic menus.
- // - user has create or update permisisons and component should show the menu actions.
- const showSelectMenus = (canSwitchNavigationMenu || canUserCreateNavigationMenu) && (hasNavigationMenus || hasClassicMenus) || hasManagePermissions && showManageActions;
- if (!showSelectMenus) {
- return null;
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
- ref: forwardedRef,
- label: (0,external_wp_i18n_namespaceObject.__)('Select Menu'),
- text: (0,external_wp_i18n_namespaceObject.__)('Select Menu'),
- icon: null,
- toggleProps: toggleProps
- }, _ref3 => {
- let {
- onClose
- } = _ref3;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, showNavigationMenus && hasNavigationMenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
- label: (0,external_wp_i18n_namespaceObject.__)('Menus')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, {
- value: currentMenuId,
- onSelect: handleSelect(onClose),
- choices: menuChoices
- })), showClassicMenus && hasClassicMenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
- label: (0,external_wp_i18n_namespaceObject.__)('Classic Menus')
- }, classicMenus === null || classicMenus === void 0 ? void 0 : classicMenus.map(menu => {
- const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menu.name);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
- onClick: handleSelectClassic(onClose, menu),
- key: menu.id,
- "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(createActionLabel, label)
- }, label);
- })), showManageActions && hasManagePermissions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
- label: (0,external_wp_i18n_namespaceObject.__)('Tools')
- }, canUserCreateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
- onClick: onCreateNew
- }, (0,external_wp_i18n_namespaceObject.__)('Create new menu')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
- href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
- post_type: 'wp_navigation'
- })
- }, (0,external_wp_i18n_namespaceObject.__)('Manage menus'))));
- });
- }
- /* harmony default export */ var navigation_menu_selector = ((0,external_wp_element_namespaceObject.forwardRef)(NavigationMenuSelector));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function NavigationPlaceholder(_ref) {
- let {
- isSelected,
- currentMenuId,
- clientId,
- canUserCreateNavigationMenu = false,
- isResolvingCanUserCreateNavigationMenu,
- onFinish,
- onCreateEmpty
- } = _ref;
- const {
- isResolvingMenus,
- hasResolvedMenus
- } = useNavigationEntities();
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isSelected) {
- return;
- }
- if (isResolvingMenus) {
- (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Loading Navigation block setup options.'));
- }
- if (hasResolvedMenus) {
- (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Navigation block setup options ready.'));
- }
- }, [isResolvingMenus, isSelected]);
- const isResolvingActions = isResolvingMenus && isResolvingCanUserCreateNavigationMenu;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- className: "wp-block-navigation-placeholder"
- }, (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, {
- isVisible: !isSelected
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
- "aria-hidden": !isSelected ? true : undefined,
- className: "wp-block-navigation-placeholder__controls"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-navigation-placeholder__actions"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-navigation-placeholder__actions__indicator"
- }, (0,external_wp_element_namespaceObject.createElement)(icon, {
- icon: library_navigation
- }), " ", (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_wp_element_namespaceObject.createElement)("hr", null), isResolvingActions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(navigation_menu_selector, {
- currentMenuId: currentMenuId,
- clientId: clientId,
- onSelect: onFinish,
- toggleProps: {
- variant: 'tertiary',
- iconPosition: 'right',
- className: 'wp-block-navigation-placeholder__actions__dropdown'
- }
- }), (0,external_wp_element_namespaceObject.createElement)("hr", null), canUserCreateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "tertiary",
- onClick: onCreateEmpty
- }, (0,external_wp_i18n_namespaceObject.__)('Start empty'))))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
- /**
- * WordPress dependencies
- */
- const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var library_close = (close_close);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-icon.js
- /**
- * WordPress dependencies
- */
- function OverlayMenuIcon() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24",
- width: "24",
- height: "24",
- "aria-hidden": "true",
- focusable: "false"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
- x: "4",
- y: "7.5",
- width: "16",
- height: "1.5"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
- x: "4",
- y: "15",
- width: "16",
- height: "1.5"
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/responsive-wrapper.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function ResponsiveWrapper(_ref) {
- let {
- children,
- id,
- isOpen,
- isResponsive,
- onToggle,
- isHiddenByDefault,
- classNames,
- styles,
- hasIcon
- } = _ref;
- if (!isResponsive) {
- return children;
- }
- const responsiveContainerClasses = classnames_default()('wp-block-navigation__responsive-container', classNames, {
- 'is-menu-open': isOpen,
- 'hidden-by-default': isHiddenByDefault
- });
- const openButtonClasses = classnames_default()('wp-block-navigation__responsive-container-open', {
- 'always-shown': isHiddenByDefault
- });
- const modalId = `${id}-modal`;
- const dialogProps = {
- className: 'wp-block-navigation__responsive-dialog',
- ...(isOpen && {
- role: 'dialog',
- 'aria-modal': true,
- 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Menu')
- })
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- "aria-haspopup": "true",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Open menu'),
- className: openButtonClasses,
- onClick: () => onToggle(true)
- }, hasIcon && (0,external_wp_element_namespaceObject.createElement)(OverlayMenuIcon, null), !hasIcon && (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "wp-block-navigation__toggle_button_label"
- }, (0,external_wp_i18n_namespaceObject.__)('Menu'))), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: responsiveContainerClasses,
- style: styles,
- id: modalId
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-navigation__responsive-close",
- tabIndex: "-1"
- }, (0,external_wp_element_namespaceObject.createElement)("div", dialogProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- className: "wp-block-navigation__responsive-container-close",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Close menu'),
- onClick: () => onToggle(false)
- }, (0,external_wp_element_namespaceObject.createElement)(icon, {
- icon: library_close
- })), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-navigation__responsive-container-content",
- id: `${modalId}-content`
- }, children)))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/inner-blocks.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const inner_blocks_ALLOWED_BLOCKS = ['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'];
- const inner_blocks_DEFAULT_BLOCK = {
- name: 'core/navigation-link'
- };
- const LAYOUT = {
- type: 'default',
- alignments: []
- };
- function NavigationInnerBlocks(_ref) {
- let {
- clientId,
- hasCustomPlaceholder,
- orientation
- } = _ref;
- const {
- isImmediateParentOfSelectedBlock,
- selectedBlockHasChildren,
- isSelected
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlockCount,
- hasSelectedInnerBlock,
- getSelectedBlockClientId
- } = select(external_wp_blockEditor_namespaceObject.store);
- const selectedBlockId = getSelectedBlockClientId();
- return {
- isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
- selectedBlockHasChildren: !!getBlockCount(selectedBlockId),
- // This prop is already available but computing it here ensures it's
- // fresh compared to isImmediateParentOfSelectedBlock.
- isSelected: selectedBlockId === clientId
- };
- }, [clientId]);
- const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_navigation');
- const shouldDirectInsert = (0,external_wp_element_namespaceObject.useMemo)(() => blocks.every(_ref2 => {
- let {
- name
- } = _ref2;
- return name === 'core/navigation-link' || name === 'core/navigation-submenu' || name === 'core/page-list';
- }), [blocks]); // When the block is selected itself or has a top level item selected that
- // doesn't itself have children, show the standard appender. Else show no
- // appender.
- const parentOrChildHasSelection = isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren;
- const placeholder = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, null), []);
- const hasMenuItems = !!(blocks !== null && blocks !== void 0 && blocks.length); // If there is a `ref` attribute pointing to a `wp_navigation` but
- // that menu has no **items** (i.e. empty) then show a placeholder.
- // The block must also be selected else the placeholder will display
- // alongside the appender.
- const showPlaceholder = !hasCustomPlaceholder && !hasMenuItems && !isSelected;
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
- className: 'wp-block-navigation__container'
- }, {
- value: blocks,
- onInput,
- onChange,
- allowedBlocks: inner_blocks_ALLOWED_BLOCKS,
- __experimentalDefaultBlock: inner_blocks_DEFAULT_BLOCK,
- __experimentalDirectInsert: shouldDirectInsert,
- orientation,
- // As an exception to other blocks which feature nesting, show
- // the block appender even when a child block is selected.
- // This should be a temporary fix, to be replaced by improvements to
- // the sibling inserter.
- // See https://github.com/WordPress/gutenberg/issues/37572.
- renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender.
- parentOrChildHasSelection ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false,
- // Template lock set to false here so that the Nav
- // Block on the experimental menus screen does not
- // inherit templateLock={ 'all' }.
- templateLock: false,
- __experimentalLayout: LAYOUT,
- placeholder: showPlaceholder ? placeholder : undefined
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
- clientId: clientId,
- tagName: 'div',
- wrapperProps: innerBlocksProps
- });
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-name-control.js
- /**
- * WordPress dependencies
- */
- function NavigationMenuNameControl() {
- const [title, updateTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Menu name'),
- value: title,
- onChange: updateTitle
- });
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js
- /**
- * Generates a template part Id based on slug and theme inputs.
- *
- * @param {string} theme the template part's theme.
- * @param {string} slug the template part's slug
- * @return {string|null} the template part's Id.
- */
- function createTemplatePartId(theme, slug) {
- return theme && slug ? theme + '//' + slug : null;
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-template-part-area-label.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- // TODO: this util should perhaps be refactored somewhere like core-data.
- function useTemplatePartAreaLabel(clientId) {
- return (0,external_wp_data_namespaceObject.useSelect)(select => {
- // Use the lack of a clientId as an opportunity to bypass the rest
- // of this hook.
- if (!clientId) {
- return;
- }
- const {
- getBlock,
- getBlockParentsByBlockName
- } = select(external_wp_blockEditor_namespaceObject.store);
- const withAscendingResults = true;
- const parentTemplatePartClientIds = getBlockParentsByBlockName(clientId, 'core/template-part', withAscendingResults);
- if (!(parentTemplatePartClientIds !== null && parentTemplatePartClientIds !== void 0 && parentTemplatePartClientIds.length)) {
- return;
- } // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
- // Blocks can be loaded into a *non-post* block editor.
- // This code is lifted from this file:
- // packages/block-library/src/template-part/edit/advanced-controls.js
- // eslint-disable-next-line @wordpress/data-no-store-string-literals
- const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
- const {
- getEditedEntityRecord
- } = select(external_wp_coreData_namespaceObject.store);
- for (const templatePartClientId of parentTemplatePartClientIds) {
- const templatePartBlock = getBlock(templatePartClientId); // The 'area' usually isn't stored on the block, but instead
- // on the entity.
- const {
- theme,
- slug
- } = templatePartBlock.attributes;
- const templatePartEntityId = createTemplatePartId(theme, slug);
- const templatePartEntity = getEditedEntityRecord('postType', 'wp_template_part', templatePartEntityId); // Look up the `label` for the area in the defined areas so
- // that an internationalized label can be used.
- if (templatePartEntity !== null && templatePartEntity !== void 0 && templatePartEntity.area) {
- var _definedAreas$find;
- return (_definedAreas$find = definedAreas.find(definedArea => definedArea.area !== 'uncategorized' && definedArea.area === templatePartEntity.area)) === null || _definedAreas$find === void 0 ? void 0 : _definedAreas$find.label;
- }
- }
- }, [clientId]);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', {
- status: 'draft',
- per_page: -1
- }];
- const PUBLISHED_MENU_PARAMS = ['postType', 'wp_navigation', {
- per_page: -1,
- status: 'publish'
- }];
- function useGenerateDefaultNavigationTitle(clientId) {
- // The block will be disabled in a block preview, use this as a way of
- // avoiding the side-effects of this component for block previews.
- const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); // Because we can't conditionally call hooks, pass an undefined client id
- // arg to bypass the expensive `useTemplateArea` code. The hook will return
- // early.
- const area = useTemplatePartAreaLabel(isDisabled ? undefined : clientId);
- const registry = (0,external_wp_data_namespaceObject.useRegistry)();
- return (0,external_wp_element_namespaceObject.useCallback)(async () => {
- // Ensure other navigation menus have loaded so an
- // accurate name can be created.
- if (isDisabled) {
- return '';
- }
- const {
- getEntityRecords
- } = registry.resolveSelect(external_wp_coreData_namespaceObject.store);
- const [draftNavigationMenus, navigationMenus] = await Promise.all([getEntityRecords(...DRAFT_MENU_PARAMS), getEntityRecords(...PUBLISHED_MENU_PARAMS)]);
- const title = area ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
- (0,external_wp_i18n_namespaceObject.__)('%s navigation'), area) : // translators: 'navigation' as in website navigation.
- (0,external_wp_i18n_namespaceObject.__)('Navigation'); // Determine how many menus start with the automatic title.
- const matchingMenuTitleCount = [...draftNavigationMenus, ...navigationMenus].reduce((count, menu) => {
- var _menu$title, _menu$title$raw;
- return menu !== null && menu !== void 0 && (_menu$title = menu.title) !== null && _menu$title !== void 0 && (_menu$title$raw = _menu$title.raw) !== null && _menu$title$raw !== void 0 && _menu$title$raw.startsWith(title) ? count + 1 : count;
- }, 0); // Append a number to the end of the title if a menu with
- // the same name exists.
- const titleWithCount = matchingMenuTitleCount > 0 ? `${title} ${matchingMenuTitleCount + 1}` : title;
- return titleWithCount || '';
- }, [isDisabled, area]);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-create-navigation-menu.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const CREATE_NAVIGATION_MENU_SUCCESS = 'success';
- const CREATE_NAVIGATION_MENU_ERROR = 'error';
- const CREATE_NAVIGATION_MENU_PENDING = 'pending';
- const CREATE_NAVIGATION_MENU_IDLE = 'idle';
- function useCreateNavigationMenu(clientId) {
- const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CREATE_NAVIGATION_MENU_IDLE);
- const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(null);
- const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
- const {
- saveEntityRecord
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
- const generateDefaultTitle = useGenerateDefaultNavigationTitle(clientId); // This callback uses data from the two placeholder steps and only creates
- // a new navigation menu when the user completes the final step.
- const create = (0,external_wp_element_namespaceObject.useCallback)(async function () {
- let title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- let blocks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- // Guard against creating Navigations without a title.
- // Note you can pass no title, but if one is passed it must be
- // a string otherwise the title may end up being empty.
- if (title && typeof title !== 'string') {
- setError('Invalid title supplied when creating Navigation Menu.');
- setStatus(CREATE_NAVIGATION_MENU_ERROR);
- throw new Error(`Value of supplied title argument was not a string.`);
- }
- setStatus(CREATE_NAVIGATION_MENU_PENDING);
- setValue(null);
- setError(null);
- if (!title) {
- title = await generateDefaultTitle().catch(err => {
- setError(err === null || err === void 0 ? void 0 : err.message);
- setStatus(CREATE_NAVIGATION_MENU_ERROR);
- throw new Error('Failed to create title when saving new Navigation Menu.', {
- cause: err
- });
- });
- }
- const record = {
- title,
- content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
- status: 'publish'
- }; // Return affords ability to await on this function directly
- return saveEntityRecord('postType', 'wp_navigation', record).then(response => {
- setValue(response);
- setStatus(CREATE_NAVIGATION_MENU_SUCCESS);
- return response;
- }).catch(err => {
- setError(err === null || err === void 0 ? void 0 : err.message);
- setStatus(CREATE_NAVIGATION_MENU_ERROR);
- throw new Error('Unable to save new Navigation Menu', {
- cause: err
- });
- });
- }, [external_wp_blocks_namespaceObject.serialize, saveEntityRecord]);
- return {
- create,
- status,
- value,
- error
- };
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/unsaved-inner-blocks.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const EMPTY_OBJECT = {};
- const unsaved_inner_blocks_DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', {
- status: 'draft',
- per_page: -1
- }];
- const unsaved_inner_blocks_DEFAULT_BLOCK = {
- name: 'core/navigation-link'
- };
- const unsaved_inner_blocks_ALLOWED_BLOCKS = ['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'];
- function UnsavedInnerBlocks(_ref) {
- let {
- blockProps,
- blocks,
- clientId,
- hasSavedUnsavedInnerBlocks,
- onSave,
- hasSelection
- } = _ref;
- const originalBlocks = (0,external_wp_element_namespaceObject.useRef)();
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // Initially store the uncontrolled inner blocks for
- // dirty state comparison.
- if (!(originalBlocks !== null && originalBlocks !== void 0 && originalBlocks.current)) {
- originalBlocks.current = blocks;
- }
- }, [blocks]); // If the current inner blocks object is different in any way
- // from the original inner blocks from the post content then the
- // user has made changes to the inner blocks. At this point the inner
- // blocks can be considered "dirty".
- const innerBlocksAreDirty = blocks !== originalBlocks.current;
- const shouldDirectInsert = (0,external_wp_element_namespaceObject.useMemo)(() => blocks.every(_ref2 => {
- let {
- name
- } = _ref2;
- return name === 'core/navigation-link' || name === 'core/navigation-submenu' || name === 'core/page-list';
- }), [blocks]); // The block will be disabled in a block preview, use this as a way of
- // avoiding the side-effects of this component for block previews.
- const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context);
- const savingLock = (0,external_wp_element_namespaceObject.useRef)(false);
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- renderAppender: hasSelection ? undefined : false,
- allowedBlocks: unsaved_inner_blocks_ALLOWED_BLOCKS,
- __experimentalDefaultBlock: unsaved_inner_blocks_DEFAULT_BLOCK,
- __experimentalDirectInsert: shouldDirectInsert
- });
- const {
- isSaving,
- draftNavigationMenus,
- hasResolvedDraftNavigationMenus
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- if (isDisabled) {
- return EMPTY_OBJECT;
- }
- const {
- getEntityRecords,
- hasFinishedResolution,
- isSavingEntityRecord
- } = select(external_wp_coreData_namespaceObject.store);
- return {
- isSaving: isSavingEntityRecord('postType', 'wp_navigation'),
- draftNavigationMenus: getEntityRecords(...unsaved_inner_blocks_DRAFT_MENU_PARAMS),
- hasResolvedDraftNavigationMenus: hasFinishedResolution('getEntityRecords', unsaved_inner_blocks_DRAFT_MENU_PARAMS)
- };
- }, [isDisabled]);
- const {
- hasResolvedNavigationMenus,
- navigationMenus
- } = useNavigationMenu();
- const {
- create: createNavigationMenu
- } = useCreateNavigationMenu(clientId); // Automatically save the uncontrolled blocks.
- (0,external_wp_element_namespaceObject.useEffect)(async () => {
- // The block will be disabled when used in a BlockPreview.
- // In this case avoid automatic creation of a wp_navigation post.
- // Otherwise the user will be spammed with lots of menus!
- //
- // Also ensure other navigation menus have loaded so an
- // accurate name can be created.
- //
- // Don't try saving when another save is already
- // in progress.
- //
- // And finally only create the menu when the block is selected,
- // which is an indication they want to start editing.
- if (isDisabled || hasSavedUnsavedInnerBlocks || isSaving || savingLock.current || !hasResolvedDraftNavigationMenus || !hasResolvedNavigationMenus || !hasSelection || !innerBlocksAreDirty) {
- return;
- }
- savingLock.current = true;
- const menu = await createNavigationMenu(null, blocks);
- onSave(menu);
- savingLock.current = false;
- }, [isDisabled, isSaving, hasResolvedDraftNavigationMenus, hasResolvedNavigationMenus, draftNavigationMenus, navigationMenus, hasSelection, createNavigationMenu, blocks]);
- const Wrapper = isSaving ? external_wp_components_namespaceObject.Disabled : 'div';
- return (0,external_wp_element_namespaceObject.createElement)(Wrapper, {
- className: "wp-block-navigation__unsaved-changes"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: classnames_default()('wp-block-navigation__unsaved-changes-overlay', {
- 'is-saving': isSaving
- })
- }, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)), isSaving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-delete-control.js
- /**
- * WordPress dependencies
- */
- function NavigationMenuDeleteControl(_ref) {
- let {
- onDelete
- } = _ref;
- const [isConfirmModalVisible, setIsConfirmModalVisible] = (0,external_wp_element_namespaceObject.useState)(false);
- const id = (0,external_wp_coreData_namespaceObject.useEntityId)('postType', 'wp_navigation');
- const [title] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
- const {
- deleteEntityRecord
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- className: "wp-block-navigation-delete-menu-button",
- variant: "secondary",
- isDestructive: true,
- onClick: () => {
- setIsConfirmModalVisible(true);
- }
- }, (0,external_wp_i18n_namespaceObject.__)('Delete menu')), isConfirmModalVisible && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
- title: (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: the name of a menu to delete */
- (0,external_wp_i18n_namespaceObject.__)('Delete %s'), title),
- closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
- onRequestClose: () => setIsConfirmModalVisible(false)
- }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this navigation menu?')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
- justify: "flex-end"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "secondary",
- onClick: () => {
- setIsConfirmModalVisible(false);
- }
- }, (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, {
- variant: "primary",
- onClick: () => {
- deleteEntityRecord('postType', 'wp_navigation', id, {
- force: true
- });
- onDelete(title);
- }
- }, (0,external_wp_i18n_namespaceObject.__)('Confirm'))))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-navigation-notice.js
- /**
- * WordPress dependencies
- */
- function useNavigationNotice() {
- let {
- name,
- message = ''
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- const noticeRef = (0,external_wp_element_namespaceObject.useRef)();
- const {
- createWarningNotice,
- removeNotice
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
- const showNotice = customMsg => {
- if (noticeRef.current) {
- return;
- }
- noticeRef.current = name;
- createWarningNotice(customMsg || message, {
- id: noticeRef.current,
- type: 'snackbar'
- });
- };
- const hideNotice = () => {
- if (!noticeRef.current) {
- return;
- }
- removeNotice(noticeRef.current);
- noticeRef.current = null;
- };
- return [showNotice, hideNotice];
- }
- /* harmony default export */ var use_navigation_notice = (useNavigationNotice);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Convert a flat menu item structure to a nested blocks structure.
- *
- * @param {Object[]} menuItems An array of menu items.
- *
- * @return {WPBlock[]} An array of blocks.
- */
- function menuItemsToBlocks(menuItems) {
- if (!menuItems) {
- return null;
- }
- const menuTree = createDataTree(menuItems);
- const blocks = mapMenuItemsToBlocks(menuTree);
- return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems);
- }
- /**
- * A recursive function that maps menu item nodes to blocks.
- *
- * @param {WPNavMenuItem[]} menuItems An array of WPNavMenuItem items.
- * @return {Object} Object containing innerBlocks and mapping.
- */
- function mapMenuItemsToBlocks(menuItems) {
- let mapping = {}; // The menuItem should be in menu_order sort order.
- const sortedItems = (0,external_lodash_namespaceObject.sortBy)(menuItems, 'menu_order');
- const innerBlocks = sortedItems.map(menuItem => {
- var _menuItem$children, _menuItem$children2;
- if (menuItem.type === 'block') {
- const [block] = (0,external_wp_blocks_namespaceObject.parse)(menuItem.content.raw);
- if (!block) {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', {
- content: menuItem.content
- });
- }
- return block;
- }
- const attributes = menuItemToBlockAttributes(menuItem); // If there are children recurse to build those nested blocks.
- const {
- innerBlocks: nestedBlocks = [],
- // alias to avoid shadowing
- mapping: nestedMapping = {} // alias to avoid shadowing
- } = (_menuItem$children = menuItem.children) !== null && _menuItem$children !== void 0 && _menuItem$children.length ? mapMenuItemsToBlocks(menuItem.children) : {}; // Update parent mapping with nested mapping.
- mapping = { ...mapping,
- ...nestedMapping
- };
- const blockType = (_menuItem$children2 = menuItem.children) !== null && _menuItem$children2 !== void 0 && _menuItem$children2.length ? 'core/navigation-submenu' : 'core/navigation-link'; // Create block with nested "innerBlocks".
- const block = (0,external_wp_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); // Create mapping for menuItem -> block.
- mapping[menuItem.id] = block.clientId;
- return block;
- });
- return {
- innerBlocks,
- mapping
- };
- }
- /**
- * A WP nav_menu_item object.
- * For more documentation on the individual fields present on a menu item please see:
- * https://core.trac.wordpress.org/browser/tags/5.7.1/src/wp-includes/nav-menu.php#L789
- *
- * Changes made here should also be mirrored in packages/edit-navigation/src/store/utils.js.
- *
- * @typedef WPNavMenuItem
- *
- * @property {Object} title stores the raw and rendered versions of the title/label for this menu item.
- * @property {Array} xfn the XFN relationships expressed in the link of this menu item.
- * @property {Array} classes the HTML class attributes for this menu item.
- * @property {string} attr_title the HTML title attribute for this menu item.
- * @property {string} object The type of object originally represented, such as 'category', 'post', or 'attachment'.
- * @property {string} object_id The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.
- * @property {string} description The description of this menu item.
- * @property {string} url The URL to which this menu item points.
- * @property {string} type The family of objects originally represented, such as 'post_type' or 'taxonomy'.
- * @property {string} target The target attribute of the link element for this menu item.
- */
- /**
- * Convert block attributes to menu item.
- *
- * @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes.
- * @return {Object} the block attributes converted from the WPNavMenuItem item.
- */
- function menuItemToBlockAttributes(_ref) {
- var _object;
- let {
- title: menuItemTitleField,
- xfn,
- classes,
- // eslint-disable-next-line camelcase
- attr_title,
- object,
- // eslint-disable-next-line camelcase
- object_id,
- description,
- url,
- type: menuItemTypeField,
- target
- } = _ref;
- // For historical reasons, the `core/navigation-link` variation type is `tag`
- // whereas WP Core expects `post_tag` as the `object` type.
- // To avoid writing a block migration we perform a conversion here.
- // See also inverse equivalent in `blockAttributesToMenuItem`.
- if (object && object === 'post_tag') {
- object = 'tag';
- }
- return {
- label: (menuItemTitleField === null || menuItemTitleField === void 0 ? void 0 : menuItemTitleField.rendered) || '',
- ...(((_object = object) === null || _object === void 0 ? void 0 : _object.length) && {
- type: object
- }),
- kind: (menuItemTypeField === null || menuItemTypeField === void 0 ? void 0 : menuItemTypeField.replace('_', '-')) || 'custom',
- url: url || '',
- ...((xfn === null || xfn === void 0 ? void 0 : xfn.length) && xfn.join(' ').trim() && {
- rel: xfn.join(' ').trim()
- }),
- ...((classes === null || classes === void 0 ? void 0 : classes.length) && classes.join(' ').trim() && {
- className: classes.join(' ').trim()
- }),
- /* eslint-disable camelcase */
- ...((attr_title === null || attr_title === void 0 ? void 0 : attr_title.length) && {
- title: attr_title
- }),
- ...(object_id && 'custom' !== object && {
- id: object_id
- }),
- /* eslint-enable camelcase */
- ...((description === null || description === void 0 ? void 0 : description.length) && {
- description
- }),
- ...(target === '_blank' && {
- opensInNewTab: true
- })
- };
- }
- /**
- * Creates a nested, hierarchical tree representation from unstructured data that
- * has an inherent relationship defined between individual items.
- *
- * For example, by default, each element in the dataset should have an `id` and
- * `parent` property where the `parent` property indicates a relationship between
- * the current item and another item with a matching `id` properties.
- *
- * This is useful for building linked lists of data from flat data structures.
- *
- * @param {Array} dataset linked data to be rearranged into a hierarchical tree based on relational fields.
- * @param {string} id the property which uniquely identifies each entry within the array.
- * @param {*} relation the property which identifies how the current item is related to other items in the data (if at all).
- * @return {Array} a nested array of parent/child relationships
- */
- function createDataTree(dataset) {
- let id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
- let relation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'parent';
- const hashTable = Object.create(null);
- const dataTree = [];
- for (const data of dataset) {
- hashTable[data[id]] = { ...data,
- children: []
- };
- if (data[relation]) {
- hashTable[data[relation]] = hashTable[data[relation]] || {};
- hashTable[data[relation]].children = hashTable[data[relation]].children || [];
- hashTable[data[relation]].children.push(hashTable[data[id]]);
- } else {
- dataTree.push(hashTable[data[id]]);
- }
- }
- return dataTree;
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const CLASSIC_MENU_CONVERSION_SUCCESS = 'success';
- const CLASSIC_MENU_CONVERSION_ERROR = 'error';
- const CLASSIC_MENU_CONVERSION_PENDING = 'pending';
- const CLASSIC_MENU_CONVERSION_IDLE = 'idle';
- function useConvertClassicToBlockMenu(clientId) {
- const {
- create: createNavigationMenu
- } = useCreateNavigationMenu(clientId);
- const registry = (0,external_wp_data_namespaceObject.useRegistry)();
- const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CLASSIC_MENU_CONVERSION_IDLE);
- const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(null);
- const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
- async function convertClassicMenuToBlockMenu(menuId, menuName) {
- let navigationMenu;
- let classicMenuItems; // 1. Fetch the classic Menu items.
- try {
- classicMenuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems({
- menus: menuId,
- per_page: -1,
- context: 'view'
- });
- } catch (err) {
- throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
- (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName), {
- cause: err
- });
- } // Handle offline response which resolves to `null`.
- if (classicMenuItems === null) {
- throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
- (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName));
- } // 2. Convert the classic items into blocks.
- const {
- innerBlocks
- } = menuItemsToBlocks(classicMenuItems); // 3. Create the `wp_navigation` Post with the blocks.
- try {
- navigationMenu = await createNavigationMenu(menuName, innerBlocks);
- } catch (err) {
- throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
- (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
- cause: err
- });
- }
- return navigationMenu;
- }
- const convert = (0,external_wp_element_namespaceObject.useCallback)((menuId, menuName) => {
- if (!menuId || !menuName) {
- setError('Unable to convert menu. Missing menu details.');
- setStatus(CLASSIC_MENU_CONVERSION_ERROR);
- return;
- }
- setStatus(CLASSIC_MENU_CONVERSION_PENDING);
- setValue(null);
- setError(null);
- convertClassicMenuToBlockMenu(menuId, menuName).then(navMenu => {
- setValue(navMenu);
- setStatus(CLASSIC_MENU_CONVERSION_SUCCESS);
- }).catch(err => {
- setError(err === null || err === void 0 ? void 0 : err.message);
- setStatus(CLASSIC_MENU_CONVERSION_ERROR); // Rethrow error for debugging.
- throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
- (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
- cause: err
- });
- });
- }, [clientId]);
- return {
- convert,
- status,
- value,
- error
- };
- }
- /* harmony default export */ var use_convert_classic_menu_to_block_menu = (useConvertClassicToBlockMenu);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/index.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const EMPTY_ARRAY = [];
- function getComputedStyle(node) {
- return node.ownerDocument.defaultView.getComputedStyle(node);
- }
- function detectColors(colorsDetectionElement, setColor, setBackground) {
- if (!colorsDetectionElement) {
- return;
- }
- setColor(getComputedStyle(colorsDetectionElement).color);
- let backgroundColorNode = colorsDetectionElement;
- let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
- while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) {
- backgroundColorNode = backgroundColorNode.parentNode;
- backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
- }
- setBackground(backgroundColor);
- }
- function Navigation(_ref) {
- var _attributes$style, _attributes$style$typ;
- let {
- attributes,
- setAttributes,
- clientId,
- isSelected,
- className,
- backgroundColor,
- setBackgroundColor,
- textColor,
- setTextColor,
- overlayBackgroundColor,
- setOverlayBackgroundColor,
- overlayTextColor,
- setOverlayTextColor,
- // These props are used by the navigation editor to override specific
- // navigation block settings.
- hasSubmenuIndicatorSetting = true,
- hasColorSettings = true,
- customPlaceholder: CustomPlaceholder = null
- } = _ref;
- const {
- openSubmenusOnClick,
- overlayMenu,
- showSubmenuIcon,
- layout: {
- justifyContent,
- orientation = 'horizontal',
- flexWrap = 'wrap'
- } = {},
- hasIcon
- } = attributes;
- const ref = attributes.ref;
- const registry = (0,external_wp_data_namespaceObject.useRegistry)();
- const setRef = postId => {
- setAttributes({
- ref: postId
- });
- };
- const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(`navigationMenu/${ref}`); // Preload classic menus, so that they don't suddenly pop-in when viewing
- // the Select Menu dropdown.
- useNavigationEntities();
- const [showNavigationMenuDeleteNotice] = use_navigation_notice({
- name: 'block-library/core/navigation/delete'
- });
- const [showNavigationMenuCreateNotice, hideNavigationMenuCreateNotice] = use_navigation_notice({
- name: 'block-library/core/navigation/create'
- });
- const {
- create: createNavigationMenu,
- status: createNavigationMenuStatus,
- error: createNavigationMenuError,
- value: createNavigationMenuPost
- } = useCreateNavigationMenu(clientId);
- const isCreatingNavigationMenu = createNavigationMenuStatus === CREATE_NAVIGATION_MENU_PENDING;
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- hideNavigationMenuCreateNotice();
- if (createNavigationMenuStatus === CREATE_NAVIGATION_MENU_PENDING) {
- (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)(`Creating Navigation Menu.`));
- }
- if (createNavigationMenuStatus === CREATE_NAVIGATION_MENU_SUCCESS) {
- setRef(createNavigationMenuPost.id);
- selectBlock(clientId);
- showNavigationMenuCreateNotice((0,external_wp_i18n_namespaceObject.__)(`Navigation Menu successfully created.`));
- }
- if (createNavigationMenuStatus === CREATE_NAVIGATION_MENU_ERROR) {
- showNavigationMenuCreateNotice((0,external_wp_i18n_namespaceObject.__)('Failed to create Navigation Menu.'));
- }
- }, [createNavigationMenu, createNavigationMenuStatus, createNavigationMenuError, createNavigationMenuPost]);
- const {
- hasUncontrolledInnerBlocks,
- uncontrolledInnerBlocks,
- isInnerBlockSelected,
- hasSubmenus
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlock,
- getBlocks,
- hasSelectedInnerBlock
- } = select(external_wp_blockEditor_namespaceObject.store); // This relies on the fact that `getBlock` won't return controlled
- // inner blocks, while `getBlocks` does. It might be more stable to
- // introduce a selector like `getUncontrolledInnerBlocks`, just in
- // case `getBlock` is fixed.
- const _uncontrolledInnerBlocks = getBlock(clientId).innerBlocks;
- const _hasUncontrolledInnerBlocks = !!(_uncontrolledInnerBlocks !== null && _uncontrolledInnerBlocks !== void 0 && _uncontrolledInnerBlocks.length);
- const _controlledInnerBlocks = _hasUncontrolledInnerBlocks ? EMPTY_ARRAY : getBlocks(clientId);
- const innerBlocks = _hasUncontrolledInnerBlocks ? _uncontrolledInnerBlocks : _controlledInnerBlocks;
- return {
- hasSubmenus: !!innerBlocks.find(block => block.name === 'core/navigation-submenu'),
- hasUncontrolledInnerBlocks: _hasUncontrolledInnerBlocks,
- uncontrolledInnerBlocks: _uncontrolledInnerBlocks,
- isInnerBlockSelected: hasSelectedInnerBlock(clientId, true)
- };
- }, [clientId]);
- const {
- replaceInnerBlocks,
- selectBlock,
- __unstableMarkNextChangeAsNotPersistent
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const [hasSavedUnsavedInnerBlocks, setHasSavedUnsavedInnerBlocks] = (0,external_wp_element_namespaceObject.useState)(false);
- const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = (0,external_wp_element_namespaceObject.useState)(false);
- const [overlayMenuPreview, setOverlayMenuPreview] = (0,external_wp_element_namespaceObject.useState)(false);
- const {
- hasResolvedNavigationMenus,
- isNavigationMenuResolved,
- isNavigationMenuMissing,
- navigationMenus,
- navigationMenu,
- canUserUpdateNavigationMenu,
- hasResolvedCanUserUpdateNavigationMenu,
- canUserDeleteNavigationMenu,
- hasResolvedCanUserDeleteNavigationMenu,
- canUserCreateNavigationMenu,
- isResolvingCanUserCreateNavigationMenu,
- hasResolvedCanUserCreateNavigationMenu
- } = useNavigationMenu(ref); // Attempt to retrieve and prioritize any existing navigation menu unless
- // a specific ref is allocated or the user is explicitly creating a new menu. The aim is
- // for the block to "just work" from a user perspective using existing data.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (isCreatingNavigationMenu || ref || !(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length) || (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 1) {
- return;
- }
- setRef(navigationMenus[0].id);
- }, [navigationMenus]);
- const navRef = (0,external_wp_element_namespaceObject.useRef)();
- const isDraftNavigationMenu = (navigationMenu === null || navigationMenu === void 0 ? void 0 : navigationMenu.status) === 'draft';
- const {
- convert,
- status: classicMenuConversionStatus,
- error: classicMenuConversionError,
- value: classicMenuConversionResult
- } = use_convert_classic_menu_to_block_menu(clientId);
- const isConvertingClassicMenu = classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING; // The standard HTML5 tag for the block wrapper.
- const TagName = 'nav'; // "placeholder" shown if:
- // - there is no ref attribute pointing to a Navigation Post.
- // - there is no classic menu conversion process in progress.
- // - there is no menu creation process in progress.
- // - there are no uncontrolled blocks.
- const isPlaceholder = !ref && !isCreatingNavigationMenu && !isConvertingClassicMenu && hasResolvedNavigationMenus && !hasUncontrolledInnerBlocks;
- const isEntityAvailable = !isNavigationMenuMissing && isNavigationMenuResolved; // "loading" state:
- // - there is a menu creation process in progress.
- // - there is a classic menu conversion process in progress.
- // OR
- // - there is a ref attribute pointing to a Navigation Post
- // - the Navigation Post isn't available (hasn't resolved) yet.
- const isLoading = !hasResolvedNavigationMenus || isCreatingNavigationMenu || isConvertingClassicMenu || !!(ref && !isEntityAvailable && !isConvertingClassicMenu);
- const textDecoration = (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$typ = _attributes$style.typography) === null || _attributes$style$typ === void 0 ? void 0 : _attributes$style$typ.textDecoration;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- ref: navRef,
- className: classnames_default()(className, {
- 'items-justified-right': justifyContent === 'right',
- 'items-justified-space-between': justifyContent === 'space-between',
- 'items-justified-left': justifyContent === 'left',
- 'items-justified-center': justifyContent === 'center',
- 'is-vertical': orientation === 'vertical',
- 'no-wrap': flexWrap === 'nowrap',
- 'is-responsive': 'never' !== overlayMenu,
- 'has-text-color': !!textColor.color || !!(textColor !== null && textColor !== void 0 && textColor.class),
- [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor === null || textColor === void 0 ? void 0 : textColor.slug)]: !!(textColor !== null && textColor !== void 0 && textColor.slug),
- 'has-background': !!backgroundColor.color || backgroundColor.class,
- [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor === null || backgroundColor === void 0 ? void 0 : backgroundColor.slug)]: !!(backgroundColor !== null && backgroundColor !== void 0 && backgroundColor.slug),
- [`has-text-decoration-${textDecoration}`]: textDecoration
- }),
- style: {
- color: !(textColor !== null && textColor !== void 0 && textColor.slug) && (textColor === null || textColor === void 0 ? void 0 : textColor.color),
- backgroundColor: !(backgroundColor !== null && backgroundColor !== void 0 && backgroundColor.slug) && (backgroundColor === null || backgroundColor === void 0 ? void 0 : backgroundColor.color)
- }
- });
- const overlayClassnames = classnames_default()({
- 'has-text-color': !!overlayTextColor.color || !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.class),
- [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.slug)]: !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug),
- 'has-background': !!overlayBackgroundColor.color || (overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.class),
- [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.slug)]: !!(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug)
- });
- const overlayStyles = {
- color: !(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug) && (overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.color),
- backgroundColor: !(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug) && (overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.color) && overlayBackgroundColor.color
- }; // Turn on contrast checker for web only since it's not supported on mobile yet.
- const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web';
- const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
- const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)();
- const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
- const [detectedOverlayColor, setDetectedOverlayColor] = (0,external_wp_element_namespaceObject.useState)();
- const [showClassicMenuConversionErrorNotice, hideClassicMenuConversionErrorNotice] = use_navigation_notice({
- name: 'block-library/core/navigation/classic-menu-conversion/error'
- });
- function handleUpdateMenu(menuId) {
- setRef(menuId);
- selectBlock(clientId);
- }
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING) {
- (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu importing.'));
- }
- if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_SUCCESS && classicMenuConversionResult) {
- handleUpdateMenu(classicMenuConversionResult === null || classicMenuConversionResult === void 0 ? void 0 : classicMenuConversionResult.id);
- hideClassicMenuConversionErrorNotice();
- (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu imported successfully.'));
- }
- if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR) {
- showClassicMenuConversionErrorNotice(classicMenuConversionError);
- (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu import failed.'));
- }
- }, [classicMenuConversionStatus, classicMenuConversionResult, classicMenuConversionError]); // Spacer block needs orientation from context. This is a patch until
- // https://github.com/WordPress/gutenberg/issues/36197 is addressed.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (orientation) {
- __unstableMarkNextChangeAsNotPersistent();
- setAttributes({
- orientation
- });
- }
- }, [orientation]);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- var _navRef$current;
- if (!enableContrastChecking) {
- return;
- }
- detectColors(navRef.current, setDetectedColor, setDetectedBackgroundColor);
- const subMenuElement = (_navRef$current = navRef.current) === null || _navRef$current === void 0 ? void 0 : _navRef$current.querySelector('[data-type="core/navigation-link"] [data-type="core/navigation-link"]');
- if (subMenuElement) {
- detectColors(subMenuElement, setDetectedOverlayColor, setDetectedOverlayBackgroundColor);
- }
- });
- const [showCantEditNotice, hideCantEditNotice] = use_navigation_notice({
- name: 'block-library/core/navigation/permissions/update',
- message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to edit this Menu. Any changes made will not be saved.')
- });
- const [showCantCreateNotice, hideCantCreateNotice] = use_navigation_notice({
- name: 'block-library/core/navigation/permissions/create',
- message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Navigation Menus.')
- });
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isSelected && !isInnerBlockSelected) {
- hideCantEditNotice();
- hideCantCreateNotice();
- }
- if (isSelected || isInnerBlockSelected) {
- if (hasResolvedCanUserUpdateNavigationMenu && !canUserUpdateNavigationMenu) {
- showCantEditNotice();
- }
- if (!ref && hasResolvedCanUserCreateNavigationMenu && !canUserCreateNavigationMenu) {
- showCantCreateNotice();
- }
- }
- }, [isSelected, isInnerBlockSelected, canUserUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu, canUserCreateNavigationMenu, hasResolvedCanUserCreateNavigationMenu, ref]);
- const navigationSelectorRef = (0,external_wp_element_namespaceObject.useRef)();
- const [shouldFocusNavigationSelector, setShouldFocusNavigationSelector] = (0,external_wp_element_namespaceObject.useState)(false);
- const handleSelectNavigation = (0,external_wp_element_namespaceObject.useCallback)(navPostOrClassicMenu => {
- if (!navPostOrClassicMenu) {
- return;
- }
- const isClassicMenu = navPostOrClassicMenu.hasOwnProperty('auto_add');
- if (isClassicMenu) {
- convert(navPostOrClassicMenu.id, navPostOrClassicMenu.name);
- } else {
- handleUpdateMenu(navPostOrClassicMenu.id);
- }
- setShouldFocusNavigationSelector(true);
- }, [convert, handleUpdateMenu]); // Focus support after menu selection.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- var _navigationSelectorRe;
- if (isDraftNavigationMenu || !isEntityAvailable || !shouldFocusNavigationSelector) {
- return;
- }
- navigationSelectorRef === null || navigationSelectorRef === void 0 ? void 0 : (_navigationSelectorRe = navigationSelectorRef.current) === null || _navigationSelectorRe === void 0 ? void 0 : _navigationSelectorRe.focus();
- setShouldFocusNavigationSelector(false);
- }, [isDraftNavigationMenu, isEntityAvailable, shouldFocusNavigationSelector]);
- const resetToEmptyBlock = (0,external_wp_element_namespaceObject.useCallback)(() => {
- registry.batch(() => {
- setAttributes({
- ref: undefined
- });
- if (!ref) {
- replaceInnerBlocks(clientId, []);
- }
- });
- }, [clientId, ref]);
- const isResponsive = 'never' !== overlayMenu;
- const overlayMenuPreviewClasses = classnames_default()('wp-block-navigation__overlay-menu-preview', {
- open: overlayMenuPreview
- });
- const stylingInspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, hasSubmenuIndicatorSetting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Display')
- }, isResponsive && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- className: overlayMenuPreviewClasses,
- onClick: () => {
- setOverlayMenuPreview(!overlayMenuPreview);
- }
- }, hasIcon && (0,external_wp_element_namespaceObject.createElement)(OverlayMenuIcon, null), !hasIcon && (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Menu'))), overlayMenuPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show icon button'),
- help: (0,external_wp_i18n_namespaceObject.__)('Configure the visual appearance of the button opening the overlay menu.'),
- onChange: value => setAttributes({
- hasIcon: value
- }),
- checked: hasIcon
- }), (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Overlay Menu')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Configure overlay menu'),
- value: overlayMenu,
- help: (0,external_wp_i18n_namespaceObject.__)('Collapses the navigation options in a menu icon opening an overlay.'),
- onChange: value => setAttributes({
- overlayMenu: value
- }),
- isBlock: true,
- hideLabelFromVision: true
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "never",
- label: (0,external_wp_i18n_namespaceObject.__)('Off')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "mobile",
- label: (0,external_wp_i18n_namespaceObject.__)('Mobile')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "always",
- label: (0,external_wp_i18n_namespaceObject.__)('Always')
- })), hasSubmenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Submenus')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- checked: openSubmenusOnClick,
- onChange: value => {
- setAttributes({
- openSubmenusOnClick: value,
- ...(value && {
- showSubmenuIcon: true
- }) // Make sure arrows are shown when we toggle this on.
- });
- },
- label: (0,external_wp_i18n_namespaceObject.__)('Open on click')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- checked: showSubmenuIcon,
- onChange: value => {
- setAttributes({
- showSubmenuIcon: value
- });
- },
- disabled: attributes.openSubmenusOnClick,
- label: (0,external_wp_i18n_namespaceObject.__)('Show arrow')
- }))), hasColorSettings && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PanelColorSettings, {
- __experimentalHasMultipleOrigins: true,
- __experimentalIsRenderedInSidebar: true,
- title: (0,external_wp_i18n_namespaceObject.__)('Color'),
- initialOpen: false,
- colorSettings: [{
- value: textColor.color,
- onChange: setTextColor,
- label: (0,external_wp_i18n_namespaceObject.__)('Text')
- }, {
- value: backgroundColor.color,
- onChange: setBackgroundColor,
- label: (0,external_wp_i18n_namespaceObject.__)('Background')
- }, {
- value: overlayTextColor.color,
- onChange: setOverlayTextColor,
- label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay text')
- }, {
- value: overlayBackgroundColor.color,
- onChange: setOverlayBackgroundColor,
- label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay background')
- }]
- }, enableContrastChecking && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
- backgroundColor: detectedBackgroundColor,
- textColor: detectedColor
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
- backgroundColor: detectedOverlayBackgroundColor,
- textColor: detectedOverlayColor
- })))); // If the block has inner blocks, but no menu id, then these blocks are either:
- // - inserted via a pattern.
- // - inserted directly via Code View (or otherwise).
- // - from an older version of navigation block added before the block used a wp_navigation entity.
- // Consider this state as 'unsaved' and offer an uncontrolled version of inner blocks,
- // that automatically saves the menu as an entity when changes are made to the inner blocks.
- const hasUnsavedBlocks = hasUncontrolledInnerBlocks && !isEntityAvailable;
- if (hasUnsavedBlocks) {
- return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, stylingInspectorControls, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
- id: clientId,
- onToggle: setResponsiveMenuVisibility,
- isOpen: isResponsiveMenuOpen,
- isResponsive: 'never' !== overlayMenu,
- isHiddenByDefault: 'always' === overlayMenu,
- classNames: overlayClassnames,
- styles: overlayStyles
- }, (0,external_wp_element_namespaceObject.createElement)(UnsavedInnerBlocks, {
- blockProps: blockProps,
- blocks: uncontrolledInnerBlocks,
- clientId: clientId,
- navigationMenus: navigationMenus,
- hasSelection: isSelected || isInnerBlockSelected,
- hasSavedUnsavedInnerBlocks: hasSavedUnsavedInnerBlocks,
- onSave: post => {
- // Set some state used as a guard to prevent the creation of multiple posts.
- setHasSavedUnsavedInnerBlocks(true); // Switch to using the wp_navigation entity.
- setRef(post.id);
- showNavigationMenuCreateNotice((0,external_wp_i18n_namespaceObject.__)(`New Navigation Menu created.`));
- }
- })));
- } // Show a warning if the selected menu is no longer available.
- // TODO - the user should be able to select a new one?
- if (ref && isNavigationMenuMissing) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Navigation menu has been deleted or is unavailable. '), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- onClick: resetToEmptyBlock,
- variant: "link"
- }, (0,external_wp_i18n_namespaceObject.__)('Create a new menu?'))));
- }
- if (isEntityAvailable && hasAlreadyRendered) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
- }
- const PlaceholderComponent = CustomPlaceholder ? CustomPlaceholder : NavigationPlaceholder;
- if (isPlaceholder) {
- return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(PlaceholderComponent, {
- isSelected: isSelected,
- currentMenuId: ref,
- clientId: clientId,
- canUserCreateNavigationMenu: canUserCreateNavigationMenu,
- isResolvingCanUserCreateNavigationMenu: isResolvingCanUserCreateNavigationMenu,
- onFinish: handleSelectNavigation,
- onCreateEmpty: () => createNavigationMenu('', [])
- }));
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_coreData_namespaceObject.EntityProvider, {
- kind: "postType",
- type: "wp_navigation",
- id: ref
- }, (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, !isDraftNavigationMenu && isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
- className: "wp-block-navigation__toolbar-menu-selector"
- }, (0,external_wp_element_namespaceObject.createElement)(navigation_menu_selector, {
- ref: navigationSelectorRef,
- currentMenuId: ref,
- clientId: clientId,
- onSelect: handleSelectNavigation,
- onCreateNew: resetToEmptyBlock
- /* translators: %s: The name of a menu. */
- ,
- actionLabel: (0,external_wp_i18n_namespaceObject.__)("Switch to '%s'"),
- showManageActions: true
- }))), stylingInspectorControls, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "advanced"
- }, hasResolvedCanUserUpdateNavigationMenu && canUserUpdateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuNameControl, null), hasResolvedCanUserDeleteNavigationMenu && canUserDeleteNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuDeleteControl, {
- onDelete: function () {
- let deletedMenuTitle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- resetToEmptyBlock();
- showNavigationMenuDeleteNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
- (0,external_wp_i18n_namespaceObject.__)('Navigation menu %s successfully deleted.'), deletedMenuTitle));
- }
- })), isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, {
- className: "wp-block-navigation__loading-indicator"
- })), !isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
- id: clientId,
- onToggle: setResponsiveMenuVisibility,
- label: (0,external_wp_i18n_namespaceObject.__)('Menu'),
- hasIcon: hasIcon,
- isOpen: isResponsiveMenuOpen,
- isResponsive: isResponsive,
- isHiddenByDefault: 'always' === overlayMenu,
- classNames: overlayClassnames,
- styles: overlayStyles
- }, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(NavigationInnerBlocks, {
- clientId: clientId,
- hasCustomPlaceholder: !!CustomPlaceholder,
- orientation: orientation
- })))));
- }
- /* harmony default export */ var navigation_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)({
- textColor: 'color'
- }, {
- backgroundColor: 'color'
- }, {
- overlayBackgroundColor: 'color'
- }, {
- overlayTextColor: 'color'
- })(Navigation));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/save.js
- /**
- * WordPress dependencies
- */
- function navigation_save_save(_ref) {
- let {
- attributes
- } = _ref;
- if (attributes.ref) {
- // Avoid rendering inner blocks when a ref is defined.
- // When this id is defined the inner blocks are loaded from the
- // `wp_navigation` entity rather than the hard-coded block html.
- return;
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const TYPOGRAPHY_PRESET_DEPRECATION_MAP = {
- fontStyle: 'var:preset|font-style|',
- fontWeight: 'var:preset|font-weight|',
- textDecoration: 'var:preset|text-decoration|',
- textTransform: 'var:preset|text-transform|'
- };
- const migrateIdToRef = _ref => {
- let {
- navigationMenuId,
- ...attributes
- } = _ref;
- return { ...attributes,
- ref: navigationMenuId
- };
- };
- const deprecated_migrateWithLayout = attributes => {
- if (!!attributes.layout) {
- return attributes;
- }
- const {
- itemsJustification,
- orientation,
- ...updatedAttributes
- } = attributes;
- if (itemsJustification || orientation) {
- Object.assign(updatedAttributes, {
- layout: {
- type: 'flex',
- ...(itemsJustification && {
- justifyContent: itemsJustification
- }),
- ...(orientation && {
- orientation
- })
- }
- });
- }
- return updatedAttributes;
- };
- const navigation_deprecated_v6 = {
- attributes: {
- navigationMenuId: {
- type: 'number'
- },
- textColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- },
- rgbTextColor: {
- type: 'string'
- },
- backgroundColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- rgbBackgroundColor: {
- type: 'string'
- },
- showSubmenuIcon: {
- type: 'boolean',
- default: true
- },
- openSubmenusOnClick: {
- type: 'boolean',
- default: false
- },
- overlayMenu: {
- type: 'string',
- default: 'mobile'
- },
- __unstableLocation: {
- type: 'string'
- },
- overlayBackgroundColor: {
- type: 'string'
- },
- customOverlayBackgroundColor: {
- type: 'string'
- },
- overlayTextColor: {
- type: 'string'
- },
- customOverlayTextColor: {
- type: 'string'
- }
- },
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- html: false,
- inserter: true,
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalTextTransform: true,
- __experimentalFontFamily: true,
- __experimentalTextDecoration: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- spacing: {
- blockGap: true,
- units: ['px', 'em', 'rem', 'vh', 'vw'],
- __experimentalDefaultControls: {
- blockGap: true
- }
- },
- __experimentalLayout: {
- allowSwitching: false,
- allowInheriting: false,
- default: {
- type: 'flex'
- }
- }
- },
- save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- },
- isEligible: _ref2 => {
- let {
- navigationMenuId
- } = _ref2;
- return !!navigationMenuId;
- },
- migrate: migrateIdToRef
- };
- const navigation_deprecated_v5 = {
- attributes: {
- navigationMenuId: {
- type: 'number'
- },
- orientation: {
- type: 'string',
- default: 'horizontal'
- },
- textColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- },
- rgbTextColor: {
- type: 'string'
- },
- backgroundColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- rgbBackgroundColor: {
- type: 'string'
- },
- itemsJustification: {
- type: 'string'
- },
- showSubmenuIcon: {
- type: 'boolean',
- default: true
- },
- openSubmenusOnClick: {
- type: 'boolean',
- default: false
- },
- overlayMenu: {
- type: 'string',
- default: 'never'
- },
- __unstableLocation: {
- type: 'string'
- },
- overlayBackgroundColor: {
- type: 'string'
- },
- customOverlayBackgroundColor: {
- type: 'string'
- },
- overlayTextColor: {
- type: 'string'
- },
- customOverlayTextColor: {
- type: 'string'
- }
- },
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- html: false,
- inserter: true,
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalTextTransform: true,
- __experimentalFontFamily: true,
- __experimentalTextDecoration: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- spacing: {
- blockGap: true,
- units: ['px', 'em', 'rem', 'vh', 'vw'],
- __experimentalDefaultControls: {
- blockGap: true
- }
- }
- },
- save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- },
- isEligible: _ref3 => {
- let {
- itemsJustification,
- orientation
- } = _ref3;
- return !!itemsJustification || !!orientation;
- },
- migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout)
- };
- const navigation_deprecated_v4 = {
- attributes: {
- orientation: {
- type: 'string',
- default: 'horizontal'
- },
- textColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- },
- rgbTextColor: {
- type: 'string'
- },
- backgroundColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- rgbBackgroundColor: {
- type: 'string'
- },
- itemsJustification: {
- type: 'string'
- },
- showSubmenuIcon: {
- type: 'boolean',
- default: true
- },
- openSubmenusOnClick: {
- type: 'boolean',
- default: false
- },
- overlayMenu: {
- type: 'string',
- default: 'never'
- },
- __unstableLocation: {
- type: 'string'
- },
- overlayBackgroundColor: {
- type: 'string'
- },
- customOverlayBackgroundColor: {
- type: 'string'
- },
- overlayTextColor: {
- type: 'string'
- },
- customOverlayTextColor: {
- type: 'string'
- }
- },
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- html: false,
- inserter: true,
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalTextTransform: true,
- __experimentalFontFamily: true,
- __experimentalTextDecoration: true
- },
- spacing: {
- blockGap: true,
- units: ['px', 'em', 'rem', 'vh', 'vw'],
- __experimentalDefaultControls: {
- blockGap: true
- }
- }
- },
- save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- },
- migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family),
- isEligible(_ref4) {
- var _style$typography;
- let {
- style
- } = _ref4;
- return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
- }
- };
- const migrateIsResponsive = function (attributes) {
- delete attributes.isResponsive;
- return { ...attributes,
- overlayMenu: 'mobile'
- };
- };
- const migrateTypographyPresets = function (attributes) {
- return { ...attributes,
- style: { ...attributes.style,
- typography: (0,external_lodash_namespaceObject.mapValues)(attributes.style.typography, (value, key) => {
- const prefix = TYPOGRAPHY_PRESET_DEPRECATION_MAP[key];
- if (prefix && value.startsWith(prefix)) {
- const newValue = value.slice(prefix.length);
- if ('textDecoration' === key && 'strikethrough' === newValue) {
- return 'line-through';
- }
- return newValue;
- }
- return value;
- })
- }
- };
- };
- const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_deprecated_v5, navigation_deprecated_v4, // Remove `isResponsive` attribute.
- {
- attributes: {
- orientation: {
- type: 'string',
- default: 'horizontal'
- },
- textColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- },
- rgbTextColor: {
- type: 'string'
- },
- backgroundColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- rgbBackgroundColor: {
- type: 'string'
- },
- itemsJustification: {
- type: 'string'
- },
- showSubmenuIcon: {
- type: 'boolean',
- default: true
- },
- openSubmenusOnClick: {
- type: 'boolean',
- default: false
- },
- isResponsive: {
- type: 'boolean',
- default: 'false'
- },
- __unstableLocation: {
- type: 'string'
- },
- overlayBackgroundColor: {
- type: 'string'
- },
- customOverlayBackgroundColor: {
- type: 'string'
- },
- overlayTextColor: {
- type: 'string'
- },
- customOverlayTextColor: {
- type: 'string'
- }
- },
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- html: false,
- inserter: true,
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalTextTransform: true,
- __experimentalFontFamily: true,
- __experimentalTextDecoration: true
- }
- },
- isEligible(attributes) {
- return attributes.isResponsive;
- },
- migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateIsResponsive),
- save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- }, {
- attributes: {
- orientation: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- },
- rgbTextColor: {
- type: 'string'
- },
- backgroundColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- rgbBackgroundColor: {
- type: 'string'
- },
- itemsJustification: {
- type: 'string'
- },
- showSubmenuIcon: {
- type: 'boolean',
- default: true
- }
- },
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- html: false,
- inserter: true,
- fontSize: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalTextTransform: true,
- color: true,
- __experimentalFontFamily: true,
- __experimentalTextDecoration: true
- },
- save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- },
- isEligible(attributes) {
- if (!attributes.style || !attributes.style.typography) {
- return false;
- }
- for (const styleAttribute in TYPOGRAPHY_PRESET_DEPRECATION_MAP) {
- const attributeValue = attributes.style.typography[styleAttribute];
- if (attributeValue && attributeValue.startsWith(TYPOGRAPHY_PRESET_DEPRECATION_MAP[styleAttribute])) {
- return true;
- }
- }
- return false;
- },
- migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateTypographyPresets)
- }, {
- attributes: {
- className: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- rgbTextColor: {
- type: 'string'
- },
- backgroundColor: {
- type: 'string'
- },
- rgbBackgroundColor: {
- type: 'string'
- },
- fontSize: {
- type: 'string'
- },
- customFontSize: {
- type: 'number'
- },
- itemsJustification: {
- type: 'string'
- },
- showSubmenuIcon: {
- type: 'boolean'
- }
- },
- isEligible(attribute) {
- return attribute.rgbTextColor || attribute.rgbBackgroundColor;
- },
- supports: {
- align: ['wide', 'full'],
- anchor: true,
- html: false,
- inserter: true
- },
- migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, attributes => {
- return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['rgbTextColor', 'rgbBackgroundColor']),
- customTextColor: attributes.textColor ? undefined : attributes.rgbTextColor,
- customBackgroundColor: attributes.backgroundColor ? undefined : attributes.rgbBackgroundColor
- };
- }),
- save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- }];
- /* harmony default export */ var navigation_deprecated = (navigation_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const navigation_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/navigation",
- title: "Navigation",
- category: "theme",
- description: "A collection of blocks that allow visitors to get around your site.",
- keywords: ["menu", "navigation", "links"],
- textdomain: "default",
- attributes: {
- ref: {
- type: "number"
- },
- textColor: {
- type: "string"
- },
- customTextColor: {
- type: "string"
- },
- rgbTextColor: {
- type: "string"
- },
- backgroundColor: {
- type: "string"
- },
- customBackgroundColor: {
- type: "string"
- },
- rgbBackgroundColor: {
- type: "string"
- },
- showSubmenuIcon: {
- type: "boolean",
- "default": true
- },
- openSubmenusOnClick: {
- type: "boolean",
- "default": false
- },
- overlayMenu: {
- type: "string",
- "default": "mobile"
- },
- hasIcon: {
- type: "boolean",
- "default": true
- },
- __unstableLocation: {
- type: "string"
- },
- overlayBackgroundColor: {
- type: "string"
- },
- customOverlayBackgroundColor: {
- type: "string"
- },
- overlayTextColor: {
- type: "string"
- },
- customOverlayTextColor: {
- type: "string"
- },
- maxNestingLevel: {
- type: "number",
- "default": 5
- }
- },
- providesContext: {
- textColor: "textColor",
- customTextColor: "customTextColor",
- backgroundColor: "backgroundColor",
- customBackgroundColor: "customBackgroundColor",
- overlayTextColor: "overlayTextColor",
- customOverlayTextColor: "customOverlayTextColor",
- overlayBackgroundColor: "overlayBackgroundColor",
- customOverlayBackgroundColor: "customOverlayBackgroundColor",
- fontSize: "fontSize",
- customFontSize: "customFontSize",
- showSubmenuIcon: "showSubmenuIcon",
- openSubmenusOnClick: "openSubmenusOnClick",
- style: "style",
- orientation: "orientation",
- maxNestingLevel: "maxNestingLevel"
- },
- supports: {
- align: ["wide", "full"],
- anchor: true,
- html: false,
- inserter: true,
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalTextTransform: true,
- __experimentalFontFamily: true,
- __experimentalTextDecoration: true,
- __experimentalSkipSerialization: ["textDecoration"],
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- spacing: {
- blockGap: true,
- units: ["px", "em", "rem", "vh", "vw"],
- __experimentalDefaultControls: {
- blockGap: true
- }
- },
- __experimentalLayout: {
- allowSwitching: false,
- allowInheriting: false,
- allowVerticalAlignment: false,
- "default": {
- type: "flex"
- }
- }
- },
- viewScript: "file:./view.min.js",
- editorStyle: "wp-block-navigation-editor",
- style: "wp-block-navigation"
- };
- const {
- name: navigation_name
- } = navigation_metadata;
- const navigation_settings = {
- icon: library_navigation,
- example: {
- innerBlocks: [{
- name: 'core/navigation-link',
- attributes: {
- // translators: 'Home' as in a website's home page.
- label: (0,external_wp_i18n_namespaceObject.__)('Home'),
- url: 'https://make.wordpress.org/'
- }
- }, {
- name: 'core/navigation-link',
- attributes: {
- // translators: 'About' as in a website's about page.
- label: (0,external_wp_i18n_namespaceObject.__)('About'),
- url: 'https://make.wordpress.org/'
- }
- }, {
- name: 'core/navigation-link',
- attributes: {
- // translators: 'Contact' as in a website's contact page.
- label: (0,external_wp_i18n_namespaceObject.__)('Contact'),
- url: 'https://make.wordpress.org/'
- }
- }]
- },
- edit: navigation_edit,
- save: navigation_save_save,
- deprecated: navigation_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-link.js
- /**
- * WordPress dependencies
- */
- const customLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "https://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"
- }));
- /* harmony default export */ var custom_link = (customLink);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-submenu.js
- /**
- * WordPress dependencies
- */
- const addSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"
- }));
- /* harmony default export */ var add_submenu = (addSubmenu);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const {
- name: edit_name
- } = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/navigation-link",
- title: "Custom Link",
- category: "design",
- parent: ["core/navigation"],
- description: "Add a page, link, or another item to your navigation.",
- textdomain: "default",
- attributes: {
- label: {
- type: "string"
- },
- type: {
- type: "string"
- },
- description: {
- type: "string"
- },
- rel: {
- type: "string"
- },
- id: {
- type: "number"
- },
- opensInNewTab: {
- type: "boolean",
- "default": false
- },
- url: {
- type: "string"
- },
- title: {
- type: "string"
- },
- kind: {
- type: "string"
- },
- isTopLevelLink: {
- type: "boolean"
- }
- },
- usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"],
- supports: {
- reusable: false,
- html: false,
- __experimentalSlashInserter: true
- },
- editorStyle: "wp-block-navigation-link-editor",
- style: "wp-block-navigation-link"
- };
- /**
- * A React hook to determine if it's dragging within the target element.
- *
- * @typedef {import('@wordpress/element').RefObject} RefObject
- *
- * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
- *
- * @return {boolean} Is dragging within the target element.
- */
- const useIsDraggingWithin = elementRef => {
- const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- const {
- ownerDocument
- } = elementRef.current;
- function handleDragStart(event) {
- // Check the first time when the dragging starts.
- handleDragEnter(event);
- } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
- function handleDragEnd() {
- setIsDraggingWithin(false);
- }
- function handleDragEnter(event) {
- // Check if the current target is inside the item element.
- if (elementRef.current.contains(event.target)) {
- setIsDraggingWithin(true);
- } else {
- setIsDraggingWithin(false);
- }
- } // Bind these events to the document to catch all drag events.
- // Ideally, we can also use `event.relatedTarget`, but sadly that
- // doesn't work in Safari.
- ownerDocument.addEventListener('dragstart', handleDragStart);
- ownerDocument.addEventListener('dragend', handleDragEnd);
- ownerDocument.addEventListener('dragenter', handleDragEnter);
- return () => {
- ownerDocument.removeEventListener('dragstart', handleDragStart);
- ownerDocument.removeEventListener('dragend', handleDragEnd);
- ownerDocument.removeEventListener('dragenter', handleDragEnter);
- };
- }, []);
- return isDraggingWithin;
- };
- /**
- * Given the Link block's type attribute, return the query params to give to
- * /wp/v2/search.
- *
- * @param {string} type Link block's type attribute.
- * @param {string} kind Link block's entity of kind (post-type|taxonomy)
- * @return {{ type?: string, subtype?: string }} Search query params.
- */
- function getSuggestionsQuery(type, kind) {
- switch (type) {
- case 'post':
- case 'page':
- return {
- type: 'post',
- subtype: type
- };
- case 'category':
- return {
- type: 'term',
- subtype: 'category'
- };
- case 'tag':
- return {
- type: 'term',
- subtype: 'post_tag'
- };
- case 'post_format':
- return {
- type: 'post-format'
- };
- default:
- if (kind === 'taxonomy') {
- return {
- type: 'term',
- subtype: type
- };
- }
- if (kind === 'post-type') {
- return {
- type: 'post',
- subtype: type
- };
- }
- return {};
- }
- }
- /**
- * Determine the colors for a menu.
- *
- * Order of priority is:
- * 1: Overlay custom colors (if submenu)
- * 2: Overlay theme colors (if submenu)
- * 3: Custom colors
- * 4: Theme colors
- * 5: Global styles
- *
- * @param {Object} context
- * @param {boolean} isSubMenu
- */
- function getColors(context, isSubMenu) {
- var _style$color, _style$color2;
- const {
- textColor,
- customTextColor,
- backgroundColor,
- customBackgroundColor,
- overlayTextColor,
- customOverlayTextColor,
- overlayBackgroundColor,
- customOverlayBackgroundColor,
- style
- } = context;
- const colors = {};
- if (isSubMenu && !!customOverlayTextColor) {
- colors.customTextColor = customOverlayTextColor;
- } else if (isSubMenu && !!overlayTextColor) {
- colors.textColor = overlayTextColor;
- } else if (!!customTextColor) {
- colors.customTextColor = customTextColor;
- } else if (!!textColor) {
- colors.textColor = textColor;
- } else if (!!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text)) {
- colors.customTextColor = style.color.text;
- }
- if (isSubMenu && !!customOverlayBackgroundColor) {
- colors.customBackgroundColor = customOverlayBackgroundColor;
- } else if (isSubMenu && !!overlayBackgroundColor) {
- colors.backgroundColor = overlayBackgroundColor;
- } else if (!!customBackgroundColor) {
- colors.customBackgroundColor = customBackgroundColor;
- } else if (!!backgroundColor) {
- colors.backgroundColor = backgroundColor;
- } else if (!!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background)) {
- colors.customTextColor = style.color.background;
- }
- return colors;
- }
- /**
- * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind
- */
- /**
- * Navigation Link Block Attributes
- *
- * @typedef {Object} WPNavigationLinkBlockAttributes
- *
- * @property {string} [label] Link text.
- * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.
- * @property {string} [type] The type such as post, page, tag, category and other custom types.
- * @property {string} [rel] The relationship of the linked URL.
- * @property {number} [id] A post or term id.
- * @property {boolean} [opensInNewTab] Sets link target to _blank when true.
- * @property {string} [url] Link href.
- * @property {string} [title] Link title attribute.
- */
- /**
- * Link Control onChange handler that updates block attributes when a setting is changed.
- *
- * @param {Object} updatedValue New block attributes to update.
- * @param {Function} setAttributes Block attribute update function.
- * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.
- *
- */
- const updateNavigationLinkBlockAttributes = function () {
- let updatedValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let setAttributes = arguments.length > 1 ? arguments[1] : undefined;
- let blockAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- const {
- label: originalLabel = '',
- kind: originalKind = '',
- type: originalType = ''
- } = blockAttributes;
- const {
- title = '',
- // the title of any provided Post.
- url = '',
- opensInNewTab,
- id,
- kind: newKind = originalKind,
- type: newType = originalType
- } = updatedValue;
- const normalizedTitle = title.replace(/http(s?):\/\//gi, '');
- const normalizedURL = url.replace(/http(s?):\/\//gi, '');
- const escapeTitle = title !== '' && normalizedTitle !== normalizedURL && originalLabel !== title;
- const label = escapeTitle ? (0,external_lodash_namespaceObject.escape)(title) : originalLabel || (0,external_lodash_namespaceObject.escape)(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
- const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
- const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
- const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom';
- const kind = isCustomLink ? 'custom' : newKind;
- setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
- ...(url && {
- url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(url))
- }),
- ...(label && {
- label
- }),
- ...(undefined !== opensInNewTab && {
- opensInNewTab
- }),
- ...(id && Number.isInteger(id) && {
- id
- }),
- ...(kind && {
- kind
- }),
- ...(type && type !== 'URL' && {
- type
- })
- });
- };
- const useIsInvalidLink = (kind, type, id) => {
- const isPostType = kind === 'post-type' || type === 'post' || type === 'page';
- const hasId = Number.isInteger(id);
- const postStatus = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getEntityRecord;
- if (!isPostType) {
- return null;
- }
- const {
- getEntityRecord
- } = select(external_wp_coreData_namespaceObject.store);
- return (_getEntityRecord = getEntityRecord('postType', type, id)) === null || _getEntityRecord === void 0 ? void 0 : _getEntityRecord.status;
- }, [isPostType, type, id]); // Check Navigation Link validity if:
- // 1. Link is 'post-type'.
- // 2. It has an id.
- // 3. It's neither null, nor undefined, as valid items might be either of those while loading.
- // If those conditions are met, check if
- // 1. The post status is published.
- // 2. The Navigation Link item has no label.
- // If either of those is true, invalidate.
- const isInvalid = isPostType && hasId && postStatus && 'trash' === postStatus;
- const isDraft = 'draft' === postStatus;
- return [isInvalid, isDraft];
- };
- const useMissingText = type => {
- let missingText = '';
- switch (type) {
- case 'post':
- /* translators: label for missing post in navigation link block */
- missingText = (0,external_wp_i18n_namespaceObject.__)('Select post');
- break;
- case 'page':
- /* translators: label for missing page in navigation link block */
- missingText = (0,external_wp_i18n_namespaceObject.__)('Select page');
- break;
- case 'category':
- /* translators: label for missing category in navigation link block */
- missingText = (0,external_wp_i18n_namespaceObject.__)('Select category');
- break;
- case 'tag':
- /* translators: label for missing tag in navigation link block */
- missingText = (0,external_wp_i18n_namespaceObject.__)('Select tag');
- break;
- default:
- /* translators: label for missing values in navigation link block */
- missingText = (0,external_wp_i18n_namespaceObject.__)('Add link');
- }
- return missingText;
- };
- /**
- * Removes HTML from a given string.
- * Note the does not provide XSS protection or otherwise attempt
- * to filter strings with malicious intent.
- *
- * See also: https://github.com/WordPress/gutenberg/pull/35539
- *
- * @param {string} html the string from which HTML should be removed.
- * @return {string} the "cleaned" string.
- */
- function navStripHTML(html) {
- const doc = document.implementation.createHTMLDocument('');
- doc.body.innerHTML = html;
- return doc.body.textContent || '';
- }
- /**
- * Add transforms to Link Control
- */
- function LinkControlTransforms(_ref) {
- let {
- clientId,
- replace
- } = _ref;
- const {
- getBlock,
- blockTransforms
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlock: _getBlock,
- getBlockRootClientId,
- getBlockTransformItems
- } = select(external_wp_blockEditor_namespaceObject.store);
- return {
- getBlock: _getBlock,
- blockTransforms: getBlockTransformItems([_getBlock(clientId)], getBlockRootClientId(clientId))
- };
- }, [clientId]);
- const featuredBlocks = ['core/site-logo', 'core/social-links', 'core/search'];
- const transforms = blockTransforms.filter(item => {
- return featuredBlocks.includes(item.name);
- });
- if (!(transforms !== null && transforms !== void 0 && transforms.length)) {
- return null;
- }
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "link-control-transform"
- }, (0,external_wp_element_namespaceObject.createElement)("h3", {
- className: "link-control-transform__subheading"
- }, (0,external_wp_i18n_namespaceObject.__)('Transform')), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "link-control-transform__items"
- }, transforms.map((item, index) => {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- key: `transform-${index}`,
- onClick: () => replace(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), item.name)),
- className: "link-control-transform__item"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: item.icon
- }), item.title);
- })));
- }
- function NavigationLinkEdit(_ref2) {
- let {
- attributes,
- isSelected,
- setAttributes,
- insertBlocksAfter,
- mergeBlocks,
- onReplace,
- context,
- clientId
- } = _ref2;
- const {
- id,
- label,
- type,
- opensInNewTab,
- url,
- description,
- rel,
- title,
- kind
- } = attributes;
- const [isInvalid, isDraft] = useIsInvalidLink(kind, type, id);
- const {
- maxNestingLevel
- } = context;
- const link = {
- url,
- opensInNewTab,
- title: label && navStripHTML(label) // don't allow HTML to display inside the <LinkControl>
- };
- const {
- saveEntityRecord
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
- const {
- replaceBlock,
- __unstableMarkNextChangeAsNotPersistent
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false);
- const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null);
- const isDraggingWithin = useIsDraggingWithin(listItemRef);
- const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add link…');
- const ref = (0,external_wp_element_namespaceObject.useRef)();
- const {
- innerBlocks,
- isAtMaxNesting,
- isTopLevelLink,
- isParentOfSelectedBlock,
- hasChildren,
- userCanCreatePages,
- userCanCreatePosts
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlocks,
- getBlockCount,
- getBlockName,
- getBlockRootClientId,
- hasSelectedInnerBlock,
- getBlockParentsByBlockName
- } = select(external_wp_blockEditor_namespaceObject.store);
- return {
- innerBlocks: getBlocks(clientId),
- isAtMaxNesting: getBlockParentsByBlockName(clientId, [edit_name, 'core/navigation-submenu']).length >= maxNestingLevel,
- isTopLevelLink: getBlockName(getBlockRootClientId(clientId)) === 'core/navigation',
- isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true),
- hasChildren: !!getBlockCount(clientId),
- userCanCreatePages: select(external_wp_coreData_namespaceObject.store).canUser('create', 'pages'),
- userCanCreatePosts: select(external_wp_coreData_namespaceObject.store).canUser('create', 'posts')
- };
- }, [clientId]);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // This side-effect should not create an undo level as those should
- // only be created via user interactions. Mark this change as
- // not persistent to avoid undo level creation.
- // See https://github.com/WordPress/gutenberg/issues/34564.
- __unstableMarkNextChangeAsNotPersistent();
- setAttributes({
- isTopLevelLink
- });
- }, [isTopLevelLink]);
- /**
- * Transform to submenu block.
- */
- function transformToSubmenu() {
- const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks);
- replaceBlock(clientId, newSubmenu);
- }
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // Show the LinkControl on mount if the URL is empty
- // ( When adding a new menu item)
- // This can't be done in the useState call because it conflicts
- // with the autofocus behavior of the BlockListBlock component.
- if (!url) {
- setIsLinkOpen(true);
- } // If block has inner blocks, transform to Submenu.
- if (hasChildren) {
- transformToSubmenu();
- }
- }, []);
- /**
- * The hook shouldn't be necessary but due to a focus loss happening
- * when selecting a suggestion in the link popover, we force close on block unselection.
- */
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isSelected) {
- setIsLinkOpen(false);
- }
- }, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (isLinkOpen && url) {
- // Does this look like a URL and have something TLD-ish?
- if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
- // Focus and select the label text.
- selectLabelText();
- } else {
- // Focus it (but do not select).
- (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
- }
- }
- }, [url]);
- /**
- * Focus the Link label text and select it.
- */
- function selectLabelText() {
- ref.current.focus();
- const {
- ownerDocument
- } = ref.current;
- const {
- defaultView
- } = ownerDocument;
- const selection = defaultView.getSelection();
- const range = ownerDocument.createRange(); // Get the range of the current ref contents so we can add this range to the selection.
- range.selectNodeContents(ref.current);
- selection.removeAllRanges();
- selection.addRange(range);
- }
- /**
- * Removes the current link if set.
- */
- function removeLink() {
- // Reset all attributes that comprise the link.
- setAttributes({
- url: '',
- label: '',
- id: '',
- kind: '',
- type: ''
- }); // Close the link editing UI.
- setIsLinkOpen(false);
- }
- let userCanCreate = false;
- if (!type || type === 'page') {
- userCanCreate = userCanCreatePages;
- } else if (type === 'post') {
- userCanCreate = userCanCreatePosts;
- }
- async function handleCreate(pageTitle) {
- const postType = type || 'page';
- const page = await saveEntityRecord('postType', postType, {
- title: pageTitle,
- status: 'draft'
- });
- return {
- id: page.id,
- type: postType,
- title: page.title.rendered,
- url: page.link,
- kind: 'post-type'
- };
- }
- const {
- textColor,
- customTextColor,
- backgroundColor,
- customBackgroundColor
- } = getColors(context, !isTopLevelLink);
- function onKeyDown(event) {
- if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k') || !url && event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
- setIsLinkOpen(true);
- }
- }
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- ref: listItemRef,
- className: classnames_default()('wp-block-navigation-item', {
- 'is-editing': isSelected || isParentOfSelectedBlock,
- 'is-dragging-within': isDraggingWithin,
- 'has-link': !!url,
- 'has-child': hasChildren,
- 'has-text-color': !!textColor || !!customTextColor,
- [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
- 'has-background': !!backgroundColor || customBackgroundColor,
- [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor
- }),
- style: {
- color: !textColor && customTextColor,
- backgroundColor: !backgroundColor && customBackgroundColor
- },
- onKeyDown
- });
- if (!url || isInvalid || isDraft) {
- blockProps.onClick = () => setIsLinkOpen(true);
- }
- const classes = classnames_default()('wp-block-navigation-item__content', {
- 'wp-block-navigation-link__placeholder': !url || isInvalid || isDraft
- });
- const missingText = useMissingText(type, isInvalid, isDraft);
- /* translators: Whether the navigation link is Invalid or a Draft. */
- const placeholderText = `(${isInvalid ? (0,external_wp_i18n_namespaceObject.__)('Invalid') : (0,external_wp_i18n_namespaceObject.__)('Draft')})`;
- const tooltipText = isInvalid || isDraft ? (0,external_wp_i18n_namespaceObject.__)('This item has been deleted, or is a draft') : (0,external_wp_i18n_namespaceObject.__)('This item is missing a link');
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- name: "link",
- icon: library_link,
- title: (0,external_wp_i18n_namespaceObject.__)('Link'),
- shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
- onClick: () => setIsLinkOpen(true)
- }), !isAtMaxNesting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- name: "submenu",
- icon: add_submenu,
- title: (0,external_wp_i18n_namespaceObject.__)('Add submenu'),
- onClick: transformToSubmenu
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
- value: description || '',
- onChange: descriptionValue => {
- setAttributes({
- description: descriptionValue
- });
- },
- label: (0,external_wp_i18n_namespaceObject.__)('Description'),
- help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- value: title || '',
- onChange: titleValue => {
- setAttributes({
- title: titleValue
- });
- },
- label: (0,external_wp_i18n_namespaceObject.__)('Link title'),
- autoComplete: "off"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- value: rel || '',
- onChange: relValue => {
- setAttributes({
- rel: relValue
- });
- },
- label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
- autoComplete: "off"
- }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
- className: classes
- }, !url ? (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-navigation-link__placeholder-text"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
- position: "top center",
- text: tooltipText
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", null, missingText), (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "wp-block-navigation-link__missing_text-tooltip"
- }, tooltipText)))) : (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isInvalid && !isDraft && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- ref: ref,
- identifier: "label",
- className: "wp-block-navigation-item__label",
- value: label,
- onChange: labelValue => setAttributes({
- label: labelValue
- }),
- onMerge: mergeBlocks,
- onReplace: onReplace,
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')),
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'),
- placeholder: itemLabelPlaceholder,
- withoutInteractiveFormatting: true,
- allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
- onClick: () => {
- if (!url) {
- setIsLinkOpen(true);
- }
- }
- }), description && (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "wp-block-navigation-item__description"
- }, description)), (isInvalid || isDraft) && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-navigation-link__placeholder-text wp-block-navigation-link__label"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.KeyboardShortcuts, {
- shortcuts: {
- enter: () => isSelected && setIsLinkOpen(true)
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
- position: "top center",
- text: tooltipText
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", null,
- /* Trim to avoid trailing white space when the placeholder text is not present */
- `${label} ${placeholderText}`.trim()), (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "wp-block-navigation-link__missing_text-tooltip"
- }, tooltipText))))), isLinkOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
- position: "bottom center",
- onClose: () => setIsLinkOpen(false),
- anchorRef: listItemRef.current
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
- hasTextControl: true,
- hasRichPreviews: true,
- className: "wp-block-navigation-link__inline-link-input",
- value: link,
- showInitialSuggestions: true,
- withCreateSuggestion: userCanCreate,
- createSuggestion: handleCreate,
- createSuggestionButtonText: searchTerm => {
- let format;
- if (type === 'post') {
- /* translators: %s: search term. */
- format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>');
- } else {
- /* translators: %s: search term. */
- format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>');
- }
- return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), {
- mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
- });
- },
- noDirectEntry: !!type,
- noURLSuggestion: !!type,
- suggestionsQuery: getSuggestionsQuery(type, kind),
- onChange: updatedValue => updateNavigationLinkBlockAttributes(updatedValue, setAttributes, attributes),
- onRemove: removeLink,
- renderControlBottom: !url ? () => (0,external_wp_element_namespaceObject.createElement)(LinkControlTransforms, {
- clientId: clientId,
- replace: replaceBlock
- }) : null
- })))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/save.js
- /**
- * WordPress dependencies
- */
- function navigation_link_save_save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-title.js
- /**
- * WordPress dependencies
- */
- const postTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 14.5h16V16H4zM4 18.5h9V20H4zM4 4h3c2 0 3 .86 3 2.583 0 .891-.253 1.554-.76 1.988-.505.435-1.24.652-2.204.652H5.542V12H4V4zm2.855 4c.53 0 .924-.114 1.18-.343.266-.228.398-.579.398-1.051 0-.473-.132-.82-.397-1.04-.265-.229-.67-.343-1.217-.343H5.542V8h1.313z"
- }));
- /* harmony default export */ var post_title = (postTitle);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js
- /**
- * WordPress dependencies
- */
- const page = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var library_page = (page);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tag.js
- /**
- * WordPress dependencies
- */
- const tag = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var library_tag = (tag);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-post-type.js
- /**
- * WordPress dependencies
- */
- const customPostType = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"
- }));
- /* harmony default export */ var custom_post_type = (customPostType);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/fallback-variations.js
- /**
- * WordPress dependencies
- */
- // FALLBACK: this is only used when the server does not understand the variations property in the
- // register_block_type call. see navigation-link/index.php.
- // Delete this file when supported WP ranges understand the `variations` property when passed to
- // register_block_type in index.php.
- const fallbackVariations = [{
- name: 'link',
- isDefault: true,
- title: (0,external_wp_i18n_namespaceObject.__)('Custom Link'),
- description: (0,external_wp_i18n_namespaceObject.__)('A link to a custom URL.'),
- attributes: {}
- }, {
- name: 'post',
- icon: post_title,
- title: (0,external_wp_i18n_namespaceObject.__)('Post Link'),
- description: (0,external_wp_i18n_namespaceObject.__)('A link to a post.'),
- attributes: {
- type: 'post',
- kind: 'post-type'
- }
- }, {
- name: 'page',
- icon: library_page,
- title: (0,external_wp_i18n_namespaceObject.__)('Page Link'),
- description: (0,external_wp_i18n_namespaceObject.__)('A link to a page.'),
- attributes: {
- type: 'page',
- kind: 'post-type'
- }
- }, {
- name: 'category',
- icon: library_category,
- title: (0,external_wp_i18n_namespaceObject.__)('Category Link'),
- description: (0,external_wp_i18n_namespaceObject.__)('A link to a category.'),
- attributes: {
- type: 'category',
- kind: 'taxonomy'
- }
- }, {
- name: 'tag',
- icon: library_tag,
- title: (0,external_wp_i18n_namespaceObject.__)('Tag Link'),
- description: (0,external_wp_i18n_namespaceObject.__)('A link to a tag.'),
- attributes: {
- type: 'tag',
- kind: 'taxonomy'
- }
- }];
- /**
- * Add `isActive` function to all `navigation link` variations, if not defined.
- * `isActive` function is used to find a variation match from a created
- * Block by providing its attributes.
- */
- fallbackVariations.forEach(variation => {
- if (variation.isActive) return;
- variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
- });
- /* harmony default export */ var fallback_variations = (fallbackVariations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/hooks.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function getIcon(variationName) {
- switch (variationName) {
- case 'post':
- return post_title;
- case 'page':
- return library_page;
- case 'tag':
- return library_tag;
- case 'category':
- return library_category;
- default:
- return custom_post_type;
- }
- }
- function enhanceNavigationLinkVariations(settings, name) {
- if (name !== 'core/navigation-link') {
- return settings;
- } // Fallback handling may be deleted after supported WP ranges understand the `variations`
- // property when passed to register_block_type in index.php.
- if (!settings.variations) {
- return { ...settings,
- variations: fallback_variations
- };
- } // Otherwise decorate server passed variations with an icon and isActive function.
- if (settings.variations) {
- const isActive = (blockAttributes, variationAttributes) => {
- return blockAttributes.type === variationAttributes.type;
- };
- const variations = settings.variations.map(variation => {
- return { ...variation,
- ...(!variation.icon && {
- icon: getIcon(variation.name)
- }),
- ...(!variation.isActive && {
- isActive
- })
- };
- });
- return { ...settings,
- variations
- };
- }
- return settings;
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/transforms.js
- /**
- * WordPress dependencies
- */
- const navigation_link_transforms_transforms = {
- from: [{
- type: 'block',
- blocks: ['core/site-logo'],
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
- }
- }, {
- type: 'block',
- blocks: ['core/spacer'],
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
- }
- }, {
- type: 'block',
- blocks: ['core/home-link'],
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
- }
- }, {
- type: 'block',
- blocks: ['core/social-links'],
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
- }
- }, {
- type: 'block',
- blocks: ['core/search'],
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
- }
- }],
- to: [{
- type: 'block',
- blocks: ['core/navigation-submenu'],
- transform: (attributes, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks)
- }, {
- type: 'block',
- blocks: ['core/spacer'],
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer');
- }
- }, {
- type: 'block',
- blocks: ['core/site-logo'],
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo');
- }
- }, {
- type: 'block',
- blocks: ['core/home-link'],
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link');
- }
- }, {
- type: 'block',
- blocks: ['core/social-links'],
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links');
- }
- }, {
- type: 'block',
- blocks: ['core/search'],
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/search', {
- showLabel: false,
- buttonUseIcon: true,
- buttonPosition: 'button-inside'
- });
- }
- }]
- };
- /* harmony default export */ var navigation_link_transforms = (navigation_link_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const navigation_link_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/navigation-link",
- title: "Custom Link",
- category: "design",
- parent: ["core/navigation"],
- description: "Add a page, link, or another item to your navigation.",
- textdomain: "default",
- attributes: {
- label: {
- type: "string"
- },
- type: {
- type: "string"
- },
- description: {
- type: "string"
- },
- rel: {
- type: "string"
- },
- id: {
- type: "number"
- },
- opensInNewTab: {
- type: "boolean",
- "default": false
- },
- url: {
- type: "string"
- },
- title: {
- type: "string"
- },
- kind: {
- type: "string"
- },
- isTopLevelLink: {
- type: "boolean"
- }
- },
- usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"],
- supports: {
- reusable: false,
- html: false,
- __experimentalSlashInserter: true
- },
- editorStyle: "wp-block-navigation-link-editor",
- style: "wp-block-navigation-link"
- };
- const {
- name: navigation_link_name
- } = navigation_link_metadata;
- const navigation_link_settings = {
- icon: custom_link,
- __experimentalLabel: _ref => {
- let {
- label
- } = _ref;
- return label;
- },
- merge(leftAttributes, _ref2) {
- let {
- label: rightLabel = ''
- } = _ref2;
- return { ...leftAttributes,
- label: leftAttributes.label + rightLabel
- };
- },
- edit: NavigationLinkEdit,
- save: navigation_link_save_save,
- example: {
- attributes: {
- label: (0,external_wp_i18n_namespaceObject._x)('Example Link', 'navigation link preview example'),
- url: 'https://example.com'
- }
- },
- deprecated: [{
- isEligible(attributes) {
- return attributes.nofollow;
- },
- attributes: {
- label: {
- type: 'string'
- },
- type: {
- type: 'string'
- },
- nofollow: {
- type: 'boolean'
- },
- description: {
- type: 'string'
- },
- id: {
- type: 'number'
- },
- opensInNewTab: {
- type: 'boolean',
- default: false
- },
- url: {
- type: 'string'
- }
- },
- migrate(_ref3) {
- let {
- nofollow,
- ...rest
- } = _ref3;
- return {
- rel: nofollow ? 'nofollow' : '',
- ...rest
- };
- },
- save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- }],
- transforms: navigation_link_transforms
- }; // importing this file includes side effects. This is whitelisted in block-library/package.json under sideEffects
- (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/navigation-link', enhanceNavigationLinkVariations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/remove-submenu.js
- /**
- * WordPress dependencies
- */
- const removeSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z"
- }));
- /* harmony default export */ var remove_submenu = (removeSubmenu);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/icons.js
- /**
- * WordPress dependencies
- */
- const ItemSubmenuIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- width: "12",
- height: "12",
- viewBox: "0 0 12 12",
- fill: "none"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M1.50002 4L6.00002 8L10.5 4",
- strokeWidth: "1.5"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const {
- name: navigation_submenu_edit_name
- } = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/navigation-submenu",
- title: "Submenu",
- category: "design",
- parent: ["core/navigation"],
- description: "Add a submenu to your navigation.",
- textdomain: "default",
- attributes: {
- label: {
- type: "string"
- },
- type: {
- type: "string"
- },
- description: {
- type: "string"
- },
- rel: {
- type: "string"
- },
- id: {
- type: "number"
- },
- opensInNewTab: {
- type: "boolean",
- "default": false
- },
- url: {
- type: "string"
- },
- title: {
- type: "string"
- },
- kind: {
- type: "string"
- },
- isTopLevelItem: {
- type: "boolean"
- }
- },
- usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"],
- supports: {
- reusable: false,
- html: false
- },
- editorStyle: "wp-block-navigation-submenu-editor",
- style: "wp-block-navigation-submenu"
- };
- const navigation_submenu_edit_ALLOWED_BLOCKS = ['core/navigation-link', 'core/navigation-submenu'];
- const edit_DEFAULT_BLOCK = {
- name: 'core/navigation-link'
- };
- /**
- * A React hook to determine if it's dragging within the target element.
- *
- * @typedef {import('@wordpress/element').RefObject} RefObject
- *
- * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
- *
- * @return {boolean} Is dragging within the target element.
- */
- const edit_useIsDraggingWithin = elementRef => {
- const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- const {
- ownerDocument
- } = elementRef.current;
- function handleDragStart(event) {
- // Check the first time when the dragging starts.
- handleDragEnter(event);
- } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
- function handleDragEnd() {
- setIsDraggingWithin(false);
- }
- function handleDragEnter(event) {
- // Check if the current target is inside the item element.
- if (elementRef.current.contains(event.target)) {
- setIsDraggingWithin(true);
- } else {
- setIsDraggingWithin(false);
- }
- } // Bind these events to the document to catch all drag events.
- // Ideally, we can also use `event.relatedTarget`, but sadly that
- // doesn't work in Safari.
- ownerDocument.addEventListener('dragstart', handleDragStart);
- ownerDocument.addEventListener('dragend', handleDragEnd);
- ownerDocument.addEventListener('dragenter', handleDragEnter);
- return () => {
- ownerDocument.removeEventListener('dragstart', handleDragStart);
- ownerDocument.removeEventListener('dragend', handleDragEnd);
- ownerDocument.removeEventListener('dragenter', handleDragEnter);
- };
- }, []);
- return isDraggingWithin;
- };
- /**
- * Given the Link block's type attribute, return the query params to give to
- * /wp/v2/search.
- *
- * @param {string} type Link block's type attribute.
- * @param {string} kind Link block's entity of kind (post-type|taxonomy)
- * @return {{ type?: string, subtype?: string }} Search query params.
- */
- function edit_getSuggestionsQuery(type, kind) {
- switch (type) {
- case 'post':
- case 'page':
- return {
- type: 'post',
- subtype: type
- };
- case 'category':
- return {
- type: 'term',
- subtype: 'category'
- };
- case 'tag':
- return {
- type: 'term',
- subtype: 'post_tag'
- };
- case 'post_format':
- return {
- type: 'post-format'
- };
- default:
- if (kind === 'taxonomy') {
- return {
- type: 'term',
- subtype: type
- };
- }
- if (kind === 'post-type') {
- return {
- type: 'post',
- subtype: type
- };
- }
- return {};
- }
- }
- /**
- * Determine the colors for a menu.
- *
- * Order of priority is:
- * 1: Overlay custom colors (if submenu)
- * 2: Overlay theme colors (if submenu)
- * 3: Custom colors
- * 4: Theme colors
- * 5: Global styles
- *
- * @param {Object} context
- * @param {boolean} isSubMenu
- */
- function edit_getColors(context, isSubMenu) {
- var _style$color, _style$color2;
- const {
- textColor,
- customTextColor,
- backgroundColor,
- customBackgroundColor,
- overlayTextColor,
- customOverlayTextColor,
- overlayBackgroundColor,
- customOverlayBackgroundColor,
- style
- } = context;
- const colors = {};
- if (isSubMenu && !!customOverlayTextColor) {
- colors.customTextColor = customOverlayTextColor;
- } else if (isSubMenu && !!overlayTextColor) {
- colors.textColor = overlayTextColor;
- } else if (!!customTextColor) {
- colors.customTextColor = customTextColor;
- } else if (!!textColor) {
- colors.textColor = textColor;
- } else if (!!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text)) {
- colors.customTextColor = style.color.text;
- }
- if (isSubMenu && !!customOverlayBackgroundColor) {
- colors.customBackgroundColor = customOverlayBackgroundColor;
- } else if (isSubMenu && !!overlayBackgroundColor) {
- colors.backgroundColor = overlayBackgroundColor;
- } else if (!!customBackgroundColor) {
- colors.customBackgroundColor = customBackgroundColor;
- } else if (!!backgroundColor) {
- colors.backgroundColor = backgroundColor;
- } else if (!!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background)) {
- colors.customTextColor = style.color.background;
- }
- return colors;
- }
- /**
- * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind
- */
- /**
- * Navigation Link Block Attributes
- *
- * @typedef {Object} WPNavigationLinkBlockAttributes
- *
- * @property {string} [label] Link text.
- * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.
- * @property {string} [type] The type such as post, page, tag, category and other custom types.
- * @property {string} [rel] The relationship of the linked URL.
- * @property {number} [id] A post or term id.
- * @property {boolean} [opensInNewTab] Sets link target to _blank when true.
- * @property {string} [url] Link href.
- * @property {string} [title] Link title attribute.
- */
- /**
- * Link Control onChange handler that updates block attributes when a setting is changed.
- *
- * @param {Object} updatedValue New block attributes to update.
- * @param {Function} setAttributes Block attribute update function.
- * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.
- *
- */
- const edit_updateNavigationLinkBlockAttributes = function () {
- let updatedValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let setAttributes = arguments.length > 1 ? arguments[1] : undefined;
- let blockAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- const {
- label: originalLabel = '',
- kind: originalKind = '',
- type: originalType = ''
- } = blockAttributes;
- const {
- title = '',
- url = '',
- opensInNewTab,
- id,
- kind: newKind = originalKind,
- type: newType = originalType
- } = updatedValue;
- const normalizedTitle = title.replace(/http(s?):\/\//gi, '');
- const normalizedURL = url.replace(/http(s?):\/\//gi, '');
- const escapeTitle = title !== '' && normalizedTitle !== normalizedURL && originalLabel !== title;
- const label = escapeTitle ? (0,external_lodash_namespaceObject.escape)(title) : originalLabel || (0,external_lodash_namespaceObject.escape)(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
- const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
- const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
- const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom';
- const kind = isCustomLink ? 'custom' : newKind;
- setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
- ...(url && {
- url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(url))
- }),
- ...(label && {
- label
- }),
- ...(undefined !== opensInNewTab && {
- opensInNewTab
- }),
- ...(id && Number.isInteger(id) && {
- id
- }),
- ...(kind && {
- kind
- }),
- ...(type && type !== 'URL' && {
- type
- })
- });
- };
- function NavigationSubmenuEdit(_ref) {
- let {
- attributes,
- isSelected,
- setAttributes,
- mergeBlocks,
- onReplace,
- context,
- clientId
- } = _ref;
- const {
- label,
- type,
- opensInNewTab,
- url,
- description,
- rel,
- title,
- kind
- } = attributes;
- const link = {
- url,
- opensInNewTab
- };
- const {
- showSubmenuIcon,
- maxNestingLevel,
- openSubmenusOnClick
- } = context;
- const {
- saveEntityRecord
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
- const {
- __unstableMarkNextChangeAsNotPersistent,
- replaceBlock
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false);
- const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null);
- const isDraggingWithin = edit_useIsDraggingWithin(listItemRef);
- const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add text…');
- const ref = (0,external_wp_element_namespaceObject.useRef)();
- const {
- isAtMaxNesting,
- isTopLevelItem,
- isParentOfSelectedBlock,
- isImmediateParentOfSelectedBlock,
- hasChildren,
- selectedBlockHasChildren,
- userCanCreatePages,
- userCanCreatePosts,
- onlyDescendantIsEmptyLink
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- hasSelectedInnerBlock,
- getSelectedBlockClientId,
- getBlockParentsByBlockName,
- getBlock,
- getBlockCount,
- getBlockOrder
- } = select(external_wp_blockEditor_namespaceObject.store);
- let _onlyDescendantIsEmptyLink;
- const selectedBlockId = getSelectedBlockClientId();
- const selectedBlockChildren = getBlockOrder(selectedBlockId); // Check for a single descendant in the submenu. If that block
- // is a link block in a "placeholder" state with no label then
- // we can consider as an "empty" link.
- if ((selectedBlockChildren === null || selectedBlockChildren === void 0 ? void 0 : selectedBlockChildren.length) === 1) {
- var _singleBlock$attribut;
- const singleBlock = getBlock(selectedBlockChildren[0]);
- _onlyDescendantIsEmptyLink = (singleBlock === null || singleBlock === void 0 ? void 0 : singleBlock.name) === 'core/navigation-link' && !(singleBlock !== null && singleBlock !== void 0 && (_singleBlock$attribut = singleBlock.attributes) !== null && _singleBlock$attribut !== void 0 && _singleBlock$attribut.label);
- }
- return {
- isAtMaxNesting: getBlockParentsByBlockName(clientId, navigation_submenu_edit_name).length >= maxNestingLevel,
- isTopLevelItem: getBlockParentsByBlockName(clientId, navigation_submenu_edit_name).length === 0,
- isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true),
- isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
- hasChildren: !!getBlockCount(clientId),
- selectedBlockHasChildren: !!(selectedBlockChildren !== null && selectedBlockChildren !== void 0 && selectedBlockChildren.length),
- userCanCreatePages: select(external_wp_coreData_namespaceObject.store).canUser('create', 'pages'),
- userCanCreatePosts: select(external_wp_coreData_namespaceObject.store).canUser('create', 'posts'),
- onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink
- };
- }, [clientId]); // Show the LinkControl on mount if the URL is empty
- // ( When adding a new menu item)
- // This can't be done in the useState call because it conflicts
- // with the autofocus behavior of the BlockListBlock component.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!openSubmenusOnClick && !url) {
- setIsLinkOpen(true);
- }
- }, []); // Store the colors from context as attributes for rendering.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // This side-effect should not create an undo level as those should
- // only be created via user interactions. Mark this change as
- // not persistent to avoid undo level creation.
- // See https://github.com/WordPress/gutenberg/issues/34564.
- __unstableMarkNextChangeAsNotPersistent();
- setAttributes({
- isTopLevelItem
- });
- }, [isTopLevelItem]);
- /**
- * The hook shouldn't be necessary but due to a focus loss happening
- * when selecting a suggestion in the link popover, we force close on block unselection.
- */
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isSelected) {
- setIsLinkOpen(false);
- }
- }, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (isLinkOpen && url) {
- // Does this look like a URL and have something TLD-ish?
- if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
- // Focus and select the label text.
- selectLabelText();
- } else {
- // Focus it (but do not select).
- (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
- }
- }
- }, [url]);
- /**
- * Focus the Link label text and select it.
- */
- function selectLabelText() {
- ref.current.focus();
- const {
- ownerDocument
- } = ref.current;
- const {
- defaultView
- } = ownerDocument;
- const selection = defaultView.getSelection();
- const range = ownerDocument.createRange(); // Get the range of the current ref contents so we can add this range to the selection.
- range.selectNodeContents(ref.current);
- selection.removeAllRanges();
- selection.addRange(range);
- }
- let userCanCreate = false;
- if (!type || type === 'page') {
- userCanCreate = userCanCreatePages;
- } else if (type === 'post') {
- userCanCreate = userCanCreatePosts;
- }
- async function handleCreate(pageTitle) {
- const postType = type || 'page';
- const page = await saveEntityRecord('postType', postType, {
- title: pageTitle,
- status: 'draft'
- });
- return {
- id: page.id,
- type: postType,
- title: page.title.rendered,
- url: page.link,
- kind: 'post-type'
- };
- }
- const {
- textColor,
- customTextColor,
- backgroundColor,
- customBackgroundColor
- } = edit_getColors(context, !isTopLevelItem);
- function onKeyDown(event) {
- if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
- setIsLinkOpen(true);
- }
- }
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- ref: listItemRef,
- className: classnames_default()('wp-block-navigation-item', {
- 'is-editing': isSelected || isParentOfSelectedBlock,
- 'is-dragging-within': isDraggingWithin,
- 'has-link': !!url,
- 'has-child': hasChildren,
- 'has-text-color': !!textColor || !!customTextColor,
- [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
- 'has-background': !!backgroundColor || customBackgroundColor,
- [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor,
- 'open-on-click': openSubmenusOnClick
- }),
- style: {
- color: !textColor && customTextColor,
- backgroundColor: !backgroundColor && customBackgroundColor
- },
- onKeyDown
- }); // Always use overlay colors for submenus.
- const innerBlocksColors = edit_getColors(context, true);
- const allowedBlocks = isAtMaxNesting ? (0,external_lodash_namespaceObject.without)(navigation_submenu_edit_ALLOWED_BLOCKS, 'core/navigation-submenu') : navigation_submenu_edit_ALLOWED_BLOCKS;
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
- className: classnames_default()('wp-block-navigation__submenu-container', {
- 'is-parent-of-selected-block': isParentOfSelectedBlock,
- 'has-text-color': !!(innerBlocksColors.textColor || innerBlocksColors.customTextColor),
- [`has-${innerBlocksColors.textColor}-color`]: !!innerBlocksColors.textColor,
- 'has-background': !!(innerBlocksColors.backgroundColor || innerBlocksColors.customBackgroundColor),
- [`has-${innerBlocksColors.backgroundColor}-background-color`]: !!innerBlocksColors.backgroundColor
- }),
- style: {
- color: innerBlocksColors.customTextColor,
- backgroundColor: innerBlocksColors.customBackgroundColor
- }
- }, {
- allowedBlocks,
- __experimentalDefaultBlock: edit_DEFAULT_BLOCK,
- __experimentalDirectInsert: true,
- // Ensure block toolbar is not too far removed from item
- // being edited.
- // see: https://github.com/WordPress/gutenberg/pull/34615.
- __experimentalCaptureToolbars: true,
- renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender.
- hasChildren ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false
- });
- const ParentElement = openSubmenusOnClick ? 'button' : 'a';
- function transformToLink() {
- const newLinkBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes);
- replaceBlock(clientId, newLinkBlock);
- }
- const canConvertToLink = !selectedBlockHasChildren || onlyDescendantIsEmptyLink;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, !openSubmenusOnClick && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- name: "link",
- icon: library_link,
- title: (0,external_wp_i18n_namespaceObject.__)('Link'),
- shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
- onClick: () => setIsLinkOpen(true)
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- name: "revert",
- icon: remove_submenu,
- title: (0,external_wp_i18n_namespaceObject.__)('Convert to Link'),
- onClick: transformToLink,
- className: "wp-block-navigation__submenu__revert",
- isDisabled: !canConvertToLink
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
- value: description || '',
- onChange: descriptionValue => {
- setAttributes({
- description: descriptionValue
- });
- },
- label: (0,external_wp_i18n_namespaceObject.__)('Description'),
- help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- value: title || '',
- onChange: titleValue => {
- setAttributes({
- title: titleValue
- });
- },
- label: (0,external_wp_i18n_namespaceObject.__)('Link title'),
- autoComplete: "off"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- value: rel || '',
- onChange: relValue => {
- setAttributes({
- rel: relValue
- });
- },
- label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
- autoComplete: "off"
- }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(ParentElement, {
- className: "wp-block-navigation-item__content"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- ref: ref,
- identifier: "label",
- className: "wp-block-navigation-item__label",
- value: label,
- onChange: labelValue => setAttributes({
- label: labelValue
- }),
- onMerge: mergeBlocks,
- onReplace: onReplace,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'),
- placeholder: itemLabelPlaceholder,
- withoutInteractiveFormatting: true,
- allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
- onClick: () => {
- if (!openSubmenusOnClick && !url) {
- setIsLinkOpen(true);
- }
- }
- }), !openSubmenusOnClick && isLinkOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
- position: "bottom center",
- onClose: () => setIsLinkOpen(false),
- anchorRef: listItemRef.current
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
- className: "wp-block-navigation-link__inline-link-input",
- value: link,
- showInitialSuggestions: true,
- withCreateSuggestion: userCanCreate,
- createSuggestion: handleCreate,
- createSuggestionButtonText: searchTerm => {
- let format;
- if (type === 'post') {
- /* translators: %s: search term. */
- format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>');
- } else {
- /* translators: %s: search term. */
- format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>');
- }
- return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), {
- mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
- });
- },
- noDirectEntry: !!type,
- noURLSuggestion: !!type,
- suggestionsQuery: edit_getSuggestionsQuery(type, kind),
- onChange: updatedValue => edit_updateNavigationLinkBlockAttributes(updatedValue, setAttributes, attributes),
- onRemove: () => {
- setAttributes({
- url: ''
- });
- (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive');
- }
- }))), (showSubmenuIcon || openSubmenusOnClick) && (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "wp-block-navigation__submenu-icon"
- }, (0,external_wp_element_namespaceObject.createElement)(ItemSubmenuIcon, null)), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/save.js
- /**
- * WordPress dependencies
- */
- function navigation_submenu_save_save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/transforms.js
- /**
- * WordPress dependencies
- */
- const navigation_submenu_transforms_transforms = {
- to: [{
- type: 'block',
- blocks: ['core/navigation-link'],
- isMatch: (attributes, block) => {
- var _block$innerBlocks;
- return (block === null || block === void 0 ? void 0 : (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.length) === 0;
- },
- transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes)
- }, {
- type: 'block',
- blocks: ['core/spacer'],
- isMatch: (attributes, block) => {
- var _block$innerBlocks2;
- return (block === null || block === void 0 ? void 0 : (_block$innerBlocks2 = block.innerBlocks) === null || _block$innerBlocks2 === void 0 ? void 0 : _block$innerBlocks2.length) === 0;
- },
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer');
- }
- }, {
- type: 'block',
- blocks: ['core/site-logo'],
- isMatch: (attributes, block) => {
- var _block$innerBlocks3;
- return (block === null || block === void 0 ? void 0 : (_block$innerBlocks3 = block.innerBlocks) === null || _block$innerBlocks3 === void 0 ? void 0 : _block$innerBlocks3.length) === 0;
- },
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo');
- }
- }, {
- type: 'block',
- blocks: ['core/home-link'],
- isMatch: (attributes, block) => {
- var _block$innerBlocks4;
- return (block === null || block === void 0 ? void 0 : (_block$innerBlocks4 = block.innerBlocks) === null || _block$innerBlocks4 === void 0 ? void 0 : _block$innerBlocks4.length) === 0;
- },
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link');
- }
- }, {
- type: 'block',
- blocks: ['core/social-links'],
- isMatch: (attributes, block) => {
- var _block$innerBlocks5;
- return (block === null || block === void 0 ? void 0 : (_block$innerBlocks5 = block.innerBlocks) === null || _block$innerBlocks5 === void 0 ? void 0 : _block$innerBlocks5.length) === 0;
- },
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links');
- }
- }, {
- type: 'block',
- blocks: ['core/search'],
- isMatch: (attributes, block) => {
- var _block$innerBlocks6;
- return (block === null || block === void 0 ? void 0 : (_block$innerBlocks6 = block.innerBlocks) === null || _block$innerBlocks6 === void 0 ? void 0 : _block$innerBlocks6.length) === 0;
- },
- transform: () => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/search');
- }
- }]
- };
- /* harmony default export */ var navigation_submenu_transforms = (navigation_submenu_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const navigation_submenu_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/navigation-submenu",
- title: "Submenu",
- category: "design",
- parent: ["core/navigation"],
- description: "Add a submenu to your navigation.",
- textdomain: "default",
- attributes: {
- label: {
- type: "string"
- },
- type: {
- type: "string"
- },
- description: {
- type: "string"
- },
- rel: {
- type: "string"
- },
- id: {
- type: "number"
- },
- opensInNewTab: {
- type: "boolean",
- "default": false
- },
- url: {
- type: "string"
- },
- title: {
- type: "string"
- },
- kind: {
- type: "string"
- },
- isTopLevelItem: {
- type: "boolean"
- }
- },
- usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"],
- supports: {
- reusable: false,
- html: false
- },
- editorStyle: "wp-block-navigation-submenu-editor",
- style: "wp-block-navigation-submenu"
- };
- const {
- name: navigation_submenu_name
- } = navigation_submenu_metadata;
- const navigation_submenu_settings = {
- icon: add_submenu,
- __experimentalLabel: _ref => {
- let {
- label
- } = _ref;
- return label;
- },
- edit: NavigationSubmenuEdit,
- save: navigation_submenu_save_save,
- transforms: navigation_submenu_transforms
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page-break.js
- /**
- * WordPress dependencies
- */
- const pageBreak = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"
- }));
- /* harmony default export */ var page_break = (pageBreak);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/edit.js
- /**
- * WordPress dependencies
- */
- function NextPageEdit() {
- return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-nextpage"
- }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Page break'))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/save.js
- /**
- * WordPress dependencies
- */
- function nextpage_save_save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, '<!--nextpage-->');
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/transforms.js
- /**
- * WordPress dependencies
- */
- const nextpage_transforms_transforms = {
- from: [{
- type: 'raw',
- schema: {
- 'wp-block': {
- attributes: ['data-block']
- }
- },
- isMatch: node => node.dataset && node.dataset.block === 'core/nextpage',
- transform() {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/nextpage', {});
- }
- }]
- };
- /* harmony default export */ var nextpage_transforms = (nextpage_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const nextpage_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/nextpage",
- title: "Page Break",
- category: "design",
- description: "Separate your content into a multi-page experience.",
- keywords: ["next page", "pagination"],
- parent: ["core/post-content"],
- textdomain: "default",
- supports: {
- customClassName: false,
- className: false,
- html: false
- },
- editorStyle: "wp-block-nextpage-editor"
- };
- const {
- name: nextpage_name
- } = nextpage_metadata;
- const nextpage_settings = {
- icon: page_break,
- example: {},
- transforms: nextpage_transforms,
- edit: NextPageEdit,
- save: nextpage_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/edit.js
- /**
- * WordPress dependencies
- */
- const PatternEdit = _ref => {
- let {
- attributes,
- clientId
- } = _ref;
- const selectedPattern = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]);
- const {
- replaceBlocks,
- __unstableMarkNextChangeAsNotPersistent
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Run this effect when the component loads.
- // This adds the Pattern's contents to the post.
- // This change won't be saved.
- // It will continue to pull from the pattern file unless changes are made to its respective template part.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (selectedPattern !== null && selectedPattern !== void 0 && selectedPattern.blocks) {
- __unstableMarkNextChangeAsNotPersistent();
- replaceBlocks(clientId, selectedPattern.blocks);
- }
- }, [selectedPattern === null || selectedPattern === void 0 ? void 0 : selectedPattern.blocks]);
- const props = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- return (0,external_wp_element_namespaceObject.createElement)("div", props);
- };
- /* harmony default export */ var pattern_edit = (PatternEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
- /**
- * Internal dependencies
- */
- const pattern_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/pattern",
- title: "Pattern",
- category: "theme",
- description: "Show a block pattern.",
- supports: {
- html: false,
- inserter: false
- },
- textdomain: "default",
- attributes: {
- slug: {
- type: "string"
- }
- }
- };
- const {
- name: pattern_name
- } = pattern_metadata;
- const pattern_settings = {
- edit: pattern_edit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pages.js
- /**
- * WordPress dependencies
- */
- const pages = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M7 13.8h6v-1.5H7v1.5zM18 16V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2zM5.5 16V4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zM7 10.5h8V9H7v1.5zm0-3.3h8V5.8H7v1.4zM20.2 6v13c0 .7-.6 1.2-1.2 1.2H8v1.5h11c1.5 0 2.7-1.2 2.7-2.8V6h-1.5z"
- }));
- /* harmony default export */ var library_pages = (pages);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/convert-to-links-modal.js
- /**
- * WordPress dependencies
- */
- const PAGE_FIELDS = ['id', 'title', 'link', 'type', 'parent'];
- const MAX_PAGE_COUNT = 100;
- const convertSelectedBlockToNavigationLinks = _ref => {
- let {
- pages,
- clientId,
- replaceBlock,
- createBlock
- } = _ref;
- return () => {
- if (!pages) {
- return;
- }
- const linkMap = {};
- const navigationLinks = [];
- pages.forEach(_ref2 => {
- var _linkMap$id$innerBloc, _linkMap$id;
- let {
- id,
- title,
- link: url,
- type,
- parent
- } = _ref2;
- // See if a placeholder exists. This is created if children appear before parents in list.
- const innerBlocks = (_linkMap$id$innerBloc = (_linkMap$id = linkMap[id]) === null || _linkMap$id === void 0 ? void 0 : _linkMap$id.innerBlocks) !== null && _linkMap$id$innerBloc !== void 0 ? _linkMap$id$innerBloc : [];
- linkMap[id] = createBlock('core/navigation-link', {
- id,
- label: title.rendered,
- url,
- type,
- kind: 'post-type'
- }, innerBlocks);
- if (!parent) {
- navigationLinks.push(linkMap[id]);
- } else {
- if (!linkMap[parent]) {
- // Use a placeholder if the child appears before parent in list.
- linkMap[parent] = {
- innerBlocks: []
- };
- }
- const parentLinkInnerBlocks = linkMap[parent].innerBlocks;
- parentLinkInnerBlocks.push(linkMap[id]);
- }
- }); // Transform all links with innerBlocks into Submenus. This can't be done
- // sooner because page objects have no information on their children.
- const transformSubmenus = listOfLinks => {
- listOfLinks.forEach((block, index, listOfLinksArray) => {
- const {
- attributes,
- innerBlocks
- } = block;
- if (innerBlocks.length !== 0) {
- transformSubmenus(innerBlocks);
- const transformedBlock = createBlock('core/navigation-submenu', attributes, innerBlocks);
- listOfLinksArray[index] = transformedBlock;
- }
- });
- };
- transformSubmenus(navigationLinks);
- replaceBlock(clientId, navigationLinks);
- };
- };
- function ConvertToLinksModal(_ref3) {
- let {
- onClose,
- clientId
- } = _ref3;
- const {
- records: pages,
- hasResolved: pagesFinished
- } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('postType', 'page', {
- per_page: MAX_PAGE_COUNT,
- _fields: PAGE_FIELDS,
- // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby
- // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent
- // sort.
- orderby: 'menu_order',
- order: 'asc'
- });
- const {
- replaceBlock
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
- closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
- onRequestClose: onClose,
- title: (0,external_wp_i18n_namespaceObject.__)('Convert to links'),
- className: 'wp-block-page-list-modal',
- aria: {
- describedby: 'wp-block-page-list-modal__description'
- }
- }, (0,external_wp_element_namespaceObject.createElement)("p", {
- id: 'wp-block-page-list-modal__description'
- }, (0,external_wp_i18n_namespaceObject.__)('To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)("Note: if you add new pages to your site, you'll need to add them to your navigation menu.")), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-page-list-modal-buttons"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "tertiary",
- onClick: onClose
- }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "primary",
- disabled: !pagesFinished,
- onClick: convertSelectedBlockToNavigationLinks({
- pages,
- replaceBlock,
- clientId,
- createBlock: external_wp_blocks_namespaceObject.createBlock
- })
- }, (0,external_wp_i18n_namespaceObject.__)('Convert'))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/icons.js
- /**
- * WordPress dependencies
- */
- const icons_ItemSubmenuIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- width: "12",
- height: "12",
- viewBox: "0 0 12 12",
- fill: "none"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M1.50002 4L6.00002 8L10.5 4",
- strokeWidth: "1.5"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- // We only show the edit option when page count is <= MAX_PAGE_COUNT
- // Performance of Navigation Links is not good past this value.
- const edit_MAX_PAGE_COUNT = 100;
- function PageListEdit(_ref) {
- var _context$style;
- let {
- context,
- clientId
- } = _ref;
- const {
- pagesByParentId,
- totalPages,
- hasResolvedPages
- } = usePageData();
- const isNavigationChild = ('showSubmenuIcon' in context);
- const allowConvertToLinks = isNavigationChild && totalPages <= edit_MAX_PAGE_COUNT;
- const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false);
- const openModal = () => setOpen(true);
- const closeModal = () => setOpen(false);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()('wp-block-page-list', {
- 'has-text-color': !!context.textColor,
- [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', context.textColor)]: !!context.textColor,
- 'has-background': !!context.backgroundColor,
- [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', context.backgroundColor)]: !!context.backgroundColor
- }),
- style: { ...((_context$style = context.style) === null || _context$style === void 0 ? void 0 : _context$style.color)
- }
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, allowConvertToLinks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- title: (0,external_wp_i18n_namespaceObject.__)('Edit'),
- onClick: openModal
- }, (0,external_wp_i18n_namespaceObject.__)('Edit'))), allowConvertToLinks && isOpen && (0,external_wp_element_namespaceObject.createElement)(ConvertToLinksModal, {
- onClose: closeModal,
- clientId: clientId
- }), !hasResolvedPages && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), hasResolvedPages && totalPages === null && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
- status: 'warning',
- isDismissible: false
- }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.')))), totalPages === 0 && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
- status: 'info',
- isDismissible: false
- }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.'))), totalPages > 0 && (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, (0,external_wp_element_namespaceObject.createElement)(PageItems, {
- context: context,
- pagesByParentId: pagesByParentId
- })));
- }
- function useFrontPageId() {
- return (0,external_wp_data_namespaceObject.useSelect)(select => {
- const site = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site');
- return (site === null || site === void 0 ? void 0 : site.show_on_front) === 'page' && (site === null || site === void 0 ? void 0 : site.page_on_front);
- }, []);
- }
- function usePageData() {
- const {
- records: pages,
- hasResolved: hasResolvedPages
- } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('postType', 'page', {
- orderby: 'menu_order',
- order: 'asc',
- _fields: ['id', 'link', 'parent', 'title', 'menu_order'],
- per_page: -1
- });
- return (0,external_wp_element_namespaceObject.useMemo)(() => {
- var _pages$length;
- // TODO: Once the REST API supports passing multiple values to
- // 'orderby', this can be removed.
- // https://core.trac.wordpress.org/ticket/39037
- const sortedPages = (0,external_lodash_namespaceObject.sortBy)(pages, ['menu_order', 'title.rendered']);
- const pagesByParentId = sortedPages.reduce((accumulator, page) => {
- const {
- parent
- } = page;
- if (accumulator.has(parent)) {
- accumulator.get(parent).push(page);
- } else {
- accumulator.set(parent, [page]);
- }
- return accumulator;
- }, new Map());
- return {
- pagesByParentId,
- hasResolvedPages,
- totalPages: (_pages$length = pages === null || pages === void 0 ? void 0 : pages.length) !== null && _pages$length !== void 0 ? _pages$length : null
- };
- }, [pages, hasResolvedPages]);
- }
- const PageItems = (0,external_wp_element_namespaceObject.memo)(function PageItems(_ref2) {
- let {
- context,
- pagesByParentId,
- parentId = 0,
- depth = 0
- } = _ref2;
- const pages = pagesByParentId.get(parentId);
- const frontPageId = useFrontPageId();
- if (!(pages !== null && pages !== void 0 && pages.length)) {
- return [];
- }
- return pages.map(page => {
- var _page$title, _page$title2;
- const hasChildren = pagesByParentId.has(page.id);
- const isNavigationChild = ('showSubmenuIcon' in context);
- return (0,external_wp_element_namespaceObject.createElement)("li", {
- key: page.id,
- className: classnames_default()('wp-block-pages-list__item', {
- 'has-child': hasChildren,
- 'wp-block-navigation-item': isNavigationChild,
- 'open-on-click': context.openSubmenusOnClick,
- 'open-on-hover-click': !context.openSubmenusOnClick && context.showSubmenuIcon,
- 'menu-item-home': page.id === frontPageId
- })
- }, hasChildren && context.openSubmenusOnClick ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("button", {
- className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle",
- "aria-expanded": "false"
- }, (_page$title = page.title) === null || _page$title === void 0 ? void 0 : _page$title.rendered), (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"
- }, (0,external_wp_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null))) : (0,external_wp_element_namespaceObject.createElement)("a", {
- className: classnames_default()('wp-block-pages-list__item__link', {
- 'wp-block-navigation-item__content': isNavigationChild
- }),
- href: page.link
- }, (_page$title2 = page.title) === null || _page$title2 === void 0 ? void 0 : _page$title2.rendered), hasChildren && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !context.openSubmenusOnClick && context.showSubmenuIcon && (0,external_wp_element_namespaceObject.createElement)("button", {
- className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon",
- "aria-expanded": "false"
- }, (0,external_wp_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null)), (0,external_wp_element_namespaceObject.createElement)("ul", {
- className: classnames_default()('submenu-container', {
- 'wp-block-navigation__submenu-container': isNavigationChild
- })
- }, (0,external_wp_element_namespaceObject.createElement)(PageItems, {
- context: context,
- pagesByParentId: pagesByParentId,
- parentId: page.id,
- depth: depth + 1
- }))));
- });
- });
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const page_list_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/page-list",
- title: "Page List",
- category: "widgets",
- description: "Display a list of all pages.",
- keywords: ["menu", "navigation"],
- textdomain: "default",
- attributes: {
- __unstableMaxPages: {
- type: "number"
- }
- },
- usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"],
- supports: {
- reusable: false,
- html: false
- },
- editorStyle: "wp-block-page-list-editor",
- style: "wp-block-page-list"
- };
- const {
- name: page_list_name
- } = page_list_metadata;
- const page_list_settings = {
- icon: library_pages,
- example: {},
- edit: PageListEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/paragraph.js
- /**
- * WordPress dependencies
- */
- const paragraph = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z"
- }));
- /* harmony default export */ var library_paragraph = (paragraph);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const deprecated_supports = {
- className: false
- };
- const paragraph_deprecated_blockAttributes = {
- align: {
- type: 'string'
- },
- content: {
- type: 'string',
- source: 'html',
- selector: 'p',
- default: ''
- },
- dropCap: {
- type: 'boolean',
- default: false
- },
- placeholder: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- backgroundColor: {
- type: 'string'
- },
- fontSize: {
- type: 'string'
- },
- direction: {
- type: 'string',
- enum: ['ltr', 'rtl']
- },
- style: {
- type: 'object'
- }
- };
- const migrateCustomColorsAndFontSizes = attributes => {
- if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customFontSize) {
- return attributes;
- }
- const style = {};
- if (attributes.customTextColor || attributes.customBackgroundColor) {
- style.color = {};
- }
- if (attributes.customTextColor) {
- style.color.text = attributes.customTextColor;
- }
- if (attributes.customBackgroundColor) {
- style.color.background = attributes.customBackgroundColor;
- }
- if (attributes.customFontSize) {
- style.typography = {
- fontSize: attributes.customFontSize
- };
- }
- return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor', 'customFontSize']),
- style
- };
- };
- const paragraph_deprecated_deprecated = [{
- supports: deprecated_supports,
- attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
- customTextColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- customFontSize: {
- type: 'number'
- }
- },
- migrate: migrateCustomColorsAndFontSizes,
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- align,
- content,
- dropCap,
- backgroundColor,
- textColor,
- customBackgroundColor,
- customTextColor,
- fontSize,
- customFontSize,
- direction
- } = attributes;
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
- const className = classnames_default()({
- 'has-text-color': textColor || customTextColor,
- 'has-background': backgroundColor || customBackgroundColor,
- 'has-drop-cap': dropCap,
- [`has-text-align-${align}`]: align,
- [fontSizeClass]: fontSizeClass,
- [textClass]: textClass,
- [backgroundClass]: backgroundClass
- });
- const styles = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- color: textClass ? undefined : customTextColor,
- fontSize: fontSizeClass ? undefined : customFontSize
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "p",
- style: styles,
- className: className ? className : undefined,
- value: content,
- dir: direction
- });
- }
- }, {
- supports: deprecated_supports,
- attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
- customTextColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- customFontSize: {
- type: 'number'
- }
- },
- migrate: migrateCustomColorsAndFontSizes,
- save(_ref2) {
- let {
- attributes
- } = _ref2;
- const {
- align,
- content,
- dropCap,
- backgroundColor,
- textColor,
- customBackgroundColor,
- customTextColor,
- fontSize,
- customFontSize,
- direction
- } = attributes;
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
- const className = classnames_default()({
- 'has-text-color': textColor || customTextColor,
- 'has-background': backgroundColor || customBackgroundColor,
- 'has-drop-cap': dropCap,
- [fontSizeClass]: fontSizeClass,
- [textClass]: textClass,
- [backgroundClass]: backgroundClass
- });
- const styles = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- color: textClass ? undefined : customTextColor,
- fontSize: fontSizeClass ? undefined : customFontSize,
- textAlign: align
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "p",
- style: styles,
- className: className ? className : undefined,
- value: content,
- dir: direction
- });
- }
- }, {
- supports: deprecated_supports,
- attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
- customTextColor: {
- type: 'string'
- },
- customBackgroundColor: {
- type: 'string'
- },
- customFontSize: {
- type: 'number'
- },
- width: {
- type: 'string'
- }
- },
- migrate: migrateCustomColorsAndFontSizes,
- save(_ref3) {
- let {
- attributes
- } = _ref3;
- const {
- width,
- align,
- content,
- dropCap,
- backgroundColor,
- textColor,
- customBackgroundColor,
- customTextColor,
- fontSize,
- customFontSize
- } = attributes;
- const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const fontSizeClass = fontSize && `is-${fontSize}-text`;
- const className = classnames_default()({
- [`align${width}`]: width,
- 'has-background': backgroundColor || customBackgroundColor,
- 'has-drop-cap': dropCap,
- [fontSizeClass]: fontSizeClass,
- [textClass]: textClass,
- [backgroundClass]: backgroundClass
- });
- const styles = {
- backgroundColor: backgroundClass ? undefined : customBackgroundColor,
- color: textClass ? undefined : customTextColor,
- fontSize: fontSizeClass ? undefined : customFontSize,
- textAlign: align
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "p",
- style: styles,
- className: className ? className : undefined,
- value: content
- });
- }
- }, {
- supports: deprecated_supports,
- attributes: (0,external_lodash_namespaceObject.omit)({ ...paragraph_deprecated_blockAttributes,
- fontSize: {
- type: 'number'
- }
- }, ['style']),
- save(_ref4) {
- let {
- attributes
- } = _ref4;
- const {
- width,
- align,
- content,
- dropCap,
- backgroundColor,
- textColor,
- fontSize
- } = attributes;
- const className = classnames_default()({
- [`align${width}`]: width,
- 'has-background': backgroundColor,
- 'has-drop-cap': dropCap
- });
- const styles = {
- backgroundColor,
- color: textColor,
- fontSize,
- textAlign: align
- };
- return (0,external_wp_element_namespaceObject.createElement)("p", {
- style: styles,
- className: className ? className : undefined
- }, content);
- },
- migrate(attributes) {
- return migrateCustomColorsAndFontSizes((0,external_lodash_namespaceObject.omit)({ ...attributes,
- customFontSize: (0,external_lodash_namespaceObject.isFinite)(attributes.fontSize) ? attributes.fontSize : undefined,
- customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
- customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined
- }), ['fontSize', 'textColor', 'backgroundColor', 'style']);
- }
- }, {
- supports: deprecated_supports,
- attributes: { ...paragraph_deprecated_blockAttributes,
- content: {
- type: 'string',
- source: 'html',
- default: ''
- }
- },
- save(_ref5) {
- let {
- attributes
- } = _ref5;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content);
- },
- migrate(attributes) {
- return attributes;
- }
- }];
- /* harmony default export */ var paragraph_deprecated = (paragraph_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-ltr.js
- /**
- * WordPress dependencies
- */
- const formatLtr = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "-2 -2 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"
- }));
- /* harmony default export */ var format_ltr = (formatLtr);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const paragraph_edit_name = 'core/paragraph';
- function ParagraphRTLControl(_ref) {
- let {
- direction,
- setDirection
- } = _ref;
- return (0,external_wp_i18n_namespaceObject.isRTL)() && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
- controls: [{
- icon: format_ltr,
- title: (0,external_wp_i18n_namespaceObject._x)('Left to right', 'editor button'),
- isActive: direction === 'ltr',
- onClick() {
- setDirection(direction === 'ltr' ? undefined : 'ltr');
- }
- }]
- });
- }
- function ParagraphBlock(_ref2) {
- let {
- attributes,
- mergeBlocks,
- onReplace,
- onRemove,
- setAttributes,
- clientId
- } = _ref2;
- const {
- align,
- content,
- direction,
- dropCap,
- placeholder
- } = attributes;
- const isDropCapFeatureEnabled = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.dropCap');
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- 'has-drop-cap': dropCap,
- [`has-text-align-${align}`]: align
- }),
- style: {
- direction
- }
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: align,
- onChange: newAlign => setAttributes({
- align: newAlign
- })
- }), (0,external_wp_element_namespaceObject.createElement)(ParagraphRTLControl, {
- direction: direction,
- setDirection: newDirection => setAttributes({
- direction: newDirection
- })
- })), isDropCapFeatureEnabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "typography"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
- hasValue: () => !!dropCap,
- label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
- onDeselect: () => setAttributes({
- dropCap: undefined
- }),
- resetAllFilter: () => ({
- dropCap: undefined
- }),
- panelId: clientId
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
- checked: !!dropCap,
- onChange: () => setAttributes({
- dropCap: !dropCap
- }),
- help: dropCap ? (0,external_wp_i18n_namespaceObject.__)('Showing large initial letter.') : (0,external_wp_i18n_namespaceObject.__)('Toggle to show a large initial letter.')
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
- identifier: "content",
- tagName: "p"
- }, blockProps, {
- value: content,
- onChange: newContent => setAttributes({
- content: newContent
- }),
- onSplit: (value, isOriginal) => {
- let newAttributes;
- if (isOriginal || value) {
- newAttributes = { ...attributes,
- content: value
- };
- }
- const block = (0,external_wp_blocks_namespaceObject.createBlock)(paragraph_edit_name, newAttributes);
- if (isOriginal) {
- block.clientId = clientId;
- }
- return block;
- },
- onMerge: mergeBlocks,
- onReplace: onReplace,
- onRemove: onRemove,
- "aria-label": content ? (0,external_wp_i18n_namespaceObject.__)('Paragraph block') : (0,external_wp_i18n_namespaceObject.__)('Empty block; start writing or type forward slash to choose a block'),
- "data-empty": content ? false : true,
- placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'),
- __unstableEmbedURLOnPaste: true,
- __unstableAllowPrefixTransformations: true
- })));
- }
- /* harmony default export */ var paragraph_edit = (ParagraphBlock);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function paragraph_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- align,
- content,
- dropCap,
- direction
- } = attributes;
- const className = classnames_default()({
- 'has-drop-cap': dropCap,
- [`has-text-align-${align}`]: align
- });
- return (0,external_wp_element_namespaceObject.createElement)("p", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className,
- dir: direction
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: content
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const {
- name: paragraph_transforms_name
- } = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/paragraph",
- title: "Paragraph",
- category: "text",
- description: "Start with the basic building block of all narrative.",
- keywords: ["text"],
- textdomain: "default",
- attributes: {
- align: {
- type: "string"
- },
- content: {
- type: "string",
- source: "html",
- selector: "p",
- "default": "",
- __experimentalRole: "content"
- },
- dropCap: {
- type: "boolean",
- "default": false
- },
- placeholder: {
- type: "string"
- },
- direction: {
- type: "string",
- "enum": ["ltr", "rtl"]
- }
- },
- supports: {
- anchor: true,
- className: false,
- color: {
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- __experimentalSelector: "p",
- __unstablePasteTextInline: true
- },
- editorStyle: "wp-block-paragraph-editor",
- style: "wp-block-paragraph"
- };
- const paragraph_transforms_transforms = {
- from: [{
- type: 'raw',
- // Paragraph is a fallback and should be matched last.
- priority: 20,
- selector: 'p',
- schema: _ref => {
- let {
- phrasingContentSchema,
- isPaste
- } = _ref;
- return {
- p: {
- children: phrasingContentSchema,
- attributes: isPaste ? [] : ['style', 'id']
- }
- };
- },
- transform(node) {
- const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(paragraph_transforms_name, node.outerHTML);
- const {
- textAlign
- } = node.style || {};
- if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
- attributes.align = textAlign;
- }
- return (0,external_wp_blocks_namespaceObject.createBlock)(paragraph_transforms_name, attributes);
- }
- }]
- };
- /* harmony default export */ var paragraph_transforms = (paragraph_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const paragraph_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/paragraph",
- title: "Paragraph",
- category: "text",
- description: "Start with the basic building block of all narrative.",
- keywords: ["text"],
- textdomain: "default",
- attributes: {
- align: {
- type: "string"
- },
- content: {
- type: "string",
- source: "html",
- selector: "p",
- "default": "",
- __experimentalRole: "content"
- },
- dropCap: {
- type: "boolean",
- "default": false
- },
- placeholder: {
- type: "string"
- },
- direction: {
- type: "string",
- "enum": ["ltr", "rtl"]
- }
- },
- supports: {
- anchor: true,
- className: false,
- color: {
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- __experimentalSelector: "p",
- __unstablePasteTextInline: true
- },
- editorStyle: "wp-block-paragraph-editor",
- style: "wp-block-paragraph"
- };
- const {
- name: paragraph_name
- } = paragraph_metadata;
- const paragraph_settings = {
- icon: library_paragraph,
- example: {
- attributes: {
- content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'),
- style: {
- typography: {
- fontSize: 28
- }
- },
- dropCap: true
- }
- },
- __experimentalLabel(attributes, _ref) {
- let {
- context
- } = _ref;
- if (context === 'accessibility') {
- const {
- content
- } = attributes;
- return (0,external_lodash_namespaceObject.isEmpty)(content) ? (0,external_wp_i18n_namespaceObject.__)('Empty') : content;
- }
- },
- transforms: paragraph_transforms,
- deprecated: paragraph_deprecated,
- merge(attributes, attributesToMerge) {
- return {
- content: (attributes.content || '') + (attributesToMerge.content || '')
- };
- },
- edit: paragraph_edit,
- save: paragraph_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function PostAuthorEdit(_ref) {
- let {
- isSelected,
- context: {
- postType,
- postId,
- queryId
- },
- attributes,
- setAttributes
- } = _ref;
- const isDescendentOfQueryLoop = Number.isFinite(queryId);
- const {
- authorId,
- authorDetails,
- authors
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getEditedEntityRecor;
- const {
- getEditedEntityRecord,
- getUser,
- getUsers
- } = select(external_wp_coreData_namespaceObject.store);
- const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
- return {
- authorId: _authorId,
- authorDetails: _authorId ? getUser(_authorId) : null,
- authors: getUsers({
- who: 'authors'
- })
- };
- }, [postType, postId]);
- const {
- editEntityRecord
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
- const {
- textAlign,
- showAvatar,
- showBio,
- byline
- } = attributes;
- const avatarSizes = [];
- if (authorDetails) {
- (0,external_lodash_namespaceObject.forEach)(authorDetails.avatar_urls, (url, size) => {
- avatarSizes.push({
- value: size,
- label: `${size} x ${size}`
- });
- });
- }
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Author Settings')
- }, !isDescendentOfQueryLoop && !!(authors !== null && authors !== void 0 && authors.length) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Author'),
- value: authorId,
- options: authors.map(_ref2 => {
- let {
- id,
- name
- } = _ref2;
- return {
- value: id,
- label: name
- };
- }),
- onChange: nextAuthorId => {
- editEntityRecord('postType', postType, postId, {
- author: nextAuthorId
- });
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show avatar'),
- checked: showAvatar,
- onChange: () => setAttributes({
- showAvatar: !showAvatar
- })
- }), showAvatar && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Avatar size'),
- value: attributes.avatarSize,
- options: avatarSizes,
- onChange: size => {
- setAttributes({
- avatarSize: Number(size)
- });
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show bio'),
- checked: showBio,
- onChange: () => setAttributes({
- showBio: !showBio
- })
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, showAvatar && authorDetails && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-post-author__avatar"
- }, (0,external_wp_element_namespaceObject.createElement)("img", {
- width: attributes.avatarSize,
- src: authorDetails.avatar_urls[attributes.avatarSize],
- alt: authorDetails.name
- })), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-post-author__content"
- }, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(byline) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- className: "wp-block-post-author__byline",
- multiline: false,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post author byline text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write byline…'),
- value: byline,
- onChange: value => setAttributes({
- byline: value
- })
- }), (0,external_wp_element_namespaceObject.createElement)("p", {
- className: "wp-block-post-author__name"
- }, (authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) || (0,external_wp_i18n_namespaceObject.__)('Post Author')), showBio && (0,external_wp_element_namespaceObject.createElement)("p", {
- className: "wp-block-post-author__bio"
- }, authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.description))));
- }
- /* harmony default export */ var post_author_edit = (PostAuthorEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-author.js
- /**
- * WordPress dependencies
- */
- const postAuthor = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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",
- fillRule: "evenodd",
- clipRule: "evenodd"
- }));
- /* harmony default export */ var post_author = (postAuthor);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
- /**
- * Internal dependencies
- */
- const post_author_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-author",
- title: "Post Author",
- category: "theme",
- description: "Display post author details such as name, avatar, and bio.",
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- },
- avatarSize: {
- type: "number",
- "default": 48
- },
- showAvatar: {
- type: "boolean",
- "default": true
- },
- showBio: {
- type: "boolean"
- },
- byline: {
- type: "string"
- }
- },
- usesContext: ["postType", "postId", "queryId"],
- supports: {
- html: false,
- spacing: {
- margin: true,
- padding: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- color: {
- gradients: true,
- link: true,
- __experimentalDuotone: ".wp-block-post-author__avatar img",
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- }
- },
- editorStyle: "wp-block-post-author-editor",
- style: "wp-block-post-author"
- };
- /**
- * WordPress dependencies
- */
- const {
- name: post_author_name
- } = post_author_metadata;
- const post_author_settings = {
- icon: post_author,
- edit: post_author_edit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-biography/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function PostAuthorBiographyEdit(_ref) {
- let {
- context: {
- postType,
- postId
- },
- attributes: {
- textAlign
- },
- setAttributes
- } = _ref;
- const {
- authorDetails
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getEditedEntityRecor;
- const {
- getEditedEntityRecord,
- getUser
- } = select(external_wp_coreData_namespaceObject.store);
- const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
- return {
- authorDetails: _authorId ? getUser(_authorId) : null
- };
- }, [postType, postId]);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- const displayAuthorBiography = (authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.description) || (0,external_wp_i18n_namespaceObject.__)('Author Biography');
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, " ", displayAuthorBiography, " "));
- }
- /* harmony default export */ var post_author_biography_edit = (PostAuthorBiographyEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js
- /**
- * Internal dependencies
- */
- const post_author_biography_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-author-biography",
- title: "Post Author Biography",
- category: "theme",
- description: "The author biography.",
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- }
- },
- usesContext: ["postType", "postId"],
- supports: {
- spacing: {
- margin: true,
- padding: true
- },
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- }
- };
- /**
- * WordPress dependencies
- */
- const {
- name: post_author_biography_name
- } = post_author_biography_metadata;
- const post_author_biography_settings = {
- icon: post_author,
- edit: post_author_biography_edit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/form.js
- /**
- * WordPress dependencies
- */
- const CommentsForm = () => {
- const disabledFormRef = (0,external_wp_compose_namespaceObject.__experimentalUseDisabled)();
- const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CommentsForm);
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "comment-respond"
- }, (0,external_wp_element_namespaceObject.createElement)("h3", {
- className: "comment-reply-title"
- }, (0,external_wp_i18n_namespaceObject.__)('Leave a Reply')), (0,external_wp_element_namespaceObject.createElement)("form", {
- noValidate: true,
- className: "comment-form",
- ref: disabledFormRef
- }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("label", {
- htmlFor: `comment-${instanceId}`
- }, (0,external_wp_i18n_namespaceObject.__)('Comment')), (0,external_wp_element_namespaceObject.createElement)("textarea", {
- id: `comment-${instanceId}`,
- name: "comment",
- cols: "45",
- rows: "8"
- })), (0,external_wp_element_namespaceObject.createElement)("p", {
- className: "form-submit wp-block-button"
- }, (0,external_wp_element_namespaceObject.createElement)("input", {
- name: "submit",
- type: "submit",
- className: "submit wp-block-button__link",
- label: (0,external_wp_i18n_namespaceObject.__)('Post Comment'),
- value: (0,external_wp_i18n_namespaceObject.__)('Post Comment')
- }))));
- };
- /* harmony default export */ var post_comments_form_form = (CommentsForm);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function PostCommentsEdit(_ref) {
- let {
- attributes: {
- textAlign
- },
- setAttributes,
- context: {
- postType,
- postId
- }
- } = _ref;
- let [postTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
- postTitle = postTitle || (0,external_wp_i18n_namespaceObject.__)('Post Title');
- const [commentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId);
- const {
- avatarURL,
- defaultCommentStatus
- } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
- const isSiteEditor = postType === undefined || postId === undefined;
- const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _select$getPostType;
- return postType ? !!((_select$getPostType = select(external_wp_coreData_namespaceObject.store).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
- });
- let warning = (0,external_wp_i18n_namespaceObject.__)('Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the "Comments Query Loop" block.');
- let showPlaceholder = true;
- if (!isSiteEditor && 'open' !== commentStatus) {
- if ('closed' === commentStatus) {
- warning = (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: 1: Post type (i.e. "post", "page") */
- (0,external_wp_i18n_namespaceObject.__)('Post Comments block: Comments to this %s are not allowed.'), postType);
- showPlaceholder = false;
- } else if (!postTypeSupportsComments) {
- warning = (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: 1: Post type (i.e. "post", "page") */
- (0,external_wp_i18n_namespaceObject.__)('Post Comments block: Comments for this post type (%s) are not enabled.'), postType);
- showPlaceholder = false;
- } else if ('open' !== defaultCommentStatus) {
- warning = (0,external_wp_i18n_namespaceObject.__)('Post Comments block: Comments are not enabled.');
- showPlaceholder = false;
- }
- }
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- const disabledRef = (0,external_wp_compose_namespaceObject.__experimentalUseDisabled)();
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, warning), showPlaceholder && (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-post-comments__placeholder",
- ref: disabledRef
- }, (0,external_wp_element_namespaceObject.createElement)("h3", null,
- /* translators: %s: Post title. */
- (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle)), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "navigation"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "alignleft"
- }, (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#top"
- }, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "alignright"
- }, (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#top"
- }, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_wp_element_namespaceObject.createElement)("ol", {
- className: "commentlist"
- }, (0,external_wp_element_namespaceObject.createElement)("li", {
- className: "comment even thread-even depth-1"
- }, (0,external_wp_element_namespaceObject.createElement)("article", {
- className: "comment-body"
- }, (0,external_wp_element_namespaceObject.createElement)("footer", {
- className: "comment-meta"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "comment-author vcard"
- }, (0,external_wp_element_namespaceObject.createElement)("img", {
- alt: "Commenter Avatar",
- src: avatarURL,
- className: "avatar avatar-32 photo",
- height: "32",
- width: "32",
- loading: "lazy"
- }), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: Comment author link. */
- (0,external_wp_i18n_namespaceObject.__)('%s <span>says:</span>'), (0,external_wp_i18n_namespaceObject.sprintf)('<cite><a>%s</a></cite>', (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))), {
- span: (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "says"
- }),
- a:
- /* eslint-disable jsx-a11y/anchor-has-content */
- (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#top",
- className: "url"
- })
- /* eslint-enable jsx-a11y/anchor-has-content */
- ,
- cite: (0,external_wp_element_namespaceObject.createElement)("cite", {
- className: "fn"
- })
- })), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "comment-metadata"
- }, (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#top"
- }, (0,external_wp_element_namespaceObject.createElement)("time", {
- dateTime: "2000-01-01T12:00:00+00:00"
- }, (0,external_wp_i18n_namespaceObject.__)('January 1, 2000 at 12:00 am'))), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "edit-link"
- }, (0,external_wp_element_namespaceObject.createElement)("a", {
- className: "comment-edit-link",
- href: "#top"
- }, (0,external_wp_i18n_namespaceObject.__)('Edit'))))), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "comment-content"
- }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Hi, this is a comment.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Commenter avatars come from <a>Gravatar</a>'), {
- a:
- /* eslint-disable-next-line jsx-a11y/anchor-has-content */
- (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "https://gravatar.com/"
- })
- }))), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "reply"
- }, (0,external_wp_element_namespaceObject.createElement)("a", {
- className: "comment-reply-link",
- href: "#top",
- "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: Comment reply button text. %s: Comment author name. */
- (0,external_wp_i18n_namespaceObject.__)('Reply to %s'), (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))
- }, (0,external_wp_i18n_namespaceObject.__)('Reply')))))), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "navigation"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "alignleft"
- }, (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#top"
- }, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "alignright"
- }, (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#top"
- }, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_wp_element_namespaceObject.createElement)(post_comments_form_form, null))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const post_comments_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-comments",
- title: "Post Comments (deprecated)",
- category: "theme",
- description: "This block is deprecated. Please use the Comments Query Loop block instead.",
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- }
- },
- usesContext: ["postId", "postType"],
- supports: {
- html: false,
- align: ["wide", "full"],
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- inserter: false
- },
- style: ["wp-block-post-comments", "wp-block-buttons", "wp-block-button"],
- editorStyle: "wp-block-post-comments-editor"
- };
- const {
- name: post_comments_name
- } = post_comments_metadata;
- const post_comments_settings = {
- icon: post_comments,
- edit: PostCommentsEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments-form.js
- /**
- * WordPress dependencies
- */
- const postCommentsForm = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"
- }));
- /* harmony default export */ var post_comments_form = (postCommentsForm);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function PostCommentsFormEdit(_ref) {
- let {
- attributes,
- context,
- setAttributes
- } = _ref;
- const {
- textAlign
- } = attributes;
- const {
- postId,
- postType
- } = context;
- const [commentStatus, setCommentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- const isSiteEditor = postType === undefined || postId === undefined;
- const {
- defaultCommentStatus
- } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
- const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _select$getPostType;
- return postType ? !!((_select$getPostType = select(external_wp_coreData_namespaceObject.store).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
- });
- let warning = false;
- let actions;
- let showPlaceholder = true;
- if (!isSiteEditor && 'open' !== commentStatus) {
- if ('closed' === commentStatus) {
- warning = (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this item.');
- actions = [(0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- key: "enableComments",
- onClick: () => setCommentStatus('open'),
- variant: "primary"
- }, (0,external_wp_i18n_namespaceObject._x)('Enable comments', 'action that affects the current post'))];
- showPlaceholder = false;
- } else if (!postTypeSupportsComments) {
- warning = (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: 1: Post type (i.e. "post", "page") */
- (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this post type (%s).'), postType);
- showPlaceholder = false;
- } else if ('open' !== defaultCommentStatus) {
- warning = (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled.');
- showPlaceholder = false;
- }
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, warning && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
- actions: actions
- }, warning), showPlaceholder ? (0,external_wp_element_namespaceObject.createElement)(post_comments_form_form, null) : null));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const post_comments_form_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-comments-form",
- title: "Post Comments Form",
- category: "theme",
- description: "Display a post's comments form.",
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- }
- },
- usesContext: ["postId", "postType"],
- supports: {
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- },
- editorStyle: "wp-block-post-comments-form-editor",
- style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"]
- };
- const {
- name: post_comments_form_name
- } = post_comments_form_metadata;
- const post_comments_form_settings = {
- icon: post_comments_form,
- edit: PostCommentsFormEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-content.js
- /**
- * WordPress dependencies
- */
- const postContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "https://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"
- }));
- /* harmony default export */ var post_content = (postContent);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/hooks.js
- /**
- * WordPress dependencies
- */
- /**
- * Returns whether the current user can edit the given entity.
- *
- * @param {string} kind Entity kind.
- * @param {string} name Entity name.
- * @param {string} recordId Record's id.
- */
- function useCanEditEntity(kind, name, recordId) {
- return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]);
- }
- /* harmony default export */ var hooks = ({
- useCanEditEntity
- });
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/edit.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function ReadOnlyContent(_ref) {
- let {
- userCanEdit,
- postType,
- postId
- } = _ref;
- const [,, content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- return content !== null && content !== void 0 && content.protected && !userCanEdit ? (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('This content is password protected.'))) : (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
- dangerouslySetInnerHTML: {
- __html: content === null || content === void 0 ? void 0 : content.rendered
- }
- }));
- }
- function EditableContent(_ref2) {
- let {
- layout,
- context = {}
- } = _ref2;
- const {
- postType,
- postId
- } = context;
- const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getSettings;
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- return (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout;
- }, []);
- const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
- const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
- const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, {
- id: postId
- });
- const props = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)((0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: 'entry-content'
- }), {
- value: blocks,
- onInput,
- onChange,
- __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", props);
- }
- function Content(props) {
- const {
- context: {
- queryId,
- postType,
- postId
- } = {}
- } = props;
- const isDescendentOfQueryLoop = Number.isFinite(queryId);
- const userCanEdit = useCanEditEntity('postType', postType, postId);
- const isEditable = userCanEdit && !isDescendentOfQueryLoop;
- return isEditable ? (0,external_wp_element_namespaceObject.createElement)(EditableContent, props) : (0,external_wp_element_namespaceObject.createElement)(ReadOnlyContent, {
- userCanEdit: userCanEdit,
- postType: postType,
- postId: postId
- });
- }
- function edit_Placeholder() {
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('This is the Post Content block, it will display all the blocks in any single post or page.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types registered at your site, the Post Content block can display the contents of those entries as well.')));
- }
- function RecursionError() {
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
- }
- function PostContentEdit(_ref3) {
- let {
- context,
- attributes
- } = _ref3;
- const {
- postId: contextPostId,
- postType: contextPostType
- } = context;
- const {
- layout = {}
- } = attributes;
- const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(contextPostId);
- if (contextPostId && contextPostType && hasAlreadyRendered) {
- return (0,external_wp_element_namespaceObject.createElement)(RecursionError, null);
- }
- return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, contextPostId && contextPostType ? (0,external_wp_element_namespaceObject.createElement)(Content, {
- context: context,
- layout: layout
- }) : (0,external_wp_element_namespaceObject.createElement)(edit_Placeholder, null));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const post_content_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-content",
- title: "Post Content",
- category: "theme",
- description: "Displays the contents of a post or page.",
- textdomain: "default",
- usesContext: ["postId", "postType", "queryId"],
- supports: {
- align: ["wide", "full"],
- html: false,
- __experimentalLayout: true
- },
- editorStyle: "wp-block-post-content-editor"
- };
- const {
- name: post_content_name
- } = post_content_metadata;
- const post_content_settings = {
- icon: post_content,
- edit: PostContentEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function PostDateEdit(_ref) {
- let {
- attributes: {
- textAlign,
- format,
- isLink
- },
- context: {
- postId,
- postType: postTypeSlug,
- queryId
- },
- setAttributes
- } = _ref;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- const timeRef = (0,external_wp_element_namespaceObject.useRef)();
- const isDescendentOfQueryLoop = Number.isFinite(queryId);
- const dateSettings = (0,external_wp_date_namespaceObject.__experimentalGetSettings)();
- const [siteFormat = dateSettings.formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
- const [siteTimeFormat = dateSettings.formats.time] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format');
- const [date, setDate] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'date', postId);
- const postType = (0,external_wp_data_namespaceObject.useSelect)(select => postTypeSlug ? select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug) : null, [postTypeSlug]);
- let postDate = date ? (0,external_wp_element_namespaceObject.createElement)("time", {
- dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date),
- ref: timeRef
- }, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)) : (0,external_wp_i18n_namespaceObject.__)('Post Date');
- if (isLink && date) {
- postDate = (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#post-date-pseudo-link",
- onClick: event => event.preventDefault()
- }, postDate);
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- }), date && !isDescendentOfQueryLoop && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
- popoverProps: {
- anchorRef: timeRef.current
- },
- renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DateTimePicker, {
- currentDate: date,
- onChange: setDate,
- is12Hour: is12HourFormat(siteTimeFormat)
- }),
- renderToggle: _ref2 => {
- let {
- isOpen,
- onToggle
- } = _ref2;
- const openOnArrowDown = event => {
- if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
- event.preventDefault();
- onToggle();
- }
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- "aria-expanded": isOpen,
- icon: library_edit,
- title: (0,external_wp_i18n_namespaceObject.__)('Change Date'),
- onClick: onToggle,
- onKeyDown: openOnArrowDown
- });
- }
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
- format: format,
- defaultFormat: siteFormat,
- onChange: nextFormat => setAttributes({
- format: nextFormat
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: postType !== null && postType !== void 0 && postType.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
- (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
- onChange: () => setAttributes({
- isLink: !isLink
- }),
- checked: isLink
- }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, postDate));
- }
- function is12HourFormat(format) {
- // To know if the time format is a 12 hour time, look for any of the 12 hour
- // format characters: 'a', 'A', 'g', and 'h'. The character must be
- // unescaped, i.e. not preceded by a '\'. Coincidentally, 'aAgh' is how I
- // feel when working with regular expressions.
- // https://www.php.net/manual/en/datetime.format.php
- return /(?:^|[^\\])[aAgh]/.test(format);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/deprecated.js
- /**
- * Internal dependencies
- */
- const post_date_deprecated_v1 = {
- attributes: {
- textAlign: {
- type: 'string'
- },
- format: {
- type: 'string'
- },
- isLink: {
- type: 'boolean',
- default: false
- }
- },
- supports: {
- html: false,
- color: {
- gradients: true,
- link: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true
- }
- },
- save() {
- return null;
- },
- migrate: migrate_font_family,
- isEligible(_ref) {
- var _style$typography;
- let {
- style
- } = _ref;
- return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
- }
- };
- /**
- * New deprecations need to be placed first
- * for them to have higher priority.
- *
- * Old deprecations may need to be updated as well.
- *
- * See block-deprecation.md
- */
- /* harmony default export */ var post_date_deprecated = ([post_date_deprecated_v1]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const post_date_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-date",
- title: "Post Date",
- category: "theme",
- description: "Add the date of this post.",
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- },
- format: {
- type: "string"
- },
- isLink: {
- type: "boolean",
- "default": false
- }
- },
- usesContext: ["postId", "postType", "queryId"],
- supports: {
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- }
- };
- const {
- name: post_date_name
- } = post_date_metadata;
- const post_date_settings = {
- icon: post_date,
- edit: PostDateEdit,
- deprecated: post_date_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-excerpt.js
- /**
- * WordPress dependencies
- */
- const postExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"
- }));
- /* harmony default export */ var post_excerpt = (postExcerpt);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function PostExcerptEditor(_ref) {
- let {
- attributes: {
- textAlign,
- moreText,
- showMoreOnNewLine
- },
- setAttributes,
- isSelected,
- context: {
- postId,
- postType,
- queryId
- }
- } = _ref;
- const isDescendentOfQueryLoop = Number.isFinite(queryId);
- const userCanEdit = useCanEditEntity('postType', postType, postId);
- const isEditable = userCanEdit && !isDescendentOfQueryLoop;
- const [rawExcerpt, setExcerpt, {
- rendered: renderedExcerpt,
- protected: isProtected
- } = {}] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'excerpt', postId);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- /**
- * When excerpt is editable, strip the html tags from
- * rendered excerpt. This will be used if the entity's
- * excerpt has been produced from the content.
- */
- const strippedRenderedExcerpt = (0,external_wp_element_namespaceObject.useMemo)(() => {
- if (!renderedExcerpt) return '';
- const document = new window.DOMParser().parseFromString(renderedExcerpt, 'text/html');
- return document.body.textContent || document.body.innerText || '';
- }, [renderedExcerpt]);
- if (!postType || !postId) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('This is the Post Excerpt block, it will display the excerpt from single posts.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types with support for excerpts, the Post Excerpt block can display the excerpts of those entries as well.')));
- }
- if (isProtected && !userCanEdit) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('There is no excerpt because this is a protected post.')));
- }
- const readMoreLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- className: "wp-block-post-excerpt__more-link",
- tagName: "a",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('"Read more" link text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add "read more" link text'),
- value: moreText,
- onChange: newMoreText => setAttributes({
- moreText: newMoreText
- }),
- withoutInteractiveFormatting: true
- });
- const excerptClassName = classnames_default()('wp-block-post-excerpt__excerpt', {
- 'is-inline': !showMoreOnNewLine
- });
- const excerptContent = isEditable ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- className: excerptClassName,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post excerpt text'),
- value: rawExcerpt || strippedRenderedExcerpt || (isSelected ? '' : (0,external_wp_i18n_namespaceObject.__)('No post excerpt found')),
- onChange: setExcerpt,
- tagName: "p"
- }) : (0,external_wp_element_namespaceObject.createElement)("p", {
- className: excerptClassName
- }, strippedRenderedExcerpt || (0,external_wp_i18n_namespaceObject.__)('No post excerpt found'));
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
- value: textAlign,
- onChange: newAlign => setAttributes({
- textAlign: newAlign
- })
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Post Excerpt Settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'),
- checked: showMoreOnNewLine,
- onChange: newShowMoreOnNewLine => setAttributes({
- showMoreOnNewLine: newShowMoreOnNewLine
- })
- }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? (0,external_wp_element_namespaceObject.createElement)("p", {
- className: "wp-block-post-excerpt__more-text"
- }, readMoreLink) : readMoreLink));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/transforms.js
- /**
- * WordPress dependencies
- */
- const post_excerpt_transforms_transforms = {
- from: [{
- type: 'block',
- blocks: ['core/post-content'],
- transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-excerpt')
- }],
- to: [{
- type: 'block',
- blocks: ['core/post-content'],
- transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-content')
- }]
- };
- /* harmony default export */ var post_excerpt_transforms = (post_excerpt_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const post_excerpt_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-excerpt",
- title: "Post Excerpt",
- category: "theme",
- description: "Display a post's excerpt.",
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- },
- moreText: {
- type: "string"
- },
- showMoreOnNewLine: {
- type: "boolean",
- "default": true
- }
- },
- usesContext: ["postId", "postType", "queryId"],
- supports: {
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- spacing: {
- margin: true,
- padding: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- },
- editorStyle: "wp-block-post-excerpt-editor",
- style: "wp-block-post-excerpt"
- };
- const {
- name: post_excerpt_name
- } = post_excerpt_metadata;
- const post_excerpt_settings = {
- icon: post_excerpt,
- transforms: post_excerpt_transforms,
- edit: PostExcerptEditor
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/dimension-controls.js
- /**
- * WordPress dependencies
- */
- const SCALE_OPTIONS = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "cover",
- label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for Image dimension control')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "contain",
- label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for Image dimension control')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "fill",
- label: (0,external_wp_i18n_namespaceObject._x)('Fill', 'Scale option for Image dimension control')
- }));
- const DEFAULT_SCALE = 'cover';
- const DEFAULT_SIZE = 'full';
- const scaleHelp = {
- cover: (0,external_wp_i18n_namespaceObject.__)('Image is scaled and cropped to fill the entire space without being distorted.'),
- contain: (0,external_wp_i18n_namespaceObject.__)('Image is scaled to fill the space without clipping nor distorting.'),
- fill: (0,external_wp_i18n_namespaceObject.__)('Image will be stretched and distorted to completely fill the space.')
- };
- const DimensionControls = _ref => {
- let {
- clientId,
- attributes: {
- width,
- height,
- scale,
- sizeSlug
- },
- setAttributes,
- imageSizeOptions = []
- } = _ref;
- const defaultUnits = ['px', '%', 'vw', 'em', 'rem'];
- const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
- availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || defaultUnits
- });
- const onDimensionChange = (dimension, nextValue) => {
- const parsedValue = parseFloat(nextValue);
- /**
- * If we have no value set and we change the unit,
- * we don't want to set the attribute, as it would
- * end up having the unit as value without any number.
- */
- if (isNaN(parsedValue) && nextValue) return;
- setAttributes({
- [dimension]: parsedValue < 0 ? '0' : nextValue
- });
- };
- const scaleLabel = (0,external_wp_i18n_namespaceObject._x)('Scale', 'Image scaling options');
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "dimensions"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
- className: "single-column",
- hasValue: () => !!height,
- label: (0,external_wp_i18n_namespaceObject.__)('Height'),
- onDeselect: () => setAttributes({
- height: undefined
- }),
- resetAllFilter: () => ({
- height: undefined
- }),
- isShownByDefault: true,
- panelId: clientId
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Height'),
- labelPosition: "top",
- value: height || '',
- min: 0,
- onChange: nextHeight => onDimensionChange('height', nextHeight),
- units: units
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
- className: "single-column",
- hasValue: () => !!width,
- label: (0,external_wp_i18n_namespaceObject.__)('Width'),
- onDeselect: () => setAttributes({
- width: undefined
- }),
- resetAllFilter: () => ({
- width: undefined
- }),
- isShownByDefault: true,
- panelId: clientId
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Width'),
- labelPosition: "top",
- value: width || '',
- min: 0,
- onChange: nextWidth => onDimensionChange('width', nextWidth),
- units: units
- })), !!height && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
- hasValue: () => !!scale && scale !== DEFAULT_SCALE,
- label: scaleLabel,
- onDeselect: () => setAttributes({
- scale: DEFAULT_SCALE
- }),
- resetAllFilter: () => ({
- scale: DEFAULT_SCALE
- }),
- isShownByDefault: true,
- panelId: clientId
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
- label: scaleLabel,
- value: scale,
- help: scaleHelp[scale],
- onChange: value => setAttributes({
- scale: value
- }),
- isBlock: true
- }, SCALE_OPTIONS)), !!imageSizeOptions.length && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
- hasValue: () => !!sizeSlug,
- label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
- onDeselect: () => setAttributes({
- sizeSlug: undefined
- }),
- resetAllFilter: () => ({
- sizeSlug: undefined
- }),
- isShownByDefault: false,
- panelId: clientId
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
- value: sizeSlug || DEFAULT_SIZE,
- options: imageSizeOptions,
- onChange: nextSizeSlug => setAttributes({
- sizeSlug: nextSizeSlug
- }),
- help: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source image.')
- })));
- };
- /* harmony default export */ var dimension_controls = (DimensionControls);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/edit.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const placeholderIllustration = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- className: "components-placeholder__illustration",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 60 60",
- preserveAspectRatio: "none"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- vectorEffect: "non-scaling-stroke",
- d: "M60 60 0 0"
- }));
- const post_featured_image_edit_ALLOWED_MEDIA_TYPES = ['image'];
- const placeholderChip = (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-post-featured-image__placeholder"
- }, placeholderIllustration);
- function getMediaSourceUrlBySizeSlug(media, slug) {
- var _media$media_details, _media$media_details$, _media$media_details$2;
- return (media === null || media === void 0 ? void 0 : (_media$media_details = media.media_details) === null || _media$media_details === void 0 ? void 0 : (_media$media_details$ = _media$media_details.sizes) === null || _media$media_details$ === void 0 ? void 0 : (_media$media_details$2 = _media$media_details$[slug]) === null || _media$media_details$2 === void 0 ? void 0 : _media$media_details$2.source_url) || (media === null || media === void 0 ? void 0 : media.source_url);
- }
- function PostFeaturedImageDisplay(_ref) {
- let {
- clientId,
- attributes,
- setAttributes,
- context: {
- postId,
- postType: postTypeSlug,
- queryId
- }
- } = _ref;
- const isDescendentOfQueryLoop = Number.isFinite(queryId);
- const {
- isLink,
- height,
- width,
- scale,
- sizeSlug
- } = attributes;
- const [featuredImage, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'featured_media', postId);
- const {
- media,
- postType
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getMedia,
- getPostType
- } = select(external_wp_coreData_namespaceObject.store);
- return {
- media: featuredImage && getMedia(featuredImage, {
- context: 'view'
- }),
- postType: postTypeSlug && getPostType(postTypeSlug)
- };
- }, [featuredImage, postTypeSlug]);
- const mediaUrl = getMediaSourceUrlBySizeSlug(media, sizeSlug);
- const imageSizes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().imageSizes, []);
- const imageSizeOptions = imageSizes.filter(_ref2 => {
- var _media$media_details2, _media$media_details3, _media$media_details4;
- let {
- slug
- } = _ref2;
- return media === null || media === void 0 ? void 0 : (_media$media_details2 = media.media_details) === null || _media$media_details2 === void 0 ? void 0 : (_media$media_details3 = _media$media_details2.sizes) === null || _media$media_details3 === void 0 ? void 0 : (_media$media_details4 = _media$media_details3[slug]) === null || _media$media_details4 === void 0 ? void 0 : _media$media_details4.source_url;
- }).map(_ref3 => {
- let {
- name,
- slug
- } = _ref3;
- return {
- value: slug,
- label: name
- };
- });
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- style: {
- width,
- height
- }
- });
- const placeholder = content => {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- className: "block-editor-media-placeholder"
- }, placeholderIllustration, content);
- };
- const onSelectImage = value => {
- if (value !== null && value !== void 0 && value.id) {
- setFeaturedImage(value.id);
- }
- };
- const {
- createErrorNotice
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
- const onUploadError = message => {
- createErrorNotice(message[2], {
- type: 'snackbar'
- });
- };
- const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(dimension_controls, {
- clientId: clientId,
- attributes: attributes,
- setAttributes: setAttributes,
- imageSizeOptions: imageSizeOptions
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: postType !== null && postType !== void 0 && postType.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
- (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
- onChange: () => setAttributes({
- isLink: !isLink
- }),
- checked: isLink
- }))));
- let image;
- if (!featuredImage && isDescendentOfQueryLoop) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, placeholderChip));
- }
- const label = (0,external_wp_i18n_namespaceObject.__)('Add a featured image');
- if (!featuredImage) {
- image = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
- onSelect: onSelectImage,
- accept: "image/*",
- allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
- onError: onUploadError,
- placeholder: placeholder,
- mediaLibraryButton: _ref4 => {
- let {
- open
- } = _ref4;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- icon: library_upload,
- variant: "primary",
- label: label,
- showTooltip: true,
- tooltipPosition: "top center",
- onClick: () => {
- open();
- }
- });
- }
- });
- } else {
- // We have a Featured image so show a Placeholder if is loading.
- image = !media ? placeholderChip : (0,external_wp_element_namespaceObject.createElement)("img", {
- src: mediaUrl,
- alt: media.alt_text ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The image's alt text.
- (0,external_wp_i18n_namespaceObject.__)('Featured image: %s'), media.alt_text) : (0,external_wp_i18n_namespaceObject.__)('Featured image'),
- style: {
- height,
- objectFit: height && scale
- }
- });
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, !!media && !isDescendentOfQueryLoop && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
- mediaId: featuredImage,
- mediaURL: mediaUrl,
- allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
- accept: "image/*",
- onSelect: onSelectImage,
- onError: onUploadError
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
- onClick: () => setFeaturedImage(0)
- }, (0,external_wp_i18n_namespaceObject.__)('Reset')))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, image));
- }
- function PostFeaturedImageEdit(props) {
- var _props$context;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- if (!((_props$context = props.context) !== null && _props$context !== void 0 && _props$context.postId)) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, placeholderChip);
- }
- return (0,external_wp_element_namespaceObject.createElement)(PostFeaturedImageDisplay, props);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const post_featured_image_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-featured-image",
- title: "Post Featured Image",
- category: "theme",
- description: "Display a post's featured image.",
- textdomain: "default",
- attributes: {
- isLink: {
- type: "boolean",
- "default": false
- },
- width: {
- type: "string"
- },
- height: {
- type: "string"
- },
- scale: {
- type: "string",
- "default": "cover"
- },
- sizeSlug: {
- type: "string"
- }
- },
- usesContext: ["postId", "postType", "queryId"],
- supports: {
- align: ["left", "right", "center", "wide", "full"],
- color: {
- __experimentalDuotone: "img, .wp-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before",
- text: false,
- background: false
- },
- html: false,
- spacing: {
- margin: true,
- padding: true
- }
- },
- editorStyle: "wp-block-post-featured-image-editor",
- style: "wp-block-post-featured-image"
- };
- const {
- name: post_featured_image_name
- } = post_featured_image_metadata;
- const post_featured_image_settings = {
- icon: post_featured_image,
- edit: PostFeaturedImageEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function PostNavigationLinkEdit(_ref) {
- let {
- attributes: {
- type,
- label,
- showTitle,
- textAlign,
- linkLabel
- },
- setAttributes
- } = _ref;
- const isNext = type === 'next';
- let placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next') : (0,external_wp_i18n_namespaceObject.__)('Previous');
- if (showTitle) {
- /* translators: Label before for next and previous post. There is a space after the colon. */
- placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next: ') : (0,external_wp_i18n_namespaceObject.__)('Previous: ');
- }
- const ariaLabel = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next post') : (0,external_wp_i18n_namespaceObject.__)('Previous post');
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display the title as a link'),
- help: (0,external_wp_i18n_namespaceObject.__)('If you have entered a custom label, it will be prepended before the title.'),
- checked: !!showTitle,
- onChange: () => setAttributes({
- showTitle: !showTitle
- })
- }), showTitle && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Include the label as part of the link'),
- checked: !!linkLabel,
- onChange: () => setAttributes({
- linkLabel: !linkLabel
- })
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: "a",
- "aria-label": ariaLabel,
- placeholder: placeholder,
- value: label,
- allowedFormats: ['core/bold', 'core/italic'],
- onChange: newLabel => setAttributes({
- label: newLabel
- })
- }), showTitle && (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#post-navigation-pseudo-link",
- onClick: event => event.preventDefault()
- }, (0,external_wp_i18n_namespaceObject.__)('An example title'))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/next.js
- /**
- * WordPress dependencies
- */
- const next = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"
- }));
- /* harmony default export */ var library_next = (next);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/previous.js
- /**
- * WordPress dependencies
- */
- const previous = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"
- }));
- /* harmony default export */ var library_previous = (previous);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/variations.js
- /**
- * WordPress dependencies
- */
- const post_navigation_link_variations_variations = [{
- isDefault: true,
- name: 'post-next',
- title: (0,external_wp_i18n_namespaceObject.__)('Next post'),
- description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that follows the current post.'),
- icon: library_next,
- attributes: {
- type: 'next'
- },
- scope: ['inserter', 'transform']
- }, {
- name: 'post-previous',
- title: (0,external_wp_i18n_namespaceObject.__)('Previous post'),
- description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that precedes the current post.'),
- icon: library_previous,
- attributes: {
- type: 'previous'
- },
- scope: ['inserter', 'transform']
- }];
- /**
- * Add `isActive` function to all `post-navigation-link` variations, if not defined.
- * `isActive` function is used to find a variation match from a created
- * Block by providing its attributes.
- */
- post_navigation_link_variations_variations.forEach(variation => {
- if (variation.isActive) return;
- variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
- });
- /* harmony default export */ var post_navigation_link_variations = (post_navigation_link_variations_variations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
- /**
- * Internal dependencies
- */
- const post_navigation_link_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-navigation-link",
- title: "Post Navigation Link",
- category: "theme",
- description: "Displays the next or previous post link that is adjacent to the current post.",
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- },
- type: {
- type: "string",
- "default": "next"
- },
- label: {
- type: "string"
- },
- showTitle: {
- type: "boolean",
- "default": false
- },
- linkLabel: {
- type: "boolean",
- "default": false
- }
- },
- supports: {
- reusable: false,
- html: false,
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- }
- };
- const {
- name: post_navigation_link_name
- } = post_navigation_link_metadata;
- const post_navigation_link_settings = {
- edit: PostNavigationLinkEdit,
- variations: post_navigation_link_variations
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const post_template_edit_TEMPLATE = [['core/post-title'], ['core/post-date'], ['core/post-excerpt']];
- function PostTemplateInnerBlocks() {
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
- className: 'wp-block-post'
- }, {
- template: post_template_edit_TEMPLATE
- });
- return (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps);
- }
- function PostTemplateBlockPreview(_ref) {
- let {
- blocks,
- blockContextId,
- isHidden,
- setActiveBlockContextId
- } = _ref;
- const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
- blocks,
- props: {
- className: 'wp-block-post'
- }
- });
- const handleOnClick = () => {
- setActiveBlockContextId(blockContextId);
- };
- const style = {
- display: isHidden ? 'none' : undefined
- };
- return (0,external_wp_element_namespaceObject.createElement)("li", _extends({}, blockPreviewProps, {
- tabIndex: 0 // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
- ,
- role: "button",
- onClick: handleOnClick,
- onKeyPress: handleOnClick,
- style: style
- }));
- }
- const MemoizedPostTemplateBlockPreview = (0,external_wp_element_namespaceObject.memo)(PostTemplateBlockPreview);
- function PostTemplateEdit(_ref2) {
- let {
- clientId,
- context: {
- query: {
- perPage,
- offset,
- postType,
- order,
- orderBy,
- author,
- search,
- exclude,
- sticky,
- inherit,
- taxQuery
- } = {},
- queryContext = [{
- page: 1
- }],
- templateSlug,
- displayLayout: {
- type: layoutType = 'flex',
- columns = 1
- } = {}
- }
- } = _ref2;
- const [{
- page
- }] = queryContext;
- const [activeBlockContextId, setActiveBlockContextId] = (0,external_wp_element_namespaceObject.useState)();
- const {
- posts,
- blocks
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getEntityRecords,
- getTaxonomies
- } = select(external_wp_coreData_namespaceObject.store);
- const {
- getBlocks
- } = select(external_wp_blockEditor_namespaceObject.store);
- const taxonomies = getTaxonomies({
- type: postType,
- per_page: -1,
- context: 'view'
- });
- const query = {
- offset: perPage ? perPage * (page - 1) + offset : 0,
- order,
- orderby: orderBy
- };
- if (taxQuery) {
- // We have to build the tax query for the REST API and use as
- // keys the taxonomies `rest_base` with the `term ids` as values.
- const builtTaxQuery = Object.entries(taxQuery).reduce((accumulator, _ref3) => {
- let [taxonomySlug, terms] = _ref3;
- const taxonomy = taxonomies === null || taxonomies === void 0 ? void 0 : taxonomies.find(_ref4 => {
- let {
- slug
- } = _ref4;
- return slug === taxonomySlug;
- });
- if (taxonomy !== null && taxonomy !== void 0 && taxonomy.rest_base) {
- accumulator[taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.rest_base] = terms;
- }
- return accumulator;
- }, {});
- if (!!Object.keys(builtTaxQuery).length) {
- Object.assign(query, builtTaxQuery);
- }
- }
- if (perPage) {
- query.per_page = perPage;
- }
- if (author) {
- query.author = author;
- }
- if (search) {
- query.search = search;
- }
- if (exclude !== null && exclude !== void 0 && exclude.length) {
- query.exclude = exclude;
- } // If sticky is not set, it will return all posts in the results.
- // If sticky is set to `only`, it will limit the results to sticky posts only.
- // If it is anything else, it will exclude sticky posts from results. For the record the value stored is `exclude`.
- if (sticky) {
- query.sticky = sticky === 'only';
- } // If `inherit` is truthy, adjust conditionally the query to create a better preview.
- if (inherit) {
- // Change the post-type if needed.
- if (templateSlug !== null && templateSlug !== void 0 && templateSlug.startsWith('archive-')) {
- query.postType = templateSlug.replace('archive-', '');
- postType = query.postType;
- }
- }
- return {
- posts: getEntityRecords('postType', postType, query),
- blocks: getBlocks(clientId)
- };
- }, [perPage, page, offset, order, orderBy, clientId, author, search, postType, exclude, sticky, inherit, templateSlug, taxQuery]);
- const blockContexts = (0,external_wp_element_namespaceObject.useMemo)(() => posts === null || posts === void 0 ? void 0 : posts.map(post => ({
- postType: post.type,
- postId: post.id
- })), [posts]);
- const hasLayoutFlex = layoutType === 'flex' && columns > 1;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- 'is-flex-container': hasLayoutFlex,
- [`columns-${columns}`]: hasLayoutFlex
- })
- });
- if (!posts) {
- return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
- }
- if (!posts.length) {
- return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, " ", (0,external_wp_i18n_namespaceObject.__)('No results found.'));
- } // To avoid flicker when switching active block contexts, a preview is rendered
- // for each block context, but the preview for the active block context is hidden.
- // This ensures that when it is displayed again, the cached rendering of the
- // block preview is used, instead of having to re-render the preview from scratch.
- return (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, blockContexts && blockContexts.map(blockContext => {
- var _blockContexts$, _blockContexts$2;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
- key: blockContext.postId,
- value: blockContext
- }, blockContext.postId === (activeBlockContextId || ((_blockContexts$ = blockContexts[0]) === null || _blockContexts$ === void 0 ? void 0 : _blockContexts$.postId)) ? (0,external_wp_element_namespaceObject.createElement)(PostTemplateInnerBlocks, null) : null, (0,external_wp_element_namespaceObject.createElement)(MemoizedPostTemplateBlockPreview, {
- blocks: blocks,
- blockContextId: blockContext.postId,
- setActiveBlockContextId: setActiveBlockContextId,
- isHidden: blockContext.postId === (activeBlockContextId || ((_blockContexts$2 = blockContexts[0]) === null || _blockContexts$2 === void 0 ? void 0 : _blockContexts$2.postId))
- }));
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/save.js
- /**
- * WordPress dependencies
- */
- function PostTemplateSave() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const post_template_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-template",
- title: "Post Template",
- category: "theme",
- parent: ["core/query"],
- description: "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",
- textdomain: "default",
- usesContext: ["queryId", "query", "queryContext", "displayLayout", "templateSlug"],
- supports: {
- reusable: false,
- html: false,
- align: true,
- __experimentalLayout: {
- allowEditing: false
- }
- },
- style: "wp-block-post-template",
- editorStyle: "wp-block-post-template-editor"
- };
- const {
- name: post_template_name
- } = post_template_metadata;
- const post_template_settings = {
- icon: library_layout,
- edit: PostTemplateEdit,
- save: PostTemplateSave
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/use-post-terms.js
- /**
- * WordPress dependencies
- */
- function usePostTerms(_ref) {
- var _term$visibility2;
- let {
- postId,
- postType,
- term
- } = _ref;
- const {
- rest_base: restBase,
- slug
- } = term;
- const [termIds] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, restBase, postId);
- return (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _term$visibility;
- const visible = term === null || term === void 0 ? void 0 : (_term$visibility = term.visibility) === null || _term$visibility === void 0 ? void 0 : _term$visibility.publicly_queryable;
- if (!visible) {
- return {
- postTerms: [],
- _isLoading: false,
- hasPostTerms: false
- };
- }
- if (!termIds) {
- var _term$postTerms;
- // Waiting for post terms to be fetched.
- return {
- isLoading: term === null || term === void 0 ? void 0 : (_term$postTerms = term.postTerms) === null || _term$postTerms === void 0 ? void 0 : _term$postTerms.includes(postType)
- };
- }
- if (!termIds.length) {
- return {
- isLoading: false
- };
- }
- const {
- getEntityRecords,
- isResolving
- } = select(external_wp_coreData_namespaceObject.store);
- const taxonomyArgs = ['taxonomy', slug, {
- include: termIds,
- context: 'view'
- }];
- const terms = getEntityRecords(...taxonomyArgs);
- const _isLoading = isResolving('getEntityRecords', taxonomyArgs);
- return {
- postTerms: terms,
- isLoading: _isLoading,
- hasPostTerms: !!(terms !== null && terms !== void 0 && terms.length)
- };
- }, [termIds, term === null || term === void 0 ? void 0 : (_term$visibility2 = term.visibility) === null || _term$visibility2 === void 0 ? void 0 : _term$visibility2.publicly_queryable]);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function PostTermsEdit(_ref) {
- var _selectedTerm$labels;
- let {
- attributes,
- clientId,
- context,
- setAttributes
- } = _ref;
- const {
- term,
- textAlign,
- separator
- } = attributes;
- const {
- postId,
- postType
- } = context;
- const selectedTerm = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _taxonomy$visibility;
- if (!term) return {};
- const {
- getTaxonomy
- } = select(external_wp_coreData_namespaceObject.store);
- const taxonomy = getTaxonomy(term);
- return taxonomy !== null && taxonomy !== void 0 && (_taxonomy$visibility = taxonomy.visibility) !== null && _taxonomy$visibility !== void 0 && _taxonomy$visibility.publicly_queryable ? taxonomy : {};
- }, [term]);
- const {
- postTerms,
- hasPostTerms,
- isLoading
- } = usePostTerms({
- postId,
- postType,
- term: selectedTerm
- });
- const hasPost = postId && postType;
- const blockInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(clientId);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign,
- [`taxonomy-${term}`]: term
- })
- });
- if (!hasPost || !term) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, blockInformation.title);
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "advanced"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- autoComplete: "off",
- label: (0,external_wp_i18n_namespaceObject.__)('Separator'),
- value: separator || '',
- onChange: nextValue => {
- setAttributes({
- separator: nextValue
- });
- },
- help: (0,external_wp_i18n_namespaceObject.__)('Enter character(s) used to separate terms.')
- })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, isLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isLoading && hasPostTerms && postTerms.map(postTerm => (0,external_wp_element_namespaceObject.createElement)("a", {
- key: postTerm.id,
- href: postTerm.link,
- onClick: event => event.preventDefault()
- }, (0,external_lodash_namespaceObject.unescape)(postTerm.name))).reduce((prev, curr) => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, prev, (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "wp-block-post-terms__separator"
- }, separator || ' '), curr)), !isLoading && !hasPostTerms && ((selectedTerm === null || selectedTerm === void 0 ? void 0 : (_selectedTerm$labels = selectedTerm.labels) === null || _selectedTerm$labels === void 0 ? void 0 : _selectedTerm$labels.no_terms) || (0,external_wp_i18n_namespaceObject.__)('Term items not found.'))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-categories.js
- /**
- * WordPress dependencies
- */
- const postCategories = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",
- fillRule: "evenodd",
- clipRule: "evenodd"
- }));
- /* harmony default export */ var post_categories = (postCategories);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-terms.js
- /**
- * WordPress dependencies
- */
- const postTerms = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"
- }));
- /* harmony default export */ var post_terms = (postTerms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/variations.js
- /**
- * WordPress dependencies
- */
- const post_terms_variations_variations = [{
- name: 'category',
- title: (0,external_wp_i18n_namespaceObject.__)('Post Categories'),
- description: (0,external_wp_i18n_namespaceObject.__)("Display a post's categories."),
- icon: post_categories,
- isDefault: true,
- attributes: {
- term: 'category'
- },
- isActive: blockAttributes => blockAttributes.term === 'category'
- }, {
- name: 'post_tag',
- title: (0,external_wp_i18n_namespaceObject.__)('Post Tags'),
- description: (0,external_wp_i18n_namespaceObject.__)("Display a post's tags."),
- icon: post_terms,
- attributes: {
- term: 'post_tag'
- },
- isActive: blockAttributes => blockAttributes.term === 'post_tag'
- }];
- /* harmony default export */ var post_terms_variations = (post_terms_variations_variations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
- /**
- * Internal dependencies
- */
- const post_terms_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-terms",
- title: "Post Terms",
- category: "theme",
- description: "Post terms.",
- textdomain: "default",
- attributes: {
- term: {
- type: "string"
- },
- textAlign: {
- type: "string"
- },
- separator: {
- type: "string",
- "default": ", "
- }
- },
- usesContext: ["postId", "postType"],
- supports: {
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- typography: {
- lineHeight: true,
- fontSize: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- },
- style: "wp-block-post-terms"
- };
- /**
- * WordPress dependencies
- */
- const {
- name: post_terms_name
- } = post_terms_metadata;
- const post_terms_settings = {
- icon: post_terms,
- variations: post_terms_variations,
- edit: PostTermsEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function PostTitleEdit(_ref) {
- let {
- attributes: {
- level,
- textAlign,
- isLink,
- rel,
- linkTarget
- },
- setAttributes,
- context: {
- postType,
- postId,
- queryId
- }
- } = _ref;
- const TagName = 0 === level ? 'p' : 'h' + level;
- const isDescendentOfQueryLoop = Number.isFinite(queryId);
- const userCanEdit = useCanEditEntity('postType', postType, postId);
- const [rawTitle = '', setTitle, fullTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
- const [link] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'link', postId);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- let titleElement = (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_i18n_namespaceObject.__)('Post Title'));
- if (postType && postId) {
- titleElement = userCanEdit && !isDescendentOfQueryLoop ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, _extends({
- tagName: TagName,
- placeholder: (0,external_wp_i18n_namespaceObject.__)('No Title'),
- value: rawTitle,
- onChange: setTitle,
- __experimentalVersion: 2
- }, blockProps)) : (0,external_wp_element_namespaceObject.createElement)(TagName, _extends({}, blockProps, {
- dangerouslySetInnerHTML: {
- __html: fullTitle === null || fullTitle === void 0 ? void 0 : fullTitle.rendered
- }
- }));
- }
- if (isLink && postType && postId) {
- titleElement = userCanEdit && !isDescendentOfQueryLoop ? (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
- tagName: "a",
- href: link,
- target: linkTarget,
- rel: rel,
- placeholder: !rawTitle.length ? (0,external_wp_i18n_namespaceObject.__)('No Title') : null,
- value: rawTitle,
- onChange: setTitle,
- __experimentalVersion: 2
- })) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
- href: link,
- target: linkTarget,
- rel: rel,
- onClick: event => event.preventDefault(),
- dangerouslySetInnerHTML: {
- __html: fullTitle === null || fullTitle === void 0 ? void 0 : fullTitle.rendered
- }
- }));
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
- selectedLevel: level,
- onChange: newLevel => setAttributes({
- level: newLevel
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Make title a link'),
- onChange: () => setAttributes({
- isLink: !isLink
- }),
- checked: isLink
- }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
- onChange: value => setAttributes({
- linkTarget: value ? '_blank' : '_self'
- }),
- checked: linkTarget === '_blank'
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
- value: rel,
- onChange: newRel => setAttributes({
- rel: newRel
- })
- })))), titleElement);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/deprecated.js
- /**
- * Internal dependencies
- */
- const post_title_deprecated_v1 = {
- attributes: {
- textAlign: {
- type: 'string'
- },
- level: {
- type: 'number',
- default: 2
- },
- isLink: {
- type: 'boolean',
- default: false
- },
- rel: {
- type: 'string',
- attribute: 'rel',
- default: ''
- },
- linkTarget: {
- type: 'string',
- default: '_self'
- }
- },
- supports: {
- align: ['wide', 'full'],
- html: false,
- color: {
- gradients: true,
- link: true
- },
- spacing: {
- margin: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true
- }
- },
- save() {
- return null;
- },
- migrate: migrate_font_family,
- isEligible(_ref) {
- var _style$typography;
- let {
- style
- } = _ref;
- return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
- }
- };
- /**
- * New deprecations need to be placed first
- * for them to have higher priority.
- *
- * Old deprecations may need to be updated as well.
- *
- * See block-deprecation.md
- */
- /* harmony default export */ var post_title_deprecated = ([post_title_deprecated_v1]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const post_title_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/post-title",
- title: "Post Title",
- category: "theme",
- description: "Displays the title of a post, page, or any other content-type.",
- textdomain: "default",
- usesContext: ["postId", "postType", "queryId"],
- attributes: {
- textAlign: {
- type: "string"
- },
- level: {
- type: "number",
- "default": 2
- },
- isLink: {
- type: "boolean",
- "default": false
- },
- rel: {
- type: "string",
- attribute: "rel",
- "default": ""
- },
- linkTarget: {
- type: "string",
- "default": "_self"
- }
- },
- supports: {
- align: ["wide", "full"],
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- spacing: {
- margin: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true,
- __experimentalDefaultControls: {
- fontSize: true,
- fontAppearance: true,
- textTransform: true
- }
- }
- },
- style: "wp-block-post-title"
- };
- const {
- name: post_title_name
- } = post_title_metadata;
- const post_title_settings = {
- icon: post_title,
- edit: PostTitleEdit,
- deprecated: post_title_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/preformatted.js
- /**
- * WordPress dependencies
- */
- const preformatted = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"
- }));
- /* harmony default export */ var library_preformatted = (preformatted);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/edit.js
- /**
- * WordPress dependencies
- */
- function PreformattedEdit(_ref) {
- let {
- attributes,
- mergeBlocks,
- setAttributes,
- onRemove,
- style
- } = _ref;
- const {
- content
- } = attributes;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- style
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
- tagName: "pre",
- identifier: "content",
- preserveWhiteSpace: true,
- value: content,
- onChange: nextContent => {
- setAttributes({
- content: nextContent
- });
- },
- onRemove: onRemove,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Preformatted text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write preformatted text…'),
- onMerge: mergeBlocks
- }, blockProps, {
- __unstablePastePlainText: true
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/save.js
- /**
- * WordPress dependencies
- */
- function preformatted_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- content
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: content
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/transforms.js
- /**
- * WordPress dependencies
- */
- const preformatted_transforms_transforms = {
- from: [{
- type: 'block',
- blocks: ['core/code', 'core/paragraph'],
- transform: _ref => {
- let {
- content,
- anchor
- } = _ref;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/preformatted', {
- content,
- anchor
- });
- }
- }, {
- type: 'raw',
- isMatch: node => node.nodeName === 'PRE' && !(node.children.length === 1 && node.firstChild.nodeName === 'CODE'),
- schema: _ref2 => {
- let {
- phrasingContentSchema
- } = _ref2;
- return {
- pre: {
- children: phrasingContentSchema
- }
- };
- }
- }],
- to: [{
- type: 'block',
- blocks: ['core/paragraph'],
- transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
- }, {
- type: 'block',
- blocks: ['core/code'],
- transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', attributes)
- }]
- };
- /* harmony default export */ var preformatted_transforms = (preformatted_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const preformatted_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/preformatted",
- title: "Preformatted",
- category: "text",
- description: "Add text that respects your spacing and tabs, and also allows styling.",
- textdomain: "default",
- attributes: {
- content: {
- type: "string",
- source: "html",
- selector: "pre",
- "default": "",
- __unstablePreserveWhiteSpace: true,
- __experimentalRole: "content"
- }
- },
- supports: {
- anchor: true,
- color: {
- gradients: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- },
- style: "wp-block-preformatted"
- };
- const {
- name: preformatted_name
- } = preformatted_metadata;
- const preformatted_settings = {
- icon: library_preformatted,
- example: {
- attributes: {
- /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
- // translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work.
- content: (0,external_wp_i18n_namespaceObject.__)('EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;')
- /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
- }
- },
- transforms: preformatted_transforms,
- edit: PreformattedEdit,
- save: preformatted_save_save,
- merge(attributes, attributesToMerge) {
- return {
- content: attributes.content + attributesToMerge.content
- };
- }
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pullquote.js
- /**
- * WordPress dependencies
- */
- const pullquote = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"
- }));
- /* harmony default export */ var library_pullquote = (pullquote);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/shared.js
- const SOLID_COLOR_CLASS = `is-style-solid-color`;
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const pullquote_deprecated_blockAttributes = {
- value: {
- type: 'string',
- source: 'html',
- selector: 'blockquote',
- multiline: 'p'
- },
- citation: {
- type: 'string',
- source: 'html',
- selector: 'cite',
- default: ''
- },
- mainColor: {
- type: 'string'
- },
- customMainColor: {
- type: 'string'
- },
- textColor: {
- type: 'string'
- },
- customTextColor: {
- type: 'string'
- }
- };
- function parseBorderColor(styleString) {
- if (!styleString) {
- return;
- }
- const matches = styleString.match(/border-color:([^;]+)[;]?/);
- if (matches && matches[1]) {
- return matches[1];
- }
- } // TODO: this is ripe for a bit of a clean up according to the example in https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/#example
- const pullquote_deprecated_deprecated = [{
- attributes: { ...pullquote_deprecated_blockAttributes
- },
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- mainColor,
- customMainColor,
- customTextColor,
- textColor,
- value,
- citation,
- className
- } = attributes;
- const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
- let figureClasses, figureStyles; // Is solid color style
- if (isSolidColorStyle) {
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
- figureClasses = classnames_default()({
- 'has-background': backgroundClass || customMainColor,
- [backgroundClass]: backgroundClass
- });
- figureStyles = {
- backgroundColor: backgroundClass ? undefined : customMainColor
- }; // Is normal style and a custom color is being used ( we can set a style directly with its value)
- } else if (customMainColor) {
- figureStyles = {
- borderColor: customMainColor
- };
- }
- const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const blockquoteClasses = classnames_default()({
- 'has-text-color': textColor || customTextColor,
- [blockquoteTextColorClass]: blockquoteTextColorClass
- });
- const blockquoteStyles = blockquoteTextColorClass ? undefined : {
- color: customTextColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: figureClasses,
- style: figureStyles
- }), (0,external_wp_element_namespaceObject.createElement)("blockquote", {
- className: blockquoteClasses,
- style: blockquoteStyles
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: value,
- multiline: true
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "cite",
- value: citation
- })));
- },
- migrate(_ref2) {
- let {
- className,
- mainColor,
- customMainColor,
- customTextColor,
- ...attributes
- } = _ref2;
- const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
- let style;
- if (customMainColor) {
- if (!isSolidColorStyle) {
- // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
- style = {
- border: {
- color: customMainColor
- }
- };
- } else {
- // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
- style = {
- color: {
- background: customMainColor
- }
- };
- }
- } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
- if (customTextColor && style) {
- style.color = { ...style.color,
- text: customTextColor
- };
- }
- return {
- className,
- backgroundColor: isSolidColorStyle ? mainColor : undefined,
- borderColor: isSolidColorStyle ? undefined : mainColor,
- textAlign: isSolidColorStyle ? 'left' : undefined,
- style,
- ...attributes
- };
- }
- }, {
- attributes: { ...pullquote_deprecated_blockAttributes,
- // figureStyle is an attribute that never existed.
- // We are using it as a way to access the styles previously applied to the figure.
- figureStyle: {
- source: 'attribute',
- selector: 'figure',
- attribute: 'style'
- }
- },
- save(_ref3) {
- let {
- attributes
- } = _ref3;
- const {
- mainColor,
- customMainColor,
- textColor,
- customTextColor,
- value,
- citation,
- className,
- figureStyle
- } = attributes;
- const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
- let figureClasses, figureStyles; // Is solid color style
- if (isSolidColorStyle) {
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
- figureClasses = classnames_default()({
- 'has-background': backgroundClass || customMainColor,
- [backgroundClass]: backgroundClass
- });
- figureStyles = {
- backgroundColor: backgroundClass ? undefined : customMainColor
- }; // Is normal style and a custom color is being used ( we can set a style directly with its value)
- } else if (customMainColor) {
- figureStyles = {
- borderColor: customMainColor
- }; // If normal style and a named color are being used, we need to retrieve the color value to set the style,
- // as there is no expectation that themes create classes that set border colors.
- } else if (mainColor) {
- // Previously here we queried the color settings to know the color value
- // of a named color. This made the save function impure and the block was refactored,
- // because meanwhile a change in the editor made it impossible to query color settings in the save function.
- // Here instead of querying the color settings to know the color value, we retrieve the value
- // directly from the style previously serialized.
- const borderColor = parseBorderColor(figureStyle);
- figureStyles = {
- borderColor
- };
- }
- const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const blockquoteClasses = (textColor || customTextColor) && classnames_default()('has-text-color', {
- [blockquoteTextColorClass]: blockquoteTextColorClass
- });
- const blockquoteStyles = blockquoteTextColorClass ? undefined : {
- color: customTextColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: figureClasses,
- style: figureStyles
- }, (0,external_wp_element_namespaceObject.createElement)("blockquote", {
- className: blockquoteClasses,
- style: blockquoteStyles
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: value,
- multiline: true
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "cite",
- value: citation
- })));
- },
- migrate(_ref4) {
- let {
- className,
- figureStyle,
- mainColor,
- customMainColor,
- customTextColor,
- ...attributes
- } = _ref4;
- const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
- let style;
- if (customMainColor) {
- if (!isSolidColorStyle) {
- // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
- style = {
- border: {
- color: customMainColor
- }
- };
- } else {
- // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
- style = {
- color: {
- background: customMainColor
- }
- };
- }
- } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
- if (customTextColor && style) {
- style.color = { ...style.color,
- text: customTextColor
- };
- } // If is the default style, and a main color is set,
- // migrate the main color value into a custom border color.
- // The custom border color value is retrieved by parsing the figure styles.
- if (!isSolidColorStyle && mainColor && figureStyle) {
- const borderColor = parseBorderColor(figureStyle);
- if (borderColor) {
- return { ...attributes,
- className,
- // Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style.
- style: {
- border: {
- color: borderColor
- }
- }
- };
- }
- }
- return {
- className,
- backgroundColor: isSolidColorStyle ? mainColor : undefined,
- borderColor: isSolidColorStyle ? undefined : mainColor,
- textAlign: isSolidColorStyle ? 'left' : undefined,
- style,
- ...attributes
- };
- }
- }, {
- attributes: pullquote_deprecated_blockAttributes,
- save(_ref5) {
- let {
- attributes
- } = _ref5;
- const {
- mainColor,
- customMainColor,
- textColor,
- customTextColor,
- value,
- citation,
- className
- } = attributes;
- const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
- let figureClass, figureStyles; // Is solid color style
- if (isSolidColorStyle) {
- figureClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
- if (!figureClass) {
- figureStyles = {
- backgroundColor: customMainColor
- };
- } // Is normal style and a custom color is being used ( we can set a style directly with its value)
- } else if (customMainColor) {
- figureStyles = {
- borderColor: customMainColor
- }; // Is normal style and a named color is being used, we need to retrieve the color value to set the style,
- // as there is no expectation that themes create classes that set border colors.
- } else if (mainColor) {
- const colors = (0,external_lodash_namespaceObject.get)((0,external_wp_data_namespaceObject.select)(external_wp_blockEditor_namespaceObject.store).getSettings(), ['colors'], []);
- const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colors, mainColor);
- figureStyles = {
- borderColor: colorObject.color
- };
- }
- const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
- const blockquoteClasses = textColor || customTextColor ? classnames_default()('has-text-color', {
- [blockquoteTextColorClass]: blockquoteTextColorClass
- }) : undefined;
- const blockquoteStyle = blockquoteTextColorClass ? undefined : {
- color: customTextColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("figure", {
- className: figureClass,
- style: figureStyles
- }, (0,external_wp_element_namespaceObject.createElement)("blockquote", {
- className: blockquoteClasses,
- style: blockquoteStyle
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: value,
- multiline: true
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "cite",
- value: citation
- })));
- },
- migrate(_ref6) {
- let {
- className,
- mainColor,
- customMainColor,
- customTextColor,
- ...attributes
- } = _ref6;
- const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
- let style = {};
- if (customMainColor) {
- if (!isSolidColorStyle) {
- // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
- style = {
- border: {
- color: customMainColor
- }
- };
- } else {
- // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
- style = {
- color: {
- background: customMainColor
- }
- };
- }
- } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
- if (customTextColor && style) {
- style.color = { ...style.color,
- text: customTextColor
- };
- }
- return {
- className,
- backgroundColor: isSolidColorStyle ? mainColor : undefined,
- borderColor: isSolidColorStyle ? undefined : mainColor,
- textAlign: isSolidColorStyle ? 'left' : undefined,
- style,
- ...attributes
- };
- }
- }, {
- attributes: { ...pullquote_deprecated_blockAttributes
- },
- save(_ref7) {
- let {
- attributes
- } = _ref7;
- const {
- value,
- citation
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: value,
- multiline: true
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "cite",
- value: citation
- }));
- }
- }, {
- attributes: { ...pullquote_deprecated_blockAttributes,
- citation: {
- type: 'string',
- source: 'html',
- selector: 'footer'
- },
- align: {
- type: 'string',
- default: 'none'
- }
- },
- save(_ref8) {
- let {
- attributes
- } = _ref8;
- const {
- value,
- citation,
- align
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
- className: `align${align}`
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: value,
- multiline: true
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "footer",
- value: citation
- }));
- }
- }];
- /* harmony default export */ var pullquote_deprecated = (pullquote_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/figure.js
- const Figure = 'figure';
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/blockquote.js
- const BlockQuote = 'blockquote';
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
- function PullQuoteEdit(_ref) {
- let {
- attributes,
- setAttributes,
- isSelected,
- insertBlocksAfter
- } = _ref;
- const {
- textAlign,
- citation,
- value
- } = attributes;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- });
- const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)(Figure, blockProps, (0,external_wp_element_namespaceObject.createElement)(BlockQuote, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- identifier: "value",
- multiline: true,
- value: value,
- onChange: nextValue => setAttributes({
- value: nextValue
- }),
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote text'),
- placeholder: // translators: placeholder text used for the quote
- (0,external_wp_i18n_namespaceObject.__)('Add quote'),
- textAlign: "center"
- }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- identifier: "citation",
- tagName: isWebPlatform ? 'cite' : undefined,
- style: {
- display: 'block'
- },
- value: citation,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote citation text'),
- placeholder: // translators: placeholder text used for the citation
- (0,external_wp_i18n_namespaceObject.__)('Add citation'),
- onChange: nextCitation => setAttributes({
- citation: nextCitation
- }),
- className: "wp-block-pullquote__citation",
- __unstableMobileNoFocusOnMount: true,
- textAlign: "center",
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
- }))));
- }
- /* harmony default export */ var pullquote_edit = (PullQuoteEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function pullquote_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- textAlign,
- citation,
- value
- } = attributes;
- const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation);
- return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- })
- }), (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: value,
- multiline: true
- }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "cite",
- value: citation
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/transforms.js
- /**
- * WordPress dependencies
- */
- const pullquote_transforms_transforms = {
- from: [{
- type: 'block',
- isMultiBlock: true,
- blocks: ['core/paragraph'],
- transform: attributes => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
- value: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: (0,external_wp_richText_namespaceObject.join)(attributes.map(_ref => {
- let {
- content
- } = _ref;
- return (0,external_wp_richText_namespaceObject.create)({
- html: content
- });
- }), '\u2028'),
- multilineTag: 'p'
- }),
- anchor: attributes.anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/heading'],
- transform: _ref2 => {
- let {
- content,
- anchor
- } = _ref2;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
- value: `<p>${content}</p>`,
- anchor
- });
- }
- }],
- to: [{
- type: 'block',
- blocks: ['core/paragraph'],
- transform: _ref3 => {
- let {
- value,
- citation
- } = _ref3;
- const paragraphs = [];
- if (value && value !== '<p></p>') {
- paragraphs.push(...(0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
- html: value,
- multilineTag: 'p'
- }), '\u2028').map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: piece
- })
- })));
- }
- if (citation && citation !== '<p></p>') {
- paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: citation
- }));
- }
- if (paragraphs.length === 0) {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: ''
- });
- }
- return paragraphs;
- }
- }, {
- type: 'block',
- blocks: ['core/heading'],
- transform: _ref4 => {
- let {
- value,
- citation,
- ...attrs
- } = _ref4;
- // If there is no pullquote content, use the citation as the
- // content of the resulting heading. A nonexistent citation
- // will result in an empty heading.
- if (value === '<p></p>') {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
- content: citation
- });
- }
- const pieces = (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
- html: value,
- multilineTag: 'p'
- }), '\u2028');
- const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
- content: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: pieces[0]
- })
- });
- if (!citation && pieces.length === 1) {
- return headingBlock;
- }
- const quotePieces = pieces.slice(1);
- const pullquoteBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { ...attrs,
- citation,
- value: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: quotePieces.length ? (0,external_wp_richText_namespaceObject.join)(pieces.slice(1), '\u2028') : (0,external_wp_richText_namespaceObject.create)(),
- multilineTag: 'p'
- })
- });
- return [headingBlock, pullquoteBlock];
- }
- }]
- };
- /* harmony default export */ var pullquote_transforms = (pullquote_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const pullquote_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/pullquote",
- title: "Pullquote",
- category: "text",
- description: "Give special visual emphasis to a quote from your text.",
- textdomain: "default",
- attributes: {
- value: {
- type: "string",
- source: "html",
- selector: "blockquote",
- multiline: "p",
- __experimentalRole: "content"
- },
- citation: {
- type: "string",
- source: "html",
- selector: "cite",
- "default": "",
- __experimentalRole: "content"
- },
- textAlign: {
- type: "string"
- }
- },
- supports: {
- anchor: true,
- align: ["left", "right", "wide", "full"],
- color: {
- gradients: true,
- background: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true,
- fontAppearance: true
- }
- },
- __experimentalBorder: {
- color: true,
- radius: true,
- style: true,
- width: true,
- __experimentalDefaultControls: {
- color: true,
- radius: true,
- style: true,
- width: true
- }
- }
- },
- editorStyle: "wp-block-pullquote-editor",
- style: "wp-block-pullquote"
- };
- const {
- name: pullquote_name
- } = pullquote_metadata;
- const pullquote_settings = {
- icon: library_pullquote,
- example: {
- attributes: {
- value: '<p>' + // translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg.
- (0,external_wp_i18n_namespaceObject.__)('One of the hardest things to do in technology is disrupt yourself.') + '</p>',
- citation: (0,external_wp_i18n_namespaceObject.__)('Matt Mullenweg')
- }
- },
- transforms: pullquote_transforms,
- edit: pullquote_edit,
- save: pullquote_save_save,
- deprecated: pullquote_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/loop.js
- /**
- * WordPress dependencies
- */
- const loop = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"
- }));
- /* harmony default export */ var library_loop = (loop);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/settings.js
- /**
- * WordPress dependencies
- */
- const settings_settings = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"
- }));
- /* harmony default export */ var library_settings = (settings_settings);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-toolbar.js
- /**
- * WordPress dependencies
- */
- function QueryToolbar(_ref) {
- let {
- attributes: {
- query,
- displayLayout
- },
- setQuery,
- setDisplayLayout,
- openPatternSelectionModal
- } = _ref;
- const maxPageInputId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryToolbar, 'blocks-query-pagination-max-page-input');
- const displayLayoutControls = [{
- icon: library_list,
- title: (0,external_wp_i18n_namespaceObject.__)('List view'),
- onClick: () => setDisplayLayout({
- type: 'list'
- }),
- isActive: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'list'
- }, {
- icon: library_grid,
- title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
- onClick: () => setDisplayLayout({
- type: 'flex',
- columns: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.columns) || 3
- }),
- isActive: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex'
- }];
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !query.inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
- contentClassName: "block-library-query-toolbar__popover",
- renderToggle: _ref2 => {
- let {
- onToggle
- } = _ref2;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- icon: library_settings,
- label: (0,external_wp_i18n_namespaceObject.__)('Display settings'),
- onClick: onToggle
- });
- },
- renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
- __unstableInputWidth: "60px",
- label: (0,external_wp_i18n_namespaceObject.__)('Items per Page'),
- labelPosition: "edge",
- min: 1,
- max: 100,
- onChange: value => {
- if (isNaN(value) || value < 1 || value > 100) {
- return;
- }
- setQuery({
- perPage: value
- });
- },
- step: "1",
- value: query.perPage,
- isDragEnabled: false
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
- __unstableInputWidth: "60px",
- label: (0,external_wp_i18n_namespaceObject.__)('Offset'),
- labelPosition: "edge",
- min: 0,
- max: 100,
- onChange: value => {
- if (isNaN(value) || value < 0 || value > 100) {
- return;
- }
- setQuery({
- offset: value
- });
- },
- step: "1",
- value: query.offset,
- isDragEnabled: false
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
- id: maxPageInputId,
- help: (0,external_wp_i18n_namespaceObject.__)('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
- id: maxPageInputId,
- __unstableInputWidth: "60px",
- label: (0,external_wp_i18n_namespaceObject.__)('Max page to show'),
- labelPosition: "edge",
- min: 0,
- onChange: value => {
- if (isNaN(value) || value < 0) {
- return;
- }
- setQuery({
- pages: value
- });
- },
- step: "1",
- value: query.pages,
- isDragEnabled: false
- })))
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
- className: "wp-block-template-part__block-control-group"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- onClick: openPatternSelectionModal
- }, (0,external_wp_i18n_namespaceObject.__)('Replace'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
- controls: displayLayoutControls
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/order-control.js
- /**
- * WordPress dependencies
- */
- const orderOptions = [{
- label: (0,external_wp_i18n_namespaceObject.__)('Newest to oldest'),
- value: 'date/desc'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'),
- value: 'date/asc'
- }, {
- /* translators: label for ordering posts by title in ascending order */
- label: (0,external_wp_i18n_namespaceObject.__)('A → Z'),
- value: 'title/asc'
- }, {
- /* translators: label for ordering posts by title in descending order */
- label: (0,external_wp_i18n_namespaceObject.__)('Z → A'),
- value: 'title/desc'
- }];
- function OrderControl(_ref) {
- let {
- order,
- orderBy,
- onChange
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Order by'),
- value: `${orderBy}/${order}`,
- options: orderOptions,
- onChange: value => {
- const [newOrderBy, newOrder] = value.split('/');
- onChange({
- order: newOrder,
- orderBy: newOrderBy
- });
- }
- });
- }
- /* harmony default export */ var order_control = (OrderControl);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/utils.js
- /**
- * WordPress dependencies
- */
- /**
- * @typedef IHasNameAndId
- * @property {string|number} id The entity's id.
- * @property {string} name The entity's name.
- */
- /**
- * The object used in Query block that contains info and helper mappings
- * from an array of IHasNameAndId objects.
- *
- * @typedef {Object} QueryEntitiesInfo
- * @property {IHasNameAndId[]} entities The array of entities.
- * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.
- * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.
- * @property {string[]} names Array with the entities' names.
- */
- /**
- * Returns a helper object with mapping from Objects that implement
- * the `IHasNameAndId` interface. The returned object is used for
- * integration with `FormTokenField` component.
- *
- * @param {IHasNameAndId[]} entities The entities to extract of helper object.
- * @return {QueryEntitiesInfo} The object with the entities information.
- */
- const getEntitiesInfo = entities => {
- const mapping = entities === null || entities === void 0 ? void 0 : entities.reduce((accumulator, entity) => {
- const {
- mapById,
- mapByName,
- names
- } = accumulator;
- mapById[entity.id] = entity;
- mapByName[entity.name] = entity;
- names.push(entity.name);
- return accumulator;
- }, {
- mapById: {},
- mapByName: {},
- names: []
- });
- return {
- entities,
- ...mapping
- };
- };
- /**
- * Returns a helper object that contains:
- * 1. An `options` object from the available post types, to be passed to a `SelectControl`.
- * 2. A helper map with available taxonomies per post type.
- *
- * @return {Object} The helper object related to post types.
- */
- const usePostTypes = () => {
- const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getPostTypes;
- const {
- getPostTypes
- } = select(external_wp_coreData_namespaceObject.store);
- const excludedPostTypes = ['attachment'];
- const filteredPostTypes = (_getPostTypes = getPostTypes({
- per_page: -1
- })) === null || _getPostTypes === void 0 ? void 0 : _getPostTypes.filter(_ref => {
- let {
- viewable,
- slug
- } = _ref;
- return viewable && !excludedPostTypes.includes(slug);
- });
- return filteredPostTypes;
- }, []);
- const postTypesTaxonomiesMap = (0,external_wp_element_namespaceObject.useMemo)(() => {
- if (!(postTypes !== null && postTypes !== void 0 && postTypes.length)) return;
- return postTypes.reduce((accumulator, type) => {
- accumulator[type.slug] = type.taxonomies;
- return accumulator;
- }, {});
- }, [postTypes]);
- const postTypesSelectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => (postTypes || []).map(_ref2 => {
- let {
- labels,
- slug
- } = _ref2;
- return {
- label: labels.singular_name,
- value: slug
- };
- }), [postTypes]);
- return {
- postTypesTaxonomiesMap,
- postTypesSelectOptions
- };
- };
- /**
- * Hook that returns the taxonomies associated with a specific post type.
- *
- * @param {string} postType The post type from which to retrieve the associated taxonomies.
- * @return {Object[]} An array of the associated taxonomies.
- */
- const useTaxonomies = postType => {
- const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getTaxonomies
- } = select(external_wp_coreData_namespaceObject.store);
- const filteredTaxonomies = getTaxonomies({
- type: postType,
- per_page: -1,
- context: 'view'
- });
- return filteredTaxonomies;
- }, [postType]);
- return taxonomies;
- };
- /**
- * Recurses over a list of blocks and returns the first found
- * Query Loop block's clientId.
- *
- * @param {WPBlock[]} blocks The list of blocks to look through.
- * @return {string=} The first found Query Loop's clientId.
- */
- const getFirstQueryClientIdFromBlocks = blocks => {
- const blocksQueue = [...blocks];
- while (blocksQueue.length > 0) {
- var _block$innerBlocks;
- const block = blocksQueue.shift();
- if (block.name === 'core/query') {
- return block.clientId;
- }
- (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.forEach(innerBlock => {
- blocksQueue.push(innerBlock);
- });
- }
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/author-control.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const author_control_AUTHORS_QUERY = {
- who: 'authors',
- per_page: -1,
- _fields: 'id,name',
- context: 'view'
- };
- function AuthorControl(_ref) {
- let {
- value,
- onChange
- } = _ref;
- const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getUsers
- } = select(external_wp_coreData_namespaceObject.store);
- return getUsers(author_control_AUTHORS_QUERY);
- }, []);
- if (!authorsList) {
- return null;
- }
- const authorsInfo = getEntitiesInfo(authorsList);
- /**
- * We need to normalize the value because the block operates on a
- * comma(`,`) separated string value and `FormTokenFiels` needs an
- * array.
- */
- const normalizedValue = !value ? [] : value.toString().split(','); // Returns only the existing authors ids. This prevents the component
- // from crashing in the editor, when non existing ids are provided.
- const sanitizedValue = normalizedValue.reduce((accumulator, authorId) => {
- const author = authorsInfo.mapById[authorId];
- if (author) {
- accumulator.push({
- id: authorId,
- value: author.name
- });
- }
- return accumulator;
- }, []);
- const getIdByValue = (entitiesMappedByName, authorValue) => {
- var _entitiesMappedByName;
- const id = (authorValue === null || authorValue === void 0 ? void 0 : authorValue.id) || ((_entitiesMappedByName = entitiesMappedByName[authorValue]) === null || _entitiesMappedByName === void 0 ? void 0 : _entitiesMappedByName.id);
- if (id) return id;
- };
- const onAuthorChange = newValue => {
- const ids = Array.from(newValue.reduce((accumulator, author) => {
- // Verify that new values point to existing entities.
- const id = getIdByValue(authorsInfo.mapByName, author);
- if (id) accumulator.add(id);
- return accumulator;
- }, new Set()));
- onChange({
- author: ids.join(',')
- });
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
- label: (0,external_wp_i18n_namespaceObject.__)('Authors'),
- value: sanitizedValue,
- suggestions: authorsInfo.names,
- onChange: onAuthorChange
- });
- }
- /* harmony default export */ var author_control = (AuthorControl);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/constants.js
- const MAX_FETCHED_TERMS = 100;
- const DEFAULTS_POSTS_PER_PAGE = 3;
- /* harmony default export */ var constants = ({
- MAX_FETCHED_TERMS,
- DEFAULTS_POSTS_PER_PAGE
- });
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/taxonomy-controls.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- // Helper function to get the term id based on user input in terms `FormTokenField`.
- const getTermIdByTermValue = (termsMappedByName, termValue) => {
- var _termsMappedByName$te;
- // First we check for exact match by `term.id` or case sensitive `term.name` match.
- const termId = (termValue === null || termValue === void 0 ? void 0 : termValue.id) || ((_termsMappedByName$te = termsMappedByName[termValue]) === null || _termsMappedByName$te === void 0 ? void 0 : _termsMappedByName$te.id);
- if (termId) return termId;
- /**
- * Here we make an extra check for entered terms in a non case sensitive way,
- * to match user expectations, due to `FormTokenField` behaviour that shows
- * suggestions which are case insensitive.
- *
- * Although WP tries to discourage users to add terms with the same name (case insensitive),
- * it's still possible if you manually change the name, as long as the terms have different slugs.
- * In this edge case we always apply the first match from the terms list.
- */
- const termValueLower = termValue.toLocaleLowerCase();
- for (const term in termsMappedByName) {
- if (term.toLocaleLowerCase() === termValueLower) {
- return termsMappedByName[term].id;
- }
- }
- };
- function TaxonomyControls(_ref) {
- let {
- onChange,
- query
- } = _ref;
- const taxonomies = useTaxonomies(query.postType);
- const taxonomiesInfo = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getEntityRecords
- } = select(external_wp_coreData_namespaceObject.store);
- const termsQuery = {
- per_page: MAX_FETCHED_TERMS
- };
- const _taxonomiesInfo = taxonomies === null || taxonomies === void 0 ? void 0 : taxonomies.map(_ref2 => {
- let {
- slug,
- name
- } = _ref2;
- const _terms = getEntityRecords('taxonomy', slug, termsQuery);
- return {
- slug,
- name,
- terms: getEntitiesInfo(_terms)
- };
- });
- return _taxonomiesInfo;
- }, [taxonomies]);
- const onTermsChange = taxonomySlug => newTermValues => {
- const taxonomyInfo = taxonomiesInfo.find(_ref3 => {
- let {
- slug
- } = _ref3;
- return slug === taxonomySlug;
- });
- if (!taxonomyInfo) return;
- const termIds = Array.from(newTermValues.reduce((accumulator, termValue) => {
- const termId = getTermIdByTermValue(taxonomyInfo.terms.mapByName, termValue);
- if (termId) accumulator.add(termId);
- return accumulator;
- }, new Set()));
- const newTaxQuery = { ...query.taxQuery,
- [taxonomySlug]: termIds
- };
- onChange({
- taxQuery: newTaxQuery
- });
- }; // Returns only the existing term ids in proper format to be
- // used in `FormTokenField`. This prevents the component from
- // crashing in the editor, when non existing term ids were provided.
- const getExistingTaxQueryValue = taxonomySlug => {
- var _query$taxQuery;
- const taxonomyInfo = taxonomiesInfo.find(_ref4 => {
- let {
- slug
- } = _ref4;
- return slug === taxonomySlug;
- });
- if (!taxonomyInfo) return [];
- return (((_query$taxQuery = query.taxQuery) === null || _query$taxQuery === void 0 ? void 0 : _query$taxQuery[taxonomySlug]) || []).reduce((accumulator, termId) => {
- const term = taxonomyInfo.terms.mapById[termId];
- if (term) {
- accumulator.push({
- id: termId,
- value: term.name
- });
- }
- return accumulator;
- }, []);
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !!(taxonomiesInfo !== null && taxonomiesInfo !== void 0 && taxonomiesInfo.length) && taxonomiesInfo.map(_ref5 => {
- var _terms$names;
- let {
- slug,
- name,
- terms
- } = _ref5;
- if (!(terms !== null && terms !== void 0 && (_terms$names = terms.names) !== null && _terms$names !== void 0 && _terms$names.length)) {
- return null;
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
- key: slug,
- label: name,
- value: getExistingTaxQueryValue(slug),
- suggestions: terms.names,
- onChange: onTermsChange(slug)
- });
- }));
- }
- /* harmony default export */ var taxonomy_controls = (TaxonomyControls);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/sticky-control.js
- /**
- * WordPress dependencies
- */
- const stickyOptions = [{
- label: (0,external_wp_i18n_namespaceObject.__)('Include'),
- value: ''
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Exclude'),
- value: 'exclude'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Only'),
- value: 'only'
- }];
- function StickyControl(_ref) {
- let {
- value,
- onChange
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'),
- options: stickyOptions,
- value: value,
- onChange: onChange,
- help: (0,external_wp_i18n_namespaceObject.__)('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')
- });
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/index.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function QueryInspectorControls(_ref) {
- let {
- attributes: {
- query,
- displayLayout
- },
- setQuery,
- setDisplayLayout
- } = _ref;
- const {
- order,
- orderBy,
- author: authorIds,
- postType,
- sticky,
- inherit,
- taxQuery
- } = query;
- const [showSticky, setShowSticky] = (0,external_wp_element_namespaceObject.useState)(postType === 'post');
- const {
- postTypesTaxonomiesMap,
- postTypesSelectOptions
- } = usePostTypes();
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- setShowSticky(postType === 'post');
- }, [postType]);
- const onPostTypeChange = newValue => {
- const updateQuery = {
- postType: newValue
- }; // We need to dynamically update the `taxQuery` property,
- // by removing any not supported taxonomy from the query.
- const supportedTaxonomies = postTypesTaxonomiesMap[newValue];
- const updatedTaxQuery = Object.entries(taxQuery || {}).reduce((accumulator, _ref2) => {
- let [taxonomySlug, terms] = _ref2;
- if (supportedTaxonomies.includes(taxonomySlug)) {
- accumulator[taxonomySlug] = terms;
- }
- return accumulator;
- }, {});
- updateQuery.taxQuery = !!Object.keys(updatedTaxQuery).length ? updatedTaxQuery : undefined;
- if (newValue !== 'post') {
- updateQuery.sticky = '';
- }
- setQuery(updateQuery);
- };
- const [querySearch, setQuerySearch] = (0,external_wp_element_namespaceObject.useState)(query.search);
- const onChangeDebounced = (0,external_wp_element_namespaceObject.useCallback)((0,external_lodash_namespaceObject.debounce)(() => {
- if (query.search !== querySearch) {
- setQuery({
- search: querySearch
- });
- }
- }, 250), [querySearch, query.search]);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- onChangeDebounced();
- return onChangeDebounced.cancel;
- }, [querySearch, onChangeDebounced]);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Inherit query from template'),
- help: (0,external_wp_i18n_namespaceObject.__)('Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'),
- checked: !!inherit,
- onChange: value => setQuery({
- inherit: !!value
- })
- }), !inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- options: postTypesSelectOptions,
- value: postType,
- label: (0,external_wp_i18n_namespaceObject.__)('Post type'),
- onChange: onPostTypeChange,
- help: (0,external_wp_i18n_namespaceObject.__)('WordPress contains different types of content and they are divided into collections called "Post types". By default there are a few different ones such as blog posts and pages, but plugins could add more.')
- }), (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex' && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
- value: displayLayout.columns,
- onChange: value => setDisplayLayout({
- columns: value
- }),
- min: 2,
- max: Math.max(6, displayLayout.columns)
- }), displayLayout.columns > 6 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
- status: "warning",
- isDismissible: false
- }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.'))), !inherit && (0,external_wp_element_namespaceObject.createElement)(order_control, {
- order,
- orderBy,
- onChange: setQuery
- }), !inherit && showSticky && (0,external_wp_element_namespaceObject.createElement)(StickyControl, {
- value: sticky,
- onChange: value => setQuery({
- sticky: value
- })
- })), !inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Filters')
- }, (0,external_wp_element_namespaceObject.createElement)(taxonomy_controls, {
- onChange: setQuery,
- query: query
- }), (0,external_wp_element_namespaceObject.createElement)(author_control, {
- value: authorIds,
- onChange: setQuery
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Keyword'),
- value: querySearch,
- onChange: setQuerySearch
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-placeholder.js
- /**
- * WordPress dependencies
- */
- function QueryPlaceholder(_ref) {
- let {
- clientId,
- name,
- setAttributes,
- icon,
- label
- } = _ref;
- const {
- defaultVariation,
- scopeVariations
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlockVariations,
- getBlockType,
- getDefaultBlockVariation
- } = select(external_wp_blocks_namespaceObject.store);
- return {
- blockType: getBlockType(name),
- defaultVariation: getDefaultBlockVariation(name, 'block'),
- scopeVariations: getBlockVariations(name, 'block')
- };
- }, [name]);
- const {
- replaceInnerBlocks
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
- icon: icon,
- label: label,
- variations: scopeVariations,
- onSelect: function () {
- let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation;
- if (nextVariation.attributes) {
- setAttributes(nextVariation.attributes);
- }
- if (nextVariation.innerBlocks) {
- replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), false);
- }
- }
- }));
- }
- /* harmony default export */ var query_placeholder = (QueryPlaceholder);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const query_edit_TEMPLATE = [['core/post-template']];
- function QueryContent(_ref) {
- let {
- attributes,
- setAttributes,
- openPatternSelectionModal
- } = _ref;
- const {
- queryId,
- query,
- displayLayout,
- tagName: TagName = 'div',
- layout = {}
- } = attributes;
- const {
- __unstableMarkNextChangeAsNotPersistent
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryContent);
- const {
- themeSupportsLayout
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getSettings;
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- return {
- themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
- };
- }, []);
- const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
- const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- template: query_edit_TEMPLATE,
- __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
- });
- const {
- postsPerPage
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- return {
- postsPerPage: +getSettings().postsPerPage || DEFAULTS_POSTS_PER_PAGE
- };
- }, []); // There are some effects running where some initialization logic is
- // happening and setting some values to some attributes (ex. queryId).
- // These updates can cause an `undo trap` where undoing will result in
- // resetting again, so we need to mark these changes as not persistent
- // with `__unstableMarkNextChangeAsNotPersistent`.
- // Changes in query property (which is an object) need to be in the same callback,
- // because updates are batched after the render and changes in different query properties
- // would cause to override previous wanted changes.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- const newQuery = {};
- if (!query.perPage && postsPerPage) {
- newQuery.perPage = postsPerPage;
- }
- if (!!Object.keys(newQuery).length) {
- __unstableMarkNextChangeAsNotPersistent();
- updateQuery(newQuery);
- }
- }, [query.perPage]); // We need this for multi-query block pagination.
- // Query parameters for each block are scoped to their ID.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!Number.isFinite(queryId)) {
- __unstableMarkNextChangeAsNotPersistent();
- setAttributes({
- queryId: instanceId
- });
- }
- }, [queryId, instanceId]);
- const updateQuery = newQuery => setAttributes({
- query: { ...query,
- ...newQuery
- }
- });
- const updateDisplayLayout = newDisplayLayout => setAttributes({
- displayLayout: { ...displayLayout,
- ...newDisplayLayout
- }
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(QueryInspectorControls, {
- attributes: attributes,
- setQuery: updateQuery,
- setDisplayLayout: updateDisplayLayout
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(QueryToolbar, {
- attributes: attributes,
- setQuery: updateQuery,
- setDisplayLayout: updateDisplayLayout,
- openPatternSelectionModal: openPatternSelectionModal
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "advanced"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
- options: [{
- label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
- value: 'div'
- }, {
- label: '<main>',
- value: 'main'
- }, {
- label: '<section>',
- value: 'section'
- }, {
- label: '<aside>',
- value: 'aside'
- }],
- value: TagName,
- onChange: value => setAttributes({
- tagName: value
- })
- })), (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps));
- }
- function QueryPatternSetup(_ref2) {
- var _blockType$icon;
- let {
- attributes,
- clientId,
- name,
- openPatternSelectionModal,
- setAttributes
- } = _ref2;
- const [isStartingBlank, setIsStartingBlank] = (0,external_wp_element_namespaceObject.useState)(false);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const {
- blockType,
- allVariations,
- hasPatterns
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlockVariations,
- getBlockType
- } = select(external_wp_blocks_namespaceObject.store);
- const {
- getBlockRootClientId,
- __experimentalGetPatternsByBlockTypes
- } = select(external_wp_blockEditor_namespaceObject.store);
- const rootClientId = getBlockRootClientId(clientId);
- return {
- blockType: getBlockType(name),
- allVariations: getBlockVariations(name),
- hasPatterns: !!__experimentalGetPatternsByBlockTypes(name, rootClientId).length
- };
- }, [name, clientId]);
- const matchingVariation = (0,external_wp_blockEditor_namespaceObject.__experimentalGetMatchingVariation)(attributes, allVariations);
- const icon = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.icon) || (blockType === null || blockType === void 0 ? void 0 : (_blockType$icon = blockType.icon) === null || _blockType$icon === void 0 ? void 0 : _blockType$icon.src);
- const label = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.title) || (blockType === null || blockType === void 0 ? void 0 : blockType.title);
- if (isStartingBlank) {
- return (0,external_wp_element_namespaceObject.createElement)(query_placeholder, {
- clientId: clientId,
- name: name,
- setAttributes: setAttributes,
- icon: icon,
- label: label
- });
- }
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- icon: icon,
- label: label,
- instructions: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern for the query loop or start blank.')
- }, !!hasPatterns && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "primary",
- onClick: openPatternSelectionModal
- }, (0,external_wp_i18n_namespaceObject.__)('Choose')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "secondary",
- onClick: () => {
- setIsStartingBlank(true);
- }
- }, (0,external_wp_i18n_namespaceObject.__)('Start blank'))));
- }
- const QueryEdit = props => {
- const {
- clientId,
- name
- } = props;
- const [isPatternSelectionModalOpen, setIsPatternSelectionModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
- const {
- replaceBlock,
- selectBlock
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length, [clientId]);
- const Component = hasInnerBlocks ? QueryContent : QueryPatternSetup;
- const onBlockPatternSelect = blocks => {
- const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
- const firstQueryClientId = getFirstQueryClientIdFromBlocks(clonedBlocks);
- replaceBlock(clientId, clonedBlocks);
- if (firstQueryClientId) {
- selectBlock(firstQueryClientId);
- }
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(Component, _extends({}, props, {
- openPatternSelectionModal: () => setIsPatternSelectionModalOpen(true)
- })), isPatternSelectionModalOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
- className: "block-editor-query-pattern__selection-modal",
- title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'),
- closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
- onRequestClose: () => setIsPatternSelectionModalOpen(false)
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternSetup, {
- blockName: name,
- clientId: clientId,
- onBlockPatternSelect: onBlockPatternSelect
- })));
- };
- /* harmony default export */ var query_edit = (QueryEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/save.js
- /**
- * WordPress dependencies
- */
- function QuerySave(_ref) {
- let {
- attributes: {
- tagName: Tag = 'div'
- }
- } = _ref;
- const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
- const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
- return (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/icons.js
- /**
- * WordPress dependencies
- */
- const titleDate = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 48 48"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"
- }));
- const titleExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 48 48"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"
- }));
- const titleDateExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 48 48"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"
- }));
- const imageDateTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 48 48"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/variations.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const QUERY_DEFAULT_ATTRIBUTES = {
- query: {
- perPage: 3,
- pages: 0,
- offset: 0,
- postType: 'post',
- order: 'desc',
- orderBy: 'date',
- author: '',
- search: '',
- exclude: [],
- sticky: '',
- inherit: false
- }
- };
- const query_variations_variations = [{
- name: 'posts-list',
- title: (0,external_wp_i18n_namespaceObject.__)('Posts List'),
- description: (0,external_wp_i18n_namespaceObject.__)('Display a list of your most recent posts, excluding sticky posts.'),
- icon: post_list,
- attributes: {
- query: {
- perPage: 4,
- pages: 1,
- offset: 0,
- postType: 'post',
- order: 'desc',
- orderBy: 'date',
- author: '',
- search: '',
- sticky: 'exclude',
- inherit: false
- }
- },
- scope: ['inserter']
- }, {
- name: 'title-date',
- title: (0,external_wp_i18n_namespaceObject.__)('Title & Date'),
- icon: titleDate,
- attributes: { ...QUERY_DEFAULT_ATTRIBUTES
- },
- innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date']]], ['core/query-pagination'], ['core/query-no-results']],
- scope: ['block']
- }, {
- name: 'title-excerpt',
- title: (0,external_wp_i18n_namespaceObject.__)('Title & Excerpt'),
- icon: titleExcerpt,
- attributes: { ...QUERY_DEFAULT_ATTRIBUTES
- },
- innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
- scope: ['block']
- }, {
- name: 'title-date-excerpt',
- title: (0,external_wp_i18n_namespaceObject.__)('Title, Date, & Excerpt'),
- icon: titleDateExcerpt,
- attributes: { ...QUERY_DEFAULT_ATTRIBUTES
- },
- innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
- scope: ['block']
- }, {
- name: 'image-date-title',
- title: (0,external_wp_i18n_namespaceObject.__)('Image, Date, & Title'),
- icon: imageDateTitle,
- attributes: { ...QUERY_DEFAULT_ATTRIBUTES
- },
- innerBlocks: [['core/post-template', {}, [['core/post-featured-image'], ['core/post-date'], ['core/post-title']]], ['core/query-pagination'], ['core/query-no-results']],
- scope: ['block']
- }];
- /* harmony default export */ var query_variations = (query_variations_variations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const migrateToTaxQuery = attributes => {
- var _query$categoryIds, _query$tagIds;
- const {
- query
- } = attributes;
- const newQuery = { ...(0,external_lodash_namespaceObject.omit)(query, ['categoryIds', 'tagIds'])
- };
- if ((_query$categoryIds = query.categoryIds) !== null && _query$categoryIds !== void 0 && _query$categoryIds.length || (_query$tagIds = query.tagIds) !== null && _query$tagIds !== void 0 && _query$tagIds.length) {
- var _query$categoryIds2, _query$tagIds2;
- newQuery.taxQuery = {
- category: !!((_query$categoryIds2 = query.categoryIds) !== null && _query$categoryIds2 !== void 0 && _query$categoryIds2.length) ? query.categoryIds : undefined,
- post_tag: !!((_query$tagIds2 = query.tagIds) !== null && _query$tagIds2 !== void 0 && _query$tagIds2.length) ? query.tagIds : undefined
- };
- }
- return { ...attributes,
- query: newQuery
- };
- };
- const query_deprecated_deprecated = [// Version with `categoryIds and tagIds`.
- {
- attributes: {
- queryId: {
- type: 'number'
- },
- query: {
- type: 'object',
- default: {
- perPage: null,
- pages: 0,
- offset: 0,
- postType: 'post',
- categoryIds: [],
- tagIds: [],
- order: 'desc',
- orderBy: 'date',
- author: '',
- search: '',
- exclude: [],
- sticky: '',
- inherit: true
- }
- },
- tagName: {
- type: 'string',
- default: 'div'
- },
- displayLayout: {
- type: 'object',
- default: {
- type: 'list'
- }
- }
- },
- supports: {
- align: ['wide', 'full'],
- html: false,
- color: {
- gradients: true,
- link: true
- },
- __experimentalLayout: true
- },
- isEligible: _ref => {
- let {
- query: {
- categoryIds,
- tagIds
- } = {}
- } = _ref;
- return categoryIds || tagIds;
- },
- migrate: migrateToTaxQuery,
- save(_ref2) {
- let {
- attributes: {
- tagName: Tag = 'div'
- }
- } = _ref2;
- const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
- const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
- return (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
- }
- }, // Version with NO wrapper `div` element.
- {
- attributes: {
- queryId: {
- type: 'number'
- },
- query: {
- type: 'object',
- default: {
- perPage: null,
- pages: 0,
- offset: 0,
- postType: 'post',
- categoryIds: [],
- tagIds: [],
- order: 'desc',
- orderBy: 'date',
- author: '',
- search: '',
- exclude: [],
- sticky: '',
- inherit: true
- }
- },
- layout: {
- type: 'object',
- default: {
- type: 'list'
- }
- }
- },
- supports: {
- html: false
- },
- migrate(attributes) {
- const withTaxQuery = migrateToTaxQuery(attributes);
- return { ...(0,external_lodash_namespaceObject.omit)(withTaxQuery, ['layout']),
- displayLayout: withTaxQuery.layout
- };
- },
- save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- }];
- /* harmony default export */ var query_deprecated = (query_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/hooks.js
- /**
- * WordPress dependencies
- */
- const CreateNewPostLink = _ref => {
- let {
- attributes: {
- query: {
- postType
- } = {}
- } = {}
- } = _ref;
- if (!postType) return null;
- const newPostUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('post-new.php', {
- post_type: postType
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-query__create-new-link"
- }, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('<a>Create a new post</a> for this feed.'), // eslint-disable-next-line jsx-a11y/anchor-has-content
- {
- a: (0,external_wp_element_namespaceObject.createElement)("a", {
- href: newPostUrl
- })
- }));
- };
- /**
- * Override the default edit UI to include layout controls
- *
- * @param {Function} BlockEdit Original component
- * @return {Function} Wrapped component
- */
- const queryTopInspectorControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => {
- const {
- name,
- isSelected
- } = props;
- if (name !== 'core/query' || !isSelected) {
- return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({
- key: "edit"
- }, props));
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(CreateNewPostLink, props)), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({
- key: "edit"
- }, props)));
- }, 'withInspectorControls');
- /* harmony default export */ var query_hooks = (queryTopInspectorControls);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const query_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/query",
- title: "Query Loop",
- category: "theme",
- description: "An advanced block that allows displaying post types based on different query parameters and visual configurations.",
- textdomain: "default",
- attributes: {
- queryId: {
- type: "number"
- },
- query: {
- type: "object",
- "default": {
- perPage: null,
- pages: 0,
- offset: 0,
- postType: "post",
- order: "desc",
- orderBy: "date",
- author: "",
- search: "",
- exclude: [],
- sticky: "",
- inherit: true,
- taxQuery: null
- }
- },
- tagName: {
- type: "string",
- "default": "div"
- },
- displayLayout: {
- type: "object",
- "default": {
- type: "list"
- }
- }
- },
- providesContext: {
- queryId: "queryId",
- query: "query",
- displayLayout: "displayLayout"
- },
- supports: {
- align: ["wide", "full"],
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- __experimentalLayout: true
- },
- editorStyle: "wp-block-query-editor"
- };
- const {
- name: query_name
- } = query_metadata;
- const query_settings = {
- icon: library_loop,
- edit: query_edit,
- save: QuerySave,
- variations: query_variations,
- deprecated: query_deprecated
- }; // Importing this file includes side effects and is whitelisted
- // in block-library/package.json under `sideEffects`.
- (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/query', query_hooks);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/edit.js
- /**
- * WordPress dependencies
- */
- const query_no_results_edit_TEMPLATE = [['core/paragraph', {
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text or blocks that will display when the query returns no results.')
- }]];
- function QueryNoResultsEdit() {
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- template: query_no_results_edit_TEMPLATE
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/save.js
- /**
- * WordPress dependencies
- */
- function QueryNoResultsSave() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const query_no_results_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/query-no-results",
- title: "No results",
- category: "theme",
- description: "Contains the block elements used to render content when no query results are found.",
- parent: ["core/query"],
- textdomain: "default",
- usesContext: ["queryId", "query"],
- supports: {
- align: true,
- reusable: false,
- html: false,
- color: {
- gradients: true,
- link: true
- }
- }
- };
- const {
- name: query_no_results_name
- } = query_no_results_metadata;
- const query_no_results_settings = {
- icon: library_loop,
- edit: QueryNoResultsEdit,
- save: QueryNoResultsSave
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-arrow-controls.js
- /**
- * WordPress dependencies
- */
- function QueryPaginationArrowControls(_ref) {
- let {
- value,
- onChange
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
- value: value,
- onChange: onChange,
- help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous page link.'),
- isBlock: true
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "none",
- label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Query Pagination Next/Previous blocks')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "arrow",
- label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Query Pagination Next/Previous blocks')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
- value: "chevron",
- label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Query Pagination Next/Previous blocks')
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/edit.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const query_pagination_edit_TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']];
- const edit_getDefaultBlockLayout = blockTypeOrName => {
- const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
- return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
- };
- function edit_QueryPaginationEdit(_ref) {
- let {
- attributes: {
- paginationArrow,
- layout
- },
- setAttributes,
- clientId,
- name
- } = _ref;
- const usedLayout = layout || edit_getDefaultBlockLayout(name);
- const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getBlocks
- } = select(external_wp_blockEditor_namespaceObject.store);
- const innerBlocks = getBlocks(clientId);
- /**
- * Show the `paginationArrow` control only if a
- * `QueryPaginationNext/Previous` block exists.
- */
- return innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.find(innerBlock => {
- return ['core/query-pagination-next', 'core/query-pagination-previous'].includes(innerBlock.name);
- });
- }, []);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- template: query_pagination_edit_TEMPLATE,
- allowedBlocks: ['core/query-pagination-previous', 'core/query-pagination-numbers', 'core/query-pagination-next'],
- __experimentalLayout: usedLayout
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Settings')
- }, (0,external_wp_element_namespaceObject.createElement)(QueryPaginationArrowControls, {
- value: paginationArrow,
- onChange: value => {
- setAttributes({
- paginationArrow: value
- });
- }
- }))), (0,external_wp_element_namespaceObject.createElement)("nav", innerBlocksProps));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/save.js
- /**
- * WordPress dependencies
- */
- function query_pagination_save_save() {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/deprecated.js
- /**
- * WordPress dependencies
- */
- const query_pagination_deprecated_deprecated = [// Version with wrapper `div` element.
- {
- save() {
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
- }
- }];
- /* harmony default export */ var query_pagination_deprecated = (query_pagination_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const query_pagination_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/query-pagination",
- title: "Pagination",
- category: "theme",
- parent: ["core/query"],
- description: "Displays a paginated navigation to next/previous set of posts, when applicable.",
- textdomain: "default",
- attributes: {
- paginationArrow: {
- type: "string",
- "default": "none"
- }
- },
- usesContext: ["queryId", "query"],
- providesContext: {
- paginationArrow: "paginationArrow"
- },
- supports: {
- align: true,
- reusable: false,
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- __experimentalLayout: {
- allowSwitching: false,
- allowInheriting: false,
- "default": {
- type: "flex"
- }
- }
- },
- editorStyle: "wp-block-query-pagination-editor",
- style: "wp-block-query-pagination"
- };
- const {
- name: query_pagination_name
- } = query_pagination_metadata;
- const query_pagination_settings = {
- icon: query_pagination,
- edit: edit_QueryPaginationEdit,
- save: query_pagination_save_save,
- deprecated: query_pagination_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/edit.js
- /**
- * WordPress dependencies
- */
- const query_pagination_next_edit_arrowMap = {
- none: '',
- arrow: '→',
- chevron: '»'
- };
- function QueryPaginationNextEdit(_ref) {
- let {
- attributes: {
- label
- },
- setAttributes,
- context: {
- paginationArrow
- }
- } = _ref;
- const displayArrow = query_pagination_next_edit_arrowMap[paginationArrow];
- return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
- href: "#pagination-next-pseudo-link",
- onClick: event => event.preventDefault()
- }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
- __experimentalVersion: 2,
- tagName: "span",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page link'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Next Page'),
- value: label,
- onChange: newLabel => setAttributes({
- label: newLabel
- })
- }), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
- className: `wp-block-query-pagination-next-arrow is-arrow-${paginationArrow}`
- }, displayArrow));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const query_pagination_next_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/query-pagination-next",
- title: "Next Page",
- category: "theme",
- parent: ["core/query-pagination"],
- description: "Displays the next posts page link.",
- textdomain: "default",
- attributes: {
- label: {
- type: "string"
- }
- },
- usesContext: ["queryId", "query", "paginationArrow"],
- supports: {
- reusable: false,
- html: false,
- color: {
- gradients: true,
- text: false,
- __experimentalDefaultControls: {
- background: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- }
- };
- const {
- name: query_pagination_next_name
- } = query_pagination_next_metadata;
- const query_pagination_next_settings = {
- icon: query_pagination_next,
- edit: QueryPaginationNextEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/edit.js
- /**
- * WordPress dependencies
- */
- const createPaginationItem = function (content) {
- let Tag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'a';
- let extraClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
- return (0,external_wp_element_namespaceObject.createElement)(Tag, {
- className: `page-numbers ${extraClass}`
- }, content);
- };
- const previewPaginationNumbers = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, createPaginationItem(1), createPaginationItem(2), createPaginationItem(3, 'span', 'current'), createPaginationItem(4), createPaginationItem(5), createPaginationItem('...', 'span', 'dots'), createPaginationItem(8));
- function QueryPaginationNumbersEdit() {
- const paginationNumbers = previewPaginationNumbers();
- return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), paginationNumbers);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const query_pagination_numbers_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/query-pagination-numbers",
- title: "Page Numbers",
- category: "theme",
- parent: ["core/query-pagination"],
- description: "Displays a list of page numbers for pagination",
- textdomain: "default",
- usesContext: ["queryId", "query"],
- supports: {
- reusable: false,
- html: false,
- color: {
- gradients: true,
- text: false,
- __experimentalDefaultControls: {
- background: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- },
- editorStyle: "query-pagination-numbers-editor"
- };
- const {
- name: query_pagination_numbers_name
- } = query_pagination_numbers_metadata;
- const query_pagination_numbers_settings = {
- icon: query_pagination_numbers,
- edit: QueryPaginationNumbersEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/edit.js
- /**
- * WordPress dependencies
- */
- const query_pagination_previous_edit_arrowMap = {
- none: '',
- arrow: '←',
- chevron: '«'
- };
- function QueryPaginationPreviousEdit(_ref) {
- let {
- attributes: {
- label
- },
- setAttributes,
- context: {
- paginationArrow
- }
- } = _ref;
- const displayArrow = query_pagination_previous_edit_arrowMap[paginationArrow];
- return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
- href: "#pagination-previous-pseudo-link",
- onClick: event => event.preventDefault()
- }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
- className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`
- }, displayArrow), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
- __experimentalVersion: 2,
- tagName: "span",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page link'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Previous Page'),
- value: label,
- onChange: newLabel => setAttributes({
- label: newLabel
- })
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const query_pagination_previous_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/query-pagination-previous",
- title: "Previous Page",
- category: "theme",
- parent: ["core/query-pagination"],
- description: "Displays the previous posts page link.",
- textdomain: "default",
- attributes: {
- label: {
- type: "string"
- }
- },
- usesContext: ["queryId", "query", "paginationArrow"],
- supports: {
- reusable: false,
- html: false,
- color: {
- gradients: true,
- text: false,
- __experimentalDefaultControls: {
- background: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- }
- };
- const {
- name: query_pagination_previous_name
- } = query_pagination_previous_metadata;
- const query_pagination_previous_settings = {
- icon: query_pagination_previous,
- edit: QueryPaginationPreviousEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const SUPPORTED_TYPES = ['archive'];
- function QueryTitleEdit(_ref) {
- let {
- attributes: {
- type,
- level,
- textAlign
- },
- setAttributes
- } = _ref;
- const TagName = `h${level}`;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign,
- 'wp-block-query-title__placeholder': type === 'archive'
- })
- }); // The plan is to augment this block with more
- // block variations like `Search Title`.
- if (!SUPPORTED_TYPES.includes(type)) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Provided type is not supported.')));
- }
- let titleElement;
- if (type === 'archive') {
- titleElement = (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_i18n_namespaceObject.__)('Archive title'));
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
- selectedLevel: level,
- onChange: newLevel => setAttributes({
- level: newLevel
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), titleElement);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive-title.js
- /**
- * WordPress dependencies
- */
- const archiveTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM20 16H4v-1.5h16V16Zm-7 4H4v-1.5h9V20Z"
- }));
- /* harmony default export */ var archive_title = (archiveTitle);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/variations.js
- /**
- * WordPress dependencies
- */
- const query_title_variations_variations = [{
- isDefault: true,
- name: 'archive-title',
- title: (0,external_wp_i18n_namespaceObject.__)('Archive Title'),
- description: (0,external_wp_i18n_namespaceObject.__)('Display the archive title based on the queried object.'),
- icon: archive_title,
- attributes: {
- type: 'archive'
- },
- scope: ['inserter']
- }];
- /**
- * Add `isActive` function to all `query-title` variations, if not defined.
- * `isActive` function is used to find a variation match from a created
- * Block by providing its attributes.
- */
- query_title_variations_variations.forEach(variation => {
- if (variation.isActive) return;
- variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
- });
- /* harmony default export */ var query_title_variations = (query_title_variations_variations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/deprecated.js
- /**
- * Internal dependencies
- */
- const query_title_deprecated_v1 = {
- attributes: {
- type: {
- type: 'string'
- },
- textAlign: {
- type: 'string'
- },
- level: {
- type: 'number',
- default: 1
- }
- },
- supports: {
- align: ['wide', 'full'],
- html: false,
- color: {
- gradients: true
- },
- spacing: {
- margin: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true
- }
- },
- save() {
- return null;
- },
- migrate: migrate_font_family,
- isEligible(_ref) {
- var _style$typography;
- let {
- style
- } = _ref;
- return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
- }
- };
- /**
- * New deprecations need to be placed first
- * for them to have higher priority.
- *
- * Old deprecations may need to be updated as well.
- *
- * See block-deprecation.md
- */
- /* harmony default export */ var query_title_deprecated = ([query_title_deprecated_v1]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-title.js
- /**
- * WordPress dependencies
- */
- const queryTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm1.3-2.9c.6.3 1.3.5 2 .5.8 0 1.4-.2 2-.5.1 0 .1-.1.2-.2l.8.7.9-1-.8-.7.3-.3a5.09 5.09 0 0 0 0-4.4c-.2-.6-.7-1-1.3-1.4-.6-.3-1.3-.5-2-.5-.8 0-1.4.2-2 .5-.7.4-1.1.8-1.5 1.5-.3.6-.5 1.3-.5 2.2 0 .8.2 1.6.5 2.2.4.6.8 1.1 1.4 1.4zm-.1-5c.2-.4.5-.7.8-1s.8-.4 1.3-.4 1 .1 1.3.4.6.6.8 1c.3.4.4.8.4 1.4 0 .5-.1 1-.3 1.4v.1l-1-.9-.9 1 .9.9c-.3.2-.7.3-1.2.3s-1-.1-1.3-.4c-.4-.2-.6-.6-.8-1C5 9 4.9 8.5 4.9 8c0-.6.1-1 .3-1.4z"
- }));
- /* harmony default export */ var query_title = (queryTitle);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
- /**
- * Internal dependencies
- */
- const query_title_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/query-title",
- title: "Query Title",
- category: "theme",
- description: "Display the query title.",
- textdomain: "default",
- attributes: {
- type: {
- type: "string"
- },
- textAlign: {
- type: "string"
- },
- level: {
- type: "number",
- "default": 1
- }
- },
- supports: {
- align: ["wide", "full"],
- html: false,
- color: {
- gradients: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- spacing: {
- margin: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true,
- fontAppearance: true,
- textTransform: true
- }
- }
- },
- editorStyle: "wp-block-query-title-editor"
- };
- /**
- * WordPress dependencies
- */
- const {
- name: query_title_name
- } = query_title_metadata;
- const query_title_settings = {
- icon: query_title,
- edit: QueryTitleEdit,
- variations: query_title_variations,
- deprecated: query_title_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/quote.js
- /**
- * WordPress dependencies
- */
- const quote = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"
- }));
- /* harmony default export */ var library_quote = (quote);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const quote_deprecated_blockAttributes = {
- value: {
- type: 'string',
- source: 'html',
- selector: 'blockquote',
- multiline: 'p',
- default: ''
- },
- citation: {
- type: 'string',
- source: 'html',
- selector: 'cite',
- default: ''
- },
- align: {
- type: 'string'
- }
- };
- const quote_deprecated_deprecated = [{
- attributes: quote_deprecated_blockAttributes,
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- align,
- value,
- citation
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
- style: {
- textAlign: align ? align : null
- }
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- multiline: true,
- value: value
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "cite",
- value: citation
- }));
- }
- }, {
- attributes: { ...quote_deprecated_blockAttributes,
- style: {
- type: 'number',
- default: 1
- }
- },
- migrate(attributes) {
- if (attributes.style === 2) {
- return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['style']),
- className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large'
- };
- }
- return attributes;
- },
- save(_ref2) {
- let {
- attributes
- } = _ref2;
- const {
- align,
- value,
- citation,
- style
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
- className: style === 2 ? 'is-large' : '',
- style: {
- textAlign: align ? align : null
- }
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- multiline: true,
- value: value
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "cite",
- value: citation
- }));
- }
- }, {
- attributes: { ...quote_deprecated_blockAttributes,
- citation: {
- type: 'string',
- source: 'html',
- selector: 'footer',
- default: ''
- },
- style: {
- type: 'number',
- default: 1
- }
- },
- migrate(attributes) {
- if (!isNaN(parseInt(attributes.style))) {
- return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['style'])
- };
- }
- return attributes;
- },
- save(_ref3) {
- let {
- attributes
- } = _ref3;
- const {
- align,
- value,
- citation,
- style
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
- className: `blocks-quote-style-${style}`,
- style: {
- textAlign: align ? align : null
- }
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- multiline: true,
- value: value
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "footer",
- value: citation
- }));
- }
- }];
- /* harmony default export */ var quote_deprecated = (quote_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const edit_isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
- function QuoteEdit(_ref) {
- let {
- attributes,
- setAttributes,
- isSelected,
- mergeBlocks,
- onReplace,
- className,
- insertBlocksAfter,
- style
- } = _ref;
- const {
- align,
- value,
- citation
- } = attributes;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()(className, {
- [`has-text-align-${align}`]: align
- }),
- style
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: align,
- onChange: nextAlign => {
- setAttributes({
- align: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BlockQuotation, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- identifier: "value",
- multiline: true,
- value: value,
- onChange: nextValue => setAttributes({
- value: nextValue
- }),
- onMerge: mergeBlocks,
- onRemove: forward => {
- const hasEmptyCitation = !citation || citation.length === 0;
- if (!forward && hasEmptyCitation) {
- onReplace([]);
- }
- },
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Quote text'),
- placeholder: // translators: placeholder text used for the quote
- (0,external_wp_i18n_namespaceObject.__)('Add quote'),
- onReplace: onReplace,
- onSplit: piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { ...attributes,
- value: piece
- }),
- __unstableOnSplitMiddle: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'),
- textAlign: align
- }), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- identifier: "citation",
- tagName: edit_isWebPlatform ? 'cite' : undefined,
- style: {
- display: 'block'
- },
- value: citation,
- onChange: nextCitation => setAttributes({
- citation: nextCitation
- }),
- __unstableMobileNoFocusOnMount: true,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Quote citation text'),
- placeholder: // translators: placeholder text used for the citation
- (0,external_wp_i18n_namespaceObject.__)('Add citation'),
- className: "wp-block-quote__citation",
- textAlign: align,
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function quote_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- align,
- value,
- citation
- } = attributes;
- const className = classnames_default()({
- [`has-text-align-${align}`]: align
- });
- return (0,external_wp_element_namespaceObject.createElement)("blockquote", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- multiline: true,
- value: value
- }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "cite",
- value: citation
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/transforms.js
- /**
- * WordPress dependencies
- */
- const quote_transforms_transforms = {
- from: [{
- type: 'block',
- isMultiBlock: true,
- blocks: ['core/paragraph'],
- transform: attributes => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
- value: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: (0,external_wp_richText_namespaceObject.join)(attributes.map(_ref => {
- let {
- content
- } = _ref;
- return (0,external_wp_richText_namespaceObject.create)({
- html: content
- });
- }), '\u2028'),
- multilineTag: 'p'
- }),
- anchor: attributes.anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/heading'],
- transform: _ref2 => {
- let {
- content,
- anchor
- } = _ref2;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
- value: `<p>${content}</p>`,
- anchor
- });
- }
- }, {
- type: 'block',
- blocks: ['core/pullquote'],
- transform: _ref3 => {
- let {
- value,
- citation,
- anchor
- } = _ref3;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
- value,
- citation,
- anchor
- });
- }
- }, {
- type: 'prefix',
- prefix: '>',
- transform: content => {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
- value: `<p>${content}</p>`
- });
- }
- }, {
- type: 'raw',
- isMatch: node => {
- const isParagraphOrSingleCite = (() => {
- let hasCitation = false;
- return child => {
- // Child is a paragraph.
- if (child.nodeName === 'P') {
- return true;
- } // Child is a cite and no other cite child exists before it.
- if (!hasCitation && child.nodeName === 'CITE') {
- hasCitation = true;
- return true;
- }
- };
- })();
- return node.nodeName === 'BLOCKQUOTE' && // The quote block can only handle multiline paragraph
- // content with an optional cite child.
- Array.from(node.childNodes).every(isParagraphOrSingleCite);
- },
- schema: _ref4 => {
- let {
- phrasingContentSchema
- } = _ref4;
- return {
- blockquote: {
- children: {
- p: {
- children: phrasingContentSchema
- },
- cite: {
- children: phrasingContentSchema
- }
- }
- }
- };
- }
- }],
- to: [{
- type: 'block',
- blocks: ['core/paragraph'],
- transform: _ref5 => {
- let {
- value,
- citation
- } = _ref5;
- const paragraphs = [];
- if (value && value !== '<p></p>') {
- paragraphs.push(...(0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
- html: value,
- multilineTag: 'p'
- }), '\u2028').map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: piece
- })
- })));
- }
- if (citation && citation !== '<p></p>') {
- paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: citation
- }));
- }
- if (paragraphs.length === 0) {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: ''
- });
- }
- return paragraphs;
- }
- }, {
- type: 'block',
- blocks: ['core/heading'],
- transform: _ref6 => {
- let {
- value,
- citation,
- ...attrs
- } = _ref6;
- // If there is no quote content, use the citation as the
- // content of the resulting heading. A nonexistent citation
- // will result in an empty heading.
- if (value === '<p></p>') {
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
- content: citation
- });
- }
- const pieces = (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
- html: value,
- multilineTag: 'p'
- }), '\u2028');
- const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
- content: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: pieces[0]
- })
- });
- if (!citation && pieces.length === 1) {
- return headingBlock;
- }
- const quotePieces = pieces.slice(1);
- const quoteBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { ...attrs,
- citation,
- value: (0,external_wp_richText_namespaceObject.toHTMLString)({
- value: quotePieces.length ? (0,external_wp_richText_namespaceObject.join)(pieces.slice(1), '\u2028') : (0,external_wp_richText_namespaceObject.create)(),
- multilineTag: 'p'
- })
- });
- return [headingBlock, quoteBlock];
- }
- }, {
- type: 'block',
- blocks: ['core/pullquote'],
- transform: _ref7 => {
- let {
- value,
- citation,
- anchor
- } = _ref7;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
- value,
- citation,
- anchor
- });
- }
- }]
- };
- /* harmony default export */ var quote_transforms = (quote_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const quote_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/quote",
- title: "Quote",
- category: "text",
- description: "Give quoted text visual emphasis. \"In quoting others, we cite ourselves.\" \u2014 Julio Cort\xE1zar",
- keywords: ["blockquote", "cite"],
- textdomain: "default",
- attributes: {
- value: {
- type: "string",
- source: "html",
- selector: "blockquote",
- multiline: "p",
- "default": "",
- __experimentalRole: "content"
- },
- citation: {
- type: "string",
- source: "html",
- selector: "cite",
- "default": "",
- __experimentalRole: "content"
- },
- align: {
- type: "string"
- }
- },
- supports: {
- anchor: true,
- __experimentalSlashInserter: true,
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true,
- fontAppearance: true
- }
- },
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- }
- },
- styles: [{
- name: "default",
- label: "Default",
- isDefault: true
- }, {
- name: "plain",
- label: "Plain"
- }],
- editorStyle: "wp-block-quote-editor",
- style: "wp-block-quote"
- };
- const {
- name: quote_name
- } = quote_metadata;
- const quote_settingsV1 = {
- icon: library_quote,
- example: {
- attributes: {
- value: '<p>' + (0,external_wp_i18n_namespaceObject.__)('In quoting others, we cite ourselves.') + '</p>',
- citation: 'Julio Cortázar'
- }
- },
- transforms: quote_transforms,
- edit: QuoteEdit,
- save: quote_save_save,
- merge(attributes, _ref) {
- let {
- value,
- citation
- } = _ref;
- // Quote citations cannot be merged. Pick the second one unless it's
- // empty.
- if (!citation) {
- citation = attributes.citation;
- }
- if (!value || value === '<p></p>') {
- return { ...attributes,
- citation
- };
- }
- return { ...attributes,
- value: attributes.value + value,
- citation
- };
- },
- deprecated: quote_deprecated
- };
- let quote_settings = quote_settingsV1;
- if (false) { var quote_window; }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
- /**
- * WordPress dependencies
- */
- const symbol = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 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"
- }));
- /* harmony default export */ var library_symbol = (symbol);
- ;// CONCATENATED MODULE: external ["wp","reusableBlocks"]
- var external_wp_reusableBlocks_namespaceObject = window["wp"]["reusableBlocks"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/ungroup.js
- /**
- * WordPress dependencies
- */
- const ungroup = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"
- }));
- /* harmony default export */ var library_ungroup = (ungroup);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/edit.js
- /**
- * WordPress dependencies
- */
- function ReusableBlockEdit(_ref) {
- let {
- attributes: {
- ref
- },
- clientId
- } = _ref;
- const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(ref);
- const {
- record,
- hasResolved
- } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecord)('postType', 'wp_block', ref);
- const isMissing = hasResolved && !record;
- const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]);
- const {
- __experimentalConvertBlockToStatic: convertBlockToStatic
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_reusableBlocks_namespaceObject.store);
- const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_block', {
- id: ref
- });
- const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_block', 'title', ref);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
- value: blocks,
- onInput,
- onChange,
- renderAppender: blocks !== null && blocks !== void 0 && blocks.length ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
- });
- if (hasAlreadyRendered) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
- }
- if (isMissing) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block has been deleted or is unavailable.')));
- }
- if (!hasResolved) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)));
- }
- return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, canRemove && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- onClick: () => convertBlockToStatic(clientId),
- label: (0,external_wp_i18n_namespaceObject.__)('Convert to regular blocks'),
- icon: library_ungroup,
- showTooltip: true
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Name'),
- value: title,
- onChange: setTitle
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
- clientId: clientId,
- wrapperProps: innerBlocksProps,
- className: "block-library-block__reusable-block-container"
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const block_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/block",
- title: "Reusable block",
- category: "reusable",
- description: "Create and save content to reuse across your site. Update the block, and the changes apply everywhere it\u2019s used.",
- textdomain: "default",
- attributes: {
- ref: {
- type: "number"
- }
- },
- supports: {
- customClassName: false,
- html: false,
- inserter: false
- },
- editorStyle: "wp-block-editor"
- };
- const {
- name: block_name
- } = block_metadata;
- const block_settings = {
- edit: ReusableBlockEdit,
- icon: library_symbol
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/read-more/edit.js
- /**
- * WordPress dependencies
- */
- function ReadMore(_ref) {
- let {
- attributes: {
- content,
- linkTarget
- },
- setAttributes,
- insertBlocksAfter
- } = _ref;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
- onChange: value => setAttributes({
- linkTarget: value ? '_blank' : '_self'
- }),
- checked: linkTarget === '_blank'
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
- tagName: "a",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('"Read more" link text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Read more'),
- value: content,
- onChange: newValue => setAttributes({
- content: newValue
- }),
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())),
- withoutInteractiveFormatting: true
- }, blockProps)));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/read-more/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const read_more_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/read-more",
- title: "Read More",
- category: "theme",
- description: "Displays the link of a post, page, or any other content-type.",
- textdomain: "default",
- attributes: {
- content: {
- type: "string"
- },
- linkTarget: {
- type: "string",
- "default": "_self"
- }
- },
- usesContext: ["postId"],
- supports: {
- html: false,
- color: {
- gradients: true,
- text: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalFontWeight: true,
- __experimentalFontStyle: true,
- __experimentalTextTransform: true,
- __experimentalLetterSpacing: true,
- __experimentalTextDecoration: true,
- __experimentalDefaultControls: {
- fontSize: true,
- textDecoration: true
- }
- },
- spacing: {
- margin: ["top", "bottom"],
- padding: true,
- __experimentalDefaultControls: {
- padding: true
- }
- },
- __experimentalBorder: {
- color: true,
- radius: true,
- width: true,
- __experimentalDefaultControls: {
- width: true
- }
- }
- },
- style: "wp-block-read-more"
- };
- const {
- name: read_more_name
- } = read_more_metadata;
- const read_more_settings = {
- icon: library_link,
- edit: ReadMore
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rss.js
- /**
- * WordPress dependencies
- */
- const rss = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"
- }));
- /* harmony default export */ var library_rss = (rss);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/edit.js
- /**
- * WordPress dependencies
- */
- const DEFAULT_MIN_ITEMS = 1;
- const DEFAULT_MAX_ITEMS = 20;
- function RSSEdit(_ref) {
- let {
- attributes,
- setAttributes
- } = _ref;
- const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(!attributes.feedURL);
- const {
- blockLayout,
- columns,
- displayAuthor,
- displayDate,
- displayExcerpt,
- excerptLength,
- feedURL,
- itemsToShow
- } = attributes;
- function toggleAttribute(propName) {
- return () => {
- const value = attributes[propName];
- setAttributes({
- [propName]: !value
- });
- };
- }
- function onSubmitURL(event) {
- event.preventDefault();
- if (feedURL) {
- setAttributes({
- feedURL: (0,external_wp_url_namespaceObject.prependHTTP)(feedURL)
- });
- setIsEditing(false);
- }
- }
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- if (isEditing) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- icon: library_rss,
- label: "RSS"
- }, (0,external_wp_element_namespaceObject.createElement)("form", {
- onSubmit: onSubmitURL,
- className: "wp-block-rss__placeholder-form"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL here…'),
- value: feedURL,
- onChange: value => setAttributes({
- feedURL: value
- }),
- className: "wp-block-rss__placeholder-input"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "primary",
- type: "submit"
- }, (0,external_wp_i18n_namespaceObject.__)('Use URL')))));
- }
- const toolbarControls = [{
- icon: library_edit,
- title: (0,external_wp_i18n_namespaceObject.__)('Edit RSS URL'),
- onClick: () => setIsEditing(true)
- }, {
- icon: library_list,
- title: (0,external_wp_i18n_namespaceObject.__)('List view'),
- onClick: () => setAttributes({
- blockLayout: 'list'
- }),
- isActive: blockLayout === 'list'
- }, {
- icon: library_grid,
- title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
- onClick: () => setAttributes({
- blockLayout: 'grid'
- }),
- isActive: blockLayout === 'grid'
- }];
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
- controls: toolbarControls
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('RSS settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Number of items'),
- value: itemsToShow,
- onChange: value => setAttributes({
- itemsToShow: value
- }),
- min: DEFAULT_MIN_ITEMS,
- max: DEFAULT_MAX_ITEMS,
- required: true
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display author'),
- checked: displayAuthor,
- onChange: toggleAttribute('displayAuthor')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
- checked: displayDate,
- onChange: toggleAttribute('displayDate')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
- checked: displayExcerpt,
- onChange: toggleAttribute('displayExcerpt')
- }), displayExcerpt && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
- value: excerptLength,
- onChange: value => setAttributes({
- excerptLength: value
- }),
- min: 10,
- max: 100,
- required: true
- }), blockLayout === 'grid' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
- value: columns,
- onChange: value => setAttributes({
- columns: value
- }),
- min: 2,
- max: 6,
- required: true
- }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
- block: "core/rss",
- attributes: attributes
- }))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const rss_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/rss",
- title: "RSS",
- category: "widgets",
- description: "Display entries from any RSS or Atom feed.",
- keywords: ["atom", "feed"],
- textdomain: "default",
- attributes: {
- columns: {
- type: "number",
- "default": 2
- },
- blockLayout: {
- type: "string",
- "default": "list"
- },
- feedURL: {
- type: "string",
- "default": ""
- },
- itemsToShow: {
- type: "number",
- "default": 5
- },
- displayExcerpt: {
- type: "boolean",
- "default": false
- },
- displayAuthor: {
- type: "boolean",
- "default": false
- },
- displayDate: {
- type: "boolean",
- "default": false
- },
- excerptLength: {
- type: "number",
- "default": 55
- }
- },
- supports: {
- align: true,
- html: false
- },
- editorStyle: "wp-block-rss-editor",
- style: "wp-block-rss"
- };
- const {
- name: rss_name
- } = rss_metadata;
- const rss_settings = {
- icon: library_rss,
- example: {
- attributes: {
- feedURL: 'https://wordpress.org'
- }
- },
- edit: RSSEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js
- /**
- * WordPress dependencies
- */
- const search = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var library_search = (search);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/icons.js
- /**
- * WordPress dependencies
- */
- const buttonOnly = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "7",
- y: "10",
- width: "10",
- height: "4",
- rx: "1",
- fill: "currentColor"
- }));
- const buttonOutside = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "4.75",
- y: "15.25",
- width: "6.5",
- height: "9.5",
- transform: "rotate(-90 4.75 15.25)",
- stroke: "currentColor",
- strokeWidth: "1.5",
- fill: "none"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "16",
- y: "10",
- width: "4",
- height: "4",
- rx: "1",
- fill: "currentColor"
- }));
- const buttonInside = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "4.75",
- y: "15.25",
- width: "6.5",
- height: "14.5",
- transform: "rotate(-90 4.75 15.25)",
- stroke: "currentColor",
- strokeWidth: "1.5",
- fill: "none"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "14",
- y: "10",
- width: "4",
- height: "4",
- rx: "1",
- fill: "currentColor"
- }));
- const noButton = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "4.75",
- y: "15.25",
- width: "6.5",
- height: "14.5",
- transform: "rotate(-90 4.75 15.25)",
- stroke: "currentColor",
- fill: "none",
- strokeWidth: "1.5"
- }));
- const buttonWithIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "4.75",
- y: "7.75",
- width: "14.5",
- height: "8.5",
- rx: "1.25",
- stroke: "currentColor",
- fill: "none",
- strokeWidth: "1.5"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "8",
- y: "11",
- width: "8",
- height: "2",
- fill: "currentColor"
- }));
- const toggleLabel = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "4.75",
- y: "17.25",
- width: "5.5",
- height: "14.5",
- transform: "rotate(-90 4.75 17.25)",
- stroke: "currentColor",
- fill: "none",
- strokeWidth: "1.5"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "4",
- y: "7",
- width: "10",
- height: "2",
- fill: "currentColor"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/utils.js
- /**
- * Constants
- */
- const PC_WIDTH_DEFAULT = 50;
- const PX_WIDTH_DEFAULT = 350;
- const MIN_WIDTH = 220;
- const MIN_WIDTH_UNIT = 'px';
- /**
- * Returns a boolean whether passed unit is percentage
- *
- * @param {string} unit Block width unit.
- *
- * @return {boolean} Whether unit is '%'.
- */
- function utils_isPercentageUnit(unit) {
- return unit === '%';
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- // Used to calculate border radius adjustment to avoid "fat" corners when
- // button is placed inside wrapper.
- const DEFAULT_INNER_PADDING = '4px';
- function SearchEdit(_ref) {
- var _style$border, _style$border2, _style$border3;
- let {
- className,
- attributes,
- setAttributes,
- toggleSelection,
- isSelected,
- clientId
- } = _ref;
- const {
- label,
- showLabel,
- placeholder,
- width,
- widthUnit,
- align,
- buttonText,
- buttonPosition,
- buttonUseIcon,
- style
- } = attributes;
- const insertedInNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getBlockParentsByBlo;
- const {
- getBlockParentsByBlockName,
- wasBlockJustInserted
- } = select(external_wp_blockEditor_namespaceObject.store);
- return !!((_getBlockParentsByBlo = getBlockParentsByBlockName(clientId, 'core/navigation')) !== null && _getBlockParentsByBlo !== void 0 && _getBlockParentsByBlo.length) && wasBlockJustInserted(clientId);
- }, [clientId]);
- const {
- __unstableMarkNextChangeAsNotPersistent
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!insertedInNavigationBlock) return; // This side-effect should not create an undo level.
- __unstableMarkNextChangeAsNotPersistent();
- setAttributes({
- showLabel: false,
- buttonUseIcon: true,
- buttonPosition: 'button-inside'
- });
- }, [insertedInNavigationBlock]);
- const borderRadius = style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius;
- const borderColor = style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.color;
- const borderWidth = style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.width;
- const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); // Check for old deprecated numerical border radius. Done as a separate
- // check so that a borderRadius style won't overwrite the longhand
- // per-corner styles.
- if (typeof borderRadius === 'number') {
- borderProps.style.borderRadius = `${borderRadius}px`;
- }
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
- const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
- const unitControlInputId = `wp-block-search__width-${unitControlInstanceId}`;
- const isButtonPositionInside = 'button-inside' === buttonPosition;
- const isButtonPositionOutside = 'button-outside' === buttonPosition;
- const hasNoButton = 'no-button' === buttonPosition;
- const hasOnlyButton = 'button-only' === buttonPosition;
- const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
- availableUnits: ['%', 'px'],
- defaultValues: {
- '%': PC_WIDTH_DEFAULT,
- px: PX_WIDTH_DEFAULT
- }
- });
- const getBlockClassNames = () => {
- return classnames_default()(className, isButtonPositionInside ? 'wp-block-search__button-inside' : undefined, isButtonPositionOutside ? 'wp-block-search__button-outside' : undefined, hasNoButton ? 'wp-block-search__no-button' : undefined, hasOnlyButton ? 'wp-block-search__button-only' : undefined, !buttonUseIcon && !hasNoButton ? 'wp-block-search__text-button' : undefined, buttonUseIcon && !hasNoButton ? 'wp-block-search__icon-button' : undefined);
- };
- const buttonPositionControls = [{
- role: 'menuitemradio',
- title: (0,external_wp_i18n_namespaceObject.__)('Button outside'),
- isActive: buttonPosition === 'button-outside',
- icon: buttonOutside,
- onClick: () => {
- setAttributes({
- buttonPosition: 'button-outside'
- });
- }
- }, {
- role: 'menuitemradio',
- title: (0,external_wp_i18n_namespaceObject.__)('Button inside'),
- isActive: buttonPosition === 'button-inside',
- icon: buttonInside,
- onClick: () => {
- setAttributes({
- buttonPosition: 'button-inside'
- });
- }
- }, {
- role: 'menuitemradio',
- title: (0,external_wp_i18n_namespaceObject.__)('No button'),
- isActive: buttonPosition === 'no-button',
- icon: noButton,
- onClick: () => {
- setAttributes({
- buttonPosition: 'no-button'
- });
- }
- }];
- const getButtonPositionIcon = () => {
- switch (buttonPosition) {
- case 'button-inside':
- return buttonInside;
- case 'button-outside':
- return buttonOutside;
- case 'no-button':
- return noButton;
- case 'button-only':
- return buttonOnly;
- }
- };
- const getResizableSides = () => {
- if (hasOnlyButton) {
- return {};
- }
- return {
- right: align !== 'right',
- left: align === 'right'
- };
- };
- const renderTextField = () => {
- // If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.
- const textFieldClasses = classnames_default()('wp-block-search__input', isButtonPositionInside ? undefined : borderProps.className);
- const textFieldStyles = isButtonPositionInside ? {
- borderRadius
- } : borderProps.style;
- return (0,external_wp_element_namespaceObject.createElement)("input", {
- className: textFieldClasses,
- style: textFieldStyles,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') // We hide the placeholder field's placeholder when there is a value. This
- // stops screen readers from reading the placeholder field's placeholder
- // which is confusing.
- ,
- placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'),
- value: placeholder,
- onChange: event => setAttributes({
- placeholder: event.target.value
- })
- });
- };
- const renderButton = () => {
- // If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.
- const buttonClasses = classnames_default()('wp-block-search__button', colorProps.className, isButtonPositionInside ? undefined : borderProps.className, buttonUseIcon ? 'has-icon' : undefined);
- const buttonStyles = { ...colorProps.style,
- ...(isButtonPositionInside ? {
- borderRadius
- } : borderProps.style)
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, buttonUseIcon && (0,external_wp_element_namespaceObject.createElement)("button", {
- type: "button",
- className: buttonClasses,
- style: buttonStyles,
- "aria-label": buttonText ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(buttonText) : (0,external_wp_i18n_namespaceObject.__)('Search')
- }, (0,external_wp_element_namespaceObject.createElement)(icon, {
- icon: library_search
- })), !buttonUseIcon && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- className: buttonClasses,
- style: buttonStyles,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add button text…'),
- withoutInteractiveFormatting: true,
- value: buttonText,
- onChange: html => setAttributes({
- buttonText: html
- })
- }));
- };
- const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- title: (0,external_wp_i18n_namespaceObject.__)('Toggle search label'),
- icon: toggleLabel,
- onClick: () => {
- setAttributes({
- showLabel: !showLabel
- });
- },
- className: showLabel ? 'is-pressed' : undefined
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
- icon: getButtonPositionIcon(),
- label: (0,external_wp_i18n_namespaceObject.__)('Change button position'),
- controls: buttonPositionControls
- }), !hasNoButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- title: (0,external_wp_i18n_namespaceObject.__)('Use button with icon'),
- icon: buttonWithIcon,
- onClick: () => {
- setAttributes({
- buttonUseIcon: !buttonUseIcon
- });
- },
- className: buttonUseIcon ? 'is-pressed' : undefined
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Display Settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Width'),
- id: unitControlInputId
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
- id: unitControlInputId,
- min: `${MIN_WIDTH}${MIN_WIDTH_UNIT}`,
- onChange: newWidth => {
- const filteredWidth = widthUnit === '%' && parseInt(newWidth, 10) > 100 ? 100 : newWidth;
- setAttributes({
- width: parseInt(filteredWidth, 10)
- });
- },
- onUnitChange: newUnit => {
- setAttributes({
- width: '%' === newUnit ? PC_WIDTH_DEFAULT : PX_WIDTH_DEFAULT,
- widthUnit: newUnit
- });
- },
- style: {
- maxWidth: 80
- },
- value: `${width}${widthUnit}`,
- units: units
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
- className: "wp-block-search__components-button-group",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Percentage Width')
- }, [25, 50, 75, 100].map(widthValue => {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- key: widthValue,
- isSmall: true,
- variant: `${widthValue}%` === `${width}${widthUnit}` ? 0 : undefined,
- onClick: () => setAttributes({
- width: widthValue,
- widthUnit: '%'
- })
- }, widthValue, "%");
- }))))));
- const padBorderRadius = radius => radius ? `calc(${radius} + ${DEFAULT_INNER_PADDING})` : undefined;
- const getWrapperStyles = () => {
- const styles = {
- borderColor,
- borderWidth: isButtonPositionInside ? borderWidth : undefined
- };
- const isNonZeroBorderRadius = borderRadius !== undefined && parseInt(borderRadius, 10) !== 0;
- if (isButtonPositionInside && isNonZeroBorderRadius) {
- // We have button inside wrapper and a border radius value to apply.
- // Add default padding so we don't get "fat" corners.
- //
- // CSS calc() is used here to support non-pixel units. The inline
- // style using calc() will only apply if both values have units.
- if (typeof borderRadius === 'object') {
- // Individual corner border radii present.
- const {
- topLeft,
- topRight,
- bottomLeft,
- bottomRight
- } = borderRadius;
- return {
- borderTopLeftRadius: padBorderRadius(topLeft),
- borderTopRightRadius: padBorderRadius(topRight),
- borderBottomLeftRadius: padBorderRadius(bottomLeft),
- borderBottomRightRadius: padBorderRadius(bottomRight),
- ...styles
- };
- } // The inline style using calc() will only apply if both values
- // supplied to calc() have units. Deprecated block's may have
- // unitless integer.
- const radius = Number.isInteger(borderRadius) ? `${borderRadius}px` : borderRadius;
- styles.borderRadius = `calc(${radius} + ${DEFAULT_INNER_PADDING})`;
- }
- return styles;
- };
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: getBlockClassNames()
- });
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, controls, showLabel && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- className: "wp-block-search__label",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add label…'),
- withoutInteractiveFormatting: true,
- value: label,
- onChange: html => setAttributes({
- label: html
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
- size: {
- width: `${width}${widthUnit}`
- },
- className: classnames_default()('wp-block-search__inside-wrapper', isButtonPositionInside ? borderProps.className : undefined),
- style: getWrapperStyles(),
- minWidth: MIN_WIDTH,
- enable: getResizableSides(),
- onResizeStart: (event, direction, elt) => {
- setAttributes({
- width: parseInt(elt.offsetWidth, 10),
- widthUnit: 'px'
- });
- toggleSelection(false);
- },
- onResizeStop: (event, direction, elt, delta) => {
- setAttributes({
- width: parseInt(width + delta.width, 10)
- });
- toggleSelection(true);
- },
- showHandle: isSelected
- }, (isButtonPositionInside || isButtonPositionOutside) && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, renderTextField(), renderButton()), hasOnlyButton && renderButton(), hasNoButton && renderTextField()));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/variations.js
- /**
- * WordPress dependencies
- */
- const search_variations_variations = [{
- name: 'default',
- isDefault: true,
- attributes: {
- buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'),
- label: (0,external_wp_i18n_namespaceObject.__)('Search')
- }
- }];
- /* harmony default export */ var search_variations = (search_variations_variations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const search_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/search",
- title: "Search",
- category: "widgets",
- description: "Help visitors find your content.",
- keywords: ["find"],
- textdomain: "default",
- attributes: {
- label: {
- type: "string",
- __experimentalRole: "content"
- },
- showLabel: {
- type: "boolean",
- "default": true
- },
- placeholder: {
- type: "string",
- "default": "",
- __experimentalRole: "content"
- },
- width: {
- type: "number"
- },
- widthUnit: {
- type: "string"
- },
- buttonText: {
- type: "string",
- __experimentalRole: "content"
- },
- buttonPosition: {
- type: "string",
- "default": "button-outside"
- },
- buttonUseIcon: {
- type: "boolean",
- "default": false
- }
- },
- supports: {
- align: ["left", "center", "right"],
- color: {
- gradients: true,
- __experimentalSkipSerialization: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- __experimentalBorder: {
- color: true,
- radius: true,
- width: true,
- __experimentalSkipSerialization: true,
- __experimentalDefaultControls: {
- color: true,
- radius: true,
- width: true
- }
- },
- html: false
- },
- editorStyle: "wp-block-search-editor",
- style: "wp-block-search"
- };
- const {
- name: search_name
- } = search_metadata;
- const search_settings = {
- icon: library_search,
- example: {},
- variations: search_variations,
- edit: SearchEdit
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/separator.js
- /**
- * WordPress dependencies
- */
- const separator = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M20.2 7v4H3.8V7H2.2v9h1.6v-3.5h16.4V16h1.6V7z"
- }));
- /* harmony default export */ var library_separator = (separator);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/use-deprecated-opacity.js
- /**
- * WordPress dependencies
- */
- function useDeprecatedOpacity(opacity, currentColor, setAttributes) {
- const [deprecatedOpacityWithNoColor, setDeprecatedOpacityWithNoColor] = (0,external_wp_element_namespaceObject.useState)(false);
- const previousColor = (0,external_wp_compose_namespaceObject.usePrevious)(currentColor); // A separator with no color set will always have previousColor set to undefined,
- // and we need to differentiate these from those with color set that will return
- // previousColor as undefined on the first render.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (opacity === 'css' && !currentColor && !previousColor) {
- setDeprecatedOpacityWithNoColor(true);
- }
- }, [currentColor, previousColor, opacity]); // For deprecated blocks, that have a default 0.4 css opacity set, we
- // need to remove this if the current color is changed, or a color is added.
- // In these instances the opacity attribute is set back to the default of
- // alpha-channel which allows a new custom opacity to be set via the color picker.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (opacity === 'css' && (deprecatedOpacityWithNoColor && currentColor || previousColor && currentColor !== previousColor)) {
- setAttributes({
- opacity: 'alpha-channel'
- });
- setDeprecatedOpacityWithNoColor(false);
- }
- }, [deprecatedOpacityWithNoColor, currentColor, previousColor]);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function SeparatorEdit(_ref) {
- var _colorProps$style, _style$color;
- let {
- attributes,
- setAttributes
- } = _ref;
- const {
- backgroundColor,
- opacity,
- style
- } = attributes;
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
- const currentColor = colorProps === null || colorProps === void 0 ? void 0 : (_colorProps$style = colorProps.style) === null || _colorProps$style === void 0 ? void 0 : _colorProps$style.backgroundColor;
- const hasCustomColor = !!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.background);
- useDeprecatedOpacity(opacity, currentColor, setAttributes); // The dots styles uses text for the dots, to change those dots color is
- // using color, not backgroundColor.
- const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
- const className = classnames_default()({
- 'has-text-color': backgroundColor || currentColor,
- [colorClass]: colorClass,
- 'has-css-opacity': opacity === 'css',
- 'has-alpha-channel-opacity': opacity === 'alpha-channel'
- }, colorProps.classname);
- const styles = {
- color: currentColor,
- backgroundColor: currentColor
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.HorizontalRule, (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className,
- style: hasCustomColor ? styles : undefined
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function separatorSave(_ref) {
- var _style$color, _colorProps$style;
- let {
- attributes
- } = _ref;
- const {
- backgroundColor,
- style,
- opacity
- } = attributes;
- const customColor = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.background;
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); // The hr support changing color using border-color, since border-color
- // is not yet supported in the color palette, we use background-color.
- // The dots styles uses text for the dots, to change those dots color is
- // using color, not backgroundColor.
- const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
- const className = classnames_default()({
- 'has-text-color': backgroundColor || customColor,
- [colorClass]: colorClass,
- 'has-css-opacity': opacity === 'css',
- 'has-alpha-channel-opacity': opacity === 'alpha-channel'
- }, colorProps.className);
- const styles = {
- backgroundColor: colorProps === null || colorProps === void 0 ? void 0 : (_colorProps$style = colorProps.style) === null || _colorProps$style === void 0 ? void 0 : _colorProps$style.backgroundColor,
- color: colorClass ? undefined : customColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("hr", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className,
- style: styles
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/transforms.js
- /**
- * WordPress dependencies
- */
- const separator_transforms_transforms = {
- from: [{
- type: 'enter',
- regExp: /^-{3,}$/,
- transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/separator')
- }, {
- type: 'raw',
- selector: 'hr',
- schema: {
- hr: {}
- }
- }]
- };
- /* harmony default export */ var separator_transforms = (separator_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const separator_deprecated_v1 = {
- attributes: {
- color: {
- type: 'string'
- },
- customColor: {
- type: 'string'
- }
- },
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- color,
- customColor
- } = attributes; // the hr support changing color using border-color, since border-color
- // is not yet supported in the color palette, we use background-color
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color); // the dots styles uses text for the dots, to change those dots color is
- // using color, not backgroundColor
- const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', color);
- const className = classnames_default()({
- 'has-text-color has-background': color || customColor,
- [backgroundClass]: backgroundClass,
- [colorClass]: colorClass
- });
- const style = {
- backgroundColor: backgroundClass ? undefined : customColor,
- color: colorClass ? undefined : customColor
- };
- return (0,external_wp_element_namespaceObject.createElement)("hr", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className,
- style
- }));
- },
- migrate(attributes) {
- const {
- color,
- customColor
- } = attributes;
- return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['color', 'customColor']),
- backgroundColor: color ? color : undefined,
- opacity: 'css',
- style: customColor ? {
- color: {
- background: customColor
- }
- } : undefined
- };
- }
- };
- /* harmony default export */ var separator_deprecated = ([separator_deprecated_v1]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const separator_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/separator",
- title: "Separator",
- category: "design",
- description: "Create a break between ideas or sections with a horizontal separator.",
- keywords: ["horizontal-line", "hr", "divider"],
- textdomain: "default",
- attributes: {
- opacity: {
- type: "string",
- "default": "alpha-channel"
- }
- },
- supports: {
- anchor: true,
- align: ["center", "wide", "full"],
- color: {
- __experimentalSkipSerialization: true,
- gradients: true,
- background: true,
- text: false,
- __experimentalDefaultControls: {
- background: true
- }
- }
- },
- styles: [{
- name: "default",
- label: "Default",
- isDefault: true
- }, {
- name: "wide",
- label: "Wide Line"
- }, {
- name: "dots",
- label: "Dots"
- }],
- editorStyle: "wp-block-separator-editor",
- style: "wp-block-separator"
- };
- const {
- name: separator_name
- } = separator_metadata;
- const separator_settings = {
- icon: library_separator,
- example: {
- attributes: {
- customColor: '#065174',
- className: 'is-style-wide'
- }
- },
- transforms: separator_transforms,
- edit: SeparatorEdit,
- save: separatorSave,
- deprecated: separator_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shortcode.js
- /**
- * WordPress dependencies
- */
- const shortcode = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"
- }));
- /* harmony default export */ var library_shortcode = (shortcode);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/edit.js
- /**
- * WordPress dependencies
- */
- function ShortcodeEdit(_ref) {
- let {
- attributes,
- setAttributes
- } = _ref;
- const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ShortcodeEdit);
- const inputId = `blocks-shortcode-input-${instanceId}`;
- return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: 'components-placeholder'
- }), (0,external_wp_element_namespaceObject.createElement)("label", {
- htmlFor: inputId,
- className: "components-placeholder__label"
- }, (0,external_wp_element_namespaceObject.createElement)(icon, {
- icon: library_shortcode
- }), (0,external_wp_i18n_namespaceObject.__)('Shortcode')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
- className: "blocks-shortcode__textarea",
- id: inputId,
- value: attributes.text,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Shortcode text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write shortcode here…'),
- onChange: text => setAttributes({
- text
- })
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/save.js
- /**
- * WordPress dependencies
- */
- function shortcode_save_save(_ref) {
- let {
- attributes
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.text);
- }
- ;// CONCATENATED MODULE: external ["wp","autop"]
- var external_wp_autop_namespaceObject = window["wp"]["autop"];
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/transforms.js
- /**
- * WordPress dependencies
- */
- const shortcode_transforms_transforms = {
- from: [{
- type: 'shortcode',
- // Per "Shortcode names should be all lowercase and use all
- // letters, but numbers and underscores should work fine too.
- // Be wary of using hyphens (dashes), you'll be better off not
- // using them." in https://codex.wordpress.org/Shortcode_API
- // Require that the first character be a letter. This notably
- // prevents footnote markings ([1]) from being caught as
- // shortcodes.
- tag: '[a-z][a-z0-9_-]*',
- attributes: {
- text: {
- type: 'string',
- shortcode: (attrs, _ref) => {
- let {
- content
- } = _ref;
- return (0,external_wp_autop_namespaceObject.removep)((0,external_wp_autop_namespaceObject.autop)(content));
- }
- }
- },
- priority: 20
- }]
- };
- /* harmony default export */ var shortcode_transforms = (shortcode_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const shortcode_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/shortcode",
- title: "Shortcode",
- category: "widgets",
- description: "Insert additional custom elements with a WordPress shortcode.",
- textdomain: "default",
- attributes: {
- text: {
- type: "string",
- source: "html"
- }
- },
- supports: {
- className: false,
- customClassName: false,
- html: false
- },
- editorStyle: "wp-block-shortcode-editor"
- };
- const {
- name: shortcode_name
- } = shortcode_metadata;
- const shortcode_settings = {
- icon: library_shortcode,
- transforms: shortcode_transforms,
- edit: ShortcodeEdit,
- save: shortcode_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/site-logo.js
- /**
- * WordPress dependencies
- */
- const siteLogo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z"
- }));
- /* harmony default export */ var site_logo = (siteLogo);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Module constants
- */
- const site_logo_edit_ALLOWED_MEDIA_TYPES = ['image'];
- const ACCEPT_MEDIA_STRING = 'image/*';
- const SiteLogo = _ref => {
- let {
- alt,
- attributes: {
- align,
- width,
- height,
- isLink,
- linkTarget,
- shouldSyncIcon
- },
- containerRef,
- isSelected,
- setAttributes,
- setLogo,
- logoUrl,
- siteUrl,
- logoId,
- iconId,
- setIcon,
- canUserEdit
- } = _ref;
- const clientWidth = useClientWidth(containerRef, [align]);
- const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
- const isWideAligned = (0,external_lodash_namespaceObject.includes)(['wide', 'full'], align);
- const isResizable = !isWideAligned && isLargeViewport;
- const [{
- naturalWidth,
- naturalHeight
- }, setNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
- const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
- const {
- toggleSelection
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const classes = classnames_default()('custom-logo-link', {
- 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(logoUrl)
- });
- const {
- imageEditing,
- maxWidth,
- title
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- const siteEntities = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('root', 'site');
- return {
- title: siteEntities.title,
- ...(0,external_lodash_namespaceObject.pick)(getSettings(), ['imageEditing', 'maxWidth'])
- };
- }, []);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // Turn the `Use as site icon` toggle off if it is on but the logo and icon have
- // fallen out of sync. This can happen if the toggle is saved in the `on` position,
- // but changes are later made to the site icon in the Customizer.
- if (shouldSyncIcon && logoId !== iconId) {
- setAttributes({
- shouldSyncIcon: false
- });
- }
- }, []);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isSelected) {
- setIsEditingImage(false);
- }
- }, [isSelected]);
- function onResizeStart() {
- toggleSelection(false);
- }
- function onResizeStop() {
- toggleSelection(true);
- }
- const img = (0,external_wp_element_namespaceObject.createElement)("img", {
- className: "custom-logo",
- src: logoUrl,
- alt: alt,
- onLoad: event => {
- setNaturalSize((0,external_lodash_namespaceObject.pick)(event.target, ['naturalWidth', 'naturalHeight']));
- }
- });
- let imgWrapper = img; // Disable reason: Image itself is not meant to be interactive, but
- // should direct focus to block.
- if (isLink) {
- imgWrapper =
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
- (0,external_wp_element_namespaceObject.createElement)("a", {
- href: siteUrl,
- className: classes,
- rel: "home",
- title: title,
- onClick: event => event.preventDefault()
- }, img)
- /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
- ;
- }
- let imageWidthWithinContainer;
- if (clientWidth && naturalWidth && naturalHeight) {
- const exceedMaxWidth = naturalWidth > clientWidth;
- imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;
- }
- if (!isResizable || !imageWidthWithinContainer) {
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- style: {
- width,
- height
- }
- }, imgWrapper);
- } // Set the default width to a responsible size.
- // Note that this width is also set in the attached frontend CSS file.
- const defaultWidth = 120;
- const currentWidth = width || defaultWidth;
- const ratio = naturalWidth / naturalHeight;
- const currentHeight = currentWidth / ratio;
- const minWidth = naturalWidth < naturalHeight ? MIN_SIZE : Math.ceil(MIN_SIZE * ratio);
- const minHeight = naturalHeight < naturalWidth ? MIN_SIZE : Math.ceil(MIN_SIZE / ratio); // With the current implementation of ResizableBox, an image needs an
- // explicit pixel value for the max-width. In absence of being able to
- // set the content-width, this max-width is currently dictated by the
- // vanilla editor style. The following variable adds a buffer to this
- // vanilla style, so 3rd party themes have some wiggleroom. This does,
- // in most cases, allow you to scale the image beyond the width of the
- // main column, though not infinitely.
- // @todo It would be good to revisit this once a content-width variable
- // becomes available.
- const maxWidthBuffer = maxWidth * 2.5;
- let showRightHandle = false;
- let showLeftHandle = false;
- /* eslint-disable no-lonely-if */
- // See https://github.com/WordPress/gutenberg/issues/7584.
- if (align === 'center') {
- // When the image is centered, show both handles.
- showRightHandle = true;
- showLeftHandle = true;
- } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
- // In RTL mode the image is on the right by default.
- // Show the right handle and hide the left handle only when it is
- // aligned left. Otherwise always show the left handle.
- if (align === 'left') {
- showRightHandle = true;
- } else {
- showLeftHandle = true;
- }
- } else {
- // Show the left handle and hide the right handle only when the
- // image is aligned right. Otherwise always show the right handle.
- if (align === 'right') {
- showLeftHandle = true;
- } else {
- showRightHandle = true;
- }
- }
- /* eslint-enable no-lonely-if */
- const canEditImage = logoId && naturalWidth && naturalHeight && imageEditing;
- const imgEdit = canEditImage && isEditingImage ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditingProvider, {
- id: logoId,
- url: logoUrl,
- naturalWidth: naturalWidth,
- naturalHeight: naturalHeight,
- clientWidth: clientWidth,
- onSaveImage: imageAttributes => {
- setLogo(imageAttributes.id);
- },
- isEditing: isEditingImage,
- onFinishEditing: () => setIsEditingImage(false)
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
- url: logoUrl,
- width: currentWidth,
- height: currentHeight,
- clientWidth: clientWidth,
- naturalHeight: naturalHeight,
- naturalWidth: naturalWidth
- })) : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
- size: {
- width: currentWidth,
- height: currentHeight
- },
- showHandle: isSelected,
- minWidth: minWidth,
- maxWidth: maxWidthBuffer,
- minHeight: minHeight,
- maxHeight: maxWidthBuffer / ratio,
- lockAspectRatio: true,
- enable: {
- top: false,
- right: showRightHandle,
- bottom: true,
- left: showLeftHandle
- },
- onResizeStart: onResizeStart,
- onResizeStop: (event, direction, elt, delta) => {
- onResizeStop();
- setAttributes({
- width: parseInt(currentWidth + delta.width, 10),
- height: parseInt(currentHeight + delta.height, 10)
- });
- }
- }, imgWrapper);
- const syncSiteIconHelpText = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'), {
- a: // eslint-disable-next-line jsx-a11y/anchor-has-content
- (0,external_wp_element_namespaceObject.createElement)("a", {
- href: siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline',
- target: "_blank",
- rel: "noopener noreferrer"
- })
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Image width'),
- onChange: newWidth => setAttributes({
- width: newWidth
- }),
- min: minWidth,
- max: maxWidthBuffer,
- initialPosition: Math.min(defaultWidth, maxWidthBuffer),
- value: width || '',
- disabled: !isResizable
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Link image to home'),
- onChange: () => setAttributes({
- isLink: !isLink
- }),
- checked: isLink
- }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
- onChange: value => setAttributes({
- linkTarget: value ? '_blank' : '_self'
- }),
- checked: linkTarget === '_blank'
- })), canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Use as site icon'),
- onChange: value => {
- setAttributes({
- shouldSyncIcon: value
- });
- setIcon(value ? logoId : undefined);
- },
- checked: !!shouldSyncIcon,
- help: syncSiteIconHelpText
- })))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, canEditImage && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- onClick: () => setIsEditingImage(true),
- icon: library_crop,
- label: (0,external_wp_i18n_namespaceObject.__)('Crop')
- })), imgEdit);
- };
- function LogoEdit(_ref2) {
- let {
- attributes,
- className,
- setAttributes,
- isSelected
- } = _ref2;
- const {
- width,
- shouldSyncIcon
- } = attributes;
- const [logoUrl, setLogoUrl] = (0,external_wp_element_namespaceObject.useState)();
- const ref = (0,external_wp_element_namespaceObject.useRef)();
- const {
- siteLogoId,
- canUserEdit,
- url,
- siteIconId,
- mediaItemData,
- isRequestingMediaItem
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- canUser,
- getEntityRecord,
- getEditedEntityRecord
- } = select(external_wp_coreData_namespaceObject.store);
- const siteSettings = getEditedEntityRecord('root', 'site');
- const siteData = getEntityRecord('root', '__unstableBase');
- const _siteLogo = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_logo;
- const _readOnlyLogo = siteData === null || siteData === void 0 ? void 0 : siteData.site_logo;
- const _canUserEdit = canUser('update', 'settings');
- const _siteLogoId = _canUserEdit ? _siteLogo : _readOnlyLogo;
- const _siteIconId = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_icon;
- const mediaItem = _siteLogoId && select(external_wp_coreData_namespaceObject.store).getMedia(_siteLogoId, {
- context: 'view'
- });
- const _isRequestingMediaItem = _siteLogoId && !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getMedia', [_siteLogoId, {
- context: 'view'
- }]);
- return {
- siteLogoId: _siteLogoId,
- canUserEdit: _canUserEdit,
- url: siteData === null || siteData === void 0 ? void 0 : siteData.url,
- mediaItemData: mediaItem,
- isRequestingMediaItem: _isRequestingMediaItem,
- siteIconId: _siteIconId
- };
- }, []);
- const {
- editEntityRecord
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
- const setLogo = function (newValue) {
- let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- // `shouldForceSync` is used to force syncing when the attribute
- // may not have updated yet.
- if (shouldSyncIcon || shouldForceSync) {
- setIcon(newValue);
- }
- editEntityRecord('root', 'site', undefined, {
- site_logo: newValue
- });
- };
- const setIcon = newValue => // The new value needs to be `null` to reset the Site Icon.
- editEntityRecord('root', 'site', undefined, {
- site_icon: newValue !== null && newValue !== void 0 ? newValue : null
- });
- let alt = null;
- if (mediaItemData) {
- alt = mediaItemData.alt_text;
- if (logoUrl !== mediaItemData.source_url) {
- setLogoUrl(mediaItemData.source_url);
- }
- }
- const onInitialSelectLogo = media => {
- // Initialize the syncSiteIcon toggle. If we currently have no Site logo and no
- // site icon, automatically sync the logo to the icon.
- if (shouldSyncIcon === undefined) {
- const shouldForceSync = !siteIconId;
- setAttributes({
- shouldSyncIcon: shouldForceSync
- }); // Because we cannot rely on the `shouldSyncIcon` attribute to have updated by
- // the time `setLogo` is called, pass an argument to force the syncing.
- onSelectLogo(media, shouldForceSync);
- return;
- }
- onSelectLogo(media);
- };
- const onSelectLogo = function (media) {
- let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (!media) {
- return;
- }
- if (!media.id && media.url) {
- // This is a temporary blob image.
- setLogo(undefined);
- setLogoUrl(media.url);
- return;
- }
- setLogo(media.id, shouldForceSync);
- };
- const onRemoveLogo = () => {
- setLogo(null);
- setLogoUrl(undefined);
- setAttributes({
- width: undefined
- });
- };
- const {
- createErrorNotice
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
- const onUploadError = message => {
- createErrorNotice(message[2], {
- type: 'snackbar'
- });
- };
- const controls = canUserEdit && logoUrl && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
- mediaURL: logoUrl,
- allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
- accept: ACCEPT_MEDIA_STRING,
- onSelect: onSelectLogo,
- onError: onUploadError
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
- onClick: onRemoveLogo
- }, (0,external_wp_i18n_namespaceObject.__)('Reset'))));
- let logoImage;
- const isLoading = siteLogoId === undefined || isRequestingMediaItem;
- if (isLoading) {
- logoImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null);
- }
- if (!!logoUrl) {
- logoImage = (0,external_wp_element_namespaceObject.createElement)(SiteLogo, {
- alt: alt,
- attributes: attributes,
- className: className,
- containerRef: ref,
- isSelected: isSelected,
- setAttributes: setAttributes,
- logoUrl: logoUrl,
- setLogo: setLogo,
- logoId: (mediaItemData === null || mediaItemData === void 0 ? void 0 : mediaItemData.id) || siteLogoId,
- siteUrl: url,
- setIcon: setIcon,
- iconId: siteIconId,
- canUserEdit: canUserEdit
- });
- }
- const placeholder = content => {
- const placeholderClassName = classnames_default()('block-editor-media-placeholder', className);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- className: placeholderClassName,
- preview: logoImage
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- className: "components-placeholder__illustration",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 60 60"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- vectorEffect: "non-scaling-stroke",
- d: "m61 32.622-13.555-9.137-15.888 9.859a5 5 0 0 1-5.386-.073l-9.095-5.989L1 37.5"
- })), content);
- };
- const classes = classnames_default()(className, {
- 'is-default-size': !width
- });
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- ref,
- className: classes
- });
- const label = (0,external_wp_i18n_namespaceObject.__)('Add a site logo');
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, controls, !!logoUrl && logoImage, !logoUrl && !canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- className: "site-logo_placeholder"
- }, isLoading && (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "components-placeholder__preview"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))), !logoUrl && canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
- onSelect: onInitialSelectLogo,
- accept: ACCEPT_MEDIA_STRING,
- allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
- onError: onUploadError,
- placeholder: placeholder,
- mediaLibraryButton: _ref3 => {
- let {
- open
- } = _ref3;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- icon: library_upload,
- variant: "primary",
- label: label,
- showTooltip: true,
- tooltipPosition: "top center",
- onClick: () => {
- open();
- }
- });
- }
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/transforms.js
- /**
- * WordPress dependencies
- */
- const site_logo_transforms_transforms = {
- to: [{
- type: 'block',
- blocks: ['core/site-title'],
- transform: _ref => {
- let {
- isLink,
- linkTarget
- } = _ref;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-title', {
- isLink,
- linkTarget
- });
- }
- }]
- };
- /* harmony default export */ var site_logo_transforms = (site_logo_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const site_logo_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/site-logo",
- title: "Site Logo",
- category: "theme",
- description: "Display a graphic to represent this site. Update the block, and the changes apply everywhere it\u2019s used. This is different than the site icon, which is the smaller image visible in your dashboard, browser tabs, etc used to help others recognize this site.",
- textdomain: "default",
- attributes: {
- width: {
- type: "number"
- },
- isLink: {
- type: "boolean",
- "default": true
- },
- linkTarget: {
- type: "string",
- "default": "_self"
- },
- shouldSyncIcon: {
- type: "boolean"
- }
- },
- example: {
- viewportWidth: 500,
- attributes: {
- width: 350,
- className: "block-editor-block-types-list__site-logo-example"
- }
- },
- supports: {
- html: false,
- align: true,
- alignWide: false,
- color: {
- __experimentalDuotone: "img, .components-placeholder__illustration, .components-placeholder::before",
- text: false,
- background: false
- }
- },
- styles: [{
- name: "default",
- label: "Default",
- isDefault: true
- }, {
- name: "rounded",
- label: "Rounded"
- }],
- editorStyle: "wp-block-site-logo-editor",
- style: "wp-block-site-logo"
- };
- const {
- name: site_logo_name
- } = site_logo_metadata;
- const site_logo_settings = {
- icon: site_logo,
- edit: LogoEdit,
- transforms: site_logo_transforms
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function SiteTaglineEdit(_ref) {
- let {
- attributes,
- setAttributes,
- insertBlocksAfter
- } = _ref;
- const {
- textAlign
- } = attributes;
- const [siteTagline, setSiteTagline] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'description');
- const {
- canUserEdit,
- readOnlySiteTagLine
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- canUser,
- getEntityRecord
- } = select(external_wp_coreData_namespaceObject.store);
- const siteData = getEntityRecord('root', '__unstableBase');
- return {
- canUserEdit: canUser('update', 'settings'),
- readOnlySiteTagLine: siteData === null || siteData === void 0 ? void 0 : siteData.description
- };
- }, []);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign,
- 'wp-block-site-tagline__placeholder': !canUserEdit && !readOnlySiteTagLine
- })
- });
- const siteTaglineContent = canUserEdit ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
- allowedFormats: [],
- onChange: setSiteTagline,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site tagline text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site tagline…'),
- tagName: "p",
- value: siteTagline,
- disableLineBreaks: true,
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
- }, blockProps)) : (0,external_wp_element_namespaceObject.createElement)("p", blockProps, readOnlySiteTagLine || (0,external_wp_i18n_namespaceObject.__)('Site Tagline placeholder'));
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- onChange: newAlign => setAttributes({
- textAlign: newAlign
- }),
- value: textAlign
- })), siteTaglineContent);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/icon.js
- /**
- * WordPress dependencies
- */
- /* harmony default export */ var site_tagline_icon = ((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- width: "24",
- height: "24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- fill: "none",
- d: "M0 0h24v24H0z"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M4 9h16v2H4V9zm0 4h10v2H4v-2z"
- })));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/deprecated.js
- /**
- * Internal dependencies
- */
- const site_tagline_deprecated_v1 = {
- attributes: {
- textAlign: {
- type: 'string'
- }
- },
- supports: {
- align: ['wide', 'full'],
- html: false,
- color: {
- gradients: true
- },
- spacing: {
- margin: true,
- padding: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalTextTransform: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true
- }
- },
- save() {
- return null;
- },
- migrate: migrate_font_family,
- isEligible(_ref) {
- var _style$typography;
- let {
- style
- } = _ref;
- return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
- }
- };
- /**
- * New deprecations need to be placed first
- * for them to have higher priority.
- *
- * Old deprecations may need to be updated as well.
- *
- * See block-deprecation.md
- */
- /* harmony default export */ var site_tagline_deprecated = ([site_tagline_deprecated_v1]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
- /**
- * Internal dependencies
- */
- const site_tagline_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/site-tagline",
- title: "Site Tagline",
- category: "theme",
- description: "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",
- keywords: ["description"],
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- }
- },
- supports: {
- align: ["wide", "full"],
- html: false,
- color: {
- gradients: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- spacing: {
- margin: true,
- padding: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalTextTransform: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- },
- editorStyle: "wp-block-site-tagline-editor"
- };
- const {
- name: site_tagline_name
- } = site_tagline_metadata;
- const site_tagline_settings = {
- icon: site_tagline_icon,
- edit: SiteTaglineEdit,
- deprecated: site_tagline_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/map-marker.js
- /**
- * WordPress dependencies
- */
- const mapMarker = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "https://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"
- }));
- /* harmony default export */ var map_marker = (mapMarker);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-icon.js
- /**
- * WordPress dependencies
- */
- function LevelIcon(_ref) {
- let {
- level,
- isPressed = false
- } = _ref;
- if (level === 0) return library_paragraph;
- const levelToPath = {
- 1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
- 2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z',
- 3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z',
- 4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z',
- 5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
- 6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z'
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- width: "20",
- height: "20",
- viewBox: "0 0 20 20",
- xmlns: "http://www.w3.org/2000/svg",
- isPressed: isPressed
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: levelToPath[level]
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-toolbar.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function LevelControl(_ref) {
- let {
- level,
- onChange
- } = _ref;
- const allControls = [1, 2, 3, 4, 5, 6, 0].map(currentLevel => {
- const isActive = currentLevel === level;
- return {
- icon: (0,external_wp_element_namespaceObject.createElement)(LevelIcon, {
- level: currentLevel,
- isPressed: isActive
- }),
- title: currentLevel === 0 ? (0,external_wp_i18n_namespaceObject.__)('Paragraph') : // translators: %s: heading level e.g: "1", "2", "3"
- (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Heading %d'), currentLevel),
- isActive,
- onClick: () => onChange(currentLevel)
- };
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
- label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
- icon: (0,external_wp_element_namespaceObject.createElement)(LevelIcon, {
- level: level
- }),
- controls: allControls
- });
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/index.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function SiteTitleEdit(_ref) {
- let {
- attributes,
- setAttributes,
- insertBlocksAfter
- } = _ref;
- const {
- level,
- textAlign,
- isLink,
- linkTarget
- } = attributes;
- const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'title');
- const {
- canUserEdit,
- readOnlyTitle
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- canUser,
- getEntityRecord
- } = select(external_wp_coreData_namespaceObject.store);
- const siteData = getEntityRecord('root', '__unstableBase');
- return {
- canUserEdit: canUser('update', 'settings'),
- readOnlyTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteData === null || siteData === void 0 ? void 0 : siteData.name)
- };
- }, []);
- const TagName = level === 0 ? 'p' : `h${level}`;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign,
- 'wp-block-site-title__placeholder': !canUserEdit && !readOnlyTitle
- })
- });
- const siteTitleContent = canUserEdit ? (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: isLink ? 'a' : 'span',
- href: isLink ? '#site-title-pseudo-link' : undefined,
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site title text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site title…'),
- value: title,
- onChange: setTitle,
- allowedFormats: [],
- disableLineBreaks: true,
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
- })) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
- href: "#site-title-pseudo-link",
- onClick: event => event.preventDefault()
- }, readOnlyTitle || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder')) : (0,external_wp_element_namespaceObject.createElement)("span", null, title || readOnlyTitle));
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(LevelControl, {
- level: level,
- onChange: newLevel => setAttributes({
- level: newLevel
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'),
- onChange: () => setAttributes({
- isLink: !isLink
- }),
- checked: isLink
- }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
- onChange: value => setAttributes({
- linkTarget: value ? '_blank' : '_self'
- }),
- checked: linkTarget === '_blank'
- }))), siteTitleContent);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/deprecated.js
- /**
- * Internal dependencies
- */
- const site_title_deprecated_v1 = {
- attributes: {
- level: {
- type: 'number',
- default: 1
- },
- textAlign: {
- type: 'string'
- },
- isLink: {
- type: 'boolean',
- default: true
- },
- linkTarget: {
- type: 'string',
- default: '_self'
- }
- },
- supports: {
- align: ['wide', 'full'],
- html: false,
- color: {
- gradients: true,
- link: true
- },
- spacing: {
- padding: true,
- margin: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalTextTransform: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true
- }
- },
- save() {
- return null;
- },
- migrate: migrate_font_family,
- isEligible(_ref) {
- var _style$typography;
- let {
- style
- } = _ref;
- return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
- }
- };
- /**
- * New deprecations need to be placed first
- * for them to have higher priority.
- *
- * Old deprecations may need to be updated as well.
- *
- * See block-deprecation.md
- */
- /* harmony default export */ var site_title_deprecated = ([site_title_deprecated_v1]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/transforms.js
- /**
- * WordPress dependencies
- */
- const site_title_transforms_transforms = {
- to: [{
- type: 'block',
- blocks: ['core/site-logo'],
- transform: _ref => {
- let {
- isLink,
- linkTarget
- } = _ref;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo', {
- isLink,
- linkTarget
- });
- }
- }]
- };
- /* harmony default export */ var site_title_transforms = (site_title_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const site_title_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/site-title",
- title: "Site Title",
- category: "theme",
- description: "Displays the name of this site. Update the block, and the changes apply everywhere it\u2019s used. This will also appear in the browser title bar and in search results.",
- textdomain: "default",
- attributes: {
- level: {
- type: "number",
- "default": 1
- },
- textAlign: {
- type: "string"
- },
- isLink: {
- type: "boolean",
- "default": true
- },
- linkTarget: {
- type: "string",
- "default": "_self"
- }
- },
- example: {
- viewportWidth: 500
- },
- supports: {
- align: ["wide", "full"],
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- spacing: {
- padding: true,
- margin: true
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontFamily: true,
- __experimentalTextTransform: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalDefaultControls: {
- fontSize: true,
- lineHeight: true,
- fontAppearance: true,
- letterSpacing: true,
- textTransform: true
- }
- }
- },
- editorStyle: "wp-block-site-title-editor"
- };
- const {
- name: site_title_name
- } = site_title_metadata;
- const site_title_settings = {
- icon: map_marker,
- edit: SiteTitleEdit,
- transforms: site_title_transforms,
- deprecated: site_title_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/share.js
- /**
- * WordPress dependencies
- */
- const share = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"
- }));
- /* harmony default export */ var library_share = (share);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js
- /**
- * WordPress dependencies
- */
- const keyboardReturn = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "-2 -2 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"
- }));
- /* harmony default export */ var keyboard_return = (keyboardReturn);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/wordpress.js
- /**
- * WordPress dependencies
- */
- const WordPressIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/fivehundredpx.js
- /**
- * WordPress dependencies
- */
- const FivehundredpxIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/amazon.js
- /**
- * WordPress dependencies
- */
- const AmazonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/bandcamp.js
- /**
- * WordPress dependencies
- */
- const BandcampIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/behance.js
- /**
- * WordPress dependencies
- */
- const BehanceIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/chain.js
- /**
- * WordPress dependencies
- */
- const ChainIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19.647,16.706a1.134,1.134,0,0,0-.343-.833l-2.549-2.549a1.134,1.134,0,0,0-.833-.343,1.168,1.168,0,0,0-.883.392l.233.226q.2.189.264.264a2.922,2.922,0,0,1,.184.233.986.986,0,0,1,.159.312,1.242,1.242,0,0,1,.043.337,1.172,1.172,0,0,1-1.176,1.176,1.237,1.237,0,0,1-.337-.043,1,1,0,0,1-.312-.159,2.76,2.76,0,0,1-.233-.184q-.073-.068-.264-.264l-.226-.233a1.19,1.19,0,0,0-.4.895,1.134,1.134,0,0,0,.343.833L15.837,19.3a1.13,1.13,0,0,0,.833.331,1.18,1.18,0,0,0,.833-.318l1.8-1.789a1.12,1.12,0,0,0,.343-.821Zm-8.615-8.64a1.134,1.134,0,0,0-.343-.833L8.163,4.7a1.134,1.134,0,0,0-.833-.343,1.184,1.184,0,0,0-.833.331L4.7,6.473a1.12,1.12,0,0,0-.343.821,1.134,1.134,0,0,0,.343.833l2.549,2.549a1.13,1.13,0,0,0,.833.331,1.184,1.184,0,0,0,.883-.38L8.728,10.4q-.2-.189-.264-.264A2.922,2.922,0,0,1,8.28,9.9a.986.986,0,0,1-.159-.312,1.242,1.242,0,0,1-.043-.337A1.172,1.172,0,0,1,9.254,8.079a1.237,1.237,0,0,1,.337.043,1,1,0,0,1,.312.159,2.761,2.761,0,0,1,.233.184q.073.068.264.264l.226.233a1.19,1.19,0,0,0,.4-.895ZM22,16.706a3.343,3.343,0,0,1-1.042,2.488l-1.8,1.789a3.536,3.536,0,0,1-4.988-.025l-2.525-2.537a3.384,3.384,0,0,1-1.017-2.488,3.448,3.448,0,0,1,1.078-2.561l-1.078-1.078a3.434,3.434,0,0,1-2.549,1.078,3.4,3.4,0,0,1-2.5-1.029L3.029,9.794A3.4,3.4,0,0,1,2,7.294,3.343,3.343,0,0,1,3.042,4.806l1.8-1.789A3.384,3.384,0,0,1,7.331,2a3.357,3.357,0,0,1,2.5,1.042l2.525,2.537a3.384,3.384,0,0,1,1.017,2.488,3.448,3.448,0,0,1-1.078,2.561l1.078,1.078a3.551,3.551,0,0,1,5.049-.049l2.549,2.549A3.4,3.4,0,0,1,22,16.706Z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/codepen.js
- /**
- * WordPress dependencies
- */
- const CodepenIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/deviantart.js
- /**
- * WordPress dependencies
- */
- const DeviantArtIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dribbble.js
- /**
- * WordPress dependencies
- */
- const DribbbleIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dropbox.js
- /**
- * WordPress dependencies
- */
- const DropboxIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/etsy.js
- /**
- * WordPress dependencies
- */
- const EtsyIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/facebook.js
- /**
- * WordPress dependencies
- */
- const FacebookIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/feed.js
- /**
- * WordPress dependencies
- */
- const FeedIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/flickr.js
- /**
- * WordPress dependencies
- */
- const FlickrIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/foursquare.js
- /**
- * WordPress dependencies
- */
- const FoursquareIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/goodreads.js
- /**
- * WordPress dependencies
- */
- const GoodreadsIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/google.js
- /**
- * WordPress dependencies
- */
- const GoogleIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/github.js
- /**
- * WordPress dependencies
- */
- const GitHubIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/instagram.js
- /**
- * WordPress dependencies
- */
- const InstagramIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/lastfm.js
- /**
- * WordPress dependencies
- */
- const LastfmIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/linkedin.js
- /**
- * WordPress dependencies
- */
- const LinkedInIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mail.js
- /**
- * WordPress dependencies
- */
- const MailIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mastodon.js
- /**
- * WordPress dependencies
- */
- const MastodonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/meetup.js
- /**
- * WordPress dependencies
- */
- const MeetupIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/medium.js
- /**
- * WordPress dependencies
- */
- const MediumIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/patreon.js
- /**
- * WordPress dependencies
- */
- const PatreonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 569 546",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, {
- cx: "363",
- cy: "205",
- r: "205"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
- width: "100",
- height: "546",
- x: "0",
- y: "0"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pinterest.js
- /**
- * WordPress dependencies
- */
- const PinterestIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pocket.js
- /**
- * WordPress dependencies
- */
- const PocketIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/reddit.js
- /**
- * WordPress dependencies
- */
- const RedditIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/skype.js
- /**
- * WordPress dependencies
- */
- const SkypeIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/snapchat.js
- /**
- * WordPress dependencies
- */
- const SnapchatIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/soundcloud.js
- /**
- * WordPress dependencies
- */
- const SoundCloudIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/spotify.js
- /**
- * WordPress dependencies
- */
- const SpotifyIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/telegram.js
- /**
- * WordPress dependencies
- */
- const TelegramIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 128 128",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tiktok.js
- /**
- * WordPress dependencies
- */
- const TiktokIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 32 32",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tumblr.js
- /**
- * WordPress dependencies
- */
- const TumblrIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitch.js
- /**
- * WordPress dependencies
- */
- const TwitchIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitter.js
- /**
- * WordPress dependencies
- */
- const TwitterIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vimeo.js
- /**
- * WordPress dependencies
- */
- const VimeoIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vk.js
- /**
- * WordPress dependencies
- */
- const VkIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/yelp.js
- /**
- * WordPress dependencies
- */
- const YelpIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/youtube.js
- /**
- * WordPress dependencies
- */
- const YouTubeIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- width: "24",
- height: "24",
- viewBox: "0 0 24 24",
- version: "1.1"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"
- }));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/variations.js
- /**
- * Internal dependencies
- */
- const social_link_variations_variations = [{
- isDefault: true,
- name: 'wordpress',
- attributes: {
- service: 'wordpress'
- },
- title: 'WordPress',
- icon: WordPressIcon
- }, {
- name: 'fivehundredpx',
- attributes: {
- service: 'fivehundredpx'
- },
- title: '500px',
- icon: FivehundredpxIcon
- }, {
- name: 'amazon',
- attributes: {
- service: 'amazon'
- },
- title: 'Amazon',
- icon: AmazonIcon
- }, {
- name: 'bandcamp',
- attributes: {
- service: 'bandcamp'
- },
- title: 'Bandcamp',
- icon: BandcampIcon
- }, {
- name: 'behance',
- attributes: {
- service: 'behance'
- },
- title: 'Behance',
- icon: BehanceIcon
- }, {
- name: 'chain',
- attributes: {
- service: 'chain'
- },
- title: 'Link',
- icon: ChainIcon
- }, {
- name: 'codepen',
- attributes: {
- service: 'codepen'
- },
- title: 'CodePen',
- icon: CodepenIcon
- }, {
- name: 'deviantart',
- attributes: {
- service: 'deviantart'
- },
- title: 'DeviantArt',
- icon: DeviantArtIcon
- }, {
- name: 'dribbble',
- attributes: {
- service: 'dribbble'
- },
- title: 'Dribbble',
- icon: DribbbleIcon
- }, {
- name: 'dropbox',
- attributes: {
- service: 'dropbox'
- },
- title: 'Dropbox',
- icon: DropboxIcon
- }, {
- name: 'etsy',
- attributes: {
- service: 'etsy'
- },
- title: 'Etsy',
- icon: EtsyIcon
- }, {
- name: 'facebook',
- attributes: {
- service: 'facebook'
- },
- title: 'Facebook',
- icon: FacebookIcon
- }, {
- name: 'feed',
- attributes: {
- service: 'feed'
- },
- title: 'RSS Feed',
- icon: FeedIcon
- }, {
- name: 'flickr',
- attributes: {
- service: 'flickr'
- },
- title: 'Flickr',
- icon: FlickrIcon
- }, {
- name: 'foursquare',
- attributes: {
- service: 'foursquare'
- },
- title: 'Foursquare',
- icon: FoursquareIcon
- }, {
- name: 'goodreads',
- attributes: {
- service: 'goodreads'
- },
- title: 'Goodreads',
- icon: GoodreadsIcon
- }, {
- name: 'google',
- attributes: {
- service: 'google'
- },
- title: 'Google',
- icon: GoogleIcon
- }, {
- name: 'github',
- attributes: {
- service: 'github'
- },
- title: 'GitHub',
- icon: GitHubIcon
- }, {
- name: 'instagram',
- attributes: {
- service: 'instagram'
- },
- title: 'Instagram',
- icon: InstagramIcon
- }, {
- name: 'lastfm',
- attributes: {
- service: 'lastfm'
- },
- title: 'Last.fm',
- icon: LastfmIcon
- }, {
- name: 'linkedin',
- attributes: {
- service: 'linkedin'
- },
- title: 'LinkedIn',
- icon: LinkedInIcon
- }, {
- name: 'mail',
- attributes: {
- service: 'mail'
- },
- title: 'Mail',
- keywords: ['email', 'e-mail'],
- icon: MailIcon
- }, {
- name: 'mastodon',
- attributes: {
- service: 'mastodon'
- },
- title: 'Mastodon',
- icon: MastodonIcon
- }, {
- name: 'meetup',
- attributes: {
- service: 'meetup'
- },
- title: 'Meetup',
- icon: MeetupIcon
- }, {
- name: 'medium',
- attributes: {
- service: 'medium'
- },
- title: 'Medium',
- icon: MediumIcon
- }, {
- name: 'patreon',
- attributes: {
- service: 'patreon'
- },
- title: 'Patreon',
- icon: PatreonIcon
- }, {
- name: 'pinterest',
- attributes: {
- service: 'pinterest'
- },
- title: 'Pinterest',
- icon: PinterestIcon
- }, {
- name: 'pocket',
- attributes: {
- service: 'pocket'
- },
- title: 'Pocket',
- icon: PocketIcon
- }, {
- name: 'reddit',
- attributes: {
- service: 'reddit'
- },
- title: 'Reddit',
- icon: RedditIcon
- }, {
- name: 'skype',
- attributes: {
- service: 'skype'
- },
- title: 'Skype',
- icon: SkypeIcon
- }, {
- name: 'snapchat',
- attributes: {
- service: 'snapchat'
- },
- title: 'Snapchat',
- icon: SnapchatIcon
- }, {
- name: 'soundcloud',
- attributes: {
- service: 'soundcloud'
- },
- title: 'SoundCloud',
- icon: SoundCloudIcon
- }, {
- name: 'spotify',
- attributes: {
- service: 'spotify'
- },
- title: 'Spotify',
- icon: SpotifyIcon
- }, {
- name: 'telegram',
- attributes: {
- service: 'telegram'
- },
- title: 'Telegram',
- icon: TelegramIcon
- }, {
- name: 'tiktok',
- attributes: {
- service: 'tiktok'
- },
- title: 'TikTok',
- icon: TiktokIcon
- }, {
- name: 'tumblr',
- attributes: {
- service: 'tumblr'
- },
- title: 'Tumblr',
- icon: TumblrIcon
- }, {
- name: 'twitch',
- attributes: {
- service: 'twitch'
- },
- title: 'Twitch',
- icon: TwitchIcon
- }, {
- name: 'twitter',
- attributes: {
- service: 'twitter'
- },
- title: 'Twitter',
- icon: TwitterIcon
- }, {
- name: 'vimeo',
- attributes: {
- service: 'vimeo'
- },
- title: 'Vimeo',
- icon: VimeoIcon
- }, {
- name: 'vk',
- attributes: {
- service: 'vk'
- },
- title: 'VK',
- icon: VkIcon
- }, {
- name: 'yelp',
- attributes: {
- service: 'yelp'
- },
- title: 'Yelp',
- icon: YelpIcon
- }, {
- name: 'youtube',
- attributes: {
- service: 'youtube'
- },
- title: 'YouTube',
- icon: YouTubeIcon
- }];
- /**
- * Add `isActive` function to all `social link` variations, if not defined.
- * `isActive` function is used to find a variation match from a created
- * Block by providing its attributes.
- */
- social_link_variations_variations.forEach(variation => {
- if (variation.isActive) return;
- variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.service === variationAttributes.service;
- });
- /* harmony default export */ var social_link_variations = (social_link_variations_variations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/social-list.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Retrieves the social service's icon component.
- *
- * @param {string} name key for a social service (lowercase slug)
- *
- * @return {WPComponent} Icon component for social service.
- */
- const getIconBySite = name => {
- const variation = (0,external_lodash_namespaceObject.find)(social_link_variations, {
- name
- });
- return variation ? variation.icon : ChainIcon;
- };
- /**
- * Retrieves the display name for the social service.
- *
- * @param {string} name key for a social service (lowercase slug)
- *
- * @return {string} Display name for social service
- */
- const getNameBySite = name => {
- const variation = (0,external_lodash_namespaceObject.find)(social_link_variations, {
- name
- });
- return variation ? variation.title : (0,external_wp_i18n_namespaceObject.__)('Social Icon');
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const SocialLinkURLPopover = _ref => {
- let {
- url,
- setAttributes,
- setPopover,
- anchorRef
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLPopover, {
- anchorRef: anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current,
- onClose: () => setPopover(false)
- }, (0,external_wp_element_namespaceObject.createElement)("form", {
- className: "block-editor-url-popover__link-editor",
- onSubmit: event => {
- event.preventDefault();
- setPopover(false);
- }
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "block-editor-url-input"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLInput, {
- value: url,
- onChange: nextURL => setAttributes({
- url: nextURL
- }),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter address'),
- disableSuggestions: true
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- icon: keyboard_return,
- label: (0,external_wp_i18n_namespaceObject.__)('Apply'),
- type: "submit"
- })));
- };
- const SocialLinkEdit = _ref2 => {
- let {
- attributes,
- context,
- isSelected,
- setAttributes
- } = _ref2;
- const {
- url,
- service,
- label
- } = attributes;
- const {
- showLabels,
- iconColorValue,
- iconBackgroundColorValue
- } = context;
- const [showURLPopover, setPopover] = (0,external_wp_element_namespaceObject.useState)(false);
- const classes = classnames_default()('wp-social-link', 'wp-social-link-' + service, {
- 'wp-social-link__is-incomplete': !url
- });
- const ref = (0,external_wp_element_namespaceObject.useRef)();
- const IconComponent = getIconBySite(service);
- const socialLinkName = getNameBySite(service);
- const socialLinkLabel = label !== null && label !== void 0 ? label : socialLinkName;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classes,
- style: {
- color: iconColorValue,
- backgroundColor: iconBackgroundColorValue
- }
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: name of the social service. */
- (0,external_wp_i18n_namespaceObject.__)('%s label'), socialLinkName),
- initialOpen: false
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Link label'),
- help: (0,external_wp_i18n_namespaceObject.__)('Briefly describe the link to help screen reader users.'),
- value: label,
- onChange: value => setAttributes({
- label: value
- })
- })))), (0,external_wp_element_namespaceObject.createElement)("li", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- className: "wp-block-social-link-anchor",
- ref: ref,
- onClick: () => setPopover(true)
- }, (0,external_wp_element_namespaceObject.createElement)(IconComponent, null), (0,external_wp_element_namespaceObject.createElement)("span", {
- className: classnames_default()('wp-block-social-link-label', {
- 'screen-reader-text': !showLabels
- })
- }, socialLinkLabel), isSelected && showURLPopover && (0,external_wp_element_namespaceObject.createElement)(SocialLinkURLPopover, {
- url: url,
- setAttributes: setAttributes,
- setPopover: setPopover,
- anchorRef: ref
- }))));
- };
- /* harmony default export */ var social_link_edit = (SocialLinkEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const social_link_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/social-link",
- title: "Social Icon",
- category: "widgets",
- parent: ["core/social-links"],
- description: "Display an icon linking to a social media profile or site.",
- textdomain: "default",
- attributes: {
- url: {
- type: "string"
- },
- service: {
- type: "string"
- },
- label: {
- type: "string"
- }
- },
- usesContext: ["openInNewTab", "showLabels", "iconColorValue", "iconBackgroundColorValue"],
- supports: {
- reusable: false,
- html: false
- },
- editorStyle: "wp-block-social-link-editor"
- };
- const {
- name: social_link_name
- } = social_link_metadata;
- const social_link_settings = {
- icon: library_share,
- edit: social_link_edit,
- variations: social_link_variations
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * The specific handling by `className` below is needed because `itemsJustification`
- * was introduced in https://github.com/WordPress/gutenberg/pull/28980/files and wasn't
- * declared in block.json.
- *
- * @param {Object} attributes Block's attributes.
- */
- const social_links_deprecated_migrateWithLayout = attributes => {
- var _className$match, _className$match$;
- if (!!attributes.layout) {
- return attributes;
- }
- const {
- className
- } = attributes; // Matches classes with `items-justified-` prefix.
- const prefix = `items-justified-`;
- const justifiedItemsRegex = new RegExp(`\\b${prefix}[^ ]*[ ]?\\b`, 'g');
- const newAttributes = { ...attributes,
- className: className === null || className === void 0 ? void 0 : className.replace(justifiedItemsRegex, '').trim()
- };
- /**
- * Add `layout` prop only if `justifyContent` is defined, for backwards
- * compatibility. In other cases the block's default layout will be used.
- * Also noting that due to the missing attribute, it's possible for a block
- * to have more than one of `justified` classes.
- */
- const justifyContent = className === null || className === void 0 ? void 0 : (_className$match = className.match(justifiedItemsRegex)) === null || _className$match === void 0 ? void 0 : (_className$match$ = _className$match[0]) === null || _className$match$ === void 0 ? void 0 : _className$match$.trim();
- if (justifyContent) {
- Object.assign(newAttributes, {
- layout: {
- type: 'flex',
- justifyContent: justifyContent.slice(prefix.length)
- }
- });
- }
- return newAttributes;
- }; // Social Links block deprecations.
- const social_links_deprecated_deprecated = [// V1. Remove CSS variable use for colors.
- {
- attributes: {
- iconColor: {
- type: 'string'
- },
- customIconColor: {
- type: 'string'
- },
- iconColorValue: {
- type: 'string'
- },
- iconBackgroundColor: {
- type: 'string'
- },
- customIconBackgroundColor: {
- type: 'string'
- },
- iconBackgroundColorValue: {
- type: 'string'
- },
- openInNewTab: {
- type: 'boolean',
- default: false
- },
- size: {
- type: 'string'
- }
- },
- providesContext: {
- openInNewTab: 'openInNewTab'
- },
- supports: {
- align: ['left', 'center', 'right'],
- anchor: true
- },
- migrate: social_links_deprecated_migrateWithLayout,
- save: props => {
- const {
- attributes: {
- iconBackgroundColorValue,
- iconColorValue,
- itemsJustification,
- size
- }
- } = props;
- const className = classnames_default()(size, {
- 'has-icon-color': iconColorValue,
- 'has-icon-background-color': iconBackgroundColorValue,
- [`items-justified-${itemsJustification}`]: itemsJustification
- });
- const style = {
- '--wp--social-links--icon-color': iconColorValue,
- '--wp--social-links--icon-background-color': iconBackgroundColorValue
- };
- return (0,external_wp_element_namespaceObject.createElement)("ul", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className,
- style
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
- }
- }];
- /* harmony default export */ var social_links_deprecated = (social_links_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
- /**
- * WordPress dependencies
- */
- const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
- }));
- /* harmony default export */ var library_check = (check);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const social_links_edit_ALLOWED_BLOCKS = ['core/social-link'];
- const sizeOptions = [{
- name: (0,external_wp_i18n_namespaceObject.__)('Small'),
- value: 'has-small-icon-size'
- }, {
- name: (0,external_wp_i18n_namespaceObject.__)('Normal'),
- value: 'has-normal-icon-size'
- }, {
- name: (0,external_wp_i18n_namespaceObject.__)('Large'),
- value: 'has-large-icon-size'
- }, {
- name: (0,external_wp_i18n_namespaceObject.__)('Huge'),
- value: 'has-huge-icon-size'
- }];
- const social_links_edit_getDefaultBlockLayout = blockTypeOrName => {
- const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
- return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
- };
- function SocialLinksEdit(props) {
- var _attributes$className;
- const {
- name,
- attributes,
- iconBackgroundColor,
- iconColor,
- isSelected,
- setAttributes,
- setIconBackgroundColor,
- setIconColor
- } = props;
- const {
- iconBackgroundColorValue,
- customIconBackgroundColor,
- iconColorValue,
- openInNewTab,
- showLabels,
- size,
- layout
- } = attributes;
- const usedLayout = layout || social_links_edit_getDefaultBlockLayout(name);
- const logosOnly = (_attributes$className = attributes.className) === null || _attributes$className === void 0 ? void 0 : _attributes$className.includes('is-style-logos-only'); // Remove icon background color when logos only style is selected or
- // restore it when any other style is selected.
- const backgroundBackup = (0,external_wp_element_namespaceObject.useRef)({});
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (logosOnly) {
- backgroundBackup.current = {
- iconBackgroundColor,
- iconBackgroundColorValue,
- customIconBackgroundColor
- };
- setAttributes({
- iconBackgroundColor: undefined,
- customIconBackgroundColor: undefined,
- iconBackgroundColorValue: undefined
- });
- } else {
- setAttributes({ ...backgroundBackup.current
- });
- }
- }, [logosOnly]);
- const SocialPlaceholder = (0,external_wp_element_namespaceObject.createElement)("li", {
- className: "wp-block-social-links__social-placeholder"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-social-links__social-placeholder-icons"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-social-link wp-social-link-twitter"
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-social-link wp-social-link-facebook"
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-social-link wp-social-link-instagram"
- })));
- const SelectedSocialPlaceholder = (0,external_wp_element_namespaceObject.createElement)("li", {
- className: "wp-block-social-links__social-prompt"
- }, (0,external_wp_i18n_namespaceObject.__)('Click plus to add')); // Fallback color values are used maintain selections in case switching
- // themes and named colors in palette do not match.
- const className = classnames_default()(size, {
- 'has-icon-color': iconColor.color || iconColorValue,
- 'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue
- });
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className
- });
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- allowedBlocks: social_links_edit_ALLOWED_BLOCKS,
- placeholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,
- templateLock: false,
- __experimentalAppenderTagName: 'li',
- __experimentalLayout: usedLayout
- });
- const POPOVER_PROPS = {
- position: 'bottom right'
- };
- const colorSettings = [{
- // Use custom attribute as fallback to prevent loss of named color selection when
- // switching themes to a new theme that does not have a matching named color.
- value: iconColor.color || iconColorValue,
- onChange: colorValue => {
- setIconColor(colorValue);
- setAttributes({
- iconColorValue: colorValue
- });
- },
- label: (0,external_wp_i18n_namespaceObject.__)('Icon color')
- }];
- if (!logosOnly) {
- colorSettings.push({
- // Use custom attribute as fallback to prevent loss of named color selection when
- // switching themes to a new theme that does not have a matching named color.
- value: iconBackgroundColor.color || iconBackgroundColorValue,
- onChange: colorValue => {
- setIconBackgroundColor(colorValue);
- setAttributes({
- iconBackgroundColorValue: colorValue
- });
- },
- label: (0,external_wp_i18n_namespaceObject.__)('Icon background')
- });
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
- label: (0,external_wp_i18n_namespaceObject.__)('Size'),
- text: (0,external_wp_i18n_namespaceObject.__)('Size'),
- icon: null,
- popoverProps: POPOVER_PROPS
- }, _ref => {
- let {
- onClose
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, sizeOptions.map(entry => {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
- icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && library_check,
- isSelected: size === entry.value,
- key: entry.value,
- onClick: () => {
- setAttributes({
- size: entry.value
- });
- },
- onClose: onClose,
- role: "menuitemradio"
- }, entry.name);
- }));
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'),
- checked: openInNewTab,
- onChange: () => setAttributes({
- openInNewTab: !openInNewTab
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show labels'),
- checked: showLabels,
- onChange: () => setAttributes({
- showLabels: !showLabels
- })
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PanelColorSettings, {
- __experimentalHasMultipleOrigins: true,
- __experimentalIsRenderedInSidebar: true,
- title: (0,external_wp_i18n_namespaceObject.__)('Color'),
- colorSettings: colorSettings
- }), !logosOnly && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
- textColor: iconColorValue,
- backgroundColor: iconBackgroundColorValue,
- isLargeText: false
- })), (0,external_wp_element_namespaceObject.createElement)("ul", innerBlocksProps));
- }
- const iconColorAttributes = {
- iconColor: 'icon-color',
- iconBackgroundColor: 'icon-background-color'
- };
- /* harmony default export */ var social_links_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)(iconColorAttributes)(SocialLinksEdit));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function social_links_save_save(props) {
- const {
- attributes: {
- iconBackgroundColorValue,
- iconColorValue,
- showLabels,
- size
- }
- } = props;
- const className = classnames_default()(size, {
- 'has-visible-labels': showLabels,
- 'has-icon-color': iconColorValue,
- 'has-icon-background-color': iconBackgroundColorValue
- });
- const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- });
- const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
- return (0,external_wp_element_namespaceObject.createElement)("ul", innerBlocksProps);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const social_links_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/social-links",
- title: "Social Icons",
- category: "widgets",
- description: "Display icons linking to your social media profiles or sites.",
- keywords: ["links"],
- textdomain: "default",
- attributes: {
- iconColor: {
- type: "string"
- },
- customIconColor: {
- type: "string"
- },
- iconColorValue: {
- type: "string"
- },
- iconBackgroundColor: {
- type: "string"
- },
- customIconBackgroundColor: {
- type: "string"
- },
- iconBackgroundColorValue: {
- type: "string"
- },
- openInNewTab: {
- type: "boolean",
- "default": false
- },
- showLabels: {
- type: "boolean",
- "default": false
- },
- size: {
- type: "string"
- }
- },
- providesContext: {
- openInNewTab: "openInNewTab",
- showLabels: "showLabels",
- iconColorValue: "iconColorValue",
- iconBackgroundColorValue: "iconBackgroundColorValue"
- },
- supports: {
- align: ["left", "center", "right"],
- anchor: true,
- __experimentalExposeControlsToChildren: true,
- __experimentalLayout: {
- allowSwitching: false,
- allowInheriting: false,
- allowVerticalAlignment: false,
- "default": {
- type: "flex"
- }
- },
- spacing: {
- blockGap: ["horizontal", "vertical"],
- margin: ["top", "bottom"],
- units: ["px", "em", "rem", "vh", "vw"],
- __experimentalDefaultControls: {
- blockGap: true
- }
- }
- },
- styles: [{
- name: "default",
- label: "Default",
- isDefault: true
- }, {
- name: "logos-only",
- label: "Logos Only"
- }, {
- name: "pill-shape",
- label: "Pill Shape"
- }],
- editorStyle: "wp-block-social-links-editor",
- style: "wp-block-social-links"
- };
- const {
- name: social_links_name
- } = social_links_metadata;
- const social_links_settings = {
- example: {
- innerBlocks: [{
- name: 'core/social-link',
- attributes: {
- service: 'wordpress',
- url: 'https://wordpress.org'
- }
- }, {
- name: 'core/social-link',
- attributes: {
- service: 'facebook',
- url: 'https://www.facebook.com/WordPress/'
- }
- }, {
- name: 'core/social-link',
- attributes: {
- service: 'twitter',
- url: 'https://twitter.com/WordPress'
- }
- }]
- },
- icon: library_share,
- edit: social_links_edit,
- save: social_links_save_save,
- deprecated: social_links_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/resize-corner-n-e.js
- /**
- * WordPress dependencies
- */
- const resizeCornerNE = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12.5 4.2v1.6h4.7L5.8 17.2V12H4.2v7.8H12v-1.6H6.8L18.2 6.8v4.7h1.6V4.2z"
- }));
- /* harmony default export */ var resize_corner_n_e = (resizeCornerNE);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/deprecated.js
- /**
- * WordPress dependencies
- */
- const spacer_deprecated_deprecated = [{
- attributes: {
- height: {
- type: 'number',
- default: 100
- },
- width: {
- type: 'number'
- }
- },
- migrate(attributes) {
- const {
- height,
- width
- } = attributes;
- return { ...attributes,
- width: width !== undefined ? `${width}px` : undefined,
- height: height !== undefined ? `${height}px` : undefined
- };
- },
- save(_ref) {
- let {
- attributes
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- style: {
- height: attributes.height,
- width: attributes.width
- },
- 'aria-hidden': true
- }));
- }
- }];
- /* harmony default export */ var spacer_deprecated = (spacer_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/controls.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function DimensionInput(_ref) {
- var _ref2;
- let {
- label,
- onChange,
- isResizing,
- value = ''
- } = _ref;
- const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl, 'block-spacer-height-input'); // In most contexts the spacer size cannot meaningfully be set to a
- // percentage, since this is relative to the parent container. This
- // unit is disabled from the UI.
- const availableUnitSettings = (_ref2 = (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || undefined) === null || _ref2 === void 0 ? void 0 : _ref2.filter(availableUnit => availableUnit !== '%');
- const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
- availableUnits: availableUnitSettings || ['px', 'em', 'rem', 'vw', 'vh'],
- defaultValues: {
- px: 100,
- em: 10,
- rem: 10,
- vw: 10,
- vh: 25
- }
- });
- const handleOnChange = unprocessedValue => {
- onChange(unprocessedValue);
- }; // Force the unit to update to `px` when the Spacer is being resized.
- const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
- const computedValue = [parsedQuantity, isResizing ? 'px' : parsedUnit].join('');
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
- label: label,
- id: inputId
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
- id: inputId,
- isResetValueOnUnitChange: true,
- min: MIN_SPACER_SIZE,
- onChange: handleOnChange,
- style: {
- maxWidth: 80
- },
- value: computedValue,
- units: units
- }));
- }
- function SpacerControls(_ref3) {
- let {
- setAttributes,
- orientation,
- height,
- width,
- isResizing
- } = _ref3;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Spacer settings')
- }, orientation === 'horizontal' && (0,external_wp_element_namespaceObject.createElement)(DimensionInput, {
- label: (0,external_wp_i18n_namespaceObject.__)('Width'),
- value: width,
- onChange: nextWidth => setAttributes({
- width: nextWidth
- }),
- isResizing: isResizing
- }), orientation !== 'horizontal' && (0,external_wp_element_namespaceObject.createElement)(DimensionInput, {
- label: (0,external_wp_i18n_namespaceObject.__)('Height'),
- value: height,
- onChange: nextHeight => setAttributes({
- height: nextHeight
- }),
- isResizing: isResizing
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const MIN_SPACER_SIZE = 0;
- const ResizableSpacer = _ref => {
- let {
- orientation,
- onResizeStart,
- onResize,
- onResizeStop,
- isSelected,
- isResizing,
- setIsResizing,
- ...props
- } = _ref;
- const getCurrentSize = elt => {
- return orientation === 'horizontal' ? elt.clientWidth : elt.clientHeight;
- };
- const getNextVal = elt => {
- return `${getCurrentSize(elt)}px`;
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
- className: classnames_default()('block-library-spacer__resize-container', {
- 'resize-horizontal': orientation === 'horizontal',
- 'is-resizing': isResizing,
- 'is-selected': isSelected
- }),
- onResizeStart: (_event, _direction, elt) => {
- const nextVal = getNextVal(elt);
- onResizeStart(nextVal);
- onResize(nextVal);
- },
- onResize: (_event, _direction, elt) => {
- onResize(getNextVal(elt));
- if (!isResizing) {
- setIsResizing(true);
- }
- },
- onResizeStop: (_event, _direction, elt) => {
- const nextVal = getCurrentSize(elt);
- onResizeStop(`${nextVal}px`);
- setIsResizing(false);
- },
- __experimentalShowTooltip: true,
- __experimentalTooltipProps: {
- axis: orientation === 'horizontal' ? 'x' : 'y',
- position: 'corner',
- isVisible: isResizing
- },
- showHandle: isSelected
- }, props));
- };
- const SpacerEdit = _ref2 => {
- let {
- attributes,
- isSelected,
- setAttributes,
- toggleSelection,
- context
- } = _ref2;
- const {
- orientation
- } = context;
- const {
- height,
- width
- } = attributes;
- const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
- const [temporaryHeight, setTemporaryHeight] = (0,external_wp_element_namespaceObject.useState)(null);
- const [temporaryWidth, setTemporaryWidth] = (0,external_wp_element_namespaceObject.useState)(null);
- const onResizeStart = () => toggleSelection(false);
- const onResizeStop = () => toggleSelection(true);
- const handleOnVerticalResizeStop = newHeight => {
- onResizeStop();
- setAttributes({
- height: newHeight
- });
- setTemporaryHeight(null);
- };
- const handleOnHorizontalResizeStop = newWidth => {
- onResizeStop();
- setAttributes({
- width: newWidth
- });
- setTemporaryWidth(null);
- };
- const style = {
- height: orientation === 'horizontal' ? 24 : temporaryHeight || height || undefined,
- width: orientation === 'horizontal' ? temporaryWidth || width || undefined : undefined
- };
- const resizableBoxWithOrientation = blockOrientation => {
- if (blockOrientation === 'horizontal') {
- return (0,external_wp_element_namespaceObject.createElement)(ResizableSpacer, {
- minWidth: MIN_SPACER_SIZE,
- enable: {
- top: false,
- right: true,
- bottom: false,
- left: false,
- topRight: false,
- bottomRight: false,
- bottomLeft: false,
- topLeft: false
- },
- orientation: blockOrientation,
- onResizeStart: onResizeStart,
- onResize: setTemporaryWidth,
- onResizeStop: handleOnHorizontalResizeStop,
- isSelected: isSelected,
- isResizing: isResizing,
- setIsResizing: setIsResizing
- });
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ResizableSpacer, {
- minHeight: MIN_SPACER_SIZE,
- enable: {
- top: false,
- right: false,
- bottom: true,
- left: false,
- topRight: false,
- bottomRight: false,
- bottomLeft: false,
- topLeft: false
- },
- orientation: blockOrientation,
- onResizeStart: onResizeStart,
- onResize: setTemporaryHeight,
- onResizeStop: handleOnVerticalResizeStop,
- isSelected: isSelected,
- isResizing: isResizing,
- setIsResizing: setIsResizing
- }));
- };
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (orientation === 'horizontal' && !width) {
- setAttributes({
- height: '0px',
- width: '72px'
- });
- }
- }, []);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- style
- }), resizableBoxWithOrientation(orientation)), (0,external_wp_element_namespaceObject.createElement)(SpacerControls, {
- setAttributes: setAttributes,
- height: temporaryHeight || height,
- width: temporaryWidth || width,
- orientation: orientation,
- isResizing: isResizing
- }));
- };
- /* harmony default export */ var spacer_edit = (SpacerEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/save.js
- /**
- * WordPress dependencies
- */
- function spacer_save_save(_ref) {
- let {
- attributes: {
- height,
- width
- }
- } = _ref;
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- style: {
- height,
- width
- },
- 'aria-hidden': true
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const spacer_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/spacer",
- title: "Spacer",
- category: "design",
- description: "Add white space between blocks and customize its height.",
- textdomain: "default",
- attributes: {
- height: {
- type: "string",
- "default": "100px"
- },
- width: {
- type: "string"
- }
- },
- usesContext: ["orientation"],
- supports: {
- anchor: true
- },
- editorStyle: "wp-block-spacer-editor",
- style: "wp-block-spacer"
- };
- const {
- name: spacer_name
- } = spacer_metadata;
- const spacer_settings = {
- icon: resize_corner_n_e,
- edit: spacer_edit,
- save: spacer_save_save,
- deprecated: spacer_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-table.js
- /**
- * WordPress dependencies
- */
- const blockTable = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"
- }));
- /* harmony default export */ var block_table = (blockTable);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- const table_deprecated_supports = {
- align: true
- }; // As the previous arbitrary colors won't match theme color palettes, the hex
- // value will be mapped to the style.color.background attribute as if it was
- // a custom color selection.
- const oldColors = {
- 'subtle-light-gray': '#f3f4f5',
- 'subtle-pale-green': '#e9fbe5',
- 'subtle-pale-blue': '#e7f5fe',
- 'subtle-pale-pink': '#fcf0ef'
- };
- const table_deprecated_deprecated = [// Deprecation migrating table block to use colors block support feature.
- {
- attributes: {
- hasFixedLayout: {
- type: 'boolean',
- default: false
- },
- backgroundColor: {
- type: 'string'
- },
- caption: {
- type: 'string',
- source: 'html',
- selector: 'figcaption',
- default: ''
- },
- head: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'thead tr',
- query: {
- cells: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html'
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag'
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope'
- },
- align: {
- type: 'string',
- source: 'attribute',
- attribute: 'data-align'
- }
- }
- }
- }
- },
- body: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'tbody tr',
- query: {
- cells: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html'
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag'
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope'
- },
- align: {
- type: 'string',
- source: 'attribute',
- attribute: 'data-align'
- }
- }
- }
- }
- },
- foot: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'tfoot tr',
- query: {
- cells: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html'
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag'
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope'
- },
- align: {
- type: 'string',
- source: 'attribute',
- attribute: 'data-align'
- }
- }
- }
- }
- }
- },
- supports: {
- anchor: true,
- align: true,
- __experimentalSelector: '.wp-block-table > table'
- },
- save: _ref => {
- let {
- attributes
- } = _ref;
- const {
- hasFixedLayout,
- head,
- body,
- foot,
- backgroundColor,
- caption
- } = attributes;
- const isEmpty = !head.length && !body.length && !foot.length;
- if (isEmpty) {
- return null;
- }
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const classes = classnames_default()(backgroundClass, {
- 'has-fixed-layout': hasFixedLayout,
- 'has-background': !!backgroundClass
- });
- const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
- const Section = _ref2 => {
- let {
- type,
- rows
- } = _ref2;
- if (!rows.length) {
- return null;
- }
- const Tag = `t${type}`;
- return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref3, rowIndex) => {
- let {
- cells
- } = _ref3;
- return (0,external_wp_element_namespaceObject.createElement)("tr", {
- key: rowIndex
- }, cells.map((_ref4, cellIndex) => {
- let {
- content,
- tag,
- scope,
- align
- } = _ref4;
- const cellClasses = classnames_default()({
- [`has-text-align-${align}`]: align
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- className: cellClasses ? cellClasses : undefined,
- "data-align": align,
- tagName: tag,
- value: content,
- key: cellIndex,
- scope: tag === 'th' ? scope : undefined
- });
- }));
- }));
- };
- return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
- className: classes === '' ? undefined : classes
- }, (0,external_wp_element_namespaceObject.createElement)(Section, {
- type: "head",
- rows: head
- }), (0,external_wp_element_namespaceObject.createElement)(Section, {
- type: "body",
- rows: body
- }), (0,external_wp_element_namespaceObject.createElement)(Section, {
- type: "foot",
- rows: foot
- })), hasCaption && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- },
- isEligible: attributes => {
- return attributes.backgroundColor && attributes.backgroundColor in oldColors && !attributes.style;
- },
- // This version is the first to introduce the style attribute to the
- // table block. As a result, we'll explicitly override that.
- migrate: attributes => {
- return { ...attributes,
- backgroundColor: undefined,
- style: {
- color: {
- background: oldColors[attributes.backgroundColor]
- }
- }
- };
- }
- }, {
- attributes: {
- hasFixedLayout: {
- type: 'boolean',
- default: false
- },
- backgroundColor: {
- type: 'string'
- },
- head: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'thead tr',
- query: {
- cells: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html'
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag'
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope'
- }
- }
- }
- }
- },
- body: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'tbody tr',
- query: {
- cells: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html'
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag'
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope'
- }
- }
- }
- }
- },
- foot: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'tfoot tr',
- query: {
- cells: {
- type: 'array',
- default: [],
- source: 'query',
- selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html'
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag'
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope'
- }
- }
- }
- }
- }
- },
- supports: table_deprecated_supports,
- save(_ref5) {
- let {
- attributes
- } = _ref5;
- const {
- hasFixedLayout,
- head,
- body,
- foot,
- backgroundColor
- } = attributes;
- const isEmpty = !head.length && !body.length && !foot.length;
- if (isEmpty) {
- return null;
- }
- const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
- const classes = classnames_default()(backgroundClass, {
- 'has-fixed-layout': hasFixedLayout,
- 'has-background': !!backgroundClass
- });
- const Section = _ref6 => {
- let {
- type,
- rows
- } = _ref6;
- if (!rows.length) {
- return null;
- }
- const Tag = `t${type}`;
- return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref7, rowIndex) => {
- let {
- cells
- } = _ref7;
- return (0,external_wp_element_namespaceObject.createElement)("tr", {
- key: rowIndex
- }, cells.map((_ref8, cellIndex) => {
- let {
- content,
- tag,
- scope
- } = _ref8;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: tag,
- value: content,
- key: cellIndex,
- scope: tag === 'th' ? scope : undefined
- });
- }));
- }));
- };
- return (0,external_wp_element_namespaceObject.createElement)("table", {
- className: classes
- }, (0,external_wp_element_namespaceObject.createElement)(Section, {
- type: "head",
- rows: head
- }), (0,external_wp_element_namespaceObject.createElement)(Section, {
- type: "body",
- rows: body
- }), (0,external_wp_element_namespaceObject.createElement)(Section, {
- type: "foot",
- rows: foot
- }));
- }
- }];
- /* harmony default export */ var table_deprecated = (table_deprecated_deprecated);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-left.js
- /**
- * WordPress dependencies
- */
- const alignLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"
- }));
- /* harmony default export */ var align_left = (alignLeft);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-center.js
- /**
- * WordPress dependencies
- */
- const alignCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"
- }));
- /* harmony default export */ var align_center = (alignCenter);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-right.js
- /**
- * WordPress dependencies
- */
- const alignRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"
- }));
- /* harmony default export */ var align_right = (alignRight);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-before.js
- /**
- * WordPress dependencies
- */
- const tableRowBefore = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "-2 -2 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"
- }));
- /* harmony default export */ var table_row_before = (tableRowBefore);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-after.js
- /**
- * WordPress dependencies
- */
- const tableRowAfter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "-2 -2 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"
- }));
- /* harmony default export */ var table_row_after = (tableRowAfter);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-delete.js
- /**
- * WordPress dependencies
- */
- const tableRowDelete = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "-2 -2 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"
- }));
- /* harmony default export */ var table_row_delete = (tableRowDelete);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-before.js
- /**
- * WordPress dependencies
- */
- const tableColumnBefore = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "-2 -2 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"
- }));
- /* harmony default export */ var table_column_before = (tableColumnBefore);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-after.js
- /**
- * WordPress dependencies
- */
- const tableColumnAfter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "-2 -2 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"
- }));
- /* harmony default export */ var table_column_after = (tableColumnAfter);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-delete.js
- /**
- * WordPress dependencies
- */
- const tableColumnDelete = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "-2 -2 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"
- }));
- /* harmony default export */ var table_column_delete = (tableColumnDelete);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table.js
- /**
- * WordPress dependencies
- */
- const table = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"
- }));
- /* harmony default export */ var library_table = (table);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/state.js
- /**
- * External dependencies
- */
- const INHERITED_COLUMN_ATTRIBUTES = ['align'];
- /**
- * Creates a table state.
- *
- * @param {Object} options
- * @param {number} options.rowCount Row count for the table to create.
- * @param {number} options.columnCount Column count for the table to create.
- *
- * @return {Object} New table state.
- */
- function createTable(_ref) {
- let {
- rowCount,
- columnCount
- } = _ref;
- return {
- body: (0,external_lodash_namespaceObject.times)(rowCount, () => ({
- cells: (0,external_lodash_namespaceObject.times)(columnCount, () => ({
- content: '',
- tag: 'td'
- }))
- }))
- };
- }
- /**
- * Returns the first row in the table.
- *
- * @param {Object} state Current table state.
- *
- * @return {Object} The first table row.
- */
- function getFirstRow(state) {
- if (!isEmptyTableSection(state.head)) {
- return state.head[0];
- }
- if (!isEmptyTableSection(state.body)) {
- return state.body[0];
- }
- if (!isEmptyTableSection(state.foot)) {
- return state.foot[0];
- }
- }
- /**
- * Gets an attribute for a cell.
- *
- * @param {Object} state Current table state.
- * @param {Object} cellLocation The location of the cell
- * @param {string} attributeName The name of the attribute to get the value of.
- *
- * @return {*} The attribute value.
- */
- function getCellAttribute(state, cellLocation, attributeName) {
- const {
- sectionName,
- rowIndex,
- columnIndex
- } = cellLocation;
- return (0,external_lodash_namespaceObject.get)(state, [sectionName, rowIndex, 'cells', columnIndex, attributeName]);
- }
- /**
- * Returns updated cell attributes after applying the `updateCell` function to the selection.
- *
- * @param {Object} state The block attributes.
- * @param {Object} selection The selection of cells to update.
- * @param {Function} updateCell A function to update the selected cell attributes.
- *
- * @return {Object} New table state including the updated cells.
- */
- function updateSelectedCell(state, selection, updateCell) {
- if (!selection) {
- return state;
- }
- const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
- const {
- sectionName: selectionSectionName,
- rowIndex: selectionRowIndex
- } = selection;
- return (0,external_lodash_namespaceObject.mapValues)(tableSections, (section, sectionName) => {
- if (selectionSectionName && selectionSectionName !== sectionName) {
- return section;
- }
- return section.map((row, rowIndex) => {
- if (selectionRowIndex && selectionRowIndex !== rowIndex) {
- return row;
- }
- return {
- cells: row.cells.map((cellAttributes, columnIndex) => {
- const cellLocation = {
- sectionName,
- columnIndex,
- rowIndex
- };
- if (!isCellSelected(cellLocation, selection)) {
- return cellAttributes;
- }
- return updateCell(cellAttributes);
- })
- };
- });
- });
- }
- /**
- * Returns whether the cell at `cellLocation` is included in the selection `selection`.
- *
- * @param {Object} cellLocation An object containing cell location properties.
- * @param {Object} selection An object containing selection properties.
- *
- * @return {boolean} True if the cell is selected, false otherwise.
- */
- function isCellSelected(cellLocation, selection) {
- if (!cellLocation || !selection) {
- return false;
- }
- switch (selection.type) {
- case 'column':
- return selection.type === 'column' && cellLocation.columnIndex === selection.columnIndex;
- case 'cell':
- return selection.type === 'cell' && cellLocation.sectionName === selection.sectionName && cellLocation.columnIndex === selection.columnIndex && cellLocation.rowIndex === selection.rowIndex;
- }
- }
- /**
- * Inserts a row in the table state.
- *
- * @param {Object} state Current table state.
- * @param {Object} options
- * @param {string} options.sectionName Section in which to insert the row.
- * @param {number} options.rowIndex Row index at which to insert the row.
- * @param {number} options.columnCount Column count for the table to create.
- *
- * @return {Object} New table state.
- */
- function insertRow(state, _ref2) {
- let {
- sectionName,
- rowIndex,
- columnCount
- } = _ref2;
- const firstRow = getFirstRow(state);
- const cellCount = columnCount === undefined ? (0,external_lodash_namespaceObject.get)(firstRow, ['cells', 'length']) : columnCount; // Bail early if the function cannot determine how many cells to add.
- if (!cellCount) {
- return state;
- }
- return {
- [sectionName]: [...state[sectionName].slice(0, rowIndex), {
- cells: (0,external_lodash_namespaceObject.times)(cellCount, index => {
- const firstCellInColumn = (0,external_lodash_namespaceObject.get)(firstRow, ['cells', index], {});
- const inheritedAttributes = (0,external_lodash_namespaceObject.pick)(firstCellInColumn, INHERITED_COLUMN_ATTRIBUTES);
- return { ...inheritedAttributes,
- content: '',
- tag: sectionName === 'head' ? 'th' : 'td'
- };
- })
- }, ...state[sectionName].slice(rowIndex)]
- };
- }
- /**
- * Deletes a row from the table state.
- *
- * @param {Object} state Current table state.
- * @param {Object} options
- * @param {string} options.sectionName Section in which to delete the row.
- * @param {number} options.rowIndex Row index to delete.
- *
- * @return {Object} New table state.
- */
- function deleteRow(state, _ref3) {
- let {
- sectionName,
- rowIndex
- } = _ref3;
- return {
- [sectionName]: state[sectionName].filter((row, index) => index !== rowIndex)
- };
- }
- /**
- * Inserts a column in the table state.
- *
- * @param {Object} state Current table state.
- * @param {Object} options
- * @param {number} options.columnIndex Column index at which to insert the column.
- *
- * @return {Object} New table state.
- */
- function insertColumn(state, _ref4) {
- let {
- columnIndex
- } = _ref4;
- const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
- return (0,external_lodash_namespaceObject.mapValues)(tableSections, (section, sectionName) => {
- // Bail early if the table section is empty.
- if (isEmptyTableSection(section)) {
- return section;
- }
- return section.map(row => {
- // Bail early if the row is empty or it's an attempt to insert past
- // the last possible index of the array.
- if (isEmptyRow(row) || row.cells.length < columnIndex) {
- return row;
- }
- return {
- cells: [...row.cells.slice(0, columnIndex), {
- content: '',
- tag: sectionName === 'head' ? 'th' : 'td'
- }, ...row.cells.slice(columnIndex)]
- };
- });
- });
- }
- /**
- * Deletes a column from the table state.
- *
- * @param {Object} state Current table state.
- * @param {Object} options
- * @param {number} options.columnIndex Column index to delete.
- *
- * @return {Object} New table state.
- */
- function deleteColumn(state, _ref5) {
- let {
- columnIndex
- } = _ref5;
- const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
- return (0,external_lodash_namespaceObject.mapValues)(tableSections, section => {
- // Bail early if the table section is empty.
- if (isEmptyTableSection(section)) {
- return section;
- }
- return section.map(row => ({
- cells: row.cells.length >= columnIndex ? row.cells.filter((cell, index) => index !== columnIndex) : row.cells
- })).filter(row => row.cells.length);
- });
- }
- /**
- * Toggles the existance of a section.
- *
- * @param {Object} state Current table state.
- * @param {string} sectionName Name of the section to toggle.
- *
- * @return {Object} New table state.
- */
- function toggleSection(state, sectionName) {
- // Section exists, replace it with an empty row to remove it.
- if (!isEmptyTableSection(state[sectionName])) {
- return {
- [sectionName]: []
- };
- } // Get the length of the first row of the body to use when creating the header.
- const columnCount = (0,external_lodash_namespaceObject.get)(state, ['body', 0, 'cells', 'length'], 1); // Section doesn't exist, insert an empty row to create the section.
- return insertRow(state, {
- sectionName,
- rowIndex: 0,
- columnCount
- });
- }
- /**
- * Determines whether a table section is empty.
- *
- * @param {Object} section Table section state.
- *
- * @return {boolean} True if the table section is empty, false otherwise.
- */
- function isEmptyTableSection(section) {
- return !section || !section.length || (0,external_lodash_namespaceObject.every)(section, isEmptyRow);
- }
- /**
- * Determines whether a table row is empty.
- *
- * @param {Object} row Table row state.
- *
- * @return {boolean} True if the table section is empty, false otherwise.
- */
- function isEmptyRow(row) {
- return !(row.cells && row.cells.length);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const ALIGNMENT_CONTROLS = [{
- icon: align_left,
- title: (0,external_wp_i18n_namespaceObject.__)('Align column left'),
- align: 'left'
- }, {
- icon: align_center,
- title: (0,external_wp_i18n_namespaceObject.__)('Align column center'),
- align: 'center'
- }, {
- icon: align_right,
- title: (0,external_wp_i18n_namespaceObject.__)('Align column right'),
- align: 'right'
- }];
- const cellAriaLabel = {
- head: (0,external_wp_i18n_namespaceObject.__)('Header cell text'),
- body: (0,external_wp_i18n_namespaceObject.__)('Body cell text'),
- foot: (0,external_wp_i18n_namespaceObject.__)('Footer cell text')
- };
- const placeholder = {
- head: (0,external_wp_i18n_namespaceObject.__)('Header label'),
- foot: (0,external_wp_i18n_namespaceObject.__)('Footer label')
- };
- function TSection(_ref) {
- let {
- name,
- ...props
- } = _ref;
- const TagName = `t${name}`;
- return (0,external_wp_element_namespaceObject.createElement)(TagName, props);
- }
- function TableEdit(_ref2) {
- let {
- attributes,
- setAttributes,
- insertBlocksAfter,
- isSelected
- } = _ref2;
- const {
- hasFixedLayout,
- caption,
- head,
- foot
- } = attributes;
- const [initialRowCount, setInitialRowCount] = (0,external_wp_element_namespaceObject.useState)(2);
- const [initialColumnCount, setInitialColumnCount] = (0,external_wp_element_namespaceObject.useState)(2);
- const [selectedCell, setSelectedCell] = (0,external_wp_element_namespaceObject.useState)();
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
- const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
- /**
- * Updates the initial column count used for table creation.
- *
- * @param {number} count New initial column count.
- */
- function onChangeInitialColumnCount(count) {
- setInitialColumnCount(count);
- }
- /**
- * Updates the initial row count used for table creation.
- *
- * @param {number} count New initial row count.
- */
- function onChangeInitialRowCount(count) {
- setInitialRowCount(count);
- }
- /**
- * Creates a table based on dimensions in local state.
- *
- * @param {Object} event Form submit event.
- */
- function onCreateTable(event) {
- event.preventDefault();
- setAttributes(createTable({
- rowCount: parseInt(initialRowCount, 10) || 2,
- columnCount: parseInt(initialColumnCount, 10) || 2
- }));
- }
- /**
- * Toggles whether the table has a fixed layout or not.
- */
- function onChangeFixedLayout() {
- setAttributes({
- hasFixedLayout: !hasFixedLayout
- });
- }
- /**
- * Changes the content of the currently selected cell.
- *
- * @param {Array} content A RichText content value.
- */
- function onChange(content) {
- if (!selectedCell) {
- return;
- }
- setAttributes(updateSelectedCell(attributes, selectedCell, cellAttributes => ({ ...cellAttributes,
- content
- })));
- }
- /**
- * Align text within the a column.
- *
- * @param {string} align The new alignment to apply to the column.
- */
- function onChangeColumnAlignment(align) {
- if (!selectedCell) {
- return;
- } // Convert the cell selection to a column selection so that alignment
- // is applied to the entire column.
- const columnSelection = {
- type: 'column',
- columnIndex: selectedCell.columnIndex
- };
- const newAttributes = updateSelectedCell(attributes, columnSelection, cellAttributes => ({ ...cellAttributes,
- align
- }));
- setAttributes(newAttributes);
- }
- /**
- * Get the alignment of the currently selected cell.
- *
- * @return {string} The new alignment to apply to the column.
- */
- function getCellAlignment() {
- if (!selectedCell) {
- return;
- }
- return getCellAttribute(attributes, selectedCell, 'align');
- }
- /**
- * Add or remove a `head` table section.
- */
- function onToggleHeaderSection() {
- setAttributes(toggleSection(attributes, 'head'));
- }
- /**
- * Add or remove a `foot` table section.
- */
- function onToggleFooterSection() {
- setAttributes(toggleSection(attributes, 'foot'));
- }
- /**
- * Inserts a row at the currently selected row index, plus `delta`.
- *
- * @param {number} delta Offset for selected row index at which to insert.
- */
- function onInsertRow(delta) {
- if (!selectedCell) {
- return;
- }
- const {
- sectionName,
- rowIndex
- } = selectedCell;
- const newRowIndex = rowIndex + delta;
- setAttributes(insertRow(attributes, {
- sectionName,
- rowIndex: newRowIndex
- })); // Select the first cell of the new row.
- setSelectedCell({
- sectionName,
- rowIndex: newRowIndex,
- columnIndex: 0,
- type: 'cell'
- });
- }
- /**
- * Inserts a row before the currently selected row.
- */
- function onInsertRowBefore() {
- onInsertRow(0);
- }
- /**
- * Inserts a row after the currently selected row.
- */
- function onInsertRowAfter() {
- onInsertRow(1);
- }
- /**
- * Deletes the currently selected row.
- */
- function onDeleteRow() {
- if (!selectedCell) {
- return;
- }
- const {
- sectionName,
- rowIndex
- } = selectedCell;
- setSelectedCell();
- setAttributes(deleteRow(attributes, {
- sectionName,
- rowIndex
- }));
- }
- /**
- * Inserts a column at the currently selected column index, plus `delta`.
- *
- * @param {number} delta Offset for selected column index at which to insert.
- */
- function onInsertColumn() {
- let delta = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- if (!selectedCell) {
- return;
- }
- const {
- columnIndex
- } = selectedCell;
- const newColumnIndex = columnIndex + delta;
- setAttributes(insertColumn(attributes, {
- columnIndex: newColumnIndex
- })); // Select the first cell of the new column.
- setSelectedCell({
- rowIndex: 0,
- columnIndex: newColumnIndex,
- type: 'cell'
- });
- }
- /**
- * Inserts a column before the currently selected column.
- */
- function onInsertColumnBefore() {
- onInsertColumn(0);
- }
- /**
- * Inserts a column after the currently selected column.
- */
- function onInsertColumnAfter() {
- onInsertColumn(1);
- }
- /**
- * Deletes the currently selected column.
- */
- function onDeleteColumn() {
- if (!selectedCell) {
- return;
- }
- const {
- sectionName,
- columnIndex
- } = selectedCell;
- setSelectedCell();
- setAttributes(deleteColumn(attributes, {
- sectionName,
- columnIndex
- }));
- }
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!isSelected) {
- setSelectedCell();
- }
- }, [isSelected]);
- const sections = ['head', 'body', 'foot'].filter(name => !isEmptyTableSection(attributes[name]));
- const tableControls = [{
- icon: table_row_before,
- title: (0,external_wp_i18n_namespaceObject.__)('Insert row before'),
- isDisabled: !selectedCell,
- onClick: onInsertRowBefore
- }, {
- icon: table_row_after,
- title: (0,external_wp_i18n_namespaceObject.__)('Insert row after'),
- isDisabled: !selectedCell,
- onClick: onInsertRowAfter
- }, {
- icon: table_row_delete,
- title: (0,external_wp_i18n_namespaceObject.__)('Delete row'),
- isDisabled: !selectedCell,
- onClick: onDeleteRow
- }, {
- icon: table_column_before,
- title: (0,external_wp_i18n_namespaceObject.__)('Insert column before'),
- isDisabled: !selectedCell,
- onClick: onInsertColumnBefore
- }, {
- icon: table_column_after,
- title: (0,external_wp_i18n_namespaceObject.__)('Insert column after'),
- isDisabled: !selectedCell,
- onClick: onInsertColumnAfter
- }, {
- icon: table_column_delete,
- title: (0,external_wp_i18n_namespaceObject.__)('Delete column'),
- isDisabled: !selectedCell,
- onClick: onDeleteColumn
- }];
- const renderedSections = ['head', 'body', 'foot'].map(name => (0,external_wp_element_namespaceObject.createElement)(TSection, {
- name: name,
- key: name
- }, attributes[name].map((_ref3, rowIndex) => {
- let {
- cells
- } = _ref3;
- return (0,external_wp_element_namespaceObject.createElement)("tr", {
- key: rowIndex
- }, cells.map((_ref4, columnIndex) => {
- let {
- content,
- tag: CellTag,
- scope,
- align
- } = _ref4;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: CellTag,
- key: columnIndex,
- className: classnames_default()({
- [`has-text-align-${align}`]: align
- }, 'wp-block-table__cell-content'),
- scope: CellTag === 'th' ? scope : undefined,
- value: content,
- onChange: onChange,
- unstableOnFocus: () => {
- setSelectedCell({
- sectionName: name,
- rowIndex,
- columnIndex,
- type: 'cell'
- });
- },
- "aria-label": cellAriaLabel[name],
- placeholder: placeholder[name]
- });
- }));
- })));
- const isEmpty = !sections.length;
- return (0,external_wp_element_namespaceObject.createElement)("figure", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Change column alignment'),
- alignmentControls: ALIGNMENT_CONTROLS,
- value: getCellAlignment(),
- onChange: nextAlign => onChangeColumnAlignment(nextAlign)
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
- hasArrowIndicator: true,
- icon: library_table,
- label: (0,external_wp_i18n_namespaceObject.__)('Edit table'),
- controls: tableControls
- }))), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Table settings'),
- className: "blocks-table-settings"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'),
- checked: !!hasFixedLayout,
- onChange: onChangeFixedLayout
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Header section'),
- checked: !!(head && head.length),
- onChange: onToggleHeaderSection
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Footer section'),
- checked: !!(foot && foot.length),
- onChange: onToggleFooterSection
- }))), !isEmpty && (0,external_wp_element_namespaceObject.createElement)("table", {
- className: classnames_default()(colorProps.className, borderProps.className, {
- 'has-fixed-layout': hasFixedLayout
- }),
- style: { ...colorProps.style,
- ...borderProps.style
- }
- }, renderedSections), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: "figcaption",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Table caption text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
- value: caption,
- onChange: value => setAttributes({
- caption: value
- }) // Deselect the selected table cell when the caption is focused.
- ,
- unstableOnFocus: () => setSelectedCell(),
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
- }), isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- label: (0,external_wp_i18n_namespaceObject.__)('Table'),
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: block_table,
- showColors: true
- }),
- instructions: (0,external_wp_i18n_namespaceObject.__)('Insert a table for sharing data.')
- }, (0,external_wp_element_namespaceObject.createElement)("form", {
- className: "blocks-table__placeholder-form",
- onSubmit: onCreateTable
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- type: "number",
- label: (0,external_wp_i18n_namespaceObject.__)('Column count'),
- value: initialColumnCount,
- onChange: onChangeInitialColumnCount,
- min: "1",
- className: "blocks-table__placeholder-input"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- type: "number",
- label: (0,external_wp_i18n_namespaceObject.__)('Row count'),
- value: initialRowCount,
- onChange: onChangeInitialRowCount,
- min: "1",
- className: "blocks-table__placeholder-input"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- className: "blocks-table__placeholder-button",
- variant: "primary",
- type: "submit"
- }, (0,external_wp_i18n_namespaceObject.__)('Create Table')))));
- }
- /* harmony default export */ var table_edit = (TableEdit);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function table_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- hasFixedLayout,
- head,
- body,
- foot,
- caption
- } = attributes;
- const isEmpty = !head.length && !body.length && !foot.length;
- if (isEmpty) {
- return null;
- }
- const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
- const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
- const classes = classnames_default()(colorProps.className, borderProps.className, {
- 'has-fixed-layout': hasFixedLayout
- });
- const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
- const Section = _ref2 => {
- let {
- type,
- rows
- } = _ref2;
- if (!rows.length) {
- return null;
- }
- const Tag = `t${type}`;
- return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref3, rowIndex) => {
- let {
- cells
- } = _ref3;
- return (0,external_wp_element_namespaceObject.createElement)("tr", {
- key: rowIndex
- }, cells.map((_ref4, cellIndex) => {
- let {
- content,
- tag,
- scope,
- align
- } = _ref4;
- const cellClasses = classnames_default()({
- [`has-text-align-${align}`]: align
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- className: cellClasses ? cellClasses : undefined,
- "data-align": align,
- tagName: tag,
- value: content,
- key: cellIndex,
- scope: tag === 'th' ? scope : undefined
- });
- }));
- }));
- };
- return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
- className: classes === '' ? undefined : classes,
- style: { ...colorProps.style,
- ...borderProps.style
- }
- }, (0,external_wp_element_namespaceObject.createElement)(Section, {
- type: "head",
- rows: head
- }), (0,external_wp_element_namespaceObject.createElement)(Section, {
- type: "body",
- rows: body
- }), (0,external_wp_element_namespaceObject.createElement)(Section, {
- type: "foot",
- rows: foot
- })), hasCaption && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/transforms.js
- const tableContentPasteSchema = _ref => {
- let {
- phrasingContentSchema
- } = _ref;
- return {
- tr: {
- allowEmpty: true,
- children: {
- th: {
- allowEmpty: true,
- children: phrasingContentSchema,
- attributes: ['scope']
- },
- td: {
- allowEmpty: true,
- children: phrasingContentSchema
- }
- }
- }
- };
- };
- const tablePasteSchema = args => ({
- table: {
- children: {
- thead: {
- allowEmpty: true,
- children: tableContentPasteSchema(args)
- },
- tfoot: {
- allowEmpty: true,
- children: tableContentPasteSchema(args)
- },
- tbody: {
- allowEmpty: true,
- children: tableContentPasteSchema(args)
- }
- }
- }
- });
- const table_transforms_transforms = {
- from: [{
- type: 'raw',
- selector: 'table',
- schema: tablePasteSchema
- }]
- };
- /* harmony default export */ var table_transforms = (table_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const table_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/table",
- title: "Table",
- category: "text",
- description: "Create structured content in rows and columns to display information.",
- textdomain: "default",
- attributes: {
- hasFixedLayout: {
- type: "boolean",
- "default": false
- },
- caption: {
- type: "string",
- source: "html",
- selector: "figcaption",
- "default": ""
- },
- head: {
- type: "array",
- "default": [],
- source: "query",
- selector: "thead tr",
- query: {
- cells: {
- type: "array",
- "default": [],
- source: "query",
- selector: "td,th",
- query: {
- content: {
- type: "string",
- source: "html"
- },
- tag: {
- type: "string",
- "default": "td",
- source: "tag"
- },
- scope: {
- type: "string",
- source: "attribute",
- attribute: "scope"
- },
- align: {
- type: "string",
- source: "attribute",
- attribute: "data-align"
- }
- }
- }
- }
- },
- body: {
- type: "array",
- "default": [],
- source: "query",
- selector: "tbody tr",
- query: {
- cells: {
- type: "array",
- "default": [],
- source: "query",
- selector: "td,th",
- query: {
- content: {
- type: "string",
- source: "html"
- },
- tag: {
- type: "string",
- "default": "td",
- source: "tag"
- },
- scope: {
- type: "string",
- source: "attribute",
- attribute: "scope"
- },
- align: {
- type: "string",
- source: "attribute",
- attribute: "data-align"
- }
- }
- }
- }
- },
- foot: {
- type: "array",
- "default": [],
- source: "query",
- selector: "tfoot tr",
- query: {
- cells: {
- type: "array",
- "default": [],
- source: "query",
- selector: "td,th",
- query: {
- content: {
- type: "string",
- source: "html"
- },
- tag: {
- type: "string",
- "default": "td",
- source: "tag"
- },
- scope: {
- type: "string",
- source: "attribute",
- attribute: "scope"
- },
- align: {
- type: "string",
- source: "attribute",
- attribute: "data-align"
- }
- }
- }
- }
- }
- },
- supports: {
- anchor: true,
- align: true,
- color: {
- __experimentalSkipSerialization: true,
- gradients: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- },
- __experimentalBorder: {
- __experimentalSkipSerialization: true,
- color: true,
- style: true,
- width: true,
- __experimentalDefaultControls: {
- color: true,
- style: true,
- width: true
- }
- },
- __experimentalSelector: ".wp-block-table > table"
- },
- styles: [{
- name: "regular",
- label: "Default",
- isDefault: true
- }, {
- name: "stripes",
- label: "Stripes"
- }],
- editorStyle: "wp-block-table-editor",
- style: "wp-block-table"
- };
- const {
- name: table_name
- } = table_metadata;
- const table_settings = {
- icon: block_table,
- example: {
- attributes: {
- head: [{
- cells: [{
- content: (0,external_wp_i18n_namespaceObject.__)('Version'),
- tag: 'th'
- }, {
- content: (0,external_wp_i18n_namespaceObject.__)('Jazz Musician'),
- tag: 'th'
- }, {
- content: (0,external_wp_i18n_namespaceObject.__)('Release Date'),
- tag: 'th'
- }]
- }],
- body: [{
- cells: [{
- content: '5.2',
- tag: 'td'
- }, {
- content: 'Jaco Pastorius',
- tag: 'td'
- }, {
- content: (0,external_wp_i18n_namespaceObject.__)('May 7, 2019'),
- tag: 'td'
- }]
- }, {
- cells: [{
- content: '5.1',
- tag: 'td'
- }, {
- content: 'Betty Carter',
- tag: 'td'
- }, {
- content: (0,external_wp_i18n_namespaceObject.__)('February 21, 2019'),
- tag: 'td'
- }]
- }, {
- cells: [{
- content: '5.0',
- tag: 'td'
- }, {
- content: 'Bebo Valdés',
- tag: 'td'
- }, {
- content: (0,external_wp_i18n_namespaceObject.__)('December 6, 2018'),
- tag: 'td'
- }]
- }]
- }
- },
- transforms: table_transforms,
- edit: table_edit,
- save: table_save_save,
- deprecated: table_deprecated
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/transforms.js
- /**
- * WordPress dependencies
- */
- const tag_cloud_transforms_transforms = {
- from: [{
- type: 'block',
- blocks: ['core/categories'],
- transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/tag-cloud')
- }],
- to: [{
- type: 'block',
- blocks: ['core/categories'],
- transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/categories')
- }]
- };
- /* harmony default export */ var tag_cloud_transforms = (tag_cloud_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Minimum number of tags a user can show using this block.
- *
- * @type {number}
- */
- const MIN_TAGS = 1;
- /**
- * Maximum number of tags a user can show using this block.
- *
- * @type {number}
- */
- const MAX_TAGS = 100;
- const MIN_FONT_SIZE = 0.1;
- const MAX_FONT_SIZE = 100;
- function TagCloudEdit(_ref) {
- let {
- attributes,
- setAttributes,
- taxonomies
- } = _ref;
- const {
- taxonomy,
- showTagCounts,
- numberOfTags,
- smallestFontSize,
- largestFontSize
- } = attributes;
- const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
- availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem']
- });
- const getTaxonomyOptions = () => {
- const selectOption = {
- label: (0,external_wp_i18n_namespaceObject.__)('- Select -'),
- value: '',
- disabled: true
- };
- const taxonomyOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(taxonomies, 'show_cloud'), item => {
- return {
- value: item.slug,
- label: item.name
- };
- });
- return [selectOption, ...taxonomyOptions];
- };
- const onFontSizeChange = (fontSizeLabel, newValue) => {
- // eslint-disable-next-line @wordpress/no-unused-vars-before-return
- const [quantity, newUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(newValue);
- if (!Number.isFinite(quantity)) {
- return;
- }
- const updateObj = {
- [fontSizeLabel]: newValue
- }; // We need to keep in sync the `unit` changes to both `smallestFontSize`
- // and `largestFontSize` attributes.
- Object.entries({
- smallestFontSize,
- largestFontSize
- }).forEach(_ref2 => {
- let [attribute, currentValue] = _ref2;
- const [currentQuantity, currentUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue); // Only add an update if the other font size attribute has a different unit.
- if (attribute !== fontSizeLabel && currentUnit !== newUnit) {
- updateObj[attribute] = `${currentQuantity}${newUnit}`;
- }
- });
- setAttributes(updateObj);
- };
- const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Tag Cloud settings')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'),
- options: getTaxonomyOptions(),
- value: taxonomy,
- onChange: selectedTaxonomy => setAttributes({
- taxonomy: selectedTaxonomy
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
- checked: showTagCounts,
- onChange: () => setAttributes({
- showTagCounts: !showTagCounts
- })
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'),
- value: numberOfTags,
- onChange: value => setAttributes({
- numberOfTags: value
- }),
- min: MIN_TAGS,
- max: MAX_TAGS,
- required: true
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
- isBlock: true
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Smallest size'),
- value: smallestFontSize,
- onChange: value => {
- onFontSizeChange('smallestFontSize', value);
- },
- units: units,
- min: MIN_FONT_SIZE,
- max: MAX_FONT_SIZE
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
- isBlock: true
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Largest size'),
- value: largestFontSize,
- onChange: value => {
- onFontSizeChange('largestFontSize', value);
- },
- units: units,
- min: MIN_FONT_SIZE,
- max: MAX_FONT_SIZE
- })))));
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
- key: "tag-cloud",
- block: "core/tag-cloud",
- attributes: attributes
- })));
- }
- /* harmony default export */ var tag_cloud_edit = ((0,external_wp_data_namespaceObject.withSelect)(select => {
- return {
- taxonomies: select(external_wp_coreData_namespaceObject.store).getTaxonomies({
- per_page: -1
- })
- };
- })(TagCloudEdit));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const tag_cloud_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/tag-cloud",
- title: "Tag Cloud",
- category: "widgets",
- description: "A cloud of your most used tags.",
- textdomain: "default",
- attributes: {
- numberOfTags: {
- type: "number",
- "default": 45,
- minimum: 1,
- maximum: 100
- },
- taxonomy: {
- type: "string",
- "default": "post_tag"
- },
- showTagCounts: {
- type: "boolean",
- "default": false
- },
- smallestFontSize: {
- type: "string",
- "default": "8pt"
- },
- largestFontSize: {
- type: "string",
- "default": "22pt"
- }
- },
- styles: [{
- name: "default",
- label: "Default",
- isDefault: true
- }, {
- name: "outline",
- label: "Outline"
- }],
- supports: {
- html: false,
- align: true
- },
- editorStyle: "wp-block-tag-cloud-editor"
- };
- const {
- name: tag_cloud_name
- } = tag_cloud_metadata;
- const tag_cloud_settings = {
- icon: library_tag,
- example: {},
- edit: tag_cloud_edit,
- transforms: tag_cloud_transforms
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
- /**
- * WordPress dependencies
- */
- const symbolFilled = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var symbol_filled = (symbolFilled);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/hooks.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Retrieves the available template parts for the given area.
- *
- * @param {string} area Template part area.
- * @param {string} excludedId Template part ID to exclude.
- *
- * @return {{ templateParts: Array, isResolving: boolean }} array of template parts.
- */
- function useAlternativeTemplateParts(area, excludedId) {
- const {
- templateParts,
- isResolving
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getEntityRecords,
- isResolving: _isResolving
- } = select(external_wp_coreData_namespaceObject.store);
- const query = {
- per_page: -1
- };
- return {
- templateParts: getEntityRecords('postType', 'wp_template_part', query),
- isLoading: _isResolving('getEntityRecords', ['postType', 'wp_template_part', query])
- };
- }, []);
- const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => {
- if (!templateParts) {
- return [];
- }
- return templateParts.filter(templatePart => createTemplatePartId(templatePart.theme, templatePart.slug) !== excludedId && (!area || 'uncategorized' === area || templatePart.area === area)) || [];
- }, [templateParts, area]);
- return {
- templateParts: filteredTemplateParts,
- isResolving
- };
- }
- /**
- * Retrieves the available block patterns for the given area.
- *
- * @param {string} area Template part area.
- * @param {string} clientId Block Client ID. (The container of the block can impact allowed blocks).
- *
- * @return {Array} array of block patterns.
- */
- function useAlternativeBlockPatterns(area, clientId) {
- return (0,external_wp_data_namespaceObject.useSelect)(select => {
- const blockNameWithArea = area ? `core/template-part/${area}` : 'core/template-part';
- const {
- getBlockRootClientId,
- __experimentalGetPatternsByBlockTypes
- } = select(external_wp_blockEditor_namespaceObject.store);
- const rootClientId = getBlockRootClientId(clientId);
- return __experimentalGetPatternsByBlockTypes(blockNameWithArea, rootClientId);
- }, [area, clientId]);
- }
- function useCreateTemplatePartFromBlocks(area, setAttributes) {
- const {
- saveEntityRecord
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
- return async function () {
- let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- let title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0,external_wp_i18n_namespaceObject.__)('Untitled Template Part');
- // Currently template parts only allow latin chars.
- // Fallback slug will receive suffix by default.
- const cleanSlug = (0,external_lodash_namespaceObject.kebabCase)(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; // If we have `area` set from block attributes, means an exposed
- // block variation was inserted. So add this prop to the template
- // part entity on creation. Afterwards remove `area` value from
- // block attributes.
- const record = {
- title,
- slug: cleanSlug,
- content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
- // `area` is filterable on the server and defaults to `UNCATEGORIZED`
- // if provided value is not allowed.
- area
- };
- const templatePart = await saveEntityRecord('postType', 'wp_template_part', record);
- setAttributes({
- slug: templatePart.slug,
- theme: templatePart.theme,
- area: undefined
- });
- };
- }
- /**
- * Retrieves the template part area object.
- *
- * @param {string} area Template part area identifier.
- *
- * @return {{icon: Object, label: string, tagName: string}} Template Part area.
- */
- function useTemplatePartArea(area) {
- return (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _selectedArea$area_ta;
- // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
- // Blocks can be loaded into a *non-post* block editor.
- // eslint-disable-next-line @wordpress/data-no-store-string-literals
- const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
- const selectedArea = (0,external_lodash_namespaceObject.find)(definedAreas, {
- area
- });
- const defaultArea = (0,external_lodash_namespaceObject.find)(definedAreas, {
- area: 'uncategorized'
- });
- return {
- icon: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.icon) || (defaultArea === null || defaultArea === void 0 ? void 0 : defaultArea.icon),
- label: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.label) || (0,external_wp_i18n_namespaceObject.__)('Template Part'),
- tagName: (_selectedArea$area_ta = selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.area_tag) !== null && _selectedArea$area_ta !== void 0 ? _selectedArea$area_ta : 'div'
- };
- }, [area]);
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/title-modal.js
- /**
- * WordPress dependencies
- */
- function TitleModal(_ref) {
- let {
- areaLabel,
- onClose,
- onSubmit
- } = _ref;
- // Restructure onCreate to set the blocks on local state.
- // Add modal to confirm title and trigger onCreate.
- const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_i18n_namespaceObject.__)('Untitled Template Part'));
- const submitForCreation = event => {
- event.preventDefault();
- onSubmit(title);
- };
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
- title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
- (0,external_wp_i18n_namespaceObject.__)('Name and create your new %s'), areaLabel.toLowerCase()),
- closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
- overlayClassName: "wp-block-template-part__placeholder-create-new__title-form",
- onRequestClose: onClose
- }, (0,external_wp_element_namespaceObject.createElement)("form", {
- onSubmit: submitForCreation
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Name'),
- value: title,
- onChange: setTitle
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
- className: "wp-block-template-part__placeholder-create-new__title-form-actions",
- justify: "flex-end"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "primary",
- type: "submit",
- disabled: !title.length,
- "aria-disabled": !title.length
- }, (0,external_wp_i18n_namespaceObject.__)('Create'))))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function TemplatePartPlaceholder(_ref) {
- let {
- area,
- clientId,
- templatePartId,
- onOpenSelectionModal,
- setAttributes
- } = _ref;
- const {
- templateParts,
- isResolving
- } = useAlternativeTemplateParts(area, templatePartId);
- const blockPatterns = useAlternativeBlockPatterns(area, clientId);
- const [showTitleModal, setShowTitleModal] = (0,external_wp_element_namespaceObject.useState)(false);
- const areaObject = useTemplatePartArea(area);
- const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
- icon: areaObject.icon,
- label: areaObject.label,
- instructions: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
- (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s or create a new one.'), areaObject.label.toLowerCase())
- }, isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isResolving && !!(templateParts.length || blockPatterns.length) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "primary",
- onClick: onOpenSelectionModal
- }, (0,external_wp_i18n_namespaceObject.__)('Choose')), !isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "secondary",
- onClick: () => {
- setShowTitleModal(true);
- }
- }, (0,external_wp_i18n_namespaceObject.__)('Start blank')), showTitleModal && (0,external_wp_element_namespaceObject.createElement)(TitleModal, {
- areaLabel: areaObject.label,
- onClose: () => setShowTitleModal(false),
- onSubmit: title => {
- createFromBlocks([], title);
- }
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection-modal.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function TemplatePartSelectionModal(_ref) {
- let {
- setAttributes,
- onClose,
- templatePartId = null,
- area,
- clientId
- } = _ref;
- // When the templatePartId is undefined,
- // it means the user is creating a new one from the placeholder.
- const isReplacingTemplatePartContent = !!templatePartId;
- const {
- templateParts
- } = useAlternativeTemplateParts(area, templatePartId); // We can map template parts to block patters to reuse the BlockPatternsList UI
- const templartPartsAsBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
- return templateParts.map(templatePart => ({
- name: createTemplatePartId(templatePart.theme, templatePart.slug),
- title: templatePart.title.rendered,
- blocks: (0,external_wp_blocks_namespaceObject.parse)(templatePart.content.raw),
- templatePart
- }));
- }, [templateParts]);
- const shownTemplateParts = (0,external_wp_compose_namespaceObject.useAsyncList)(templartPartsAsBlockPatterns);
- const {
- createSuccessNotice
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
- const blockPatterns = useAlternativeBlockPatterns(area, clientId);
- const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(blockPatterns);
- const {
- replaceInnerBlocks
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const onTemplatePartSelect = (0,external_wp_element_namespaceObject.useCallback)(templatePart => {
- var _templatePart$title;
- setAttributes({
- slug: templatePart.slug,
- theme: templatePart.theme,
- area: undefined
- });
- createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: template part title. */
- (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" inserted.'), ((_templatePart$title = templatePart.title) === null || _templatePart$title === void 0 ? void 0 : _templatePart$title.rendered) || templatePart.slug), {
- type: 'snackbar'
- });
- onClose();
- }, []);
- const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "block-library-template-part__selection-content"
- }, !!templartPartsAsBlockPatterns.length && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Existing template parts')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
- blockPatterns: templartPartsAsBlockPatterns,
- shownPatterns: shownTemplateParts,
- onClickPattern: pattern => {
- onTemplatePartSelect(pattern.templatePart);
- }
- })), !!blockPatterns.length && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Patterns')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
- blockPatterns: blockPatterns,
- shownPatterns: shownBlockPatterns,
- onClickPattern: (pattern, blocks) => {
- if (isReplacingTemplatePartContent) {
- replaceInnerBlocks(clientId, blocks);
- } else {
- createFromBlocks(blocks, pattern.title);
- }
- onClose();
- }
- }))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js
- /**
- * WordPress dependencies
- */
- function TemplatePartAdvancedControls(_ref) {
- let {
- tagName,
- setAttributes,
- isEntityAvailable,
- templatePartId,
- defaultWrapper
- } = _ref;
- const [area, setArea] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'area', templatePartId);
- const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'title', templatePartId);
- const {
- areaOptions
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
- // Blocks can be loaded into a *non-post* block editor.
- // eslint-disable-next-line @wordpress/data-no-store-string-literals
- const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
- return {
- areaOptions: definedAreas.map(_ref2 => {
- let {
- label,
- area: _area
- } = _ref2;
- return {
- label,
- value: _area
- };
- })
- };
- }, []);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
- __experimentalGroup: "advanced"
- }, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Title'),
- value: title,
- onChange: value => {
- setTitle(value);
- },
- onFocus: event => event.target.select()
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Area'),
- labelPosition: "top",
- options: areaOptions,
- value: area,
- onChange: setArea
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
- options: [{
- label: (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: HTML tag based on area. */
- (0,external_wp_i18n_namespaceObject.__)('Default based on area (%s)'), `<${defaultWrapper}>`),
- value: ''
- }, {
- label: '<header>',
- value: 'header'
- }, {
- label: '<main>',
- value: 'main'
- }, {
- label: '<section>',
- value: 'section'
- }, {
- label: '<article>',
- value: 'article'
- }, {
- label: '<aside>',
- value: 'aside'
- }, {
- label: '<footer>',
- value: 'footer'
- }, {
- label: '<div>',
- value: 'div'
- }],
- value: tagName || '',
- onChange: value => setAttributes({
- tagName: value
- })
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/inner-blocks.js
- /**
- * WordPress dependencies
- */
- function TemplatePartInnerBlocks(_ref) {
- let {
- postId: id,
- hasInnerBlocks,
- layout,
- tagName,
- blockProps,
- clientId
- } = _ref;
- const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => {
- var _getSettings;
- const {
- getSettings
- } = select(external_wp_blockEditor_namespaceObject.store);
- return (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout;
- }, []);
- const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
- const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
- const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_template_part', {
- id
- });
- const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
- value: blocks,
- onInput,
- onChange,
- renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
- __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
- clientId: clientId,
- tagName: tagName,
- wrapperProps: innerBlocksProps
- });
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/index.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function TemplatePartEdit(_ref) {
- let {
- attributes,
- setAttributes,
- clientId
- } = _ref;
- const {
- slug,
- theme,
- tagName,
- layout = {}
- } = attributes;
- const templatePartId = createTemplatePartId(theme, slug);
- const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(templatePartId);
- const [isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen] = (0,external_wp_element_namespaceObject.useState)(false); // Set the postId block attribute if it did not exist,
- // but wait until the inner blocks have loaded to allow
- // new edits to trigger this.
- const {
- isResolved,
- innerBlocks,
- isMissing,
- area
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getEditedEntityRecord,
- hasFinishedResolution
- } = select(external_wp_coreData_namespaceObject.store);
- const {
- getBlocks
- } = select(external_wp_blockEditor_namespaceObject.store);
- const getEntityArgs = ['postType', 'wp_template_part', templatePartId];
- const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null;
- const _area = (entityRecord === null || entityRecord === void 0 ? void 0 : entityRecord.area) || attributes.area;
- const hasResolvedEntity = templatePartId ? hasFinishedResolution('getEditedEntityRecord', getEntityArgs) : false;
- return {
- innerBlocks: getBlocks(clientId),
- isResolved: hasResolvedEntity,
- isMissing: hasResolvedEntity && (0,external_lodash_namespaceObject.isEmpty)(entityRecord),
- area: _area
- };
- }, [templatePartId, clientId]);
- const {
- templateParts
- } = useAlternativeTemplateParts(area, templatePartId);
- const blockPatterns = useAlternativeBlockPatterns(area, clientId);
- const hasReplacements = !!templateParts.length || !!blockPatterns.length;
- const areaObject = useTemplatePartArea(area);
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
- const isPlaceholder = !slug;
- const isEntityAvailable = !isPlaceholder && !isMissing && isResolved;
- const TagName = tagName || areaObject.tagName; // We don't want to render a missing state if we have any inner blocks.
- // A new template part is automatically created if we have any inner blocks but no entity.
- if (innerBlocks.length === 0 && (slug && !theme || slug && isMissing)) {
- return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: Template part slug */
- (0,external_wp_i18n_namespaceObject.__)('Template part has been deleted or is unavailable: %s'), slug)));
- }
- if (isEntityAvailable && hasAlreadyRendered) {
- return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
- }
- return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)(TemplatePartAdvancedControls, {
- tagName: tagName,
- setAttributes: setAttributes,
- isEntityAvailable: isEntityAvailable,
- templatePartId: templatePartId,
- defaultWrapper: areaObject.tagName
- }), isPlaceholder && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(TemplatePartPlaceholder, {
- area: attributes.area,
- templatePartId: templatePartId,
- clientId: clientId,
- setAttributes: setAttributes,
- onOpenSelectionModal: () => setIsTemplatePartSelectionOpen(true)
- })), isEntityAvailable && hasReplacements && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
- className: "wp-block-template-part__block-control-group"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- onClick: () => setIsTemplatePartSelectionOpen(true)
- }, (0,external_wp_i18n_namespaceObject.__)('Replace')))), isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(TemplatePartInnerBlocks, {
- clientId: clientId,
- tagName: TagName,
- blockProps: blockProps,
- postId: templatePartId,
- hasInnerBlocks: innerBlocks.length > 0,
- layout: layout
- }), !isPlaceholder && !isResolved && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), isTemplatePartSelectionOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
- className: "block-editor-template-part__selection-modal",
- title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
- (0,external_wp_i18n_namespaceObject.__)('Choose a %s'), areaObject.label.toLowerCase()),
- closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
- onRequestClose: () => setIsTemplatePartSelectionOpen(false)
- }, (0,external_wp_element_namespaceObject.createElement)(TemplatePartSelectionModal, {
- templatePartId: templatePartId,
- clientId: clientId,
- area: area,
- setAttributes: setAttributes,
- onClose: () => setIsTemplatePartSelectionOpen(false)
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/header.js
- /**
- * WordPress dependencies
- */
- const header = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18.5 10.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"
- }));
- /* harmony default export */ var library_header = (header);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/footer.js
- /**
- * WordPress dependencies
- */
- const footer = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- fillRule: "evenodd",
- d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
- }));
- /* harmony default export */ var library_footer = (footer);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js
- /**
- * WordPress dependencies
- */
- const sidebar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
- }));
- /* harmony default export */ var library_sidebar = (sidebar);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/fallback-variations.js
- /**
- * WordPress dependencies
- */
- const fallback_variations_fallbackVariations = [{
- name: 'header',
- icon: library_header,
- title: (0,external_wp_i18n_namespaceObject.__)('Header'),
- description: (0,external_wp_i18n_namespaceObject.__)('The Header template defines a page area that typically contains a title, logo, and main navigation.'),
- attributes: {
- area: 'header'
- },
- scope: ['inserter']
- }, {
- name: 'footer',
- icon: library_footer,
- title: (0,external_wp_i18n_namespaceObject.__)('Footer'),
- description: (0,external_wp_i18n_namespaceObject.__)('The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.'),
- attributes: {
- area: 'footer'
- },
- scope: ['inserter']
- }];
- fallback_variations_fallbackVariations.forEach(variation => {
- if (variation.isActive) return;
- variation.isActive = (blockAttributes, variationAttributes) => {
- const {
- area,
- theme,
- slug
- } = blockAttributes; // We first check the `area` block attribute which is set during insertion.
- // This property is removed on the creation of a template part.
- if (area) return area === variationAttributes.area; // Find a matching variation from the created template part
- // by checking the entity's `area` property.
- if (!slug) return false;
- const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
- return (entity === null || entity === void 0 ? void 0 : entity.area) === variationAttributes.area;
- };
- });
- /* harmony default export */ var template_part_fallback_variations = (fallback_variations_fallbackVariations);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/variations.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function getTemplatePartIcon(iconName) {
- if ('header' === iconName) {
- return library_header;
- } else if ('footer' === iconName) {
- return library_footer;
- } else if ('sidebar' === iconName) {
- return library_sidebar;
- }
- return symbol_filled;
- }
- function enhanceTemplatePartVariations(settings, name) {
- if (name !== 'core/template-part') {
- return settings;
- } // WordPress versions pre-5.8 do not support server side variation registration.
- // So we must register the fallback variations until those versions are no longer supported.
- if (!(settings.variations && settings.variations.length)) {
- return { ...settings,
- variations: template_part_fallback_variations
- };
- }
- if (settings.variations) {
- const isActive = (blockAttributes, variationAttributes) => {
- const {
- area,
- theme,
- slug
- } = blockAttributes; // We first check the `area` block attribute which is set during insertion.
- // This property is removed on the creation of a template part.
- if (area) return area === variationAttributes.area; // Find a matching variation from the created template part
- // by checking the entity's `area` property.
- if (!slug) return false;
- const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
- return (entity === null || entity === void 0 ? void 0 : entity.area) === variationAttributes.area;
- };
- const variations = settings.variations.map(variation => {
- return { ...variation,
- ...(!variation.isActive && {
- isActive
- }),
- ...(typeof variation.icon === 'string' && {
- icon: getTemplatePartIcon(variation.icon)
- })
- };
- });
- return { ...settings,
- variations
- };
- }
- return settings;
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const template_part_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/template-part",
- title: "Template Part",
- category: "theme",
- description: "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",
- textdomain: "default",
- attributes: {
- slug: {
- type: "string"
- },
- theme: {
- type: "string"
- },
- tagName: {
- type: "string"
- },
- area: {
- type: "string"
- }
- },
- supports: {
- align: true,
- html: false,
- reusable: false
- },
- editorStyle: "wp-block-template-part-editor"
- };
- const {
- name: template_part_name
- } = template_part_metadata;
- const template_part_settings = {
- icon: symbol_filled,
- __experimentalLabel: _ref => {
- var _entity$title;
- let {
- slug,
- theme
- } = _ref;
- // Attempt to find entity title if block is a template part.
- // Require slug to request, otherwise entity is uncreated and will throw 404.
- if (!slug) {
- return;
- }
- const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', theme + '//' + slug);
- if (!entity) {
- return;
- }
- return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)((_entity$title = entity.title) === null || _entity$title === void 0 ? void 0 : _entity$title.rendered) || (0,external_lodash_namespaceObject.startCase)(entity.slug);
- },
- edit: TemplatePartEdit
- }; // Importing this file includes side effects. This is whitelisted in block-library/package.json under sideEffects
- (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); // Prevent adding template parts inside post templates.
- const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content'];
- (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromPostTemplates', (can, blockType, rootClientId, _ref2) => {
- let {
- getBlock,
- getBlockParentsByBlockName
- } = _ref2;
- if (blockType.name !== 'core/template-part') {
- return can;
- }
- for (const disallowedParentType of DISALLOWED_PARENTS) {
- var _getBlock;
- const hasDisallowedParent = ((_getBlock = getBlock(rootClientId)) === null || _getBlock === void 0 ? void 0 : _getBlock.name) === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length;
- if (hasDisallowedParent) {
- return false;
- }
- }
- return true;
- });
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/term-description.js
- /**
- * WordPress dependencies
- */
- const term_description_tag = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z"
- }));
- /* harmony default export */ var term_description = (term_description_tag);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function TermDescriptionEdit(_ref) {
- let {
- attributes,
- setAttributes,
- mergedStyle
- } = _ref;
- const {
- textAlign
- } = attributes;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- }),
- style: mergedStyle
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-term-description__placeholder"
- }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Term Description')))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const term_description_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/term-description",
- title: "Term Description",
- category: "theme",
- description: "Display the description of categories, tags and custom taxonomies when viewing an archive.",
- textdomain: "default",
- attributes: {
- textAlign: {
- type: "string"
- }
- },
- supports: {
- align: ["wide", "full"],
- html: false,
- color: {
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- lineHeight: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- },
- editorStyle: "wp-block-term-description-editor"
- };
- const {
- name: term_description_name
- } = term_description_metadata;
- const term_description_settings = {
- icon: term_description,
- edit: TermDescriptionEdit
- };
- ;// CONCATENATED MODULE: external ["wp","deprecated"]
- var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
- var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function TextColumnsEdit(_ref) {
- let {
- attributes,
- setAttributes
- } = _ref;
- const {
- width,
- content,
- columns
- } = attributes;
- external_wp_deprecated_default()('The Text Columns block', {
- since: '5.3',
- alternative: 'the Columns block'
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, {
- value: width,
- onChange: nextWidth => setAttributes({
- width: nextWidth
- }),
- controls: ['center', 'wide', 'full']
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
- value: columns,
- onChange: value => setAttributes({
- columns: value
- }),
- min: 2,
- max: 4,
- required: true
- }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: `align${width} columns-${columns}`
- }), (0,external_lodash_namespaceObject.times)(columns, index => {
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-column",
- key: `column-${index}`
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: "p",
- value: (0,external_lodash_namespaceObject.get)(content, [index, 'children']),
- onChange: nextContent => {
- setAttributes({
- content: [...content.slice(0, index), {
- children: nextContent
- }, ...content.slice(index + 1)]
- });
- },
- "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: column index (starting with 1)
- (0,external_wp_i18n_namespaceObject.__)('Column %d text'), index + 1),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('New Column')
- }));
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function text_columns_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- width,
- content,
- columns
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className: `align${width} columns-${columns}`
- }), (0,external_lodash_namespaceObject.times)(columns, index => (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "wp-block-column",
- key: `column-${index}`
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "p",
- value: (0,external_lodash_namespaceObject.get)(content, [index, 'children'])
- }))));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/transforms.js
- /**
- * WordPress dependencies
- */
- const text_columns_transforms_transforms = {
- to: [{
- type: 'block',
- blocks: ['core/columns'],
- transform: _ref => {
- let {
- className,
- columns,
- content,
- width
- } = _ref;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {
- align: 'wide' === width || 'full' === width ? width : undefined,
- className,
- columns
- }, content.map(_ref2 => {
- let {
- children
- } = _ref2;
- return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
- content: children
- })]);
- }));
- }
- }]
- };
- /* harmony default export */ var text_columns_transforms = (text_columns_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
- /**
- * Internal dependencies
- */
- const text_columns_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/text-columns",
- title: "Text Columns (deprecated)",
- icon: "columns",
- category: "design",
- description: "This block is deprecated. Please use the Columns block instead.",
- textdomain: "default",
- attributes: {
- content: {
- type: "array",
- source: "query",
- selector: "p",
- query: {
- children: {
- type: "string",
- source: "html"
- }
- },
- "default": [{}, {}]
- },
- columns: {
- type: "number",
- "default": 2
- },
- width: {
- type: "string"
- }
- },
- supports: {
- inserter: false
- },
- editorStyle: "wp-block-text-columns-editor",
- style: "wp-block-text-columns"
- };
- const {
- name: text_columns_name
- } = text_columns_metadata;
- const text_columns_settings = {
- transforms: text_columns_transforms,
- getEditWrapperProps(attributes) {
- const {
- width
- } = attributes;
- if ('wide' === width || 'full' === width) {
- return {
- 'data-align': width
- };
- }
- },
- edit: TextColumnsEdit,
- save: text_columns_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/verse.js
- /**
- * WordPress dependencies
- */
- const verse = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"
- }));
- /* harmony default export */ var library_verse = (verse);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/deprecated.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const verse_deprecated_v1 = {
- attributes: {
- content: {
- type: 'string',
- source: 'html',
- selector: 'pre',
- default: ''
- },
- textAlign: {
- type: 'string'
- }
- },
- save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- textAlign,
- content
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "pre",
- style: {
- textAlign
- },
- value: content
- });
- }
- };
- const verse_deprecated_v2 = {
- attributes: {
- content: {
- type: 'string',
- source: 'html',
- selector: 'pre',
- default: '',
- __unstablePreserveWhiteSpace: true,
- __experimentalRole: 'content'
- },
- textAlign: {
- type: 'string'
- }
- },
- supports: {
- anchor: true,
- color: {
- gradients: true,
- link: true
- },
- typography: {
- fontSize: true,
- __experimentalFontFamily: true
- },
- spacing: {
- padding: true
- }
- },
- save(_ref2) {
- let {
- attributes
- } = _ref2;
- const {
- textAlign,
- content
- } = attributes;
- const className = classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- });
- return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: content
- }));
- },
- migrate: migrate_font_family,
- isEligible(_ref3) {
- var _style$typography;
- let {
- style
- } = _ref3;
- return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
- }
- };
- /**
- * New deprecations need to be placed first
- * for them to have higher priority.
- *
- * Old deprecations may need to be updated as well.
- *
- * See block-deprecation.md
- */
- /* harmony default export */ var verse_deprecated = ([verse_deprecated_v2, verse_deprecated_v1]);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function VerseEdit(_ref) {
- let {
- attributes,
- setAttributes,
- mergeBlocks,
- onRemove,
- style
- } = _ref;
- const {
- textAlign,
- content
- } = attributes;
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- }),
- style
- });
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
- value: textAlign,
- onChange: nextAlign => {
- setAttributes({
- textAlign: nextAlign
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
- tagName: "pre",
- identifier: "content",
- preserveWhiteSpace: true,
- value: content,
- onChange: nextContent => {
- setAttributes({
- content: nextContent
- });
- },
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Verse text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Write verse…'),
- onRemove: onRemove,
- onMerge: mergeBlocks,
- textAlign: textAlign
- }, blockProps, {
- __unstablePastePlainText: true
- })));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/save.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- function verse_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- textAlign,
- content
- } = attributes;
- const className = classnames_default()({
- [`has-text-align-${textAlign}`]: textAlign
- });
- return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save({
- className
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- value: content
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/transforms.js
- /**
- * WordPress dependencies
- */
- const verse_transforms_transforms = {
- from: [{
- type: 'block',
- blocks: ['core/paragraph'],
- transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/verse', attributes)
- }],
- to: [{
- type: 'block',
- blocks: ['core/paragraph'],
- transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
- }]
- };
- /* harmony default export */ var verse_transforms = (verse_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const verse_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/verse",
- title: "Verse",
- category: "text",
- description: "Insert poetry. Use special spacing formats. Or quote song lyrics.",
- keywords: ["poetry", "poem"],
- textdomain: "default",
- attributes: {
- content: {
- type: "string",
- source: "html",
- selector: "pre",
- "default": "",
- __unstablePreserveWhiteSpace: true,
- __experimentalRole: "content"
- },
- textAlign: {
- type: "string"
- }
- },
- supports: {
- anchor: true,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true
- }
- },
- typography: {
- fontSize: true,
- __experimentalFontFamily: true,
- lineHeight: true,
- __experimentalFontStyle: true,
- __experimentalFontWeight: true,
- __experimentalLetterSpacing: true,
- __experimentalTextTransform: true,
- __experimentalDefaultControls: {
- fontSize: true,
- fontAppearance: true
- }
- },
- spacing: {
- padding: true
- }
- },
- style: "wp-block-verse",
- editorStyle: "wp-block-verse-editor"
- };
- const {
- name: verse_name
- } = verse_metadata;
- const verse_settings = {
- icon: library_verse,
- example: {
- attributes: {
- /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
- // translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work.
- content: (0,external_wp_i18n_namespaceObject.__)('WHAT was he doing, the great god Pan,\n Down in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.')
- /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
- }
- },
- transforms: verse_transforms,
- deprecated: verse_deprecated,
- merge(attributes, attributesToMerge) {
- return {
- content: attributes.content + attributesToMerge.content
- };
- },
- edit: VerseEdit,
- save: verse_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/video.js
- /**
- * WordPress dependencies
- */
- const video = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var library_video = (video);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit-common-settings.js
- /**
- * WordPress dependencies
- */
- const options = [{
- value: 'auto',
- label: (0,external_wp_i18n_namespaceObject.__)('Auto')
- }, {
- value: 'metadata',
- label: (0,external_wp_i18n_namespaceObject.__)('Metadata')
- }, {
- value: 'none',
- label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value')
- }];
- const VideoSettings = _ref => {
- let {
- setAttributes,
- attributes
- } = _ref;
- const {
- autoplay,
- controls,
- loop,
- muted,
- playsInline,
- preload
- } = attributes;
- const autoPlayHelpText = (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.');
- const getAutoplayHelp = external_wp_element_namespaceObject.Platform.select({
- web: (0,external_wp_element_namespaceObject.useCallback)(checked => {
- return checked ? autoPlayHelpText : null;
- }, []),
- native: autoPlayHelpText
- });
- const toggleFactory = (0,external_wp_element_namespaceObject.useMemo)(() => {
- const toggleAttribute = attribute => {
- return newValue => {
- setAttributes({
- [attribute]: newValue
- });
- };
- };
- return {
- autoplay: toggleAttribute('autoplay'),
- loop: toggleAttribute('loop'),
- muted: toggleAttribute('muted'),
- controls: toggleAttribute('controls'),
- playsInline: toggleAttribute('playsInline')
- };
- }, []);
- const onChangePreload = (0,external_wp_element_namespaceObject.useCallback)(value => {
- setAttributes({
- preload: value
- });
- }, []);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'),
- onChange: toggleFactory.autoplay,
- checked: autoplay,
- help: getAutoplayHelp
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Loop'),
- onChange: toggleFactory.loop,
- checked: loop
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Muted'),
- onChange: toggleFactory.muted,
- checked: muted
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Playback controls'),
- onChange: toggleFactory.controls,
- checked: controls
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Play inline'),
- onChange: toggleFactory.playsInline,
- checked: playsInline
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Preload'),
- value: preload,
- onChange: onChangePreload,
- options: options,
- hideCancelButton: true
- }));
- };
- /* harmony default export */ var edit_common_settings = (VideoSettings);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js
- /**
- * WordPress dependencies
- */
- const media = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- 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"
- }));
- /* harmony default export */ var library_media = (media);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks-editor.js
- /**
- * WordPress dependencies
- */
- const ALLOWED_TYPES = ['text/vtt'];
- const DEFAULT_KIND = 'subtitles';
- const KIND_OPTIONS = [{
- label: (0,external_wp_i18n_namespaceObject.__)('Subtitles'),
- value: 'subtitles'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Captions'),
- value: 'captions'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Descriptions'),
- value: 'descriptions'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Chapters'),
- value: 'chapters'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Metadata'),
- value: 'metadata'
- }];
- const captionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- width: "18",
- height: "14",
- viewBox: "0 0 18 14",
- role: "img",
- fill: "none"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
- x: "0.75",
- y: "0.75",
- width: "16.5",
- height: "12.5",
- rx: "1.25",
- stroke: "black",
- strokeWidth: "1.5",
- fill: "none"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M3 7H15",
- stroke: "black",
- strokeWidth: "1.5"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M3 10L15 10",
- stroke: "black",
- strokeWidth: "1.5"
- }));
- function TrackList(_ref) {
- let {
- tracks,
- onEditPress
- } = _ref;
- let content;
- if (tracks.length === 0) {
- content = (0,external_wp_element_namespaceObject.createElement)("p", {
- className: "block-library-video-tracks-editor__tracks-informative-message"
- }, (0,external_wp_i18n_namespaceObject.__)('Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.'));
- } else {
- content = tracks.map((track, index) => {
- return (0,external_wp_element_namespaceObject.createElement)("div", {
- key: index,
- className: "block-library-video-tracks-editor__track-list-track"
- }, (0,external_wp_element_namespaceObject.createElement)("span", null, track.label, " "), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "tertiary",
- onClick: () => onEditPress(index),
- "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: Label of the video text track e.g: "French subtitles" */
- (0,external_wp_i18n_namespaceObject.__)('Edit %s'), track.label)
- }, (0,external_wp_i18n_namespaceObject.__)('Edit')));
- });
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
- label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'),
- className: "block-library-video-tracks-editor__track-list"
- }, content);
- }
- function SingleTrackEditor(_ref2) {
- let {
- track,
- onChange,
- onClose,
- onRemove
- } = _ref2;
- const {
- src = '',
- label = '',
- srcLang = '',
- kind = DEFAULT_KIND
- } = track;
- const fileName = src.startsWith('blob:') ? '' : (0,external_wp_url_namespaceObject.getFilename)(src) || '';
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "block-library-video-tracks-editor__single-track-editor"
- }, (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "block-library-video-tracks-editor__single-track-editor-edit-track-label"
- }, (0,external_wp_i18n_namespaceObject.__)('Edit track')), (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('File'), ": ", (0,external_wp_element_namespaceObject.createElement)("b", null, fileName)), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "block-library-video-tracks-editor__single-track-editor-label-language"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl
- /* eslint-disable jsx-a11y/no-autofocus */
- , {
- autoFocus: true
- /* eslint-enable jsx-a11y/no-autofocus */
- ,
- onChange: newLabel => onChange({ ...track,
- label: newLabel
- }),
- label: (0,external_wp_i18n_namespaceObject.__)('Label'),
- value: label,
- help: (0,external_wp_i18n_namespaceObject.__)('Title of track')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- onChange: newSrcLang => onChange({ ...track,
- srcLang: newSrcLang
- }),
- label: (0,external_wp_i18n_namespaceObject.__)('Source language'),
- value: srcLang,
- help: (0,external_wp_i18n_namespaceObject.__)('Language tag (en, fr, etc.)')
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- className: "block-library-video-tracks-editor__single-track-editor-kind-select",
- options: KIND_OPTIONS,
- value: kind,
- label: (0,external_wp_i18n_namespaceObject.__)('Kind'),
- onChange: newKind => {
- onChange({ ...track,
- kind: newKind
- });
- }
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
- className: "block-library-video-tracks-editor__single-track-editor-buttons-container"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "secondary",
- onClick: () => {
- const changes = {};
- let hasChanges = false;
- if (label === '') {
- changes.label = (0,external_wp_i18n_namespaceObject.__)('English');
- hasChanges = true;
- }
- if (srcLang === '') {
- changes.srcLang = 'en';
- hasChanges = true;
- }
- if (track.kind === undefined) {
- changes.kind = DEFAULT_KIND;
- hasChanges = true;
- }
- if (hasChanges) {
- onChange({ ...track,
- ...changes
- });
- }
- onClose();
- }
- }, (0,external_wp_i18n_namespaceObject.__)('Close')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- isDestructive: true,
- variant: "link",
- onClick: onRemove
- }, (0,external_wp_i18n_namespaceObject.__)('Remove track')))));
- }
- function TracksEditor(_ref3) {
- let {
- tracks = [],
- onChange
- } = _ref3;
- const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
- return select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload;
- }, []);
- const [trackBeingEdited, setTrackBeingEdited] = (0,external_wp_element_namespaceObject.useState)(null);
- if (!mediaUpload) {
- return null;
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
- contentClassName: "block-library-video-tracks-editor",
- renderToggle: _ref4 => {
- let {
- isOpen,
- onToggle
- } = _ref4;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
- label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'),
- showTooltip: true,
- "aria-expanded": isOpen,
- "aria-haspopup": "true",
- onClick: onToggle,
- icon: captionIcon
- });
- },
- renderContent: _ref5 => {
- let {} = _ref5;
- if (trackBeingEdited !== null) {
- return (0,external_wp_element_namespaceObject.createElement)(SingleTrackEditor, {
- track: tracks[trackBeingEdited],
- onChange: newTrack => {
- const newTracks = [...tracks];
- newTracks[trackBeingEdited] = newTrack;
- onChange(newTracks);
- },
- onClose: () => setTrackBeingEdited(null),
- onRemove: () => {
- onChange(tracks.filter((_track, index) => index !== trackBeingEdited));
- setTrackBeingEdited(null);
- }
- });
- }
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_wp_element_namespaceObject.createElement)(TrackList, {
- tracks: tracks,
- onEditPress: setTrackBeingEdited
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
- className: "block-library-video-tracks-editor__add-tracks-container",
- label: (0,external_wp_i18n_namespaceObject.__)('Add tracks')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
- onSelect: _ref6 => {
- let {
- url
- } = _ref6;
- const trackIndex = tracks.length;
- onChange([...tracks, {
- src: url
- }]);
- setTrackBeingEdited(trackIndex);
- },
- allowedTypes: ALLOWED_TYPES,
- render: _ref7 => {
- let {
- open
- } = _ref7;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
- icon: library_media,
- onClick: open
- }, (0,external_wp_i18n_namespaceObject.__)('Open Media Library'));
- }
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, {
- onChange: event => {
- const files = event.target.files;
- const trackIndex = tracks.length;
- mediaUpload({
- allowedTypes: ALLOWED_TYPES,
- filesList: files,
- onFileChange: _ref8 => {
- let [{
- url
- }] = _ref8;
- const newTracks = [...tracks];
- if (!newTracks[trackIndex]) {
- newTracks[trackIndex] = {};
- }
- newTracks[trackIndex] = { ...tracks[trackIndex],
- src: url
- };
- onChange(newTracks);
- setTrackBeingEdited(trackIndex);
- }
- });
- },
- accept: ".vtt,text/vtt",
- render: _ref9 => {
- let {
- openFileDialog
- } = _ref9;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
- icon: library_upload,
- onClick: () => {
- openFileDialog();
- }
- }, (0,external_wp_i18n_namespaceObject.__)('Upload'));
- }
- })))));
- }
- });
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks.js
- function Tracks(_ref) {
- let {
- tracks = []
- } = _ref;
- return tracks.map(track => {
- return (0,external_wp_element_namespaceObject.createElement)("track", _extends({
- key: track.src
- }, track));
- });
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit.js
- /**
- * External dependencies
- */
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const video_edit_ALLOWED_MEDIA_TYPES = ['video'];
- const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = ['image'];
- function VideoEdit(_ref) {
- let {
- isSelected,
- noticeUI,
- attributes,
- className,
- setAttributes,
- insertBlocksAfter,
- onReplace,
- noticeOperations
- } = _ref;
- const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(VideoEdit);
- const videoPlayer = (0,external_wp_element_namespaceObject.useRef)();
- const posterImageButton = (0,external_wp_element_namespaceObject.useRef)();
- const {
- id,
- caption,
- controls,
- poster,
- src,
- tracks
- } = attributes;
- const isTemporaryVideo = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src);
- const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) {
- const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src);
- if (file) {
- mediaUpload({
- filesList: [file],
- onFileChange: _ref2 => {
- let [{
- url
- }] = _ref2;
- setAttributes({
- src: url
- });
- },
- onError: message => {
- noticeOperations.createErrorNotice(message);
- },
- allowedTypes: video_edit_ALLOWED_MEDIA_TYPES
- });
- }
- }
- }, []);
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- // Placeholder may be rendered.
- if (videoPlayer.current) {
- videoPlayer.current.load();
- }
- }, [poster]);
- function onSelectVideo(media) {
- var _media$image, _media$image2;
- if (!media || !media.url) {
- // In this case there was an error
- // previous attributes should be removed
- // because they may be temporary blob urls.
- setAttributes({
- src: undefined,
- id: undefined,
- poster: undefined
- });
- return;
- } // Sets the block's attribute and updates the edit component from the
- // selected media.
- setAttributes({
- src: media.url,
- id: media.id,
- poster: ((_media$image = media.image) === null || _media$image === void 0 ? void 0 : _media$image.src) !== media.icon ? (_media$image2 = media.image) === null || _media$image2 === void 0 ? void 0 : _media$image2.src : undefined
- });
- }
- function onSelectURL(newSrc) {
- if (newSrc !== src) {
- // Check if there's an embed block that handles this URL.
- const embedBlock = createUpgradedEmbedBlock({
- attributes: {
- url: newSrc
- }
- });
- if (undefined !== embedBlock) {
- onReplace(embedBlock);
- return;
- }
- setAttributes({
- src: newSrc,
- id: undefined,
- poster: undefined
- });
- }
- }
- function onUploadError(message) {
- noticeOperations.removeAllNotices();
- noticeOperations.createErrorNotice(message);
- }
- const classes = classnames_default()(className, {
- 'is-transient': isTemporaryVideo
- });
- const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
- className: classes
- });
- if (!src) {
- return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
- icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
- icon: library_video
- }),
- onSelect: onSelectVideo,
- onSelectURL: onSelectURL,
- accept: "video/*",
- allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
- value: attributes,
- notices: noticeUI,
- onError: onUploadError
- }));
- }
- function onSelectPoster(image) {
- setAttributes({
- poster: image.url
- });
- }
- function onRemovePoster() {
- setAttributes({
- poster: undefined
- }); // Move focus back to the Media Upload button.
- posterImageButton.current.focus();
- }
- const videoPosterDescription = `video-block__poster-image-description-${instanceId}`;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "block"
- }, (0,external_wp_element_namespaceObject.createElement)(TracksEditor, {
- tracks: tracks,
- onChange: newTracks => {
- setAttributes({
- tracks: newTracks
- });
- }
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
- group: "other"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
- mediaId: id,
- mediaURL: src,
- allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
- accept: "video/*",
- onSelect: onSelectVideo,
- onSelectURL: onSelectURL,
- onError: onUploadError
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
- title: (0,external_wp_i18n_namespaceObject.__)('Video settings')
- }, (0,external_wp_element_namespaceObject.createElement)(edit_common_settings, {
- setAttributes: setAttributes,
- attributes: attributes
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
- className: "editor-video-poster-control"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Poster image')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
- title: (0,external_wp_i18n_namespaceObject.__)('Select poster image'),
- onSelect: onSelectPoster,
- allowedTypes: VIDEO_POSTER_ALLOWED_MEDIA_TYPES,
- render: _ref3 => {
- let {
- open
- } = _ref3;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "primary",
- onClick: open,
- ref: posterImageButton,
- "aria-describedby": videoPosterDescription
- }, !poster ? (0,external_wp_i18n_namespaceObject.__)('Select') : (0,external_wp_i18n_namespaceObject.__)('Replace'));
- }
- }), (0,external_wp_element_namespaceObject.createElement)("p", {
- id: videoPosterDescription,
- hidden: true
- }, poster ? (0,external_wp_i18n_namespaceObject.sprintf)(
- /* translators: %s: poster image URL. */
- (0,external_wp_i18n_namespaceObject.__)('The current poster image url is %s'), poster) : (0,external_wp_i18n_namespaceObject.__)('There is no poster image currently selected')), !!poster && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- onClick: onRemovePoster,
- variant: "tertiary"
- }, (0,external_wp_i18n_namespaceObject.__)('Remove')))))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
- isDisabled: !isSelected
- }, (0,external_wp_element_namespaceObject.createElement)("video", {
- controls: controls,
- poster: poster,
- src: src,
- ref: videoPlayer
- }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
- tracks: tracks
- }))), isTemporaryVideo && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
- tagName: "figcaption",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Video caption text'),
- placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
- value: caption,
- onChange: value => setAttributes({
- caption: value
- }),
- inlineToolbar: true,
- __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
- })));
- }
- /* harmony default export */ var video_edit = ((0,external_wp_components_namespaceObject.withNotices)(VideoEdit));
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/save.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- function video_save_save(_ref) {
- let {
- attributes
- } = _ref;
- const {
- autoplay,
- caption,
- controls,
- loop,
- muted,
- poster,
- preload,
- src,
- playsInline,
- tracks
- } = attributes;
- return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), src && (0,external_wp_element_namespaceObject.createElement)("video", {
- autoPlay: autoplay,
- controls: controls,
- loop: loop,
- muted: muted,
- poster: poster,
- preload: preload !== 'metadata' ? preload : undefined,
- src: src,
- playsInline: playsInline
- }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
- tracks: tracks
- })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
- tagName: "figcaption",
- value: caption
- }));
- }
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/transforms.js
- /**
- * WordPress dependencies
- */
- const video_transforms_transforms = {
- from: [{
- type: 'files',
- isMatch(files) {
- return files.length === 1 && files[0].type.indexOf('video/') === 0;
- },
- transform(files) {
- const file = files[0]; // We don't need to upload the media directly here
- // It's already done as part of the `componentDidMount`
- // in the video block
- const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
- src: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
- });
- return block;
- }
- }, {
- type: 'shortcode',
- tag: 'video',
- attributes: {
- src: {
- type: 'string',
- shortcode: _ref => {
- let {
- named: {
- src,
- mp4,
- m4v,
- webm,
- ogv,
- flv
- }
- } = _ref;
- return src || mp4 || m4v || webm || ogv || flv;
- }
- },
- poster: {
- type: 'string',
- shortcode: _ref2 => {
- let {
- named: {
- poster
- }
- } = _ref2;
- return poster;
- }
- },
- loop: {
- type: 'string',
- shortcode: _ref3 => {
- let {
- named: {
- loop
- }
- } = _ref3;
- return loop;
- }
- },
- autoplay: {
- type: 'string',
- shortcode: _ref4 => {
- let {
- named: {
- autoplay
- }
- } = _ref4;
- return autoplay;
- }
- },
- preload: {
- type: 'string',
- shortcode: _ref5 => {
- let {
- named: {
- preload
- }
- } = _ref5;
- return preload;
- }
- }
- }
- }]
- };
- /* harmony default export */ var video_transforms = (video_transforms_transforms);
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- const video_metadata = {
- $schema: "https://schemas.wp.org/trunk/block.json",
- apiVersion: 2,
- name: "core/video",
- title: "Video",
- category: "media",
- description: "Embed a video from your media library or upload a new one.",
- keywords: ["movie"],
- textdomain: "default",
- attributes: {
- autoplay: {
- type: "boolean",
- source: "attribute",
- selector: "video",
- attribute: "autoplay"
- },
- caption: {
- type: "string",
- source: "html",
- selector: "figcaption"
- },
- controls: {
- type: "boolean",
- source: "attribute",
- selector: "video",
- attribute: "controls",
- "default": true
- },
- id: {
- type: "number"
- },
- loop: {
- type: "boolean",
- source: "attribute",
- selector: "video",
- attribute: "loop"
- },
- muted: {
- type: "boolean",
- source: "attribute",
- selector: "video",
- attribute: "muted"
- },
- poster: {
- type: "string",
- source: "attribute",
- selector: "video",
- attribute: "poster"
- },
- preload: {
- type: "string",
- source: "attribute",
- selector: "video",
- attribute: "preload",
- "default": "metadata"
- },
- src: {
- type: "string",
- source: "attribute",
- selector: "video",
- attribute: "src"
- },
- playsInline: {
- type: "boolean",
- source: "attribute",
- selector: "video",
- attribute: "playsinline"
- },
- tracks: {
- type: "array",
- items: {
- type: "object"
- },
- "default": []
- }
- },
- supports: {
- anchor: true,
- align: true
- },
- editorStyle: "wp-block-video-editor",
- style: "wp-block-video"
- };
- const {
- name: video_name
- } = video_metadata;
- const video_settings = {
- icon: library_video,
- example: {
- attributes: {
- src: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm',
- // translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block.
- caption: (0,external_wp_i18n_namespaceObject.__)('Wood thrush singing in Central Park, NYC.')
- }
- },
- transforms: video_transforms,
- edit: video_edit,
- save: video_save_save
- };
- ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/index.js
- /**
- * WordPress dependencies
- */
- /**
- * Internal dependencies
- */
- /**
- * Function to register an individual block.
- *
- * @param {Object} block The block to be registered.
- *
- */
- const registerBlock = block => {
- if (!block) {
- return;
- }
- const {
- metadata,
- settings,
- name
- } = block;
- (0,external_wp_blocks_namespaceObject.registerBlockType)({
- name,
- ...metadata
- }, settings);
- };
- /**
- * Function to get all the core blocks in an array.
- *
- * @example
- * ```js
- * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';
- *
- * const coreBlocks = __experimentalGetCoreBlocks();
- * ```
- */
- const __experimentalGetCoreBlocks = () => [// Common blocks are grouped at the top to prioritize their display
- // in various contexts — like the inserter and auto-complete components.
- build_module_paragraph_namespaceObject, build_module_image_namespaceObject, build_module_heading_namespaceObject, build_module_gallery_namespaceObject, build_module_list_namespaceObject, build_module_quote_namespaceObject, // Register all remaining core blocks.
- archives_namespaceObject, build_module_audio_namespaceObject, build_module_button_namespaceObject, build_module_buttons_namespaceObject, build_module_calendar_namespaceObject, categories_namespaceObject, window.wp && window.wp.oldEditor ? freeform_namespaceObject : null, // Only add the classic block in WP Context.
- build_module_code_namespaceObject, build_module_column_namespaceObject, build_module_columns_namespaceObject, build_module_cover_namespaceObject, embed_namespaceObject, build_module_file_namespaceObject, build_module_group_namespaceObject, build_module_html_namespaceObject, latest_comments_namespaceObject, latest_posts_namespaceObject, media_text_namespaceObject, missing_namespaceObject, build_module_more_namespaceObject, nextpage_namespaceObject, page_list_namespaceObject, pattern_namespaceObject, build_module_preformatted_namespaceObject, build_module_pullquote_namespaceObject, block_namespaceObject, build_module_rss_namespaceObject, build_module_search_namespaceObject, build_module_separator_namespaceObject, build_module_shortcode_namespaceObject, social_link_namespaceObject, social_links_namespaceObject, spacer_namespaceObject, build_module_table_namespaceObject, // tableOfContents,
- tag_cloud_namespaceObject, text_columns_namespaceObject, build_module_verse_namespaceObject, build_module_video_namespaceObject, // theme blocks
- build_module_navigation_namespaceObject, navigation_link_namespaceObject, navigation_submenu_namespaceObject, build_module_site_logo_namespaceObject, site_title_namespaceObject, site_tagline_namespaceObject, query_namespaceObject, template_part_namespaceObject, avatar_namespaceObject, build_module_post_title_namespaceObject, build_module_post_excerpt_namespaceObject, build_module_post_featured_image_namespaceObject, build_module_post_content_namespaceObject, build_module_post_author_namespaceObject, build_module_post_date_namespaceObject, build_module_post_terms_namespaceObject, post_navigation_link_namespaceObject, post_template_namespaceObject, build_module_query_pagination_namespaceObject, build_module_query_pagination_next_namespaceObject, build_module_query_pagination_numbers_namespaceObject, build_module_query_pagination_previous_namespaceObject, query_no_results_namespaceObject, read_more_namespaceObject, build_module_comment_author_name_namespaceObject, build_module_comment_content_namespaceObject, comment_date_namespaceObject, build_module_comment_edit_link_namespaceObject, build_module_comment_reply_link_namespaceObject, comment_template_namespaceObject, comments_title_namespaceObject, comments_query_loop_namespaceObject, comments_pagination_namespaceObject, comments_pagination_next_namespaceObject, comments_pagination_numbers_namespaceObject, comments_pagination_previous_namespaceObject, build_module_post_comments_namespaceObject, build_module_post_comments_form_namespaceObject, home_link_namespaceObject, loginout_namespaceObject, build_module_term_description_namespaceObject, build_module_query_title_namespaceObject, post_author_biography_namespaceObject];
- /**
- * Function to register core blocks provided by the block editor.
- *
- * @param {Array} blocks An optional array of the core blocks being registered.
- *
- * @example
- * ```js
- * import { registerCoreBlocks } from '@wordpress/block-library';
- *
- * registerCoreBlocks();
- * ```
- */
- const registerCoreBlocks = function () {
- let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __experimentalGetCoreBlocks();
- blocks.forEach(registerBlock);
- (0,external_wp_blocks_namespaceObject.setDefaultBlockName)(paragraph_name);
- if (window.wp && window.wp.oldEditor) {
- (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)(freeform_name);
- }
- (0,external_wp_blocks_namespaceObject.setUnregisteredTypeHandlerName)(missing_name);
- (0,external_wp_blocks_namespaceObject.setGroupingBlockName)(group_name);
- };
- /**
- * Function to register experimental core blocks depending on editor settings.
- *
- * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.
- * @example
- * ```js
- * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
- *
- * __experimentalRegisterExperimentalCoreBlocks( settings );
- * ```
- */
- const __experimentalRegisterExperimentalCoreBlocks = false ? 0 : undefined;
- }();
- (window.wp = window.wp || {}).blockLibrary = __webpack_exports__;
- /******/ })()
- ;
|