1 line
2.0 KiB
JavaScript
1 line
2.0 KiB
JavaScript
(()=>{"use strict";var e,i={7301:()=>{const e=window.wp.blocks,i=(window.wp.i18n,window.wp.blockEditor),t=window.wp.data,r=window.ReactJSXRuntime,l=JSON.parse('{"UU":"carhop-blocks/highlight-timeline"}');(0,e.registerBlockType)(l.UU,{icon:{src:(0,r.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",children:(0,r.jsx)("path",{d:"M16 24L8 16L16 8L24 16L16 24Z"})})},edit:function({attributes:e,setAttributes:l,...s}){const o=(0,t.useSelect)(e=>{const{getBlocks:i}=e("core/block-editor");return(i(s.clientId)||[]).filter(e=>"carhop-blocks/highlight-timeline-step"===e.name).map(e=>e.attributes?.year).filter(e=>null!=e&&""!==e)},[s.clientId]);return(0,r.jsxs)("div",{...(0,i.useBlockProps)({className:"highlight-timeline"}),children:[(0,r.jsx)("div",{className:"highlight-timeline__innerblocks",children:(0,r.jsx)(i.InnerBlocks,{allowedBlocks:["carhop-blocks/highlight-timeline-step"]})}),(0,r.jsx)("ul",{className:"highlight-timeline__years",children:o.map((e,i)=>(0,r.jsx)("li",{className:"story-timeline__year",children:e},i))})]})},save:function({attributes:e}){return(0,r.jsx)(i.InnerBlocks.Content,{})}})}},t={};function r(e){var l=t[e];if(void 0!==l)return l.exports;var s=t[e]={exports:{}};return i[e](s,s.exports,r),s.exports}r.m=i,e=[],r.O=(i,t,l,s)=>{if(!t){var o=1/0;for(h=0;h<e.length;h++){for(var[t,l,s]=e[h],n=!0,c=0;c<t.length;c++)(!1&s||o>=s)&&Object.keys(r.O).every(e=>r.O[e](t[c]))?t.splice(c--,1):(n=!1,s<o&&(o=s));if(n){e.splice(h--,1);var a=l();void 0!==a&&(i=a)}}return i}s=s||0;for(var h=e.length;h>0&&e[h-1][2]>s;h--)e[h]=e[h-1];e[h]=[t,l,s]},r.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),(()=>{var e={2454:0,3690:0};r.O.j=i=>0===e[i];var i=(i,t)=>{var l,s,[o,n,c]=t,a=0;if(o.some(i=>0!==e[i])){for(l in n)r.o(n,l)&&(r.m[l]=n[l]);if(c)var h=c(r)}for(i&&i(t);a<o.length;a++)s=o[a],r.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return r.O(h)},t=globalThis.webpackChunkcarhop_blocks=globalThis.webpackChunkcarhop_blocks||[];t.forEach(i.bind(null,0)),t.push=i.bind(null,t.push.bind(t))})();var l=r.O(void 0,[3690],()=>r(7301));l=r.O(l)})(); |