1 line
4.0 KiB
JavaScript
1 line
4.0 KiB
JavaScript
(()=>{"use strict";var e,r={2841:()=>{const e=window.wp.blocks,r=(window.wp.i18n,window.wp.blockEditor),n=window.wp.components,t=window.React;var o,l;function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},i.apply(null,arguments)}var s,a,c=function(e){return t.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 32 32"},e),o||(o=t.createElement("g",{fill:"none",stroke:"currentColor",strokeWidth:2},t.createElement("path",{d:"m21.15 10.59-9.38 10.02M21.15 21.4V10.59H10.83"}))),l||(l=t.createElement("circle",{cx:16,cy:16,r:15,fill:"none",stroke:"currentColor",strokeWidth:2})))};function h(){return h=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},h.apply(null,arguments)}var u=function(e){return t.createElement("svg",h({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 32 32"},e),s||(s=t.createElement("circle",{cx:16,cy:16,r:15,fill:"none",stroke:"currentColor",strokeWidth:2})),a||(a=t.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 9v11m-5-3 5 6 5-6"})))};const d=window.ReactJSXRuntime,p=JSON.parse('{"UU":"carhop-blocks/cta"}');(0,e.registerBlockType)(p.UU,{icon:{src:(0,d.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",children:[(0,d.jsxs)("g",{children:[(0,d.jsx)("path",{d:"M21.15,10.59l-9.38,10.02",stroke:"#136f63",fill:"none",strokeWidth:"3"}),(0,d.jsx)("path",{d:"M21.15,21.4v-10.81h-10.32",stroke:"#136f63",fill:"none",strokeWidth:"3"})]}),(0,d.jsx)("circle",{cx:"16",cy:"16",r:"15",stroke:"#136f63",fill:"none",strokeWidth:"3"})]})},edit:function({attributes:e,setAttributes:t}){const{color:o,link:l}=e,i=(0,r.useSetting)("color.palette.theme"),s="string"==typeof l?.url&&l.url.startsWith("#");return console.log(e),console.log(l),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(r.BlockControls,{children:(0,d.jsx)(r.AlignmentToolbar,{value:e.align,onChange:e=>t({align:e})})}),(0,d.jsx)(r.InspectorControls,{children:(0,d.jsxs)(n.PanelBody,{title:"Lien",initialOpen:!0,children:[(0,d.jsx)("div",{children:(0,d.jsx)(r.__experimentalLinkControl,{value:e.link,label:"Lien",onSelect:e=>{console.log("onSelect"),console.log(e)},onChange:e=>{var r;(r=e)?(r.url&&(r.title=r.url),console.log(r),t({link:r})):t({link:void 0})}},"link-control")}),(0,d.jsx)(n.PanelBody,{title:"Couleur",initialOpen:!0,children:(0,d.jsx)(n.PanelRow,{children:(0,d.jsx)(n.ColorPalette,{value:o,onChange:e=>{!function(e){t({color:e})}(e)},colors:i,disableCustomColors:!0})})})]})}),(0,d.jsxs)("div",{...(0,r.useBlockProps)({className:`cta align--${e.align}${s?" cta--hash-link":""}`,style:{"--cta-current-color":o}}),children:[(0,d.jsx)(r.RichText,{tagName:"a",placeholder:"Ajouter un lien",value:e.text,onChange:e=>t({text:e}),allowedFormats:[]}),s?(0,d.jsx)(u,{style:{color:o}}):(0,d.jsx)(c,{style:{color:o}})]})]})},save:function({attributes:e}){}})}},n={};function t(e){var o=n[e];if(void 0!==o)return o.exports;var l=n[e]={exports:{}};return r[e](l,l.exports,t),l.exports}t.m=r,e=[],t.O=(r,n,o,l)=>{if(!n){var i=1/0;for(h=0;h<e.length;h++){for(var[n,o,l]=e[h],s=!0,a=0;a<n.length;a++)(!1&l||i>=l)&&Object.keys(t.O).every(e=>t.O[e](n[a]))?n.splice(a--,1):(s=!1,l<i&&(i=l));if(s){e.splice(h--,1);var c=o();void 0!==c&&(r=c)}}return r}l=l||0;for(var h=e.length;h>0&&e[h-1][2]>l;h--)e[h]=e[h-1];e[h]=[n,o,l]},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={7010:0,3350:0};t.O.j=r=>0===e[r];var r=(r,n)=>{var o,l,[i,s,a]=n,c=0;if(i.some(r=>0!==e[r])){for(o in s)t.o(s,o)&&(t.m[o]=s[o]);if(a)var h=a(t)}for(r&&r(n);c<i.length;c++)l=i[c],t.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return t.O(h)},n=globalThis.webpackChunkcarhop_blocks=globalThis.webpackChunkcarhop_blocks||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})();var o=t.O(void 0,[3350],()=>t(2841));o=t.O(o)})(); |