Changeset 3228821
- Timestamp:
- 01/26/2025 01:56:14 PM (14 months ago)
- Location:
- simple-tabs-block
- Files:
-
- 16 edited
- 1 copied
-
tags/2.2.1 (copied) (copied from simple-tabs-block/trunk)
-
tags/2.2.1/build/tab/block.json (modified) (1 diff)
-
tags/2.2.1/build/tab/index.asset.php (modified) (1 diff)
-
tags/2.2.1/build/tab/index.js (modified) (1 diff)
-
tags/2.2.1/build/tabs/block.json (modified) (2 diffs)
-
tags/2.2.1/build/tabs/index.asset.php (modified) (1 diff)
-
tags/2.2.1/build/tabs/index.js (modified) (2 diffs)
-
tags/2.2.1/readme.txt (modified) (2 diffs)
-
tags/2.2.1/simple-tabs-block.php (modified) (1 diff)
-
trunk/build/tab/block.json (modified) (1 diff)
-
trunk/build/tab/index.asset.php (modified) (1 diff)
-
trunk/build/tab/index.js (modified) (1 diff)
-
trunk/build/tabs/block.json (modified) (2 diffs)
-
trunk/build/tabs/index.asset.php (modified) (1 diff)
-
trunk/build/tabs/index.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/simple-tabs-block.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
simple-tabs-block/tags/2.2.1/build/tab/block.json
r3189523 r3228821 3 3 "apiVersion": 2, 4 4 "name": "cloudcatch/tab", 5 "version": "2.2. 0",5 "version": "2.2.1", 6 6 "title": "Tab", 7 7 "category": "design", -
simple-tabs-block/tags/2.2.1/build/tab/index.asset.php
r3189523 r3228821 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' b7211c8a79b62ff2049e');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'd4ef49167187e17262f3'); -
simple-tabs-block/tags/2.2.1/build/tab/index.js
r3189523 r3228821 1 (()=>{var e={942:(e,t)=>{var a;!function(){"use strict";var o={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=r(e,c(a)))}return e}function c(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)o.call(e,a)&&e[a]&&(t=r(t,a));return t}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},t={};function a(o){var n=t[o];if(void 0!==n)return n.exports;var c=t[o]={exports:{}};return e[o](c,c.exports,a),c.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.i18n,t=window.wp.blocks;var o=a(942),n=a.n(o);let c=e=>crypto.getRandomValues(new Uint8Array(e));const r=window.wp.components,i=window.wp.element,s=window.wp.blockEditor,l=window.ReactJSXRuntime,d=[{attributes:{index:{type:"number"},label:{type:"string",default:"Title"},showDescription:{type:"boolean",default:!1},description:{type:"string",default:""}},save({attributes:e}){const{index:t}=e,a=s.useInnerBlocksProps.save({tabid:t,className:"wp-block-cloudcatch-tab"});return(0,l.jsx)("div",{...a})}}];(0,t.registerBlockType)("cloudcatch/tab",{edit:function({attributes:t,setAttributes:a,context:o}){var d;const{id:b,index:u,label:p,showDescription:h,description:x}=t;(0,i.useEffect)((()=>{if(!b){const e=((e,t=21)=>((e,t,a)=>{let o=(2<<Math.log2(e.length-1))-1,n=-~(1.6*o*t/e.length);return(c=t)=>{let r="";for(;;){let t=a(n),i= n;for(;i--;)if(r+=e[t[i]&o]||"",r.length===c)return r}}})(e,t,c))("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",11);a({id:e()})}}),[]);const v=(0,s.useBlockProps)({className:n()({active:b===o["cloudcatch/tabs/activeTab"]}),role:"tab",tabIndex:"0",tabid:u}),w=(0,s.useInnerBlocksProps)({tabid:u,className:n()("wp-block-cloudcatch-tab-content",{active:b===o["cloudcatch/tabs/activeTab"]}),style:{display:b===o["cloudcatch/tabs/activeTab"]?"block":"none"}});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.InspectorControls,{children:(0,l.jsxs)(r.PanelBody,{children:[(0,l.jsx)(r.TextControl,{label:(0,e.__)("Tab label"),value:p,onChange:e=>a({label:e}),__nextHasNoMarginBottom:!0}),(0,l.jsx)(r.ToggleControl,{label:(0,e.__)("Show description"),checked:h,onChange:()=>a({showDescription:!h}),__nextHasNoMarginBottom:!0})]})}),(0,l.jsxs)("div",{...v,children:[(0,l.jsx)(s.RichText,{tagName:"label",value:null!==(d=t?.label)&&void 0!==d?d:(0,e.__)("Title"),onChange:e=>a({label:e}),className:"wp-block-cloudcatch-tab__label"}),h&&(0,l.jsx)(s.RichText,{"aria-label":(0,e.__)("Description"),placeholder:(0,e.__)("Add text…"),value:x,onChange:e=>a({description:e}),identifier:"div",className:"wp-block-cloudcatch-tab__description"})]}),(0,l.jsx)("div",{...w})]})},icon:()=>(0,l.jsx)(r.Icon,{icon:()=>(0,l.jsxs)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,l.jsx)(r.Path,{d:"M19.1 7.8h-7.5v-.7c0-1-.8-1.8-1.8-1.8h-5c-1 0-1.8.8-1.8 1.8v11.6c0 1 .8 1.8 1.8 1.8h14.3c1 0 1.8-.8 1.8-1.8V9.5c0-.9-.8-1.7-1.8-1.7zm.3 10.9c0 .1-.1.3-.3.3H4.9c-.1 0-.3-.1-.3-.3V7.1c0-.1.1-.3.3-.3h5c.1 0 .3.1.3.3V9.2h9.1c.1 0 .3.1.3.3v9.2z"}),(0,l.jsx)(r.Path,{d:"M16.8 13.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM16.8 16.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8z"})]})}),save:function({attributes:t}){const{index:a,label:o,showDescription:n,description:c}=t,r=s.useBlockProps.save({role:"tab",tabIndex:"0",tabid:a}),i=s.useInnerBlocksProps.save({tabid:a,className:"wp-block-cloudcatch-tab-content"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{...r,children:[(0,l.jsx)("label",{className:"wp-block-cloudcatch-tab__label",children:null!=o?o:(0,e.__)("Title","simple-tabs-block")}),n&&c.length>0&&(0,l.jsx)("div",{"aria-label":"Description",className:"wp-block-cloudcatch-tab__description",children:c})]}),(0,l.jsx)("div",{...i})]})},deprecated:d,example:{name:"cloudcatch/tab",attributes:{id:"500",index:0,label:(0,e.__)("Tab 1","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{1 (()=>{var e={942:(e,t)=>{var a;!function(){"use strict";var o={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=r(e,c(a)))}return e}function c(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)o.call(e,a)&&e[a]&&(t=r(t,a));return t}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},t={};function a(o){var n=t[o];if(void 0!==n)return n.exports;var c=t[o]={exports:{}};return e[o](c,c.exports,a),c.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.i18n,t=window.wp.blocks;var o=a(942),n=a.n(o);let c=e=>crypto.getRandomValues(new Uint8Array(e));const r=window.wp.components,i=window.wp.element,s=window.wp.blockEditor,l=window.ReactJSXRuntime,d=[{attributes:{index:{type:"number"},label:{type:"string",default:"Title"},showDescription:{type:"boolean",default:!1},description:{type:"string",default:""}},save({attributes:e}){const{index:t}=e,a=s.useInnerBlocksProps.save({tabid:t,className:"wp-block-cloudcatch-tab"});return(0,l.jsx)("div",{...a})}}];(0,t.registerBlockType)("cloudcatch/tab",{edit:function({attributes:t,setAttributes:a,context:o}){var d;const{id:b,index:u,label:p,showDescription:h,description:x}=t;(0,i.useEffect)((()=>{if(!b){const e=((e,t=21)=>((e,t,a)=>{let o=(2<<Math.log2(e.length-1))-1,n=-~(1.6*o*t/e.length);return(c=t)=>{let r="";for(;;){let t=a(n),i=0|n;for(;i--;)if(r+=e[t[i]&o]||"",r.length>=c)return r}}})(e,0|t,c))("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",11);a({id:e()})}}),[]);const v=(0,s.useBlockProps)({className:n()({active:b===o["cloudcatch/tabs/activeTab"]}),role:"tab",tabIndex:"0",tabid:u}),w=(0,s.useInnerBlocksProps)({tabid:u,className:n()("wp-block-cloudcatch-tab-content",{active:b===o["cloudcatch/tabs/activeTab"]}),style:{display:b===o["cloudcatch/tabs/activeTab"]?"block":"none"}});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.InspectorControls,{children:(0,l.jsxs)(r.PanelBody,{children:[(0,l.jsx)(r.TextControl,{label:(0,e.__)("Tab label"),value:p,onChange:e=>a({label:e}),__nextHasNoMarginBottom:!0}),(0,l.jsx)(r.ToggleControl,{label:(0,e.__)("Show description"),checked:h,onChange:()=>a({showDescription:!h}),__nextHasNoMarginBottom:!0})]})}),(0,l.jsxs)("div",{...v,children:[(0,l.jsx)(s.RichText,{tagName:"label",value:null!==(d=t?.label)&&void 0!==d?d:(0,e.__)("Title"),onChange:e=>a({label:e}),className:"wp-block-cloudcatch-tab__label"}),h&&(0,l.jsx)(s.RichText,{"aria-label":(0,e.__)("Description"),placeholder:(0,e.__)("Add text…"),value:x,onChange:e=>a({description:e}),identifier:"div",className:"wp-block-cloudcatch-tab__description"})]}),(0,l.jsx)("div",{...w})]})},icon:()=>(0,l.jsx)(r.Icon,{icon:()=>(0,l.jsxs)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,l.jsx)(r.Path,{d:"M19.1 7.8h-7.5v-.7c0-1-.8-1.8-1.8-1.8h-5c-1 0-1.8.8-1.8 1.8v11.6c0 1 .8 1.8 1.8 1.8h14.3c1 0 1.8-.8 1.8-1.8V9.5c0-.9-.8-1.7-1.8-1.7zm.3 10.9c0 .1-.1.3-.3.3H4.9c-.1 0-.3-.1-.3-.3V7.1c0-.1.1-.3.3-.3h5c.1 0 .3.1.3.3V9.2h9.1c.1 0 .3.1.3.3v9.2z"}),(0,l.jsx)(r.Path,{d:"M16.8 13.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM16.8 16.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8z"})]})}),save:function({attributes:t}){const{index:a,label:o,showDescription:n,description:c}=t,r=s.useBlockProps.save({role:"tab",tabIndex:"0",tabid:a}),i=s.useInnerBlocksProps.save({tabid:a,className:"wp-block-cloudcatch-tab-content"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{...r,children:[(0,l.jsx)("label",{className:"wp-block-cloudcatch-tab__label",children:null!=o?o:(0,e.__)("Title","simple-tabs-block")}),n&&c.length>0&&(0,l.jsx)("div",{"aria-label":"Description",className:"wp-block-cloudcatch-tab__description",children:c})]}),(0,l.jsx)("div",{...i})]})},deprecated:d,example:{name:"cloudcatch/tab",attributes:{id:"500",index:0,label:(0,e.__)("Tab 1","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{ 2 2 /* translators: example text. */ 3 3 content:(0,e.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.","simple-tabs-block")}}]}})})()})(); -
simple-tabs-block/tags/2.2.1/build/tabs/block.json
r3189523 r3228821 3 3 "apiVersion": 2, 4 4 "name": "cloudcatch/tabs", 5 "version": "2.2. 0",5 "version": "2.2.1", 6 6 "title": "Tabs", 7 7 "category": "design", … … 88 88 "allowSwitching": false, 89 89 "allowInheriting": false, 90 "allowEditing": false, 90 91 "default": { 91 92 "type": "flex" -
simple-tabs-block/tags/2.2.1/build/tabs/index.asset.php
r3189523 r3228821 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => ' be5457baeeb5faa6a51f');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '9eac05f9c436150a7761'); -
simple-tabs-block/tags/2.2.1/build/tabs/index.js
r3189523 r3228821 1 (()=>{var t,e={180:(t,e,r)=>{"use strict";const a=window.wp.i18n,o=window.wp.blocks;var n=r(942), c=r.n(n),i=r(638),s=r.n(i);const l=window.wp.blockEditor,u=window.wp.element,p=window.wp.components,d=window.wp.data,b=window.wp.compose,f=window.ReactJSXRuntime,v=["cloudcatch/tab"],h={name:"cloudcatch/tab"},m=(0,b.compose)((0,d.withSelect)(((t,{clientId:e})=>({innerBlocks:t("core/block-editor").getBlocks(e)}))),(0,d.withDispatch)(((t,{clientId:e},{select:r})=>{const{getBlock:a}=r("core/block-editor"),{updateBlockAttributes:o}=t("core/block-editor"),n=a(e),{selectBlock:c}=t(l.store);return{selectBlock(t){c(t)},resetTabOrder(){const t=[];s()(n.innerBlocks.length,(e=>{o(n.innerBlocks[e].clientId,{index:e}),t.push(n.innerBlocks[e].attributes.id)})),o(e,{tabs:t})},updateActiveTab(t){o(n.clientId,{activeTab:t})}}})))((function({attributes:t,setAttributes:e,innerBlocks:r,clientId:o,updateActiveTab:n,resetTabOrder:i}){const{defaultTab:s,activeTab:b,layout:{justifyContent:m,orientation:w="horizontal",flexWrap:g="wrap"}={}}=t;(0,u.useEffect)((()=>{i()}),[r]);const{getSelectedBlock:k}=(0,d.select)(l.store),{innerBlockCount:x,selectedBlock:j,innerBlockIds:y}=(0,d.useSelect)((t=>({innerBlockCount:t(l.store).getBlock(o)?.innerBlocks?.length,selectedBlock:k(),innerBlockIds:t(l.store).getBlock(o)?.innerBlocks.map((t=>t.attributes.id)).filter((t=>void 0!==t))})),[o]);(0,u.useEffect)((()=>{!b&&y.length&&n(y[0])}),[y]),(0,u.useEffect)((()=>{j&&y.includes(j?.attributes?.id)&&n(j.attributes.id)}),[j]);const _=(0,l.useBlockProps)({className:c()("wp-block-cloudcatch-tabs__wrapper","wp-block-cloudcatch-tabs-v2"),"data-default-tab":s||void 0}),B=(0,l.useInnerBlocksProps)({className:c()("wp-block-cloudcatch-tabs__container",{"items-justified-right":"right"===m,"items-justified-space-between":"space-between"===m,"items-justified-left":"left"===m,"items-justified-center":"center"===m,"is-vertical":"vertical"===w,"no-wrap":"nowrap"===g}),style:{gridTemplateColumns:"vertical"!==w?`repeat(${x}, auto) ${"left"===m?"1fr":"auto"}`:void 0,gridTemplateRows:"vertical"===w?`repeat(${x}, auto) 1fr`:void 0}},{renderAppender:l.InnerBlocks.ButtonBlockAppender,allowedBlocks:v,defaultBlock:h,directInsert:!0,templateLock:!1,template:[["cloudcatch/tab",{label:"Tab 1"},[["core/paragraph",{content:"Tab 1 Content"}]]],["cloudcatch/tab",{label:"Tab 2"},[["core/paragraph",{content:"Tab 2 Content"}]]],["cloudcatch/tab",{label:"Tab 3"},[["core/paragraph",{content:"Tab 3 Content"}]]]]});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(l.InspectorControls,{children:(0,f.jsx)(p.PanelBody,{children:(0,f.jsx)(p.SelectControl,{label:(0,a.__)("Default open tab","simple-tabs-block"),value:s,options:r.map(((t,e)=>({value:e,label:t.attributes.label}))),onChange:t=>e({defaultTab:parseInt(t)}),__nextHasNoMarginBottom:!0})})}),(0,f.jsx)("div",{..._,children:(0,f.jsx)("div",{...B})})]})})),w=[{attributes:{uuid:{type:"string"},tabs:{type:"array",default:[]},defaultTab:{type:"number",default:0},activeTab:{type:"string",default:""}},save({attributes:t}){const{uuid:e,tabs:r,defaultTab:o,layout:{justifyContent:n,orientation:i="horizontal",flexWrap:s="wrap"}={}}=t,u=c()("wp-block-cloudcatch-tabs__wrapper",{"items-justified-right":"right"===n,"items-justified-space-between":"space-between"===n,"items-justified-left":"left"===n,"items-justified-center":"center"===n,"is-vertical":"vertical"===i,"no-wrap":"nowrap"===s});return(0,f.jsxs)("div",{...l.useBlockProps.save({className:u}),children:[(0,f.jsx)("div",{className:"wp-block-cloudcatch-tabs__tabs-wrapper",children:(0,f.jsx)("div",{className:"wp-block-cloudcatch-tabs__tabs",role:"tablist","aria-orientation":i,children:r.map(((t,e)=>{var r,n;return(0,f.jsxs)("div",{children:[(0,f.jsx)(l.RichText.Content,{value:null!==(r=t?.attributes?.label)&&void 0!==r?r:(0,a.__)("Title"),tagName:"label",tabIndex:"0",role:"tab",tabid:e,className:c()("wp-block-cloudcatch-tab__label",t?.attributes?.className,{active:e===o})},e),t?.attributes?.showDescription&&(0,f.jsx)(l.RichText.Content,{value:null!==(n=t?.attributes?.description)&&void 0!==n?n:(0,a.__)("Description"),tagName:"div",className:"wp-block-cloudcatch-tab__description"})]},e)}))})}),(0,f.jsx)("div",{...l.useInnerBlocksProps.save({className:"wp-block-cloudcatch-tabs__container"})})]})}}];(0,o.registerBlockType)("cloudcatch/tabs",{edit:m,icon:()=>(0,f.jsx)(p.Icon,{icon:()=>(0,f.jsxs)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,f.jsx)(p.Path,{d:"M19.1 7.8h-7.5v-.7c0-1-.8-1.8-1.8-1.8h-5c-1 0-1.8.8-1.8 1.8v11.6c0 1 .8 1.8 1.8 1.8h14.3c1 0 1.8-.8 1.8-1.8V9.5c0-.9-.8-1.7-1.8-1.7zm.3 10.9c0 .1-.1.3-.3.3H4.9c-.1 0-.3-.1-.3-.3V7.1c0-.1.1-.3.3-.3h5c.1 0 .3.1.3.3V9.2h9.1c.1 0 .3.1.3.3v9.2z"}),(0,f.jsx)(p.Path,{d:"M16.8 13.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM16.8 16.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM15.1 6.9h-2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7h2c.4 0 .8.3.8.7-.1.3-.4.7-.8.7zM19.2 6.9h-2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7h2c.4 0 .8.3.8.7-.1.3-.4.7-.8.7z"})]})}),save:function({attributes:t}){const{tabs:e,defaultTab:r,layout:{justifyContent:a,orientation:o="horizontal",flexWrap:n="wrap"}={}}=t,i=e.length,s=l.useBlockProps.save({className:c()("wp-block-cloudcatch-tabs__wrapper","wp-block-cloudcatch-tabs-v2"),"data-default-tab":r||void 0}),u=l.useInnerBlocksProps.save({className:c()("wp-block-cloudcatch-tabs__container",{"items-justified-right":"right"===a,"items-justified-space-between":"space-between"===a,"items-justified-left":"left"===a,"items-justified-center":"center"===a,"is-vertical":"vertical"===o,"no-wrap":"nowrap"===n}),style:{gridTemplateColumns:"vertical"!==o?`repeat(${i}, auto) ${"left"===a?"1fr":"auto"}`:void 0,gridTemplateRows:"vertical"===o?`repeat(${i}, auto) 1fr`:void 0}});return(0,f.jsx)("div",{...s,children:(0,f.jsx)("div",{...u})})},deprecated:w,example:{attributes:{tabs:["500","501","502"]},innerBlocks:[{name:"cloudcatch/tab",attributes:{id:"500",index:0,label:(0,a.__)("Tab 1","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{1 (()=>{var t,e={180:(t,e,r)=>{"use strict";const a=window.wp.i18n,o=window.wp.blocks;var n=r(942),i=r.n(n),c=r(638),s=r.n(c);const l=window.wp.blockEditor,u=window.wp.element,p=window.wp.components,d=window.wp.data,b=window.wp.compose,f=window.ReactJSXRuntime,v=["cloudcatch/tab"],h={name:"cloudcatch/tab"},m=(0,b.compose)((0,d.withSelect)(((t,{clientId:e})=>({innerBlocks:t("core/block-editor").getBlocks(e)}))),(0,d.withDispatch)(((t,{clientId:e},{select:r})=>{const{getBlock:a}=r("core/block-editor"),{updateBlockAttributes:o}=t("core/block-editor"),n=a(e),{selectBlock:i}=t(l.store);return{selectBlock(t){i(t)},resetTabOrder(){const t=[];s()(n.innerBlocks.length,(e=>{o(n.innerBlocks[e].clientId,{index:e}),t.push(n.innerBlocks[e].attributes.id)})),o(e,{tabs:t})},updateActiveTab(t){o(n.clientId,{activeTab:t})}}})))((function({attributes:t,setAttributes:e,innerBlocks:r,clientId:o,updateActiveTab:n,resetTabOrder:c}){const{defaultTab:s,activeTab:b,layout:{justifyContent:m,orientation:w="horizontal",flexWrap:g="wrap"}={}}=t;(0,u.useEffect)((()=>{c()}),[r]);const{getSelectedBlock:k}=(0,d.select)(l.store),{innerBlockCount:j,selectedBlock:x,innerBlockIds:y}=(0,d.useSelect)((t=>({innerBlockCount:t(l.store).getBlock(o)?.innerBlocks?.length,selectedBlock:k(),innerBlockIds:t(l.store).getBlock(o)?.innerBlocks.map((t=>t.attributes.id)).filter((t=>void 0!==t))})),[o]);(0,u.useEffect)((()=>{!b&&y.length&&n(y[0])}),[y]),(0,u.useEffect)((()=>{x&&y.includes(x?.attributes?.id)&&n(x.attributes.id)}),[x]);const _=(0,l.useBlockProps)({className:i()("wp-block-cloudcatch-tabs__wrapper","wp-block-cloudcatch-tabs-v2"),"data-default-tab":s||void 0}),B=(0,l.useInnerBlocksProps)({className:i()("wp-block-cloudcatch-tabs__container",{"items-justified-right":"right"===m,"items-justified-space-between":"space-between"===m,"items-justified-left":"left"===m,"items-justified-center":"center"===m,"is-vertical":"vertical"===w,"no-wrap":"nowrap"===g}),style:{gridTemplateColumns:"vertical"!==w?`repeat(${j}, auto) ${"left"===m?"1fr":"auto"}`:void 0,gridTemplateRows:"vertical"===w?`repeat(${j}, auto) 1fr`:void 0}},{renderAppender:l.InnerBlocks.ButtonBlockAppender,allowedBlocks:v,defaultBlock:h,directInsert:!0,templateLock:!1,template:[["cloudcatch/tab",{label:"Tab 1"},[["core/paragraph",{content:"Tab 1 Content"}]]],["cloudcatch/tab",{label:"Tab 2"},[["core/paragraph",{content:"Tab 2 Content"}]]],["cloudcatch/tab",{label:"Tab 3"},[["core/paragraph",{content:"Tab 3 Content"}]]]]});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(l.InspectorControls,{children:(0,f.jsx)(p.PanelBody,{children:(0,f.jsx)(p.SelectControl,{label:(0,a.__)("Default open tab","simple-tabs-block"),value:s,options:r.map(((t,e)=>({value:e,label:t.attributes.label}))),onChange:t=>e({defaultTab:parseInt(t)}),__nextHasNoMarginBottom:!0})})}),(0,f.jsx)("div",{..._,children:(0,f.jsx)("div",{...B})})]})})),w=[{attributes:{uuid:{type:"string"},tabs:{type:"array",default:[]},defaultTab:{type:"number",default:0},activeTab:{type:"string",default:""}},save({attributes:t}){const{tabs:e,defaultTab:r,layout:{justifyContent:a,orientation:o="horizontal",flexWrap:n="wrap"}={}}=t,c=e.length,s=l.useBlockProps.save({className:i()("wp-block-cloudcatch-tabs__wrapper","wp-block-cloudcatch-tabs-v2"),"data-default-tab":r||void 0}),u=l.useInnerBlocksProps.save({className:i()("wp-block-cloudcatch-tabs__container",{"items-justified-right":"right"===a,"items-justified-space-between":"space-between"===a,"items-justified-left":"left"===a,"items-justified-center":"center"===a,"is-vertical":"vertical"===o,"no-wrap":"nowrap"===n}),style:{gridTemplateColumns:"vertical"!==o?`repeat(${c}, auto) ${"left"===a?"1fr":"auto"}`:void 0,gridTemplateRows:"vertical"===o?`repeat(${c}, auto) 1fr`:void 0}});return(0,f.jsx)("div",{...s,children:(0,f.jsx)("div",{...u})})}},{attributes:{uuid:{type:"string"},tabs:{type:"array",default:[]},defaultTab:{type:"number",default:0},activeTab:{type:"string",default:""}},save({attributes:t}){const{tabs:e,defaultTab:r,layout:{justifyContent:o,orientation:n="horizontal",flexWrap:c="wrap"}={}}=t,s=i()("wp-block-cloudcatch-tabs__wrapper",{"items-justified-right":"right"===o,"items-justified-space-between":"space-between"===o,"items-justified-left":"left"===o,"items-justified-center":"center"===o,"is-vertical":"vertical"===n,"no-wrap":"nowrap"===c});return(0,f.jsxs)("div",{...l.useBlockProps.save({className:s}),children:[(0,f.jsx)("div",{className:"wp-block-cloudcatch-tabs__tabs-wrapper",children:(0,f.jsx)("div",{className:"wp-block-cloudcatch-tabs__tabs",role:"tablist","aria-orientation":n,children:e.map(((t,e)=>{var o,n;return(0,f.jsxs)("div",{children:[(0,f.jsx)(l.RichText.Content,{value:null!==(o=t?.attributes?.label)&&void 0!==o?o:(0,a.__)("Title"),tagName:"label",tabIndex:"0",role:"tab",tabid:e,className:i()("wp-block-cloudcatch-tab__label",t?.attributes?.className,{active:e===r})},e),t?.attributes?.showDescription&&(0,f.jsx)(l.RichText.Content,{value:null!==(n=t?.attributes?.description)&&void 0!==n?n:(0,a.__)("Description"),tagName:"div",className:"wp-block-cloudcatch-tab__description"})]},e)}))})}),(0,f.jsx)("div",{...l.useInnerBlocksProps.save({className:"wp-block-cloudcatch-tabs__container"})})]})}}];(0,o.registerBlockType)("cloudcatch/tabs",{edit:m,icon:()=>(0,f.jsx)(p.Icon,{icon:()=>(0,f.jsxs)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,f.jsx)(p.Path,{d:"M19.1 7.8h-7.5v-.7c0-1-.8-1.8-1.8-1.8h-5c-1 0-1.8.8-1.8 1.8v11.6c0 1 .8 1.8 1.8 1.8h14.3c1 0 1.8-.8 1.8-1.8V9.5c0-.9-.8-1.7-1.8-1.7zm.3 10.9c0 .1-.1.3-.3.3H4.9c-.1 0-.3-.1-.3-.3V7.1c0-.1.1-.3.3-.3h5c.1 0 .3.1.3.3V9.2h9.1c.1 0 .3.1.3.3v9.2z"}),(0,f.jsx)(p.Path,{d:"M16.8 13.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM16.8 16.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM15.1 6.9h-2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7h2c.4 0 .8.3.8.7-.1.3-.4.7-.8.7zM19.2 6.9h-2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7h2c.4 0 .8.3.8.7-.1.3-.4.7-.8.7z"})]})}),save:function({attributes:t}){const{tabs:e,defaultTab:r,layout:{justifyContent:a,orientation:o="horizontal",flexWrap:n="wrap"}={}}=t,c=e.length,s=l.useBlockProps.save({className:i()("wp-block-cloudcatch-tabs__wrapper","wp-block-cloudcatch-tabs-v2"),"data-default-tab":r||void 0}),u=l.useInnerBlocksProps.save({className:i()("wp-block-cloudcatch-tabs__container","wp-block-cloudcatch-tabs-is-layout-flex",{"items-justified-right":"right"===a,"items-justified-space-between":"space-between"===a,"items-justified-left":"left"===a,"items-justified-center":"center"===a,"is-vertical":"vertical"===o,"no-wrap":"nowrap"===n}),style:{gridTemplateColumns:"vertical"!==o?`repeat(${c}, auto) ${"left"===a?"1fr":"auto"}`:void 0,gridTemplateRows:"vertical"===o?`repeat(${c}, auto) 1fr`:void 0}});return(0,f.jsx)("div",{...s,children:(0,f.jsx)("div",{...u})})},deprecated:w,example:{attributes:{tabs:["500","501","502"]},innerBlocks:[{name:"cloudcatch/tab",attributes:{id:"500",index:0,label:(0,a.__)("Tab 1","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{ 2 2 /* translators: example text. */ 3 3 content:(0,a.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.","simple-tabs-block")}}]},{name:"cloudcatch/tab",attributes:{id:"501",index:1,label:(0,a.__)("Tab 2","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{ … … 5 5 content:(0,a.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}}]},{name:"cloudcatch/tab",attributes:{id:"502",index:2,label:(0,a.__)("Tab 3","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{ 6 6 /* translators: example text. */ 7 content:(0,a.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}}]}]}})},873:(t,e,r)=>{var a=r(325).Symbol;t.exports=a},552:(t,e,r)=>{var a=r(873),o=r(659),n=r(350), c=a?a.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":c&&c in Object(t)?o(t):n(t)}},96:t=>{t.exports=function(t,e){for(var r=-1,a=Array(t);++r<t;)a[r]=e(r);return a}},128:(t,e,r)=>{var a=r(800),o=/^\s+/;t.exports=function(t){return t?t.slice(0,a(t)+1).replace(o,""):t}},66:(t,e,r)=>{var a=r(488);t.exports=function(t){return"function"==typeof t?t:a}},840:(t,e,r)=>{var a="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=a},659:(t,e,r)=>{var a=r(873),o=Object.prototype,n=o.hasOwnProperty,c=o.toString,i=a?a.toStringTag:void 0;t.exports=function(t){var e=n.call(t,i),r=t[i];try{t[i]=void 0;var a=!0}catch(t){}var o=c.call(t);return a&&(e?t[i]=r:delete t[i]),o}},350:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},325:(t,e,r)=>{var a=r(840),o="object"==typeof self&&self&&self.Object===Object&&self,n=a||o||Function("return this")();t.exports=n},800:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},488:t=>{t.exports=function(t){return t}},805:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},346:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},394:(t,e,r)=>{var a=r(552),o=r(346);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==a(t)}},638:(t,e,r)=>{var a=r(96),o=r(66),n=r(489),c=4294967295,i=Math.min;t.exports=function(t,e){if((t=n(t))<1||t>9007199254740991)return[];var r=c,s=i(t,c);e=o(e),t-=c;for(var l=a(s,e);++r<t;)e(r);return l}},400:(t,e,r)=>{var a=r(374),o=1/0;t.exports=function(t){return t?(t=a(t))===o||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},489:(t,e,r)=>{var a=r(400);t.exports=function(t){var e=a(t),r=e%1;return e==e?r?e-r:e:0}},374:(t,e,r)=>{var a=r(128),o=r(805),n=r(394),c=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(n(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=a(t);var r=i.test(t);return r||s.test(t)?l(t.slice(2),r?2:8):c.test(t)?NaN:+t}},942:(t,e)=>{var r;!function(){"use strict";var a={}.hasOwnProperty;function o(){for(var t="",e=0;e<arguments.length;e++){var r=arguments[e];r&&(t=c(t,n(r)))}return t}function n(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return o.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var r in t)a.call(t,r)&&t[r]&&(e=c(e,r));return e}function c(t,e){return e?t?t+" "+e:t+e:t}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()}},r={};function a(t){var o=r[t];if(void 0!==o)return o.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,a),n.exports}a.m=e,t=[],a.O=(e,r,o,n)=>{if(!r){var c=1/0;for(u=0;u<t.length;u++){r=t[u][0],o=t[u][1],n=t[u][2];for(var i=!0,s=0;s<r.length;s++)(!1&n||c>=n)&&Object.keys(a.O).every((t=>a.O[t](r[s])))?r.splice(s--,1):(i=!1,n<c&&(c=n));if(i){t.splice(u--,1);var l=o();void 0!==l&&(e=l)}}return e}n=n||0;for(var u=t.length;u>0&&t[u-1][2]>n;u--)t[u]=t[u-1];t[u]=[r,o,n]},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={534:0,186:0};a.O.j=e=>0===t[e];var e=(e,r)=>{var o,n,c=r[0],i=r[1],s=r[2],l=0;if(c.some((e=>0!==t[e]))){for(o in i)a.o(i,o)&&(a.m[o]=i[o]);if(s)var u=s(a)}for(e&&e(r);l<c.length;l++)n=c[l],a.o(t,n)&&t[n]&&t[n][0](),t[n]=0;return a.O(u)},r=self.webpackChunksimple_tabs_block=self.webpackChunksimple_tabs_block||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var o=a.O(void 0,[186],(()=>a(180)));o=a.O(o)})();7 content:(0,a.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}}]}]}})},873:(t,e,r)=>{var a=r(325).Symbol;t.exports=a},552:(t,e,r)=>{var a=r(873),o=r(659),n=r(350),i=a?a.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":i&&i in Object(t)?o(t):n(t)}},96:t=>{t.exports=function(t,e){for(var r=-1,a=Array(t);++r<t;)a[r]=e(r);return a}},128:(t,e,r)=>{var a=r(800),o=/^\s+/;t.exports=function(t){return t?t.slice(0,a(t)+1).replace(o,""):t}},66:(t,e,r)=>{var a=r(488);t.exports=function(t){return"function"==typeof t?t:a}},840:(t,e,r)=>{var a="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=a},659:(t,e,r)=>{var a=r(873),o=Object.prototype,n=o.hasOwnProperty,i=o.toString,c=a?a.toStringTag:void 0;t.exports=function(t){var e=n.call(t,c),r=t[c];try{t[c]=void 0;var a=!0}catch(t){}var o=i.call(t);return a&&(e?t[c]=r:delete t[c]),o}},350:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},325:(t,e,r)=>{var a=r(840),o="object"==typeof self&&self&&self.Object===Object&&self,n=a||o||Function("return this")();t.exports=n},800:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},488:t=>{t.exports=function(t){return t}},805:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},346:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},394:(t,e,r)=>{var a=r(552),o=r(346);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==a(t)}},638:(t,e,r)=>{var a=r(96),o=r(66),n=r(489),i=4294967295,c=Math.min;t.exports=function(t,e){if((t=n(t))<1||t>9007199254740991)return[];var r=i,s=c(t,i);e=o(e),t-=i;for(var l=a(s,e);++r<t;)e(r);return l}},400:(t,e,r)=>{var a=r(374),o=1/0;t.exports=function(t){return t?(t=a(t))===o||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},489:(t,e,r)=>{var a=r(400);t.exports=function(t){var e=a(t),r=e%1;return e==e?r?e-r:e:0}},374:(t,e,r)=>{var a=r(128),o=r(805),n=r(394),i=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(n(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=a(t);var r=c.test(t);return r||s.test(t)?l(t.slice(2),r?2:8):i.test(t)?NaN:+t}},942:(t,e)=>{var r;!function(){"use strict";var a={}.hasOwnProperty;function o(){for(var t="",e=0;e<arguments.length;e++){var r=arguments[e];r&&(t=i(t,n(r)))}return t}function n(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return o.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var r in t)a.call(t,r)&&t[r]&&(e=i(e,r));return e}function i(t,e){return e?t?t+" "+e:t+e:t}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()}},r={};function a(t){var o=r[t];if(void 0!==o)return o.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,a),n.exports}a.m=e,t=[],a.O=(e,r,o,n)=>{if(!r){var i=1/0;for(u=0;u<t.length;u++){r=t[u][0],o=t[u][1],n=t[u][2];for(var c=!0,s=0;s<r.length;s++)(!1&n||i>=n)&&Object.keys(a.O).every((t=>a.O[t](r[s])))?r.splice(s--,1):(c=!1,n<i&&(i=n));if(c){t.splice(u--,1);var l=o();void 0!==l&&(e=l)}}return e}n=n||0;for(var u=t.length;u>0&&t[u-1][2]>n;u--)t[u]=t[u-1];t[u]=[r,o,n]},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={534:0,186:0};a.O.j=e=>0===t[e];var e=(e,r)=>{var o,n,i=r[0],c=r[1],s=r[2],l=0;if(i.some((e=>0!==t[e]))){for(o in c)a.o(c,o)&&(a.m[o]=c[o]);if(s)var u=s(a)}for(e&&e(r);l<i.length;l++)n=i[l],a.o(t,n)&&t[n]&&t[n][0](),t[n]=0;return a.O(u)},r=self.webpackChunksimple_tabs_block=self.webpackChunksimple_tabs_block||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var o=a.O(void 0,[186],(()=>a(180)));o=a.O(o)})(); -
simple-tabs-block/tags/2.2.1/readme.txt
r3189523 r3228821 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.0 7 Stable tag: 2.2. 07 Stable tag: 2.2.1 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 26 26 27 27 == Changelog == 28 29 = 2.2.1 = 30 * Fix: Block gap not applying when modified globally in style book 28 31 29 32 = 2.2.0 = -
simple-tabs-block/tags/2.2.1/simple-tabs-block.php
r3189523 r3228821 5 5 * Requires at least: 6.5 6 6 * Requires PHP: 7.0 7 * Version: 2.2. 07 * Version: 2.2.1 8 8 * Author: CloudCatch LLC 9 9 * Author URI: https://cloudcatch.io -
simple-tabs-block/trunk/build/tab/block.json
r3189523 r3228821 3 3 "apiVersion": 2, 4 4 "name": "cloudcatch/tab", 5 "version": "2.2. 0",5 "version": "2.2.1", 6 6 "title": "Tab", 7 7 "category": "design", -
simple-tabs-block/trunk/build/tab/index.asset.php
r3189523 r3228821 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' b7211c8a79b62ff2049e');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'd4ef49167187e17262f3'); -
simple-tabs-block/trunk/build/tab/index.js
r3189523 r3228821 1 (()=>{var e={942:(e,t)=>{var a;!function(){"use strict";var o={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=r(e,c(a)))}return e}function c(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)o.call(e,a)&&e[a]&&(t=r(t,a));return t}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},t={};function a(o){var n=t[o];if(void 0!==n)return n.exports;var c=t[o]={exports:{}};return e[o](c,c.exports,a),c.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.i18n,t=window.wp.blocks;var o=a(942),n=a.n(o);let c=e=>crypto.getRandomValues(new Uint8Array(e));const r=window.wp.components,i=window.wp.element,s=window.wp.blockEditor,l=window.ReactJSXRuntime,d=[{attributes:{index:{type:"number"},label:{type:"string",default:"Title"},showDescription:{type:"boolean",default:!1},description:{type:"string",default:""}},save({attributes:e}){const{index:t}=e,a=s.useInnerBlocksProps.save({tabid:t,className:"wp-block-cloudcatch-tab"});return(0,l.jsx)("div",{...a})}}];(0,t.registerBlockType)("cloudcatch/tab",{edit:function({attributes:t,setAttributes:a,context:o}){var d;const{id:b,index:u,label:p,showDescription:h,description:x}=t;(0,i.useEffect)((()=>{if(!b){const e=((e,t=21)=>((e,t,a)=>{let o=(2<<Math.log2(e.length-1))-1,n=-~(1.6*o*t/e.length);return(c=t)=>{let r="";for(;;){let t=a(n),i= n;for(;i--;)if(r+=e[t[i]&o]||"",r.length===c)return r}}})(e,t,c))("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",11);a({id:e()})}}),[]);const v=(0,s.useBlockProps)({className:n()({active:b===o["cloudcatch/tabs/activeTab"]}),role:"tab",tabIndex:"0",tabid:u}),w=(0,s.useInnerBlocksProps)({tabid:u,className:n()("wp-block-cloudcatch-tab-content",{active:b===o["cloudcatch/tabs/activeTab"]}),style:{display:b===o["cloudcatch/tabs/activeTab"]?"block":"none"}});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.InspectorControls,{children:(0,l.jsxs)(r.PanelBody,{children:[(0,l.jsx)(r.TextControl,{label:(0,e.__)("Tab label"),value:p,onChange:e=>a({label:e}),__nextHasNoMarginBottom:!0}),(0,l.jsx)(r.ToggleControl,{label:(0,e.__)("Show description"),checked:h,onChange:()=>a({showDescription:!h}),__nextHasNoMarginBottom:!0})]})}),(0,l.jsxs)("div",{...v,children:[(0,l.jsx)(s.RichText,{tagName:"label",value:null!==(d=t?.label)&&void 0!==d?d:(0,e.__)("Title"),onChange:e=>a({label:e}),className:"wp-block-cloudcatch-tab__label"}),h&&(0,l.jsx)(s.RichText,{"aria-label":(0,e.__)("Description"),placeholder:(0,e.__)("Add text…"),value:x,onChange:e=>a({description:e}),identifier:"div",className:"wp-block-cloudcatch-tab__description"})]}),(0,l.jsx)("div",{...w})]})},icon:()=>(0,l.jsx)(r.Icon,{icon:()=>(0,l.jsxs)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,l.jsx)(r.Path,{d:"M19.1 7.8h-7.5v-.7c0-1-.8-1.8-1.8-1.8h-5c-1 0-1.8.8-1.8 1.8v11.6c0 1 .8 1.8 1.8 1.8h14.3c1 0 1.8-.8 1.8-1.8V9.5c0-.9-.8-1.7-1.8-1.7zm.3 10.9c0 .1-.1.3-.3.3H4.9c-.1 0-.3-.1-.3-.3V7.1c0-.1.1-.3.3-.3h5c.1 0 .3.1.3.3V9.2h9.1c.1 0 .3.1.3.3v9.2z"}),(0,l.jsx)(r.Path,{d:"M16.8 13.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM16.8 16.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8z"})]})}),save:function({attributes:t}){const{index:a,label:o,showDescription:n,description:c}=t,r=s.useBlockProps.save({role:"tab",tabIndex:"0",tabid:a}),i=s.useInnerBlocksProps.save({tabid:a,className:"wp-block-cloudcatch-tab-content"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{...r,children:[(0,l.jsx)("label",{className:"wp-block-cloudcatch-tab__label",children:null!=o?o:(0,e.__)("Title","simple-tabs-block")}),n&&c.length>0&&(0,l.jsx)("div",{"aria-label":"Description",className:"wp-block-cloudcatch-tab__description",children:c})]}),(0,l.jsx)("div",{...i})]})},deprecated:d,example:{name:"cloudcatch/tab",attributes:{id:"500",index:0,label:(0,e.__)("Tab 1","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{1 (()=>{var e={942:(e,t)=>{var a;!function(){"use strict";var o={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=r(e,c(a)))}return e}function c(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)o.call(e,a)&&e[a]&&(t=r(t,a));return t}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},t={};function a(o){var n=t[o];if(void 0!==n)return n.exports;var c=t[o]={exports:{}};return e[o](c,c.exports,a),c.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.i18n,t=window.wp.blocks;var o=a(942),n=a.n(o);let c=e=>crypto.getRandomValues(new Uint8Array(e));const r=window.wp.components,i=window.wp.element,s=window.wp.blockEditor,l=window.ReactJSXRuntime,d=[{attributes:{index:{type:"number"},label:{type:"string",default:"Title"},showDescription:{type:"boolean",default:!1},description:{type:"string",default:""}},save({attributes:e}){const{index:t}=e,a=s.useInnerBlocksProps.save({tabid:t,className:"wp-block-cloudcatch-tab"});return(0,l.jsx)("div",{...a})}}];(0,t.registerBlockType)("cloudcatch/tab",{edit:function({attributes:t,setAttributes:a,context:o}){var d;const{id:b,index:u,label:p,showDescription:h,description:x}=t;(0,i.useEffect)((()=>{if(!b){const e=((e,t=21)=>((e,t,a)=>{let o=(2<<Math.log2(e.length-1))-1,n=-~(1.6*o*t/e.length);return(c=t)=>{let r="";for(;;){let t=a(n),i=0|n;for(;i--;)if(r+=e[t[i]&o]||"",r.length>=c)return r}}})(e,0|t,c))("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",11);a({id:e()})}}),[]);const v=(0,s.useBlockProps)({className:n()({active:b===o["cloudcatch/tabs/activeTab"]}),role:"tab",tabIndex:"0",tabid:u}),w=(0,s.useInnerBlocksProps)({tabid:u,className:n()("wp-block-cloudcatch-tab-content",{active:b===o["cloudcatch/tabs/activeTab"]}),style:{display:b===o["cloudcatch/tabs/activeTab"]?"block":"none"}});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.InspectorControls,{children:(0,l.jsxs)(r.PanelBody,{children:[(0,l.jsx)(r.TextControl,{label:(0,e.__)("Tab label"),value:p,onChange:e=>a({label:e}),__nextHasNoMarginBottom:!0}),(0,l.jsx)(r.ToggleControl,{label:(0,e.__)("Show description"),checked:h,onChange:()=>a({showDescription:!h}),__nextHasNoMarginBottom:!0})]})}),(0,l.jsxs)("div",{...v,children:[(0,l.jsx)(s.RichText,{tagName:"label",value:null!==(d=t?.label)&&void 0!==d?d:(0,e.__)("Title"),onChange:e=>a({label:e}),className:"wp-block-cloudcatch-tab__label"}),h&&(0,l.jsx)(s.RichText,{"aria-label":(0,e.__)("Description"),placeholder:(0,e.__)("Add text…"),value:x,onChange:e=>a({description:e}),identifier:"div",className:"wp-block-cloudcatch-tab__description"})]}),(0,l.jsx)("div",{...w})]})},icon:()=>(0,l.jsx)(r.Icon,{icon:()=>(0,l.jsxs)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,l.jsx)(r.Path,{d:"M19.1 7.8h-7.5v-.7c0-1-.8-1.8-1.8-1.8h-5c-1 0-1.8.8-1.8 1.8v11.6c0 1 .8 1.8 1.8 1.8h14.3c1 0 1.8-.8 1.8-1.8V9.5c0-.9-.8-1.7-1.8-1.7zm.3 10.9c0 .1-.1.3-.3.3H4.9c-.1 0-.3-.1-.3-.3V7.1c0-.1.1-.3.3-.3h5c.1 0 .3.1.3.3V9.2h9.1c.1 0 .3.1.3.3v9.2z"}),(0,l.jsx)(r.Path,{d:"M16.8 13.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM16.8 16.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8z"})]})}),save:function({attributes:t}){const{index:a,label:o,showDescription:n,description:c}=t,r=s.useBlockProps.save({role:"tab",tabIndex:"0",tabid:a}),i=s.useInnerBlocksProps.save({tabid:a,className:"wp-block-cloudcatch-tab-content"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{...r,children:[(0,l.jsx)("label",{className:"wp-block-cloudcatch-tab__label",children:null!=o?o:(0,e.__)("Title","simple-tabs-block")}),n&&c.length>0&&(0,l.jsx)("div",{"aria-label":"Description",className:"wp-block-cloudcatch-tab__description",children:c})]}),(0,l.jsx)("div",{...i})]})},deprecated:d,example:{name:"cloudcatch/tab",attributes:{id:"500",index:0,label:(0,e.__)("Tab 1","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{ 2 2 /* translators: example text. */ 3 3 content:(0,e.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.","simple-tabs-block")}}]}})})()})(); -
simple-tabs-block/trunk/build/tabs/block.json
r3189523 r3228821 3 3 "apiVersion": 2, 4 4 "name": "cloudcatch/tabs", 5 "version": "2.2. 0",5 "version": "2.2.1", 6 6 "title": "Tabs", 7 7 "category": "design", … … 88 88 "allowSwitching": false, 89 89 "allowInheriting": false, 90 "allowEditing": false, 90 91 "default": { 91 92 "type": "flex" -
simple-tabs-block/trunk/build/tabs/index.asset.php
r3189523 r3228821 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => ' be5457baeeb5faa6a51f');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '9eac05f9c436150a7761'); -
simple-tabs-block/trunk/build/tabs/index.js
r3189523 r3228821 1 (()=>{var t,e={180:(t,e,r)=>{"use strict";const a=window.wp.i18n,o=window.wp.blocks;var n=r(942), c=r.n(n),i=r(638),s=r.n(i);const l=window.wp.blockEditor,u=window.wp.element,p=window.wp.components,d=window.wp.data,b=window.wp.compose,f=window.ReactJSXRuntime,v=["cloudcatch/tab"],h={name:"cloudcatch/tab"},m=(0,b.compose)((0,d.withSelect)(((t,{clientId:e})=>({innerBlocks:t("core/block-editor").getBlocks(e)}))),(0,d.withDispatch)(((t,{clientId:e},{select:r})=>{const{getBlock:a}=r("core/block-editor"),{updateBlockAttributes:o}=t("core/block-editor"),n=a(e),{selectBlock:c}=t(l.store);return{selectBlock(t){c(t)},resetTabOrder(){const t=[];s()(n.innerBlocks.length,(e=>{o(n.innerBlocks[e].clientId,{index:e}),t.push(n.innerBlocks[e].attributes.id)})),o(e,{tabs:t})},updateActiveTab(t){o(n.clientId,{activeTab:t})}}})))((function({attributes:t,setAttributes:e,innerBlocks:r,clientId:o,updateActiveTab:n,resetTabOrder:i}){const{defaultTab:s,activeTab:b,layout:{justifyContent:m,orientation:w="horizontal",flexWrap:g="wrap"}={}}=t;(0,u.useEffect)((()=>{i()}),[r]);const{getSelectedBlock:k}=(0,d.select)(l.store),{innerBlockCount:x,selectedBlock:j,innerBlockIds:y}=(0,d.useSelect)((t=>({innerBlockCount:t(l.store).getBlock(o)?.innerBlocks?.length,selectedBlock:k(),innerBlockIds:t(l.store).getBlock(o)?.innerBlocks.map((t=>t.attributes.id)).filter((t=>void 0!==t))})),[o]);(0,u.useEffect)((()=>{!b&&y.length&&n(y[0])}),[y]),(0,u.useEffect)((()=>{j&&y.includes(j?.attributes?.id)&&n(j.attributes.id)}),[j]);const _=(0,l.useBlockProps)({className:c()("wp-block-cloudcatch-tabs__wrapper","wp-block-cloudcatch-tabs-v2"),"data-default-tab":s||void 0}),B=(0,l.useInnerBlocksProps)({className:c()("wp-block-cloudcatch-tabs__container",{"items-justified-right":"right"===m,"items-justified-space-between":"space-between"===m,"items-justified-left":"left"===m,"items-justified-center":"center"===m,"is-vertical":"vertical"===w,"no-wrap":"nowrap"===g}),style:{gridTemplateColumns:"vertical"!==w?`repeat(${x}, auto) ${"left"===m?"1fr":"auto"}`:void 0,gridTemplateRows:"vertical"===w?`repeat(${x}, auto) 1fr`:void 0}},{renderAppender:l.InnerBlocks.ButtonBlockAppender,allowedBlocks:v,defaultBlock:h,directInsert:!0,templateLock:!1,template:[["cloudcatch/tab",{label:"Tab 1"},[["core/paragraph",{content:"Tab 1 Content"}]]],["cloudcatch/tab",{label:"Tab 2"},[["core/paragraph",{content:"Tab 2 Content"}]]],["cloudcatch/tab",{label:"Tab 3"},[["core/paragraph",{content:"Tab 3 Content"}]]]]});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(l.InspectorControls,{children:(0,f.jsx)(p.PanelBody,{children:(0,f.jsx)(p.SelectControl,{label:(0,a.__)("Default open tab","simple-tabs-block"),value:s,options:r.map(((t,e)=>({value:e,label:t.attributes.label}))),onChange:t=>e({defaultTab:parseInt(t)}),__nextHasNoMarginBottom:!0})})}),(0,f.jsx)("div",{..._,children:(0,f.jsx)("div",{...B})})]})})),w=[{attributes:{uuid:{type:"string"},tabs:{type:"array",default:[]},defaultTab:{type:"number",default:0},activeTab:{type:"string",default:""}},save({attributes:t}){const{uuid:e,tabs:r,defaultTab:o,layout:{justifyContent:n,orientation:i="horizontal",flexWrap:s="wrap"}={}}=t,u=c()("wp-block-cloudcatch-tabs__wrapper",{"items-justified-right":"right"===n,"items-justified-space-between":"space-between"===n,"items-justified-left":"left"===n,"items-justified-center":"center"===n,"is-vertical":"vertical"===i,"no-wrap":"nowrap"===s});return(0,f.jsxs)("div",{...l.useBlockProps.save({className:u}),children:[(0,f.jsx)("div",{className:"wp-block-cloudcatch-tabs__tabs-wrapper",children:(0,f.jsx)("div",{className:"wp-block-cloudcatch-tabs__tabs",role:"tablist","aria-orientation":i,children:r.map(((t,e)=>{var r,n;return(0,f.jsxs)("div",{children:[(0,f.jsx)(l.RichText.Content,{value:null!==(r=t?.attributes?.label)&&void 0!==r?r:(0,a.__)("Title"),tagName:"label",tabIndex:"0",role:"tab",tabid:e,className:c()("wp-block-cloudcatch-tab__label",t?.attributes?.className,{active:e===o})},e),t?.attributes?.showDescription&&(0,f.jsx)(l.RichText.Content,{value:null!==(n=t?.attributes?.description)&&void 0!==n?n:(0,a.__)("Description"),tagName:"div",className:"wp-block-cloudcatch-tab__description"})]},e)}))})}),(0,f.jsx)("div",{...l.useInnerBlocksProps.save({className:"wp-block-cloudcatch-tabs__container"})})]})}}];(0,o.registerBlockType)("cloudcatch/tabs",{edit:m,icon:()=>(0,f.jsx)(p.Icon,{icon:()=>(0,f.jsxs)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,f.jsx)(p.Path,{d:"M19.1 7.8h-7.5v-.7c0-1-.8-1.8-1.8-1.8h-5c-1 0-1.8.8-1.8 1.8v11.6c0 1 .8 1.8 1.8 1.8h14.3c1 0 1.8-.8 1.8-1.8V9.5c0-.9-.8-1.7-1.8-1.7zm.3 10.9c0 .1-.1.3-.3.3H4.9c-.1 0-.3-.1-.3-.3V7.1c0-.1.1-.3.3-.3h5c.1 0 .3.1.3.3V9.2h9.1c.1 0 .3.1.3.3v9.2z"}),(0,f.jsx)(p.Path,{d:"M16.8 13.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM16.8 16.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM15.1 6.9h-2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7h2c.4 0 .8.3.8.7-.1.3-.4.7-.8.7zM19.2 6.9h-2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7h2c.4 0 .8.3.8.7-.1.3-.4.7-.8.7z"})]})}),save:function({attributes:t}){const{tabs:e,defaultTab:r,layout:{justifyContent:a,orientation:o="horizontal",flexWrap:n="wrap"}={}}=t,i=e.length,s=l.useBlockProps.save({className:c()("wp-block-cloudcatch-tabs__wrapper","wp-block-cloudcatch-tabs-v2"),"data-default-tab":r||void 0}),u=l.useInnerBlocksProps.save({className:c()("wp-block-cloudcatch-tabs__container",{"items-justified-right":"right"===a,"items-justified-space-between":"space-between"===a,"items-justified-left":"left"===a,"items-justified-center":"center"===a,"is-vertical":"vertical"===o,"no-wrap":"nowrap"===n}),style:{gridTemplateColumns:"vertical"!==o?`repeat(${i}, auto) ${"left"===a?"1fr":"auto"}`:void 0,gridTemplateRows:"vertical"===o?`repeat(${i}, auto) 1fr`:void 0}});return(0,f.jsx)("div",{...s,children:(0,f.jsx)("div",{...u})})},deprecated:w,example:{attributes:{tabs:["500","501","502"]},innerBlocks:[{name:"cloudcatch/tab",attributes:{id:"500",index:0,label:(0,a.__)("Tab 1","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{1 (()=>{var t,e={180:(t,e,r)=>{"use strict";const a=window.wp.i18n,o=window.wp.blocks;var n=r(942),i=r.n(n),c=r(638),s=r.n(c);const l=window.wp.blockEditor,u=window.wp.element,p=window.wp.components,d=window.wp.data,b=window.wp.compose,f=window.ReactJSXRuntime,v=["cloudcatch/tab"],h={name:"cloudcatch/tab"},m=(0,b.compose)((0,d.withSelect)(((t,{clientId:e})=>({innerBlocks:t("core/block-editor").getBlocks(e)}))),(0,d.withDispatch)(((t,{clientId:e},{select:r})=>{const{getBlock:a}=r("core/block-editor"),{updateBlockAttributes:o}=t("core/block-editor"),n=a(e),{selectBlock:i}=t(l.store);return{selectBlock(t){i(t)},resetTabOrder(){const t=[];s()(n.innerBlocks.length,(e=>{o(n.innerBlocks[e].clientId,{index:e}),t.push(n.innerBlocks[e].attributes.id)})),o(e,{tabs:t})},updateActiveTab(t){o(n.clientId,{activeTab:t})}}})))((function({attributes:t,setAttributes:e,innerBlocks:r,clientId:o,updateActiveTab:n,resetTabOrder:c}){const{defaultTab:s,activeTab:b,layout:{justifyContent:m,orientation:w="horizontal",flexWrap:g="wrap"}={}}=t;(0,u.useEffect)((()=>{c()}),[r]);const{getSelectedBlock:k}=(0,d.select)(l.store),{innerBlockCount:j,selectedBlock:x,innerBlockIds:y}=(0,d.useSelect)((t=>({innerBlockCount:t(l.store).getBlock(o)?.innerBlocks?.length,selectedBlock:k(),innerBlockIds:t(l.store).getBlock(o)?.innerBlocks.map((t=>t.attributes.id)).filter((t=>void 0!==t))})),[o]);(0,u.useEffect)((()=>{!b&&y.length&&n(y[0])}),[y]),(0,u.useEffect)((()=>{x&&y.includes(x?.attributes?.id)&&n(x.attributes.id)}),[x]);const _=(0,l.useBlockProps)({className:i()("wp-block-cloudcatch-tabs__wrapper","wp-block-cloudcatch-tabs-v2"),"data-default-tab":s||void 0}),B=(0,l.useInnerBlocksProps)({className:i()("wp-block-cloudcatch-tabs__container",{"items-justified-right":"right"===m,"items-justified-space-between":"space-between"===m,"items-justified-left":"left"===m,"items-justified-center":"center"===m,"is-vertical":"vertical"===w,"no-wrap":"nowrap"===g}),style:{gridTemplateColumns:"vertical"!==w?`repeat(${j}, auto) ${"left"===m?"1fr":"auto"}`:void 0,gridTemplateRows:"vertical"===w?`repeat(${j}, auto) 1fr`:void 0}},{renderAppender:l.InnerBlocks.ButtonBlockAppender,allowedBlocks:v,defaultBlock:h,directInsert:!0,templateLock:!1,template:[["cloudcatch/tab",{label:"Tab 1"},[["core/paragraph",{content:"Tab 1 Content"}]]],["cloudcatch/tab",{label:"Tab 2"},[["core/paragraph",{content:"Tab 2 Content"}]]],["cloudcatch/tab",{label:"Tab 3"},[["core/paragraph",{content:"Tab 3 Content"}]]]]});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(l.InspectorControls,{children:(0,f.jsx)(p.PanelBody,{children:(0,f.jsx)(p.SelectControl,{label:(0,a.__)("Default open tab","simple-tabs-block"),value:s,options:r.map(((t,e)=>({value:e,label:t.attributes.label}))),onChange:t=>e({defaultTab:parseInt(t)}),__nextHasNoMarginBottom:!0})})}),(0,f.jsx)("div",{..._,children:(0,f.jsx)("div",{...B})})]})})),w=[{attributes:{uuid:{type:"string"},tabs:{type:"array",default:[]},defaultTab:{type:"number",default:0},activeTab:{type:"string",default:""}},save({attributes:t}){const{tabs:e,defaultTab:r,layout:{justifyContent:a,orientation:o="horizontal",flexWrap:n="wrap"}={}}=t,c=e.length,s=l.useBlockProps.save({className:i()("wp-block-cloudcatch-tabs__wrapper","wp-block-cloudcatch-tabs-v2"),"data-default-tab":r||void 0}),u=l.useInnerBlocksProps.save({className:i()("wp-block-cloudcatch-tabs__container",{"items-justified-right":"right"===a,"items-justified-space-between":"space-between"===a,"items-justified-left":"left"===a,"items-justified-center":"center"===a,"is-vertical":"vertical"===o,"no-wrap":"nowrap"===n}),style:{gridTemplateColumns:"vertical"!==o?`repeat(${c}, auto) ${"left"===a?"1fr":"auto"}`:void 0,gridTemplateRows:"vertical"===o?`repeat(${c}, auto) 1fr`:void 0}});return(0,f.jsx)("div",{...s,children:(0,f.jsx)("div",{...u})})}},{attributes:{uuid:{type:"string"},tabs:{type:"array",default:[]},defaultTab:{type:"number",default:0},activeTab:{type:"string",default:""}},save({attributes:t}){const{tabs:e,defaultTab:r,layout:{justifyContent:o,orientation:n="horizontal",flexWrap:c="wrap"}={}}=t,s=i()("wp-block-cloudcatch-tabs__wrapper",{"items-justified-right":"right"===o,"items-justified-space-between":"space-between"===o,"items-justified-left":"left"===o,"items-justified-center":"center"===o,"is-vertical":"vertical"===n,"no-wrap":"nowrap"===c});return(0,f.jsxs)("div",{...l.useBlockProps.save({className:s}),children:[(0,f.jsx)("div",{className:"wp-block-cloudcatch-tabs__tabs-wrapper",children:(0,f.jsx)("div",{className:"wp-block-cloudcatch-tabs__tabs",role:"tablist","aria-orientation":n,children:e.map(((t,e)=>{var o,n;return(0,f.jsxs)("div",{children:[(0,f.jsx)(l.RichText.Content,{value:null!==(o=t?.attributes?.label)&&void 0!==o?o:(0,a.__)("Title"),tagName:"label",tabIndex:"0",role:"tab",tabid:e,className:i()("wp-block-cloudcatch-tab__label",t?.attributes?.className,{active:e===r})},e),t?.attributes?.showDescription&&(0,f.jsx)(l.RichText.Content,{value:null!==(n=t?.attributes?.description)&&void 0!==n?n:(0,a.__)("Description"),tagName:"div",className:"wp-block-cloudcatch-tab__description"})]},e)}))})}),(0,f.jsx)("div",{...l.useInnerBlocksProps.save({className:"wp-block-cloudcatch-tabs__container"})})]})}}];(0,o.registerBlockType)("cloudcatch/tabs",{edit:m,icon:()=>(0,f.jsx)(p.Icon,{icon:()=>(0,f.jsxs)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,f.jsx)(p.Path,{d:"M19.1 7.8h-7.5v-.7c0-1-.8-1.8-1.8-1.8h-5c-1 0-1.8.8-1.8 1.8v11.6c0 1 .8 1.8 1.8 1.8h14.3c1 0 1.8-.8 1.8-1.8V9.5c0-.9-.8-1.7-1.8-1.7zm.3 10.9c0 .1-.1.3-.3.3H4.9c-.1 0-.3-.1-.3-.3V7.1c0-.1.1-.3.3-.3h5c.1 0 .3.1.3.3V9.2h9.1c.1 0 .3.1.3.3v9.2z"}),(0,f.jsx)(p.Path,{d:"M16.8 13.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM16.8 16.6H7.2c-.4 0-.7-.3-.7-.8 0-.4.3-.7.7-.7h9.5c.4 0 .8.3.8.7 0 .5-.3.8-.7.8zM15.1 6.9h-2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7h2c.4 0 .8.3.8.7-.1.3-.4.7-.8.7zM19.2 6.9h-2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7h2c.4 0 .8.3.8.7-.1.3-.4.7-.8.7z"})]})}),save:function({attributes:t}){const{tabs:e,defaultTab:r,layout:{justifyContent:a,orientation:o="horizontal",flexWrap:n="wrap"}={}}=t,c=e.length,s=l.useBlockProps.save({className:i()("wp-block-cloudcatch-tabs__wrapper","wp-block-cloudcatch-tabs-v2"),"data-default-tab":r||void 0}),u=l.useInnerBlocksProps.save({className:i()("wp-block-cloudcatch-tabs__container","wp-block-cloudcatch-tabs-is-layout-flex",{"items-justified-right":"right"===a,"items-justified-space-between":"space-between"===a,"items-justified-left":"left"===a,"items-justified-center":"center"===a,"is-vertical":"vertical"===o,"no-wrap":"nowrap"===n}),style:{gridTemplateColumns:"vertical"!==o?`repeat(${c}, auto) ${"left"===a?"1fr":"auto"}`:void 0,gridTemplateRows:"vertical"===o?`repeat(${c}, auto) 1fr`:void 0}});return(0,f.jsx)("div",{...s,children:(0,f.jsx)("div",{...u})})},deprecated:w,example:{attributes:{tabs:["500","501","502"]},innerBlocks:[{name:"cloudcatch/tab",attributes:{id:"500",index:0,label:(0,a.__)("Tab 1","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{ 2 2 /* translators: example text. */ 3 3 content:(0,a.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.","simple-tabs-block")}}]},{name:"cloudcatch/tab",attributes:{id:"501",index:1,label:(0,a.__)("Tab 2","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{ … … 5 5 content:(0,a.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}}]},{name:"cloudcatch/tab",attributes:{id:"502",index:2,label:(0,a.__)("Tab 3","simple-tabs-block")},innerBlocks:[{name:"core/paragraph",attributes:{ 6 6 /* translators: example text. */ 7 content:(0,a.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}}]}]}})},873:(t,e,r)=>{var a=r(325).Symbol;t.exports=a},552:(t,e,r)=>{var a=r(873),o=r(659),n=r(350), c=a?a.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":c&&c in Object(t)?o(t):n(t)}},96:t=>{t.exports=function(t,e){for(var r=-1,a=Array(t);++r<t;)a[r]=e(r);return a}},128:(t,e,r)=>{var a=r(800),o=/^\s+/;t.exports=function(t){return t?t.slice(0,a(t)+1).replace(o,""):t}},66:(t,e,r)=>{var a=r(488);t.exports=function(t){return"function"==typeof t?t:a}},840:(t,e,r)=>{var a="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=a},659:(t,e,r)=>{var a=r(873),o=Object.prototype,n=o.hasOwnProperty,c=o.toString,i=a?a.toStringTag:void 0;t.exports=function(t){var e=n.call(t,i),r=t[i];try{t[i]=void 0;var a=!0}catch(t){}var o=c.call(t);return a&&(e?t[i]=r:delete t[i]),o}},350:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},325:(t,e,r)=>{var a=r(840),o="object"==typeof self&&self&&self.Object===Object&&self,n=a||o||Function("return this")();t.exports=n},800:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},488:t=>{t.exports=function(t){return t}},805:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},346:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},394:(t,e,r)=>{var a=r(552),o=r(346);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==a(t)}},638:(t,e,r)=>{var a=r(96),o=r(66),n=r(489),c=4294967295,i=Math.min;t.exports=function(t,e){if((t=n(t))<1||t>9007199254740991)return[];var r=c,s=i(t,c);e=o(e),t-=c;for(var l=a(s,e);++r<t;)e(r);return l}},400:(t,e,r)=>{var a=r(374),o=1/0;t.exports=function(t){return t?(t=a(t))===o||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},489:(t,e,r)=>{var a=r(400);t.exports=function(t){var e=a(t),r=e%1;return e==e?r?e-r:e:0}},374:(t,e,r)=>{var a=r(128),o=r(805),n=r(394),c=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(n(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=a(t);var r=i.test(t);return r||s.test(t)?l(t.slice(2),r?2:8):c.test(t)?NaN:+t}},942:(t,e)=>{var r;!function(){"use strict";var a={}.hasOwnProperty;function o(){for(var t="",e=0;e<arguments.length;e++){var r=arguments[e];r&&(t=c(t,n(r)))}return t}function n(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return o.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var r in t)a.call(t,r)&&t[r]&&(e=c(e,r));return e}function c(t,e){return e?t?t+" "+e:t+e:t}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()}},r={};function a(t){var o=r[t];if(void 0!==o)return o.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,a),n.exports}a.m=e,t=[],a.O=(e,r,o,n)=>{if(!r){var c=1/0;for(u=0;u<t.length;u++){r=t[u][0],o=t[u][1],n=t[u][2];for(var i=!0,s=0;s<r.length;s++)(!1&n||c>=n)&&Object.keys(a.O).every((t=>a.O[t](r[s])))?r.splice(s--,1):(i=!1,n<c&&(c=n));if(i){t.splice(u--,1);var l=o();void 0!==l&&(e=l)}}return e}n=n||0;for(var u=t.length;u>0&&t[u-1][2]>n;u--)t[u]=t[u-1];t[u]=[r,o,n]},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={534:0,186:0};a.O.j=e=>0===t[e];var e=(e,r)=>{var o,n,c=r[0],i=r[1],s=r[2],l=0;if(c.some((e=>0!==t[e]))){for(o in i)a.o(i,o)&&(a.m[o]=i[o]);if(s)var u=s(a)}for(e&&e(r);l<c.length;l++)n=c[l],a.o(t,n)&&t[n]&&t[n][0](),t[n]=0;return a.O(u)},r=self.webpackChunksimple_tabs_block=self.webpackChunksimple_tabs_block||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var o=a.O(void 0,[186],(()=>a(180)));o=a.O(o)})();7 content:(0,a.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}}]}]}})},873:(t,e,r)=>{var a=r(325).Symbol;t.exports=a},552:(t,e,r)=>{var a=r(873),o=r(659),n=r(350),i=a?a.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":i&&i in Object(t)?o(t):n(t)}},96:t=>{t.exports=function(t,e){for(var r=-1,a=Array(t);++r<t;)a[r]=e(r);return a}},128:(t,e,r)=>{var a=r(800),o=/^\s+/;t.exports=function(t){return t?t.slice(0,a(t)+1).replace(o,""):t}},66:(t,e,r)=>{var a=r(488);t.exports=function(t){return"function"==typeof t?t:a}},840:(t,e,r)=>{var a="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=a},659:(t,e,r)=>{var a=r(873),o=Object.prototype,n=o.hasOwnProperty,i=o.toString,c=a?a.toStringTag:void 0;t.exports=function(t){var e=n.call(t,c),r=t[c];try{t[c]=void 0;var a=!0}catch(t){}var o=i.call(t);return a&&(e?t[c]=r:delete t[c]),o}},350:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},325:(t,e,r)=>{var a=r(840),o="object"==typeof self&&self&&self.Object===Object&&self,n=a||o||Function("return this")();t.exports=n},800:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},488:t=>{t.exports=function(t){return t}},805:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},346:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},394:(t,e,r)=>{var a=r(552),o=r(346);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==a(t)}},638:(t,e,r)=>{var a=r(96),o=r(66),n=r(489),i=4294967295,c=Math.min;t.exports=function(t,e){if((t=n(t))<1||t>9007199254740991)return[];var r=i,s=c(t,i);e=o(e),t-=i;for(var l=a(s,e);++r<t;)e(r);return l}},400:(t,e,r)=>{var a=r(374),o=1/0;t.exports=function(t){return t?(t=a(t))===o||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},489:(t,e,r)=>{var a=r(400);t.exports=function(t){var e=a(t),r=e%1;return e==e?r?e-r:e:0}},374:(t,e,r)=>{var a=r(128),o=r(805),n=r(394),i=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(n(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=a(t);var r=c.test(t);return r||s.test(t)?l(t.slice(2),r?2:8):i.test(t)?NaN:+t}},942:(t,e)=>{var r;!function(){"use strict";var a={}.hasOwnProperty;function o(){for(var t="",e=0;e<arguments.length;e++){var r=arguments[e];r&&(t=i(t,n(r)))}return t}function n(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return o.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var r in t)a.call(t,r)&&t[r]&&(e=i(e,r));return e}function i(t,e){return e?t?t+" "+e:t+e:t}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()}},r={};function a(t){var o=r[t];if(void 0!==o)return o.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,a),n.exports}a.m=e,t=[],a.O=(e,r,o,n)=>{if(!r){var i=1/0;for(u=0;u<t.length;u++){r=t[u][0],o=t[u][1],n=t[u][2];for(var c=!0,s=0;s<r.length;s++)(!1&n||i>=n)&&Object.keys(a.O).every((t=>a.O[t](r[s])))?r.splice(s--,1):(c=!1,n<i&&(i=n));if(c){t.splice(u--,1);var l=o();void 0!==l&&(e=l)}}return e}n=n||0;for(var u=t.length;u>0&&t[u-1][2]>n;u--)t[u]=t[u-1];t[u]=[r,o,n]},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={534:0,186:0};a.O.j=e=>0===t[e];var e=(e,r)=>{var o,n,i=r[0],c=r[1],s=r[2],l=0;if(i.some((e=>0!==t[e]))){for(o in c)a.o(c,o)&&(a.m[o]=c[o]);if(s)var u=s(a)}for(e&&e(r);l<i.length;l++)n=i[l],a.o(t,n)&&t[n]&&t[n][0](),t[n]=0;return a.O(u)},r=self.webpackChunksimple_tabs_block=self.webpackChunksimple_tabs_block||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var o=a.O(void 0,[186],(()=>a(180)));o=a.O(o)})(); -
simple-tabs-block/trunk/readme.txt
r3189523 r3228821 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.0 7 Stable tag: 2.2. 07 Stable tag: 2.2.1 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 26 26 27 27 == Changelog == 28 29 = 2.2.1 = 30 * Fix: Block gap not applying when modified globally in style book 28 31 29 32 = 2.2.0 = -
simple-tabs-block/trunk/simple-tabs-block.php
r3189523 r3228821 5 5 * Requires at least: 6.5 6 6 * Requires PHP: 7.0 7 * Version: 2.2. 07 * Version: 2.2.1 8 8 * Author: CloudCatch LLC 9 9 * Author URI: https://cloudcatch.io
Note: See TracChangeset
for help on using the changeset viewer.