From 1affd90ea196d0816e9dddb7f7753757b8921556 Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Tue, 9 Jul 2024 19:30:35 +0530 Subject: [PATCH 1/6] EX-1142 add proxy function for get_block_wrapper_attributes --- inc/blocks/helpers.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/inc/blocks/helpers.php b/inc/blocks/helpers.php index d72e933..18a59a3 100644 --- a/inc/blocks/helpers.php +++ b/inc/blocks/helpers.php @@ -199,3 +199,23 @@ function get_border_styles( array $attributes = [] ): array { 'inline_styles' => $inline_styles, ]; } + +/** + * Get block wrapper attributes. + * + * @param array $attributes The block attributes. + * + * @return string + */ +function get_block_wrapper_attributes( array $attributes = [] ): string { + if ( ! is_array( $attributes ) ) { + return ''; + } + + $normalized_attributes = []; + foreach ( $attributes as $key => $value ) { + $normalized_attributes[] = $key . '="' . esc_attr( $value ) . '"'; + } + + return implode( ' ', $normalized_attributes ); +} From d9c6b72fd6f536d3f0c6d2df7173bc89b363dc6b Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Tue, 9 Jul 2024 19:31:17 +0530 Subject: [PATCH 2/6] EX-1142 use proxy get_block_wrapper_attributes function --- inc/blocks/table-column.php | 1 + inc/blocks/table-row-container.php | 1 + inc/blocks/table-row.php | 1 + inc/blocks/table.php | 1 + 4 files changed, 4 insertions(+) diff --git a/inc/blocks/table-column.php b/inc/blocks/table-column.php index 36a8b8d..e097c9e 100644 --- a/inc/blocks/table-column.php +++ b/inc/blocks/table-column.php @@ -7,6 +7,7 @@ namespace Travelopia\Blocks\TableColumn; +use function Travelopia\Blocks\Helpers\get_block_wrapper_attributes; use function Travelopia\Blocks\Helpers\get_border_styles; use function Travelopia\Blocks\Helpers\get_css_classes; use function Travelopia\Blocks\Helpers\get_css_styles; diff --git a/inc/blocks/table-row-container.php b/inc/blocks/table-row-container.php index 8c79b17..398fefc 100644 --- a/inc/blocks/table-row-container.php +++ b/inc/blocks/table-row-container.php @@ -7,6 +7,7 @@ namespace Travelopia\Blocks\TableRowContainer; +use function Travelopia\Blocks\Helpers\get_block_wrapper_attributes; use function Travelopia\Blocks\Helpers\get_css_classes; const BLOCK_NAME = 'travelopia/table-row-container'; diff --git a/inc/blocks/table-row.php b/inc/blocks/table-row.php index 2ee1fab..2baba6a 100644 --- a/inc/blocks/table-row.php +++ b/inc/blocks/table-row.php @@ -7,6 +7,7 @@ namespace Travelopia\Blocks\TableRow; +use function Travelopia\Blocks\Helpers\get_block_wrapper_attributes; use function Travelopia\Blocks\Helpers\get_border_styles; use function Travelopia\Blocks\Helpers\get_css_classes; use function Travelopia\Blocks\Helpers\get_css_styles; diff --git a/inc/blocks/table.php b/inc/blocks/table.php index 92b0e27..de17283 100644 --- a/inc/blocks/table.php +++ b/inc/blocks/table.php @@ -7,6 +7,7 @@ namespace Travelopia\Blocks\Table; +use function Travelopia\Blocks\Helpers\get_block_wrapper_attributes; use function Travelopia\Blocks\Helpers\get_css_classes; use function Travelopia\Blocks\Helpers\get_css_styles; From b4b00403907399503165db8c9c257093e881acc4 Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Tue, 9 Jul 2024 19:32:41 +0530 Subject: [PATCH 3/6] EX-1142 fix phpstan error --- inc/blocks/helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/blocks/helpers.php b/inc/blocks/helpers.php index 18a59a3..328f38c 100644 --- a/inc/blocks/helpers.php +++ b/inc/blocks/helpers.php @@ -203,7 +203,7 @@ function get_border_styles( array $attributes = [] ): array { /** * Get block wrapper attributes. * - * @param array $attributes The block attributes. + * @param mixed[] $attributes The block attributes. * * @return string */ From 3ffad5f15eac0ac02023cc1cf8b42a05940599f2 Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Tue, 9 Jul 2024 23:35:45 +0530 Subject: [PATCH 4/6] EX-1142 disable bottom merge on columns in last row --- src/editor/blocks/table-column/toolbar.tsx | 36 ++++++++++++++++------ 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/editor/blocks/table-column/toolbar.tsx b/src/editor/blocks/table-column/toolbar.tsx index 3d801a7..c0a12b6 100644 --- a/src/editor/blocks/table-column/toolbar.tsx +++ b/src/editor/blocks/table-column/toolbar.tsx @@ -81,6 +81,7 @@ export default function Toolbar( { } = dispatch( 'core/block-editor' ); const [ maximumColumnsInCurrentRow, setMaximumColumnsInCurrentRow ] = useState( 0 ); + const [ maximumRowsInCurrentColumn, setMaximumRowsInCurrentColumn ] = useState( 0 ); const rowContainerBlockType = useMemo( () => getBlock( rowContainerId )?.attributes?.type, [ rowContainerId, getBlock ] ); @@ -97,19 +98,36 @@ export default function Toolbar( { return; } - // Traverse rows. - tableBlock.innerBlocks.some( ( rowBlock, index ): boolean => { - // Get current row. - if ( rowBlock.name !== rowBlockName || index + 1 !== tableRow || ! rowBlock.innerBlocks.length ) { + // Traverse table. + tableBlock.innerBlocks.some( ( rowContainerBlock ): boolean => { + + if ( rowContainerBlock.name !== rowContainerBlockName || ! rowContainerBlock.innerBlocks.length ) { return false; } - // Set maximum columns in current row. - setMaximumColumnsInCurrentRow( rowBlock.innerBlocks.length ); + let maxRows = 0; + rowContainerBlock.innerBlocks.forEach( ( rowBlock, rowIndex ) => { + if ( rowBlock.name !== rowBlockName || ! rowBlock.innerBlocks.length ) { + return; + } + + // Set maximum columns in current row. + if ( rowIndex + 1 === tableRow ) { + setMaximumColumnsInCurrentRow( rowBlock.innerBlocks.length ); + } + + rowBlock.innerBlocks.forEach( ( columnBlock, columnIndex ) => { + if ( columnBlock.name !== columnBlockName || columnIndex + 1 !== tableColumn ) { + return; + } + + maxRows++; + } ); + } ); - // Short-circuit loop. + setMaximumRowsInCurrentColumn( maxRows ); return true; - } ); + }); }, [ tableRow, tableColumn, getBlock, tableId ] ); /** @@ -649,7 +667,7 @@ export default function Toolbar( { { icon: arrowDown, title: __( 'Merge column down', 'tp' ), - isDisabled: ( rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ), + isDisabled: ( tableRow === maximumRowsInCurrentColumn || rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ), onClick: onMergeColumnDown, }, ] as DropdownOption[]; From d780faac0b4c8ee12f43901c69abe47e9a2e31fe Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Tue, 9 Jul 2024 23:39:59 +0530 Subject: [PATCH 5/6] EX-1142 update asset files --- dist/editor/blocks.asset.php | 2 +- dist/editor/blocks.js | 2 +- dist/editor/blocks.js.map | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/editor/blocks.asset.php b/dist/editor/blocks.asset.php index cd7ab20..a12af25 100644 --- a/dist/editor/blocks.asset.php +++ b/dist/editor/blocks.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => '7369bf1f984476aa1081'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'a9d2811d6f17d28c57df'); diff --git a/dist/editor/blocks.js b/dist/editor/blocks.js index 7f79271..f9c2439 100644 --- a/dist/editor/blocks.js +++ b/dist/editor/blocks.js @@ -1 +1 @@ -(()=>{var e={251:(e,t,o)=>{"use strict";var n=o(196),r=Symbol.for("react.element"),l=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,o){var n,l={},c=null,p=null;for(n in void 0!==o&&(c=""+o),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(p=t.ref),t)a.call(t,n)&&!i.hasOwnProperty(n)&&(l[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===l[n]&&(l[n]=t[n]);return{$$typeof:r,type:e,key:c,ref:p,props:l,_owner:s.current}}t.Fragment=l,t.jsx=c,t.jsxs=c},893:(e,t,o)=>{"use strict";e.exports=o(251)},196:e=>{"use strict";e.exports=window.React},967:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};o.r(e),o.d(e,{name:()=>z,settings:()=>E});var t={};o.r(t),o.d(t,{name:()=>P,settings:()=>M});var n={};o.r(n),o.d(n,{name:()=>A,settings:()=>N});var r={};o.r(r),o.d(r,{name:()=>G,settings:()=>L});var l={};o.r(l),o.d(l,{name:()=>$,settings:()=>W});const a=window.wp.blocks;var s=o(893);const i=window.wp.i18n,c=window.wp.blockEditor;var p=o(196);const d=window.wp.primitives,u=(0,p.createElement)(d.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,p.createElement)(d.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"})),v=window.wp.element,h=window.wp.components,m=window.wp.data;var b=o(967),w=o.n(b);function k(e){const{setAttributes:t,clientId:o}=e,[n,r]=(0,v.useState)(2),[l,a]=(0,v.useState)(2);return(0,s.jsx)(h.Placeholder,{label:(0,i.__)("Table","tp"),icon:(0,s.jsx)(c.BlockIcon,{icon:u,showColors:!0}),instructions:(0,i.__)("Insert a table for sharing data.","tp"),children:(0,s.jsxs)("form",{className:"travelopia-table__placeholder-form",onSubmit:e=>{e.preventDefault(),t({rows:n,columns:l}),F("tbody",o)},children:[(0,s.jsx)(h.TextControl,{type:"number",label:(0,i.__)("Column count","tp"),value:l,onChange:e=>a(parseInt(e)),min:"1",className:"travelopia-table__placeholder-input"}),(0,s.jsx)(h.TextControl,{type:"number",label:(0,i.__)("Row count","tp"),value:n,onChange:e=>r(parseInt(e)),min:"1",className:"travelopia-table__placeholder-input"}),(0,s.jsx)(h.Button,{variant:"primary",type:"submit",children:(0,i.__)("Create Table","tp")})]})})}const f=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),_=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),g=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),y=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),x=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),B=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),I=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,p.createElement)(d.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})),V=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,p.createElement)(d.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})),j=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,p.createElement)(d.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})),S=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,p.createElement)(d.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})),C=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,p.createElement)(d.Path,{d:"M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"}));const H=function(e){const{attributes:t,setAttributes:o}=e,n=(0,c.useBlockProps)({className:"travelopia-table__cell"});return(0,s.jsx)(c.RichText,Object.assign({tagName:"span"},n,{placeholder:(0,i.__)("Cell content","tp"),onChange:e=>o({content:e}),value:t.content}))},z="travelopia/table-cell",E={apiVersion:3,icon:u,title:(0,i.__)("Cell","tp"),description:(0,i.__)("Individual cell of the table.","tp"),parent:["travelopia/table-column"],category:"text",keywords:[(0,i.__)("cell","tp")],attributes:{content:{type:"string",source:"html"}},supports:{html:!0,className:!1},transforms:{to:[{type:"block",blocks:["core/heading"],transform:(e,t)=>(0,a.createBlock)("core/heading",Object.assign(Object.assign({},e),{level:"3"}),t)},{type:"block",blocks:["core/paragraph"],transform:(e,t)=>(0,a.createBlock)("core/paragraph",e,t)},{type:"block",blocks:["core/list"],transform:(e,t)=>(0,a.createBlock)("core/list",{},[(0,a.createBlock)("core/list-item",e,t)])}]},edit:H,save:({attributes:e})=>(0,s.jsx)(c.RichText.Content,{value:e.content})};function O({isSelected:e,tableId:t,tableRow:o,tableColumn:n,rowContainerId:r,columnId:l}){const{getBlock:p,canInsertBlockType:d,getBlockAttributes:u,canRemoveBlock:b,getAdjacentBlockClientId:w}=(0,m.select)("core/block-editor"),{removeBlock:k,removeBlocks:H,insertBlock:E,updateBlockAttributes:O,moveBlocksToPosition:T}=(0,m.dispatch)("core/block-editor"),[M,D]=(0,v.useState)(0),N=(0,v.useMemo)((()=>{var e,t;return null===(t=null===(e=p(r))||void 0===e?void 0:e.attributes)||void 0===t?void 0:t.type}),[r,p]);(0,v.useEffect)((()=>{const e=p(t);e?e.innerBlocks.some(((e,t)=>!(e.name!==A||t+1!==o||!e.innerBlocks.length)&&(D(e.innerBlocks.length),!0))):D(0)}),[o,n,p,t]);const R=(e=0)=>{var n,l;const s=p(t);if(!s)return;if(!d(A,r))return;const i=[];for(let e=0;e<(null===(n=s.attributes)||void 0===n?void 0:n.columns);e++)i.push((0,a.createBlock)(P,{},[(0,a.createBlock)(z)]));const c=(0,a.createBlock)(A,{},i);E(c,o+e,r),O(t,{rows:(null===(l=s.attributes)||void 0===l?void 0:l.rows)+1})},L=(e=0)=>{var o;const l=p(t);if(!l)return;p(r)&&(l.innerBlocks.forEach((t=>{t.name===G&&t.innerBlocks.forEach((t=>{if(t.name!==A)return;if(!d(P,t.clientId))return;const o=(0,a.createBlock)(P,{},[(0,a.createBlock)(z)]);E(o,n+e,t.clientId)}))})),O(t,{columns:(null===(o=l.attributes)||void 0===o?void 0:o.columns)+1}))},F=(e,t)=>{var o,n,r,l;const a=u(t.clientId),s=u(e.clientId);if(parseInt(null!==(o=null==a?void 0:a.rowSpan)&&void 0!==o?o:1)!==parseInt(null!==(n=null==s?void 0:s.rowSpan)&&void 0!==n?n:1))return;const i=parseInt(null!==(r=null==a?void 0:a.colSpan)&&void 0!==r?r:1),c=parseInt(null!==(l=null==s?void 0:s.colSpan)&&void 0!==l?l:1);O(t.clientId,{colSpan:i+c}),T(e.innerBlocks.map((e=>e.clientId)),e.clientId,t.clientId),k(e.clientId)},U=(e,t)=>{var o,n,r,l;const a=u(t.clientId),s=u(e.clientId);if(parseInt(null!==(o=null==a?void 0:a.colSpan)&&void 0!==o?o:1)!==parseInt(null!==(n=null==s?void 0:s.colSpan)&&void 0!==n?n:1))return;const i=parseInt(null!==(r=null==a?void 0:a.rowSpan)&&void 0!==r?r:1),c=parseInt(null!==(l=null==s?void 0:s.rowSpan)&&void 0!==l?l:1);O(t.clientId,{rowSpan:i+c}),T(e.innerBlocks.map((e=>e.clientId)),e.clientId,t.clientId),k(e.clientId)},Y=[{icon:f,title:(0,i.__)("Insert row before","tp"),isDisabled:!e||"tfoot"===N||"thead"===N,onClick:()=>R(-1)},{icon:_,title:(0,i.__)("Insert row after","tp"),isDisabled:!e||"tfoot"===N||"thead"===N,onClick:R},{icon:g,title:(0,i.__)("Delete row","tp"),isDisabled:!e||"tfoot"===N||"thead"===N,onClick:()=>{var e;const n=p(t);if(!n)return;const l=p(r);if(!l)return;const a=l.innerBlocks[o-1];(null==a?void 0:a.clientId)&&b(a.clientId)&&(k(a.clientId),O(t,{rows:(null===(e=n.attributes)||void 0===e?void 0:e.rows)-1}))}},{icon:y,title:(0,i.__)("Insert column before","tp"),isDisabled:!e,onClick:()=>L(-1)},{icon:x,title:(0,i.__)("Insert column after","tp"),isDisabled:!e,onClick:L},{icon:B,title:(0,i.__)("Delete column","tp"),isDisabled:!e,onClick:()=>{var e;const o=p(t);if(!o)return;const r=[];o.innerBlocks.forEach((e=>{e.name===G&&e.innerBlocks.forEach((e=>{if(e.name!==A)return;const t=e.innerBlocks[n-1];(null==t?void 0:t.clientId)&&b(t.clientId)&&r.push(t.clientId)}))})),H(r),O(t,{columns:(null===(e=o.attributes)||void 0===e?void 0:e.columns)-1})}},{icon:I,title:(0,i.__)("Merge column left","tp"),isDisabled:n<2,onClick:()=>{if(!p(t))return;const e=p(l);if(!e)return;const o=w(l,-1);if(!o)return;const n=p(o);n&&F(e,n)}},{icon:V,title:(0,i.__)("Merge column right","tp"),isDisabled:n===M,onClick:()=>{if(!p(t))return;const e=p(l);if(!e)return;const o=w(l,1);if(!o)return;const n=p(o);n&&F(n,e)}},{icon:j,title:(0,i.__)("Merge column up","tp"),isDisabled:o<2||"tfoot"===N||"thead"===N,onClick:()=>{const e=p(t);if(!e)return;const l=p(r);if(!l)return;let a,s;e.innerBlocks.some((e=>{var t;if(e.name!==G)return!1;const r=u(e.clientId);return(null==r?void 0:r.type)===(null===(t=null==l?void 0:l.attributes)||void 0===t?void 0:t.type)&&e.innerBlocks.some(((e,t)=>{const r=t+1;return!(e.name!==A||r!==o&&r!==o-1||!e.innerBlocks.length)&&(e.innerBlocks.some(((e,t)=>{const l=t+1;return l===n&&r===o?s=e:l===n&&r===o-1&&(a=e),!(!a||!s)})),!(!s||!a)&&(U(s,a),!0))}))}))}},{icon:S,title:(0,i.__)("Merge column down","tp"),isDisabled:"tfoot"===N||"thead"===N,onClick:()=>{const e=p(t);if(!e)return;const l=p(r);if(!l)return;let a,s;e.innerBlocks.some((e=>{var t;if(e.name!==G)return!1;const r=u(e.clientId);return(null==r?void 0:r.type)===(null===(t=null==l?void 0:l.attributes)||void 0===t?void 0:t.type)&&e.innerBlocks.some(((e,t)=>{const r=t+1;return!(e.name!==A||r!==o&&r!==o+1||!e.innerBlocks.length)&&(e.innerBlocks.some(((e,t)=>{const l=t+1;return l===n&&r===o?a=e:l===n&&r===o+1&&(s=e),!(!a||!s)})),!(!s||!a)&&(U(s,a),!0))}))}))}}];return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(c.BlockControls,{group:"other",children:(0,s.jsx)(h.ToolbarDropdownMenu,{icon:C,label:(0,i.__)("Edit table","tp"),controls:Y})})})}const T=function({className:e,clientId:t,attributes:o,setAttributes:n,isSelected:r,context:l}){const a=(0,c.useBlockProps)({className:w()(e,"travelopia-table__column",{"travelopia-table__column--sticky":o.isSticky})}),p=l["travelopia/table-id"],d=l["travelopia/table-row-container-type"],u=l["travelopia/table-row-container-id"],b=(0,c.useInnerBlocksProps)(Object.assign(Object.assign({},a),{colSpan:o.colSpan,rowSpan:o.rowSpan}),{template:[[z]],templateLock:!1}),{row:k,column:f}=(0,m.useSelect)((e=>{const o=e(c.store).getBlockIndex(t),n=e(c.store).getBlockRootClientId(t);return{row:e(c.store).getBlockIndex(n)+1,column:o+1}}),[t]);(0,v.useEffect)((()=>{n({row:k,column:f})}),[k,f,n]),(0,v.useEffect)((()=>{n({blockId:t})}),[t,n]);let _="td";return"tbody"!==d&&(_="th"),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.InspectorControls,{children:(0,s.jsx)(h.PanelBody,{title:(0,i.__)("Column Options","tp"),children:(0,s.jsx)(h.ToggleControl,{label:(0,i.__)("Is Sticky","tp"),checked:o.isSticky,onChange:e=>n({isSticky:e}),help:(0,i.__)("Is this column sticky?","tp")})})}),(0,s.jsx)(O,{isSelected:r,tableRow:k,tableColumn:f,tableId:p,rowContainerId:u,columnId:t}),(0,s.jsx)(_,Object.assign({},b))]})},P="travelopia/table-column",M={apiVersion:3,icon:u,title:(0,i.__)("Column","tp"),description:(0,i.__)("Individual column of the table.","tp"),parent:["travelopia/table-row"],category:"text",keywords:[(0,i.__)("column","tp")],attributes:{row:{type:"number"},column:{type:"number"},colSpan:{type:"number"},rowSpan:{type:"number"},isSticky:{type:"boolean"},blockId:{type:"string"}},providesContext:{"travelopia/table-row":"row","travelopia/table-column":"column","travelopia/table-column-id":"blockId"},usesContext:["travelopia/table-row-container-type","travelopia/table-row-container-id"],supports:{html:!0,color:{text:!0,background:!0},align:["left","center","right"],__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}}},edit:T,save:()=>(0,s.jsx)(c.InnerBlocks.Content,{})};const D=function(e){const{className:t,clientId:o,setAttributes:n}=e,r=(0,c.useBlockProps)({className:w()(t,"travelopia-table__row")}),l=(0,c.useInnerBlocksProps)(Object.assign({},r),{allowedBlocks:[P],templateLock:!1});return(0,v.useEffect)((()=>{n({blockId:o})}),[o,n]),(0,s.jsx)("tr",Object.assign({},l))},A="travelopia/table-row",N={apiVersion:3,icon:u,title:(0,i.__)("Row","tp"),description:(0,i.__)("Individual row of the table.","tp"),parent:["travelopia/table-row-container"],category:"text",keywords:[(0,i.__)("row","tp")],attributes:{blockId:{type:"string"}},usesContext:["travelopia/table-row-container-type"],supports:{html:!0,color:{text:!0,background:!0},__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}}},edit:D,save:()=>(0,s.jsx)(c.InnerBlocks.Content,{})};const R=function(e){const{className:t,attributes:o,setAttributes:n,clientId:r}=e,l=(0,c.useBlockProps)({className:w()(t,"travelopia-table__row-container",{"travelopia-table__row-container--sticky":o.isSticky})}),a=(0,c.useInnerBlocksProps)(Object.assign({},l),{allowedBlocks:[A]}),p=o.type;return(0,v.useEffect)((()=>{n({blockId:r})}),[r,n]),(0,s.jsxs)(s.Fragment,{children:["thead"===o.type&&(0,s.jsx)(c.InspectorControls,{children:(0,s.jsx)(h.PanelBody,{title:(0,i.__)("Row Container Options","tp"),children:(0,s.jsx)(h.ToggleControl,{label:(0,i.__)("Is Sticky vertically","tp"),checked:o.isSticky,onChange:e=>n({isSticky:e}),help:(0,i.__)("Is this container sticky?","tp")})})}),(0,s.jsx)(p,Object.assign({},a))]})},G="travelopia/table-row-container",L={apiVersion:3,icon:u,title:(0,i.__)("Row Container","tp"),description:(0,i.__)("A container for a row (THEAD, TBODY, TFOOT).","tp"),parent:["travelopia/table"],category:"text",keywords:[(0,i.__)("thead","tp"),(0,i.__)("tbody","tp"),(0,i.__)("tfoot","tp")],attributes:{type:{type:"string",default:"tbody"},isSticky:{type:"boolean",default:!1},blockId:{type:"string"}},providesContext:{"travelopia/table-row-container-type":"type","travelopia/table-row-container-sticky":"isSticky","travelopia/table-row-container-id":"blockId"},supports:{html:!1},edit:R,save:()=>(0,s.jsx)(c.InnerBlocks.Content,{})},F=(e="tbody",t="")=>{const o=(0,m.select)("core/block-editor").getBlock(t);if(!o)return;const n=(0,a.createBlock)(G,{type:e});let r=o.attributes.rows;"tbody"!==e&&(r=1);for(let e=0;e{const o=(0,m.select)("core/block-editor").getBlock(t);o&&o.innerBlocks.length&&o.innerBlocks.forEach((t=>{var o;(null===(o=t.attributes)||void 0===o?void 0:o.type)===e&&(0,m.dispatch)("core/block-editor").removeBlock(t.clientId)}))};const Y=function(e){const{className:t,attributes:o,clientId:n,setAttributes:r}=e,l=(0,c.useBlockProps)({className:w()(t,"travelopia-table")}),a=(0,c.useInnerBlocksProps)({},{allowedBlocks:[G],renderAppender:void 0});return(0,v.useEffect)((()=>{r({blockId:n})}),[n,r]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.InspectorControls,{children:(0,s.jsxs)(h.PanelBody,{title:(0,i.__)("Table Options","tp"),children:[(0,s.jsx)(h.ToggleControl,{label:(0,i.__)("Has THEAD","tp"),checked:o.hasThead,onChange:e=>{e?F("thead",n):U("thead",n),r({hasThead:e})},help:(0,i.__)("Does this table have a header?","tp")}),(0,s.jsx)(h.ToggleControl,{label:(0,i.__)("Has TFOOT","tp"),checked:o.hasTfoot,onChange:e=>{e?F("tfoot",n):U("tfoot",n),r({hasTfoot:e})},help:(0,i.__)("Does this table have a footer?","tp")})]})}),(0,s.jsxs)("figure",Object.assign({},l,{children:[(0===o.rows||0===o.columns)&&(0,s.jsx)(k,Object.assign({},e)),(0!==o.rows||0!==o.columns)&&(0,s.jsx)("table",Object.assign({},a))]}))]})},$="travelopia/table",W={apiVersion:3,icon:u,title:(0,i.__)("Table","tp"),description:(0,i.__)("Create structured content in rows and columns to display information.","tp"),category:"text",keywords:[(0,i.__)("table","tp")],attributes:{anchor:{type:"string"},rows:{type:"number",default:0},columns:{type:"number",default:0},blockId:{type:"string"},hasThead:{type:"boolean",default:!1},hasTfoot:{type:"boolean",default:!1}},providesContext:{"travelopia/table-id":"blockId","travelopia/table-total-rows":"rows","travelopia/table-total-columns":"columns","travelopia/table-has-thead":"hasThead","travelopia/table-has-tfoot":"hasTfoot"},supports:{anchor:!0},edit:Y,save:()=>(0,s.jsx)(c.InnerBlocks.Content,{})},q=window.wp.hooks;(0,q.addFilter)("blocks.registerBlockType","travelopia/table-row-column-context",(e=>{const t=["travelopia/table-row","travelopia/table-column","travelopia/table-id","travelopia/table-row-container-id","travelopia/table-column-id"];return e.usesContext&&Array.isArray(e.usesContext)&&t.forEach((t=>{var o,n;(null===(o=e.usesContext)||void 0===o?void 0:o.includes(t))||null===(n=e.usesContext)||void 0===n||n.push(t)})),e})),(0,q.addFilter)("editor.BlockEdit","travelopia/table-toolbar",(e=>t=>{const{context:o,isSelected:n}=t;if(!o)return(0,s.jsx)(e,Object.assign({},t));const r=o["travelopia/table-row"],l=o["travelopia/table-column"],a=o["travelopia/table-id"],i=o["travelopia/table-row-container-id"],c=o["travelopia/table-column-id"];return!r||!l||!a||l<1||r<1?(0,s.jsx)(e,Object.assign({},t)):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(O,{isSelected:n,tableRow:r,tableColumn:l,tableId:a,rowContainerId:i,columnId:c}),(0,s.jsx)(e,Object.assign({},t))]})}));[l,r,n,t,e].forEach((({name:e,settings:t})=>(0,a.registerBlockType)(e,t)))})()})(); \ No newline at end of file +(()=>{var e={251:(e,t,o)=>{"use strict";var n=o(196),r=Symbol.for("react.element"),l=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,o){var n,l={},c=null,p=null;for(n in void 0!==o&&(c=""+o),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(p=t.ref),t)a.call(t,n)&&!i.hasOwnProperty(n)&&(l[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===l[n]&&(l[n]=t[n]);return{$$typeof:r,type:e,key:c,ref:p,props:l,_owner:s.current}}t.Fragment=l,t.jsx=c,t.jsxs=c},893:(e,t,o)=>{"use strict";e.exports=o(251)},196:e=>{"use strict";e.exports=window.React},967:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};o.r(e),o.d(e,{name:()=>z,settings:()=>E});var t={};o.r(t),o.d(t,{name:()=>P,settings:()=>M});var n={};o.r(n),o.d(n,{name:()=>A,settings:()=>N});var r={};o.r(r),o.d(r,{name:()=>G,settings:()=>L});var l={};o.r(l),o.d(l,{name:()=>$,settings:()=>W});const a=window.wp.blocks;var s=o(893);const i=window.wp.i18n,c=window.wp.blockEditor;var p=o(196);const d=window.wp.primitives,u=(0,p.createElement)(d.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,p.createElement)(d.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"})),v=window.wp.element,h=window.wp.components,m=window.wp.data;var b=o(967),w=o.n(b);function k(e){const{setAttributes:t,clientId:o}=e,[n,r]=(0,v.useState)(2),[l,a]=(0,v.useState)(2);return(0,s.jsx)(h.Placeholder,{label:(0,i.__)("Table","tp"),icon:(0,s.jsx)(c.BlockIcon,{icon:u,showColors:!0}),instructions:(0,i.__)("Insert a table for sharing data.","tp"),children:(0,s.jsxs)("form",{className:"travelopia-table__placeholder-form",onSubmit:e=>{e.preventDefault(),t({rows:n,columns:l}),F("tbody",o)},children:[(0,s.jsx)(h.TextControl,{type:"number",label:(0,i.__)("Column count","tp"),value:l,onChange:e=>a(parseInt(e)),min:"1",className:"travelopia-table__placeholder-input"}),(0,s.jsx)(h.TextControl,{type:"number",label:(0,i.__)("Row count","tp"),value:n,onChange:e=>r(parseInt(e)),min:"1",className:"travelopia-table__placeholder-input"}),(0,s.jsx)(h.Button,{variant:"primary",type:"submit",children:(0,i.__)("Create Table","tp")})]})})}const f=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),_=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),g=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),y=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),x=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),B=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,p.createElement)(d.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"})),I=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,p.createElement)(d.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})),V=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,p.createElement)(d.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})),j=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,p.createElement)(d.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})),S=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,p.createElement)(d.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})),C=(0,p.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,p.createElement)(d.Path,{d:"M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"}));const H=function(e){const{attributes:t,setAttributes:o}=e,n=(0,c.useBlockProps)({className:"travelopia-table__cell"});return(0,s.jsx)(c.RichText,Object.assign({tagName:"span"},n,{placeholder:(0,i.__)("Cell content","tp"),onChange:e=>o({content:e}),value:t.content}))},z="travelopia/table-cell",E={apiVersion:3,icon:u,title:(0,i.__)("Cell","tp"),description:(0,i.__)("Individual cell of the table.","tp"),parent:["travelopia/table-column"],category:"text",keywords:[(0,i.__)("cell","tp")],attributes:{content:{type:"string",source:"html"}},supports:{html:!0,className:!1},transforms:{to:[{type:"block",blocks:["core/heading"],transform:(e,t)=>(0,a.createBlock)("core/heading",Object.assign(Object.assign({},e),{level:"3"}),t)},{type:"block",blocks:["core/paragraph"],transform:(e,t)=>(0,a.createBlock)("core/paragraph",e,t)},{type:"block",blocks:["core/list"],transform:(e,t)=>(0,a.createBlock)("core/list",{},[(0,a.createBlock)("core/list-item",e,t)])}]},edit:H,save:({attributes:e})=>(0,s.jsx)(c.RichText.Content,{value:e.content})};function O({isSelected:e,tableId:t,tableRow:o,tableColumn:n,rowContainerId:r,columnId:l}){const{getBlock:p,canInsertBlockType:d,getBlockAttributes:u,canRemoveBlock:b,getAdjacentBlockClientId:w}=(0,m.select)("core/block-editor"),{removeBlock:k,removeBlocks:H,insertBlock:E,updateBlockAttributes:O,moveBlocksToPosition:T}=(0,m.dispatch)("core/block-editor"),[M,D]=(0,v.useState)(0),[N,R]=(0,v.useState)(0),L=(0,v.useMemo)((()=>{var e,t;return null===(t=null===(e=p(r))||void 0===e?void 0:e.attributes)||void 0===t?void 0:t.type}),[r,p]);(0,v.useEffect)((()=>{const e=p(t);e?e.innerBlocks.some((e=>{if(e.name!==G||!e.innerBlocks.length)return!1;let t=0;return e.innerBlocks.forEach(((e,r)=>{e.name===A&&e.innerBlocks.length&&(r+1===o&&D(e.innerBlocks.length),e.innerBlocks.forEach(((e,o)=>{e.name===P&&o+1===n&&t++})))})),R(t),!0})):D(0)}),[o,n,p,t]);const F=(e=0)=>{var n,l;const s=p(t);if(!s)return;if(!d(A,r))return;const i=[];for(let e=0;e<(null===(n=s.attributes)||void 0===n?void 0:n.columns);e++)i.push((0,a.createBlock)(P,{},[(0,a.createBlock)(z)]));const c=(0,a.createBlock)(A,{},i);E(c,o+e,r),O(t,{rows:(null===(l=s.attributes)||void 0===l?void 0:l.rows)+1})},U=(e=0)=>{var o;const l=p(t);if(!l)return;p(r)&&(l.innerBlocks.forEach((t=>{t.name===G&&t.innerBlocks.forEach((t=>{if(t.name!==A)return;if(!d(P,t.clientId))return;const o=(0,a.createBlock)(P,{},[(0,a.createBlock)(z)]);E(o,n+e,t.clientId)}))})),O(t,{columns:(null===(o=l.attributes)||void 0===o?void 0:o.columns)+1}))},Y=(e,t)=>{var o,n,r,l;const a=u(t.clientId),s=u(e.clientId);if(parseInt(null!==(o=null==a?void 0:a.rowSpan)&&void 0!==o?o:1)!==parseInt(null!==(n=null==s?void 0:s.rowSpan)&&void 0!==n?n:1))return;const i=parseInt(null!==(r=null==a?void 0:a.colSpan)&&void 0!==r?r:1),c=parseInt(null!==(l=null==s?void 0:s.colSpan)&&void 0!==l?l:1);O(t.clientId,{colSpan:i+c}),T(e.innerBlocks.map((e=>e.clientId)),e.clientId,t.clientId),k(e.clientId)},$=(e,t)=>{var o,n,r,l;const a=u(t.clientId),s=u(e.clientId);if(parseInt(null!==(o=null==a?void 0:a.colSpan)&&void 0!==o?o:1)!==parseInt(null!==(n=null==s?void 0:s.colSpan)&&void 0!==n?n:1))return;const i=parseInt(null!==(r=null==a?void 0:a.rowSpan)&&void 0!==r?r:1),c=parseInt(null!==(l=null==s?void 0:s.rowSpan)&&void 0!==l?l:1);O(t.clientId,{rowSpan:i+c}),T(e.innerBlocks.map((e=>e.clientId)),e.clientId,t.clientId),k(e.clientId)},W=[{icon:f,title:(0,i.__)("Insert row before","tp"),isDisabled:!e||"tfoot"===L||"thead"===L,onClick:()=>F(-1)},{icon:_,title:(0,i.__)("Insert row after","tp"),isDisabled:!e||"tfoot"===L||"thead"===L,onClick:F},{icon:g,title:(0,i.__)("Delete row","tp"),isDisabled:!e||"tfoot"===L||"thead"===L,onClick:()=>{var e;const n=p(t);if(!n)return;const l=p(r);if(!l)return;const a=l.innerBlocks[o-1];(null==a?void 0:a.clientId)&&b(a.clientId)&&(k(a.clientId),O(t,{rows:(null===(e=n.attributes)||void 0===e?void 0:e.rows)-1}))}},{icon:y,title:(0,i.__)("Insert column before","tp"),isDisabled:!e,onClick:()=>U(-1)},{icon:x,title:(0,i.__)("Insert column after","tp"),isDisabled:!e,onClick:U},{icon:B,title:(0,i.__)("Delete column","tp"),isDisabled:!e,onClick:()=>{var e;const o=p(t);if(!o)return;const r=[];o.innerBlocks.forEach((e=>{e.name===G&&e.innerBlocks.forEach((e=>{if(e.name!==A)return;const t=e.innerBlocks[n-1];(null==t?void 0:t.clientId)&&b(t.clientId)&&r.push(t.clientId)}))})),H(r),O(t,{columns:(null===(e=o.attributes)||void 0===e?void 0:e.columns)-1})}},{icon:I,title:(0,i.__)("Merge column left","tp"),isDisabled:n<2,onClick:()=>{if(!p(t))return;const e=p(l);if(!e)return;const o=w(l,-1);if(!o)return;const n=p(o);n&&Y(e,n)}},{icon:V,title:(0,i.__)("Merge column right","tp"),isDisabled:n===M,onClick:()=>{if(!p(t))return;const e=p(l);if(!e)return;const o=w(l,1);if(!o)return;const n=p(o);n&&Y(n,e)}},{icon:j,title:(0,i.__)("Merge column up","tp"),isDisabled:o<2||"tfoot"===L||"thead"===L,onClick:()=>{const e=p(t);if(!e)return;const l=p(r);if(!l)return;let a,s;e.innerBlocks.some((e=>{var t;if(e.name!==G)return!1;const r=u(e.clientId);return(null==r?void 0:r.type)===(null===(t=null==l?void 0:l.attributes)||void 0===t?void 0:t.type)&&e.innerBlocks.some(((e,t)=>{const r=t+1;return!(e.name!==A||r!==o&&r!==o-1||!e.innerBlocks.length)&&(e.innerBlocks.some(((e,t)=>{const l=t+1;return l===n&&r===o?s=e:l===n&&r===o-1&&(a=e),!(!a||!s)})),!(!s||!a)&&($(s,a),!0))}))}))}},{icon:S,title:(0,i.__)("Merge column down","tp"),isDisabled:o===N||"tfoot"===L||"thead"===L,onClick:()=>{const e=p(t);if(!e)return;const l=p(r);if(!l)return;let a,s;e.innerBlocks.some((e=>{var t;if(e.name!==G)return!1;const r=u(e.clientId);return(null==r?void 0:r.type)===(null===(t=null==l?void 0:l.attributes)||void 0===t?void 0:t.type)&&e.innerBlocks.some(((e,t)=>{const r=t+1;return!(e.name!==A||r!==o&&r!==o+1||!e.innerBlocks.length)&&(e.innerBlocks.some(((e,t)=>{const l=t+1;return l===n&&r===o?a=e:l===n&&r===o+1&&(s=e),!(!a||!s)})),!(!s||!a)&&($(s,a),!0))}))}))}}];return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(c.BlockControls,{group:"other",children:(0,s.jsx)(h.ToolbarDropdownMenu,{icon:C,label:(0,i.__)("Edit table","tp"),controls:W})})})}const T=function({className:e,clientId:t,attributes:o,setAttributes:n,isSelected:r,context:l}){const a=(0,c.useBlockProps)({className:w()(e,"travelopia-table__column",{"travelopia-table__column--sticky":o.isSticky})}),p=l["travelopia/table-id"],d=l["travelopia/table-row-container-type"],u=l["travelopia/table-row-container-id"],b=(0,c.useInnerBlocksProps)(Object.assign(Object.assign({},a),{colSpan:o.colSpan,rowSpan:o.rowSpan}),{template:[[z]],templateLock:!1}),{row:k,column:f}=(0,m.useSelect)((e=>{const o=e(c.store).getBlockIndex(t),n=e(c.store).getBlockRootClientId(t);return{row:e(c.store).getBlockIndex(n)+1,column:o+1}}),[t]);(0,v.useEffect)((()=>{n({row:k,column:f})}),[k,f,n]),(0,v.useEffect)((()=>{n({blockId:t})}),[t,n]);let _="td";return"tbody"!==d&&(_="th"),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.InspectorControls,{children:(0,s.jsx)(h.PanelBody,{title:(0,i.__)("Column Options","tp"),children:(0,s.jsx)(h.ToggleControl,{label:(0,i.__)("Is Sticky","tp"),checked:o.isSticky,onChange:e=>n({isSticky:e}),help:(0,i.__)("Is this column sticky?","tp")})})}),(0,s.jsx)(O,{isSelected:r,tableRow:k,tableColumn:f,tableId:p,rowContainerId:u,columnId:t}),(0,s.jsx)(_,Object.assign({},b))]})},P="travelopia/table-column",M={apiVersion:3,icon:u,title:(0,i.__)("Column","tp"),description:(0,i.__)("Individual column of the table.","tp"),parent:["travelopia/table-row"],category:"text",keywords:[(0,i.__)("column","tp")],attributes:{row:{type:"number"},column:{type:"number"},colSpan:{type:"number"},rowSpan:{type:"number"},isSticky:{type:"boolean"},blockId:{type:"string"}},providesContext:{"travelopia/table-row":"row","travelopia/table-column":"column","travelopia/table-column-id":"blockId"},usesContext:["travelopia/table-row-container-type","travelopia/table-row-container-id"],supports:{html:!0,color:{text:!0,background:!0},align:["left","center","right"],__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}}},edit:T,save:()=>(0,s.jsx)(c.InnerBlocks.Content,{})};const D=function(e){const{className:t,clientId:o,setAttributes:n}=e,r=(0,c.useBlockProps)({className:w()(t,"travelopia-table__row")}),l=(0,c.useInnerBlocksProps)(Object.assign({},r),{allowedBlocks:[P],templateLock:!1});return(0,v.useEffect)((()=>{n({blockId:o})}),[o,n]),(0,s.jsx)("tr",Object.assign({},l))},A="travelopia/table-row",N={apiVersion:3,icon:u,title:(0,i.__)("Row","tp"),description:(0,i.__)("Individual row of the table.","tp"),parent:["travelopia/table-row-container"],category:"text",keywords:[(0,i.__)("row","tp")],attributes:{blockId:{type:"string"}},usesContext:["travelopia/table-row-container-type"],supports:{html:!0,color:{text:!0,background:!0},__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}}},edit:D,save:()=>(0,s.jsx)(c.InnerBlocks.Content,{})};const R=function(e){const{className:t,attributes:o,setAttributes:n,clientId:r}=e,l=(0,c.useBlockProps)({className:w()(t,"travelopia-table__row-container",{"travelopia-table__row-container--sticky":o.isSticky})}),a=(0,c.useInnerBlocksProps)(Object.assign({},l),{allowedBlocks:[A]}),p=o.type;return(0,v.useEffect)((()=>{n({blockId:r})}),[r,n]),(0,s.jsxs)(s.Fragment,{children:["thead"===o.type&&(0,s.jsx)(c.InspectorControls,{children:(0,s.jsx)(h.PanelBody,{title:(0,i.__)("Row Container Options","tp"),children:(0,s.jsx)(h.ToggleControl,{label:(0,i.__)("Is Sticky vertically","tp"),checked:o.isSticky,onChange:e=>n({isSticky:e}),help:(0,i.__)("Is this container sticky?","tp")})})}),(0,s.jsx)(p,Object.assign({},a))]})},G="travelopia/table-row-container",L={apiVersion:3,icon:u,title:(0,i.__)("Row Container","tp"),description:(0,i.__)("A container for a row (THEAD, TBODY, TFOOT).","tp"),parent:["travelopia/table"],category:"text",keywords:[(0,i.__)("thead","tp"),(0,i.__)("tbody","tp"),(0,i.__)("tfoot","tp")],attributes:{type:{type:"string",default:"tbody"},isSticky:{type:"boolean",default:!1},blockId:{type:"string"}},providesContext:{"travelopia/table-row-container-type":"type","travelopia/table-row-container-sticky":"isSticky","travelopia/table-row-container-id":"blockId"},supports:{html:!1},edit:R,save:()=>(0,s.jsx)(c.InnerBlocks.Content,{})},F=(e="tbody",t="")=>{const o=(0,m.select)("core/block-editor").getBlock(t);if(!o)return;const n=(0,a.createBlock)(G,{type:e});let r=o.attributes.rows;"tbody"!==e&&(r=1);for(let e=0;e{const o=(0,m.select)("core/block-editor").getBlock(t);o&&o.innerBlocks.length&&o.innerBlocks.forEach((t=>{var o;(null===(o=t.attributes)||void 0===o?void 0:o.type)===e&&(0,m.dispatch)("core/block-editor").removeBlock(t.clientId)}))};const Y=function(e){const{className:t,attributes:o,clientId:n,setAttributes:r}=e,l=(0,c.useBlockProps)({className:w()(t,"travelopia-table")}),a=(0,c.useInnerBlocksProps)({},{allowedBlocks:[G],renderAppender:void 0});return(0,v.useEffect)((()=>{r({blockId:n})}),[n,r]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.InspectorControls,{children:(0,s.jsxs)(h.PanelBody,{title:(0,i.__)("Table Options","tp"),children:[(0,s.jsx)(h.ToggleControl,{label:(0,i.__)("Has THEAD","tp"),checked:o.hasThead,onChange:e=>{e?F("thead",n):U("thead",n),r({hasThead:e})},help:(0,i.__)("Does this table have a header?","tp")}),(0,s.jsx)(h.ToggleControl,{label:(0,i.__)("Has TFOOT","tp"),checked:o.hasTfoot,onChange:e=>{e?F("tfoot",n):U("tfoot",n),r({hasTfoot:e})},help:(0,i.__)("Does this table have a footer?","tp")})]})}),(0,s.jsxs)("figure",Object.assign({},l,{children:[(0===o.rows||0===o.columns)&&(0,s.jsx)(k,Object.assign({},e)),(0!==o.rows||0!==o.columns)&&(0,s.jsx)("table",Object.assign({},a))]}))]})},$="travelopia/table",W={apiVersion:3,icon:u,title:(0,i.__)("Table","tp"),description:(0,i.__)("Create structured content in rows and columns to display information.","tp"),category:"text",keywords:[(0,i.__)("table","tp")],attributes:{anchor:{type:"string"},rows:{type:"number",default:0},columns:{type:"number",default:0},blockId:{type:"string"},hasThead:{type:"boolean",default:!1},hasTfoot:{type:"boolean",default:!1}},providesContext:{"travelopia/table-id":"blockId","travelopia/table-total-rows":"rows","travelopia/table-total-columns":"columns","travelopia/table-has-thead":"hasThead","travelopia/table-has-tfoot":"hasTfoot"},supports:{anchor:!0},edit:Y,save:()=>(0,s.jsx)(c.InnerBlocks.Content,{})},q=window.wp.hooks;(0,q.addFilter)("blocks.registerBlockType","travelopia/table-row-column-context",(e=>{const t=["travelopia/table-row","travelopia/table-column","travelopia/table-id","travelopia/table-row-container-id","travelopia/table-column-id"];return e.usesContext&&Array.isArray(e.usesContext)&&t.forEach((t=>{var o,n;(null===(o=e.usesContext)||void 0===o?void 0:o.includes(t))||null===(n=e.usesContext)||void 0===n||n.push(t)})),e})),(0,q.addFilter)("editor.BlockEdit","travelopia/table-toolbar",(e=>t=>{const{context:o,isSelected:n}=t;if(!o)return(0,s.jsx)(e,Object.assign({},t));const r=o["travelopia/table-row"],l=o["travelopia/table-column"],a=o["travelopia/table-id"],i=o["travelopia/table-row-container-id"],c=o["travelopia/table-column-id"];return!r||!l||!a||l<1||r<1?(0,s.jsx)(e,Object.assign({},t)):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(O,{isSelected:n,tableRow:r,tableColumn:l,tableId:a,rowContainerId:i,columnId:c}),(0,s.jsx)(e,Object.assign({},t))]})}));[l,r,n,t,e].forEach((({name:e,settings:t})=>(0,a.registerBlockType)(e,t)))})()})(); \ No newline at end of file diff --git a/dist/editor/blocks.js.map b/dist/editor/blocks.js.map index f09eeb8..1f7bb2c 100644 --- a/dist/editor/blocks.js.map +++ b/dist/editor/blocks.js.map @@ -1 +1 @@ -{"version":3,"file":"./dist/editor/blocks.js","mappings":"wCASa,IAAIA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EAAET,EAAEU,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KAAKC,EAAE,KAAiF,IAAIH,UAAhF,IAASD,IAAIG,EAAE,GAAGH,QAAG,IAASD,EAAEN,MAAMU,EAAE,GAAGJ,EAAEN,UAAK,IAASM,EA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AW,SAAEjE,KAAM4C,EAC7B,IAIKhG,CAAQ,KAOjB,IAAA0I,WAAW,mBAAoB,4BAA8BE,GACnD9N,IACR,MAAM,QAAEkL,EAAO,WAAE3E,GAAevG,EAEhC,IAAOkL,EACN,OAAO,SAAC4C,EAAS,iBAAM9N,IAGxB,MAAMyG,EAAWyE,EAAS,wBACpBxE,EAAcwE,EAAS,2BACvB1E,EAAU0E,EAAS,uBACnB6C,EAAsB7C,EAAS,qCAC/B8C,EAAgB9C,EAAS,8BAE/B,OACGzE,IACAC,IACAF,GACFE,EAAc,GACdD,EAAW,GAEJ,SAACqH,EAAS,iBAAM9N,KAIvB,iCACC,SAACsG,EAAO,CACPC,WAAaA,EACbE,SAAWA,EACXC,YAAcA,EACdF,QAAUA,EACVG,eAAiBoH,EACjBnH,SAAWoH,KAEZ,SAACF,EAAS,iBAAM9N,MAEjB,ICxDY,CACd,EACA,EACA,EACA,EACA,GAMMyI,SAAS,EAAIP,OAAMhD,eAAgB,IAAA+I,mBAAmB/F,EAAMhD,I","sources":["webpack://travelopia-wordpress-blocks/./node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://travelopia-wordpress-blocks/./node_modules/react/jsx-runtime.js","webpack://travelopia-wordpress-blocks/external window \"React\"","webpack://travelopia-wordpress-blocks/./node_modules/classnames/index.js","webpack://travelopia-wordpress-blocks/webpack/bootstrap","webpack://travelopia-wordpress-blocks/webpack/runtime/compat get default export","webpack://travelopia-wordpress-blocks/webpack/runtime/define property getters","webpack://travelopia-wordpress-blocks/webpack/runtime/hasOwnProperty shorthand","webpack://travelopia-wordpress-blocks/webpack/runtime/make namespace object","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"blocks\"]","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"i18n\"]","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"blockEditor\"]","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"primitives\"]","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/block-table.js","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"element\"]","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"components\"]","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"data\"]","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table/placeholder.tsx","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-row-before.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-row-after.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-row-delete.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-column-before.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-column-after.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-column-delete.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/arrow-left.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/arrow-right.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/arrow-up.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/arrow-down.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table.js","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-cell/edit.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-cell/index.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-column/toolbar.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-column/edit.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-column/index.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-row/edit.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-row/index.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-row-container/edit.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-row-container/index.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table/edit.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table/index.tsx","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"hooks\"]","webpack://travelopia-wordpress-blocks/./src/editor/blocks/block-toolbar.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/index.ts"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","module.exports = window[\"React\"];","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\nconst blockTable = createElement(SVG, {\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, createElement(Path, {\n 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\"\n}));\nexport default blockTable;\n//# sourceMappingURL=block-table.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { blockTable as icon } from '@wordpress/icons';\nimport {\n\tButton,\n\tTextControl,\n\tPlaceholder,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport {\n\tBlockEditProps,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies.\n */\nimport { createAndInsertRowContainer } from './edit';\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n *\n * @return {JSX.Element} JSX Component.\n */\nexport function TablePlaceholder( props: BlockEditProps ): JSX.Element {\n\tconst { setAttributes, clientId } = props;\n\tconst [ rows, setRows ] = useState( 2 );\n\tconst [ columns, setColumns ] = useState( 2 );\n\n\treturn (\n\t\t }\n\t\t\tinstructions={ __( 'Insert a table for sharing data.', 'tp' ) }\n\t\t>\n\t\t\t {\n\t\t\t\t\t// Prevent form submission.\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t// Set attributes.\n\t\t\t\t\tsetAttributes( { rows, columns } );\n\n\t\t\t\t\t// Create and insert row container.\n\t\t\t\t\tcreateAndInsertRowContainer( 'tbody', clientId );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t setColumns( parseInt( totalColumns ) ) }\n\t\t\t\t\tmin=\"1\"\n\t\t\t\t\tclassName=\"travelopia-table__placeholder-input\"\n\t\t\t\t/>\n\t\t\t\t setRows( parseInt( totalRows ) ) }\n\t\t\t\t\tmin=\"1\"\n\t\t\t\t\tclassName=\"travelopia-table__placeholder-input\"\n\t\t\t\t/>\n\t\t\t\t\n\t\t\t\t\t{ __( 'Create Table', 'tp' ) }\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableRowBefore = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableRowBefore;\n//# sourceMappingURL=table-row-before.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableRowAfter = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableRowAfter;\n//# sourceMappingURL=table-row-after.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableRowDelete = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableRowDelete;\n//# sourceMappingURL=table-row-delete.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableColumnBefore = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableColumnBefore;\n//# sourceMappingURL=table-column-before.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableColumnAfter = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableColumnAfter;\n//# sourceMappingURL=table-column-after.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableColumnDelete = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableColumnDelete;\n//# sourceMappingURL=table-column-delete.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst arrowLeft = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z\"\n}));\nexport default arrowLeft;\n//# sourceMappingURL=arrow-left.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst arrowRight = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z\"\n}));\nexport default arrowRight;\n//# sourceMappingURL=arrow-right.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst arrowUp = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z\"\n}));\nexport default arrowUp;\n//# sourceMappingURL=arrow-up.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst arrowDown = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z\"\n}));\nexport default arrowDown;\n//# sourceMappingURL=arrow-down.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst table = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z\"\n}));\nexport default table;\n//# sourceMappingURL=table.js.map","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockEditProps } from '@wordpress/blocks';\nimport {\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n *\n * @return {JSX.Element} JSX Component.\n */\nfunction TableCellEdit( props: BlockEditProps ): JSX.Element {\n\tconst { attributes, setAttributes } = props;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'travelopia-table__cell',\n\t} );\n\n\treturn (\n\t\t setAttributes( { content } ) }\n\t\t\tvalue={ attributes.content }\n\t\t/>\n\t);\n}\n\nexport default TableCellEdit;\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { RichText } from '@wordpress/block-editor';\nimport {\n\tBlockConfiguration,\n\tBlockInstance,\n\tBlockSaveProps,\n\tcreateBlock,\n\tTransformBlock,\n} from '@wordpress/blocks';\nimport {\n\tblockTable as icon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies.\n */\nimport edit from './edit';\n\n/**\n * Block data.\n */\nexport const name: string = 'travelopia/table-cell';\n\nexport const settings: BlockConfiguration = {\n\tapiVersion: 3,\n\ticon,\n\ttitle: __( 'Cell', 'tp' ),\n\tdescription: __( 'Individual cell of the table.', 'tp' ),\n\tparent: [ 'travelopia/table-column' ],\n\tcategory: 'text',\n\tkeywords: [ __( 'cell', 'tp' ) ],\n\tattributes: {\n\t\tcontent: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t},\n\t},\n\tsupports: {\n\t\thtml: true,\n\t\tclassName: false,\n\t},\n\ttransforms: {\n\t\tto: [\n\t\t\t{\n\t\t\t\ttype: 'block',\n\t\t\t\tblocks: [ 'core/heading' ],\n\t\t\t\ttransform: ( attributes: string[], innerBlocks: BlockInstance<{ [k: string]: any; }>[] | undefined ) => {\n\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t'core/heading', { ...attributes, level: '3' }, innerBlocks\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t} as unknown as TransformBlock,\n\t\t\t{\n\t\t\t\ttype: 'block',\n\t\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\t\ttransform: ( attributes: string[], innerBlocks: BlockInstance<{ [k: string]: any; }>[] | undefined ) => {\n\t\t\t\t\treturn createBlock( 'core/paragraph', attributes, innerBlocks );\n\t\t\t\t},\n\t\t\t} as unknown as TransformBlock,\n\t\t\t{\n\t\t\t\ttype: 'block',\n\t\t\t\tblocks: [ 'core/list' ],\n\t\t\t\ttransform: ( attributes: string[], innerBlocks: BlockInstance<{ [k: string]: any; }>[] | undefined ) => {\n\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t'core/list',\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tcreateBlock( 'core/list-item', attributes, innerBlocks ),\n\t\t\t\t\t\t]\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t} as unknown as TransformBlock,\n\t\t],\n\t},\n\tedit,\n\tsave( { attributes }: BlockSaveProps ) {\n\t\treturn (\n\t\t\t\n\t\t);\n\t},\n};\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockInstance, createBlock } from '@wordpress/blocks';\nimport { BlockControls } from '@wordpress/block-editor';\nimport { ToolbarDropdownMenu } from '@wordpress/components';\nimport { select, dispatch } from '@wordpress/data';\nimport { DropdownOption } from '@wordpress/components/build-types/dropdown-menu/types';\nimport {\n\tarrowLeft,\n\tarrowRight,\n\tarrowUp,\n\tarrowDown,\n\ttableColumnAfter,\n\ttableColumnBefore,\n\ttableColumnDelete,\n\ttableRowAfter,\n\ttableRowBefore,\n\ttableRowDelete,\n\ttable,\n} from '@wordpress/icons';\nimport {\n\tuseState,\n\tuseEffect,\n\tuseMemo,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies.\n */\nimport { name as columnBlockName } from './index';\nimport { name as rowBlockName } from '../table-row';\nimport { name as cellBlockName } from '../table-cell';\nimport { name as rowContainerBlockName } from '../table-row-container';\n\n/**\n * Column block toolbar.\n *\n * @param {Object} props Block properties.\n * @param {boolean} props.isSelected Is block selected.\n * @param {string} props.tableId Table block ID.\n * @param {number} props.tableRow Table row index.\n * @param {number} props.tableColumn Table column index.\n * @param {string} props.rowContainerId Table row container ID.\n * @param {string} props.columnId Column block ID.\n *\n * @return {JSX.Element} JSX Component.\n */\nexport default function Toolbar( {\n\tisSelected,\n\ttableId,\n\ttableRow,\n\ttableColumn,\n\trowContainerId,\n\tcolumnId,\n}: {\n\tisSelected: boolean;\n\ttableId: string;\n\ttableRow: number;\n\ttableColumn: number;\n\trowContainerId: string;\n\tcolumnId: string;\n} ): JSX.Element {\n\tconst {\n\t\tgetBlock,\n\t\tcanInsertBlockType,\n\t\tgetBlockAttributes,\n\t\t// @ts-ignore\n\t\tcanRemoveBlock,\n\t\tgetAdjacentBlockClientId,\n\t} = select( 'core/block-editor' );\n\n\tconst {\n\t\tremoveBlock,\n\t\tremoveBlocks,\n\t\tinsertBlock,\n\t\tupdateBlockAttributes,\n\t\t// @ts-ignore\n\t\tmoveBlocksToPosition,\n\t} = dispatch( 'core/block-editor' );\n\n\tconst [ maximumColumnsInCurrentRow, setMaximumColumnsInCurrentRow ] = useState( 0 );\n\n\tconst rowContainerBlockType = useMemo( () => getBlock( rowContainerId )?.attributes?.type, [ rowContainerId, getBlock ] );\n\n\t/**\n\t * Set maximum columns in current row.\n\t */\n\tuseEffect( (): void => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if we have a block.\n\t\tif ( ! tableBlock ) {\n\t\t\tsetMaximumColumnsInCurrentRow( 0 );\n\t\t\treturn;\n\t\t}\n\n\t\t// Traverse rows.\n\t\ttableBlock.innerBlocks.some( ( rowBlock, index ): boolean => {\n\t\t\t// Get current row.\n\t\t\tif ( rowBlock.name !== rowBlockName || index + 1 !== tableRow || ! rowBlock.innerBlocks.length ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Set maximum columns in current row.\n\t\t\tsetMaximumColumnsInCurrentRow( rowBlock.innerBlocks.length );\n\n\t\t\t// Short-circuit loop.\n\t\t\treturn true;\n\t\t} );\n\t}, [ tableRow, tableColumn, getBlock, tableId ] );\n\n\t/**\n\t * Insert row.\n\t *\n\t * @param {0|-1} insertionIndex Insertion index. -1 for before and 0 for after.\n\t */\n\tconst onInsertRow = ( insertionIndex: 0 | -1 = 0 ) => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if the row block can be inserted.\n\t\tif ( ! canInsertBlockType( rowBlockName, rowContainerId ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Create column blocks.\n\t\tconst columnBlocks = [];\n\n\t\t// Loop through the table columns count attribute.\n\t\tfor ( let i = 0; i < tableBlock.attributes?.columns || 0; i++ ) {\n\t\t\tcolumnBlocks.push(\n\t\t\t\tcreateBlock( columnBlockName, {}, [ createBlock( cellBlockName ) ] ),\n\t\t\t);\n\t\t}\n\n\t\t// Create a new row block.\n\t\tconst newRowBlock = createBlock( rowBlockName, {}, columnBlocks );\n\n\t\t// Insert the new row block.\n\t\tinsertBlock( newRowBlock, tableRow + insertionIndex, rowContainerId );\n\n\t\t// Update the table block attributes.\n\t\tupdateBlockAttributes( tableId, {\n\t\t\trows: tableBlock.attributes?.rows + 1,\n\t\t} );\n\t};\n\n\t/**\n\t * Delete row.\n\t */\n\tconst onDeleteRow = () => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get current row container block.\n\t\tconst rowContainerBlock = getBlock( rowContainerId );\n\n\t\t// Check if the row container block exists.\n\t\tif ( ! rowContainerBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get current row block.\n\t\tconst currentRowBlock = rowContainerBlock.innerBlocks[ tableRow - 1 ];\n\n\t\t// Check if the current row block is removable.\n\t\tif (\n\t\t\t! currentRowBlock?.clientId ||\n\t\t\t! canRemoveBlock( currentRowBlock.clientId )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the current row block.\n\t\tremoveBlock( currentRowBlock.clientId );\n\n\t\t// Update the table block attributes.\n\t\tupdateBlockAttributes( tableId, {\n\t\t\trows: tableBlock.attributes?.rows - 1,\n\t\t} );\n\t};\n\n\t/**\n\t * Insert column.\n\t *\n\t * @param {0|-1} insertionIndex Insertion index. -1 for before and 0 for after.\n\t */\n\tconst onInsertColumn = ( insertionIndex: 0 | -1 = 0 ) => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get current row container block.\n\t\tconst rowContainerBlock = getBlock( rowContainerId );\n\n\t\t// Check if the row container block exists.\n\t\tif ( ! rowContainerBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Loop through the table row blocks and insert a new column block.\n\t\ttableBlock.innerBlocks.forEach( ( currentRowContainerBlock ) => {\n\t\t\t// Check the name of the row container block.\n\t\t\tif ( currentRowContainerBlock.name !== rowContainerBlockName ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Loop through the row container blocks.\n\t\t\tcurrentRowContainerBlock.innerBlocks.forEach( ( rowBlock ) => {\n\t\t\t\t// Check the name of the row block.\n\t\t\t\tif ( rowBlock.name !== rowBlockName ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Check if the column block can be inserted.\n\t\t\t\tif ( ! canInsertBlockType( columnBlockName, rowBlock.clientId ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Create a new column block.\n\t\t\t\tconst newColumnBlock = createBlock( columnBlockName, {}, [\n\t\t\t\t\tcreateBlock( cellBlockName ),\n\t\t\t\t] );\n\n\t\t\t\t// Insert the new column block.\n\t\t\t\tinsertBlock( newColumnBlock, tableColumn + insertionIndex, rowBlock.clientId );\n\t\t\t} );\n\t\t} );\n\n\t\t// Update the table block attributes.\n\t\tupdateBlockAttributes( tableId, {\n\t\t\tcolumns: tableBlock.attributes?.columns + 1,\n\t\t} );\n\t};\n\n\t/**\n\t * Delete column.\n\t */\n\tconst onDeleteColumn = () => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Columns to be removed.\n\t\tconst columnsToRemove: string[] = [];\n\n\t\t// Loop through the table row blocks.\n\t\ttableBlock.innerBlocks.forEach( ( currentRowContainerBlock ) => {\n\t\t\t// Check the name of the row container block.\n\t\t\tif ( currentRowContainerBlock.name !== rowContainerBlockName ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Loop through the row container blocks.\n\t\t\tcurrentRowContainerBlock.innerBlocks.forEach( ( rowBlock ) => {\n\t\t\t\t// Check the name of the row block.\n\t\t\t\tif ( rowBlock.name !== rowBlockName ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the current column block.\n\t\t\t\tconst currentColumnBlock = rowBlock.innerBlocks[ tableColumn - 1 ];\n\n\t\t\t\t// Check if the current column block is removable.\n\t\t\t\tif (\n\t\t\t\t\tcurrentColumnBlock?.clientId &&\n\t\t\t\t\tcanRemoveBlock( currentColumnBlock.clientId )\n\t\t\t\t) {\n\t\t\t\t\tcolumnsToRemove.push( currentColumnBlock.clientId );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\t// Remove the columns.\n\t\tremoveBlocks( columnsToRemove );\n\n\t\t// Update the table block attributes.\n\t\tupdateBlockAttributes( tableId, {\n\t\t\tcolumns: tableBlock.attributes?.columns - 1,\n\t\t} );\n\t};\n\n\t/**\n\t * Merge column left.\n\t */\n\tconst onMergeColumnLeft = (): void => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentBlock = getBlock( columnId );\n\t\tif ( ! currentBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previousBlockClientId = getAdjacentBlockClientId( columnId, -1 );\n\t\tif ( ! previousBlockClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previousBlock = getBlock( previousBlockClientId );\n\t\tif ( ! previousBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Merge columns.\n\t\tmergeColumnsHorizontally( currentBlock, previousBlock );\n\t};\n\n\t/**\n\t * Merge column right.\n\t */\n\tconst onMergeColumnRight = (): void => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentBlock = getBlock( columnId );\n\t\tif ( ! currentBlock ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextBlockClientId = getAdjacentBlockClientId( columnId, 1 );\n\t\tif ( ! nextBlockClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextBlock = getBlock( nextBlockClientId );\n\t\tif ( ! nextBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Merge columns.\n\t\tmergeColumnsHorizontally( nextBlock, currentBlock );\n\t};\n\n\t/**\n\t * Merge column up.\n\t */\n\tconst onMergeColumnUp = (): void => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get current row container block.\n\t\tconst rowContainerBlock = getBlock( rowContainerId );\n\n\t\t// Check if the row container block exists.\n\t\tif ( ! rowContainerBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prepare variables.\n\t\tlet columnToMergeInto: BlockInstance | undefined;\n\t\tlet columnToMergeFrom: BlockInstance | undefined;\n\n\t\t// Traverse rows.\n\t\ttableBlock.innerBlocks.some( ( currentRowContainerBlock ) => {\n\t\t\tif ( currentRowContainerBlock.name !== rowContainerBlockName ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Avoid merging thead/tfoot row with tbody row.\n\t\t\tconst currentRowContainerBlockAttributes = getBlockAttributes( currentRowContainerBlock.clientId );\n\t\t\tif ( currentRowContainerBlockAttributes?.type !== rowContainerBlock?.attributes?.type ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn currentRowContainerBlock.innerBlocks.some( ( rowBlock, rowIndex ): boolean => {\n\t\t\t\t// Get current row.\n\t\t\t\tconst rowNumber: number = rowIndex + 1;\n\t\t\t\tif ( rowBlock.name !== rowBlockName || ( rowNumber !== tableRow && rowNumber !== tableRow - 1 ) || ! rowBlock.innerBlocks.length ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Traverse columns in current row.\n\t\t\t\trowBlock.innerBlocks.some( ( columnBlock, columnIndex ): boolean => {\n\t\t\t\t\t// Get column to merge from and into.\n\t\t\t\t\tconst columnNumber: number = columnIndex + 1;\n\t\t\t\t\tif ( columnNumber === tableColumn && rowNumber === tableRow ) {\n\t\t\t\t\t\tcolumnToMergeFrom = columnBlock;\n\t\t\t\t\t} else if ( columnNumber === tableColumn && rowNumber === tableRow - 1 ) {\n\t\t\t\t\t\tcolumnToMergeInto = columnBlock;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Short circuit if we found them.\n\t\t\t\t\tif ( columnToMergeInto && columnToMergeFrom ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// We haven't found them, loop some more.\n\t\t\t\t\treturn false;\n\t\t\t\t} );\n\n\t\t\t\t// Check if we have a \"to\" and \"from\" column.\n\t\t\t\tif ( ! columnToMergeFrom || ! columnToMergeInto ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Merge columns.\n\t\t\t\tmergeColumnsVertically( columnToMergeFrom, columnToMergeInto );\n\n\t\t\t\t// Short-circuit loop.\n\t\t\t\treturn true;\n\t\t\t} );\n\t\t} );\n\t};\n\n\t/**\n\t * Merge column down.\n\t */\n\tconst onMergeColumnDown = (): void => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get current row container block.\n\t\tconst rowContainerBlock = getBlock( rowContainerId );\n\n\t\t// Check if the row container block exists.\n\t\tif ( ! rowContainerBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prepare variables.\n\t\tlet columnToMergeInto: BlockInstance | undefined;\n\t\tlet columnToMergeFrom: BlockInstance | undefined;\n\n\t\t// Traverse rows.\n\t\ttableBlock.innerBlocks.some( ( currentRowContainerBlock ) => {\n\t\t\tif ( currentRowContainerBlock.name !== rowContainerBlockName ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Avoid merging thead/tfoot row with tbody row.\n\t\t\tconst currentRowContainerBlockAttributes = getBlockAttributes( currentRowContainerBlock.clientId );\n\t\t\tif ( currentRowContainerBlockAttributes?.type !== rowContainerBlock?.attributes?.type ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn currentRowContainerBlock.innerBlocks.some( ( rowBlock, rowIndex ): boolean => {\n\t\t\t\t// Get current row.\n\t\t\t\tconst rowNumber: number = rowIndex + 1;\n\t\t\t\tif ( rowBlock.name !== rowBlockName || ( rowNumber !== tableRow && rowNumber !== tableRow + 1 ) || ! rowBlock.innerBlocks.length ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Traverse columns in current row.\n\t\t\t\trowBlock.innerBlocks.some( ( columnBlock, columnIndex ): boolean => {\n\t\t\t\t\t// Get column to merge from and into.\n\t\t\t\t\tconst columnNumber: number = columnIndex + 1;\n\t\t\t\t\tif ( columnNumber === tableColumn && rowNumber === tableRow ) {\n\t\t\t\t\t\tcolumnToMergeInto = columnBlock;\n\t\t\t\t\t} else if ( columnNumber === tableColumn && rowNumber === tableRow + 1 ) {\n\t\t\t\t\t\tcolumnToMergeFrom = columnBlock;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Short circuit if we found them.\n\t\t\t\t\tif ( columnToMergeInto && columnToMergeFrom ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// We haven't found them, loop some more.\n\t\t\t\t\treturn false;\n\t\t\t\t} );\n\n\t\t\t\t// Check if we have a \"to\" and \"from\" column.\n\t\t\t\tif ( ! columnToMergeFrom || ! columnToMergeInto ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Merge columns.\n\t\t\t\tmergeColumnsVertically( columnToMergeFrom, columnToMergeInto );\n\n\t\t\t\t// Short-circuit loop.\n\t\t\t\treturn true;\n\t\t\t} );\n\t\t} );\n\t};\n\n\t/**\n\t * Merge columns horizontally.\n\t *\n\t * @param {Object} fromColumn From column block instance.\n\t * @param {Object} toColumn To column block instance.\n\t */\n\tconst mergeColumnsHorizontally = ( fromColumn: BlockInstance, toColumn: BlockInstance ): void => {\n\t\t// Get colspans.\n\t\tconst mergeIntoAttributes = getBlockAttributes( toColumn.clientId );\n\t\tconst mergeFromAttributes = getBlockAttributes( fromColumn.clientId );\n\n\t\t// Get rowspans.\n\t\tconst mergeIntoRowspan: number = parseInt( mergeIntoAttributes?.rowSpan ?? 1 );\n\t\tconst mergeFromRowspan: number = parseInt( mergeFromAttributes?.rowSpan ?? 1 );\n\n\t\t// Invalid merge.\n\t\tif ( mergeIntoRowspan !== mergeFromRowspan ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mergeIntoColspan: number = parseInt( mergeIntoAttributes?.colSpan ?? 1 );\n\t\tconst mergeFromColspan: number = parseInt( mergeFromAttributes?.colSpan ?? 1 );\n\n\t\t// Update colspan.\n\t\tupdateBlockAttributes( toColumn.clientId, { colSpan: mergeIntoColspan + mergeFromColspan } );\n\n\t\t// If it is the current column, move children to previous column and delete current column.\n\t\tmoveBlocksToPosition(\n\t\t\tfromColumn.innerBlocks.map( ( block ) => block.clientId ),\n\t\t\tfromColumn.clientId,\n\t\t\ttoColumn.clientId\n\t\t);\n\n\t\t// Remove block that is being merged from.\n\t\tremoveBlock( fromColumn.clientId );\n\t};\n\n\t/**\n\t * Merge columns vertically.\n\t *\n\t * @param {Object} fromColumn From column block instance.\n\t * @param {Object} toColumn To column block instance.\n\t */\n\tconst mergeColumnsVertically = ( fromColumn: BlockInstance, toColumn: BlockInstance ): void => {\n\t\t// Get rowspans.\n\t\tconst mergeIntoAttributes = getBlockAttributes( toColumn.clientId );\n\t\tconst mergeFromAttributes = getBlockAttributes( fromColumn.clientId );\n\n\t\t// Get colspans.\n\t\tconst mergeIntoColspan: number = parseInt( mergeIntoAttributes?.colSpan ?? 1 );\n\t\tconst mergeFromColspan: number = parseInt( mergeFromAttributes?.colSpan ?? 1 );\n\n\t\t// Invalid merge.\n\t\tif ( mergeIntoColspan !== mergeFromColspan ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mergeIntoRowspan: number = parseInt( mergeIntoAttributes?.rowSpan ?? 1 );\n\t\tconst mergeFromRowspan: number = parseInt( mergeFromAttributes?.rowSpan ?? 1 );\n\n\t\t// Update rowspan.\n\t\tupdateBlockAttributes( toColumn.clientId, { rowSpan: mergeIntoRowspan + mergeFromRowspan } );\n\n\t\t// If it is the current column, move children to previous column and delete current column.\n\t\tmoveBlocksToPosition(\n\t\t\tfromColumn.innerBlocks.map( ( block ) => block.clientId ),\n\t\t\tfromColumn.clientId,\n\t\t\ttoColumn.clientId\n\t\t);\n\n\t\t// Remove block that is being merged from.\n\t\tremoveBlock( fromColumn.clientId );\n\t};\n\n\t/**\n\t * Table controls.\n\t */\n\tconst tableControls = [\n\t\t{\n\t\t\ticon: tableRowBefore,\n\t\t\ttitle: __( 'Insert row before', 'tp' ),\n\t\t\tisDisabled: ( ! isSelected || rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ),\n\t\t\tonClick: () => onInsertRow( -1 ),\n\t\t},\n\t\t{\n\t\t\ticon: tableRowAfter,\n\t\t\ttitle: __( 'Insert row after', 'tp' ),\n\t\t\tisDisabled: ( ! isSelected || rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ),\n\t\t\tonClick: onInsertRow,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowDelete,\n\t\t\ttitle: __( 'Delete row', 'tp' ),\n\t\t\tisDisabled: ( ! isSelected || rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ),\n\t\t\tonClick: onDeleteRow,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnBefore,\n\t\t\ttitle: __( 'Insert column before', 'tp' ),\n\t\t\tisDisabled: ! isSelected,\n\t\t\tonClick: () => onInsertColumn( -1 ),\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnAfter,\n\t\t\ttitle: __( 'Insert column after', 'tp' ),\n\t\t\tisDisabled: ! isSelected,\n\t\t\tonClick: onInsertColumn,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnDelete,\n\t\t\ttitle: __( 'Delete column', 'tp' ),\n\t\t\tisDisabled: ! isSelected,\n\t\t\tonClick: onDeleteColumn,\n\t\t},\n\t\t{\n\t\t\ticon: arrowLeft,\n\t\t\ttitle: __( 'Merge column left', 'tp' ),\n\t\t\tisDisabled: tableColumn < 2,\n\t\t\tonClick: onMergeColumnLeft,\n\t\t},\n\t\t{\n\t\t\ticon: arrowRight,\n\t\t\ttitle: __( 'Merge column right', 'tp' ),\n\t\t\tisDisabled: tableColumn === maximumColumnsInCurrentRow,\n\t\t\tonClick: onMergeColumnRight,\n\t\t},\n\t\t{\n\t\t\ticon: arrowUp,\n\t\t\ttitle: __( 'Merge column up', 'tp' ),\n\t\t\tisDisabled: ( tableRow < 2 || rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ),\n\t\t\tonClick: onMergeColumnUp,\n\t\t},\n\t\t{\n\t\t\ticon: arrowDown,\n\t\t\ttitle: __( 'Merge column down', 'tp' ),\n\t\t\tisDisabled: ( rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ),\n\t\t\tonClick: onMergeColumnDown,\n\t\t},\n\t] as DropdownOption[];\n\n\t/**\n\t * Return block controls.\n\t */\n\treturn (\n\t\t<>\n\t\t\t{ /* @ts-ignore - Group is not defined in the prop-type. */ }\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","/**\n * WordPress dependencies.\n */\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n\tInspectorControls,\n} from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { BlockEditProps } from '@wordpress/blocks';\n\n/**\n * External dependencies.\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies.\n */\nimport Toolbar from './toolbar';\nimport { name as cellBlockName } from '../table-cell';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n * @param {string} props.className Class name.\n * @param {string} props.clientId Client ID.\n * @param {Object} props.attributes Attributes.\n * @param {Function} props.setAttributes Set attributes.\n * @param {boolean} props.isSelected Is block selected.\n * @param {Object} props.context Block context.\n *\n * @return {JSX.Element} JSX Component.\n */\nfunction TableColumnEdit( {\n\tclassName,\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tcontext,\n}: BlockEditProps ): JSX.Element {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, 'travelopia-table__column', {\n\t\t\t'travelopia-table__column--sticky': attributes.isSticky,\n\t\t} ),\n\t} );\n\n\tconst tableId: string = context[ 'travelopia/table-id' ] as string;\n\tconst rowContainerType: string = context[ 'travelopia/table-row-container-type' ] as string;\n\tconst rowContainerId: string = context[ 'travelopia/table-row-container-id' ] as string;\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\t...blockProps,\n\t\t\tcolSpan: attributes.colSpan,\n\t\t\trowSpan: attributes.rowSpan,\n\t\t},\n\t\t{\n\t\t\ttemplate: [ [ cellBlockName ] ],\n\t\t\ttemplateLock: false,\n\t\t},\n\t);\n\n\t// Get the row and column index.\n\tconst { row, column } = useSelect(\n\t\t( select: any ) => {\n\t\t\t// Calculate the row and column index.\n\t\t\tconst columnIndex = select( blockEditorStore ).getBlockIndex( clientId );\n\t\t\tconst rowClientId =\n\t\t\t\tselect( blockEditorStore ).getBlockRootClientId( clientId );\n\t\t\tconst rowIndex = select( blockEditorStore ).getBlockIndex( rowClientId );\n\n\t\t\treturn {\n\t\t\t\trow: rowIndex + 1, // Start index at 1.\n\t\t\t\tcolumn: columnIndex + 1,\n\t\t\t};\n\t\t},\n\t\t[ clientId ],\n\t);\n\n\t// Update the row and column index.\n\tuseEffect( () => {\n\t\tsetAttributes( { row, column } );\n\t}, [ row, column, setAttributes ] );\n\n\tuseEffect( () => {\n\t\tsetAttributes( { blockId: clientId } );\n\t}, [ clientId, setAttributes ] );\n\n\t// Determine tag.\n\tlet Tag: string = 'td';\n\tif ( 'tbody' !== rowContainerType ) {\n\t\tTag = 'th';\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t setAttributes( { isSticky } ) }\n\t\t\t\t\t\thelp={ __( 'Is this column sticky?', 'tp' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport default TableColumnEdit;\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockConfiguration } from '@wordpress/blocks';\nimport {\n\tInnerBlocks,\n} from '@wordpress/block-editor';\nimport {\n\tblockTable as icon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies.\n */\nimport edit from './edit';\n\n/**\n * Block data.\n */\nexport const name: string = 'travelopia/table-column';\n\nexport const settings: BlockConfiguration = {\n\tapiVersion: 3,\n\ticon,\n\ttitle: __( 'Column', 'tp' ),\n\tdescription: __( 'Individual column of the table.', 'tp' ),\n\tparent: [ 'travelopia/table-row' ],\n\tcategory: 'text',\n\tkeywords: [ __( 'column', 'tp' ) ],\n\tattributes: {\n\t\trow: {\n\t\t\ttype: 'number',\n\t\t},\n\t\tcolumn: {\n\t\t\ttype: 'number',\n\t\t},\n\t\tcolSpan: {\n\t\t\ttype: 'number',\n\t\t},\n\t\trowSpan: {\n\t\t\ttype: 'number',\n\t\t},\n\t\tisSticky: {\n\t\t\ttype: 'boolean',\n\t\t},\n\t\tblockId: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tprovidesContext: {\n\t\t'travelopia/table-row': 'row' as never,\n\t\t'travelopia/table-column': 'column' as never,\n\t\t'travelopia/table-column-id': 'blockId' as never,\n\t},\n\tusesContext: [\n\t\t'travelopia/table-row-container-type',\n\t\t'travelopia/table-row-container-id',\n\t],\n\tsupports: {\n\t\thtml: true,\n\t\tcolor: {\n\t\t\ttext: true,\n\t\t\tbackground: true,\n\t\t},\n\t\talign: [ 'left', 'center', 'right' ],\n\t\t// @ts-ignore\n\t\t__experimentalBorder: {\n\t\t\tcolor: true,\n\t\t\tstyle: true,\n\t\t\twidth: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tcolor: true,\n\t\t\t\tstyle: true,\n\t\t\t\twidth: true,\n\t\t\t},\n\t\t},\n\t},\n\tedit,\n\tsave() {\n\t\treturn ;\n\t},\n};\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport {\n\tBlockEditProps,\n} from '@wordpress/blocks';\n\n/**\n * External dependencies.\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies.\n */\nimport { name as columnBlockName } from '../table-column';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n *\n * @return {JSX.Element} JSX Component.\n */\nfunction TableRowEdit( props: BlockEditProps ): JSX.Element {\n\t// Block props.\n\tconst { className, clientId, setAttributes } = props;\n\n\t// Inner block props.\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, 'travelopia-table__row' ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( { ...blockProps }, {\n\t\tallowedBlocks: [ columnBlockName ],\n\t\ttemplateLock: false,\n\t} );\n\n\tuseEffect( () => {\n\t\tsetAttributes( { blockId: clientId } );\n\t}, [ clientId, setAttributes ] );\n\n\treturn (\n\t\t\n\t);\n}\n\nexport default TableRowEdit;\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockConfiguration } from '@wordpress/blocks';\nimport {\n\tInnerBlocks,\n} from '@wordpress/block-editor';\nimport {\n\tblockTable as icon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies.\n */\nimport edit from './edit';\n\n/**\n * Block data.\n */\nexport const name: string = 'travelopia/table-row';\n\nexport const settings: BlockConfiguration = {\n\tapiVersion: 3,\n\ticon,\n\ttitle: __( 'Row', 'tp' ),\n\tdescription: __( 'Individual row of the table.', 'tp' ),\n\tparent: [ 'travelopia/table-row-container' ],\n\tcategory: 'text',\n\tkeywords: [ __( 'row', 'tp' ) ],\n\tattributes: {\n\t\tblockId: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tusesContext: [\n\t\t'travelopia/table-row-container-type',\n\t],\n\tsupports: {\n\t\thtml: true,\n\t\tcolor: {\n\t\t\ttext: true,\n\t\t\tbackground: true,\n\t\t},\n\t\t// @ts-ignore\n\t\t__experimentalBorder: {\n\t\t\tcolor: true,\n\t\t\tstyle: true,\n\t\t\twidth: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tcolor: true,\n\t\t\t\tstyle: true,\n\t\t\t\twidth: true,\n\t\t\t},\n\t\t},\n\t},\n\tedit,\n\tsave() {\n\t\treturn ;\n\t},\n};\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tToggleControl,\n} from '@wordpress/components';\nimport {\n\tBlockEditProps,\n} from '@wordpress/blocks';\n\n/**\n * External dependencies.\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies.\n */\nimport { name as rowBlockName } from '../table-row';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n *\n * @return {JSX.Element} JSX Component.\n */\nfunction TableRowContainerEdit( props: BlockEditProps ): JSX.Element {\n\t// Block props.\n\tconst { className, attributes, setAttributes, clientId } = props;\n\n\t// Inner block props.\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, 'travelopia-table__row-container', {\n\t\t\t'travelopia-table__row-container--sticky': attributes.isSticky,\n\t\t} ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( { ...blockProps }, {\n\t\tallowedBlocks: [ rowBlockName ],\n\t} );\n\n\t// Determine tag.\n\tconst Tag: string = attributes.type;\n\n\tuseEffect( () => {\n\t\tsetAttributes( { blockId: clientId } );\n\t}, [ clientId, setAttributes ] );\n\n\t// Return component.\n\treturn (\n\t\t<>\n\t\t\t{ 'thead' === attributes.type &&\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t setAttributes( { isSticky } ) }\n\t\t\t\t\t\t\thelp={ __( 'Is this container sticky?', 'tp' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\n\t);\n}\n\nexport default TableRowContainerEdit;\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockConfiguration } from '@wordpress/blocks';\nimport {\n\tInnerBlocks,\n} from '@wordpress/block-editor';\nimport {\n\tblockTable as icon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies.\n */\nimport edit from './edit';\n\n/**\n * Block data.\n */\nexport const name: string = 'travelopia/table-row-container';\n\nexport const settings: BlockConfiguration = {\n\tapiVersion: 3,\n\ticon,\n\ttitle: __( 'Row Container', 'tp' ),\n\tdescription: __( 'A container for a row (THEAD, TBODY, TFOOT).', 'tp' ),\n\tparent: [ 'travelopia/table' ],\n\tcategory: 'text',\n\tkeywords: [\n\t\t__( 'thead', 'tp' ),\n\t\t__( 'tbody', 'tp' ),\n\t\t__( 'tfoot', 'tp' ),\n\t],\n\tattributes: {\n\t\ttype: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'tbody',\n\t\t},\n\t\tisSticky: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\tblockId: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tprovidesContext: {\n\t\t'travelopia/table-row-container-type': 'type' as never,\n\t\t'travelopia/table-row-container-sticky': 'isSticky' as never,\n\t\t'travelopia/table-row-container-id': 'blockId' as never,\n\t},\n\tsupports: {\n\t\thtml: false,\n\t},\n\tedit,\n\tsave() {\n\t\treturn ;\n\t},\n};\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport {\n\tBlockEditProps,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tPanelBody,\n\tToggleControl,\n} from '@wordpress/components';\nimport {\n\tselect,\n\tdispatch,\n} from '@wordpress/data';\n\n/**\n * External dependencies.\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies.\n */\nimport { TablePlaceholder } from './placeholder';\nimport { name as rowContainerBlockName } from '../table-row-container';\nimport { name as rowBlockName } from '../table-row';\nimport { name as columnBlockName } from '../table-column';\nimport { name as cellBlockName } from '../table-cell';\n\n/**\n * Create and insert a row container.\n *\n * @param {string} type Row container type.\n * @param {string} tableClientId The table block's client ID.\n */\nexport const createAndInsertRowContainer = ( type: string = 'tbody', tableClientId: string = '' ): void => {\n\t// Get table block.\n\tconst tableBlock = select( 'core/block-editor' ).getBlock( tableClientId );\n\tif ( ! tableBlock ) {\n\t\treturn;\n\t}\n\n\t// Create row container.\n\tconst rowContainerBlock = createBlock( rowContainerBlockName, { type } );\n\n\t// Determine number of rows to create.\n\tlet totalRows = tableBlock.attributes.rows;\n\tif ( 'tbody' !== type ) {\n\t\ttotalRows = 1;\n\t}\n\n\t// Add rows and columns to it.\n\tfor ( let i: number = 0; i < totalRows; i++ ) {\n\t\tconst columnBlocks = [];\n\t\tfor ( let j: number = 0; j < tableBlock.attributes.columns; j++ ) {\n\t\t\tcolumnBlocks.push(\n\t\t\t\tcreateBlock( columnBlockName, {}, [\n\t\t\t\t\tcreateBlock( cellBlockName ),\n\t\t\t\t] )\n\t\t\t);\n\t\t}\n\n\t\trowContainerBlock.innerBlocks.push(\n\t\t\tcreateBlock( rowBlockName, {}, columnBlocks )\n\t\t);\n\t}\n\n\t// Add newly created row and column blocks to the table.\n\tif ( 'tbody' === type ) {\n\t\tdispatch( 'core/block-editor' ).replaceInnerBlocks( tableClientId, [ rowContainerBlock ] );\n\t} else {\n\t\tconst position = 'thead' === type ? 0 : tableBlock.innerBlocks.length;\n\t\tdispatch( 'core/block-editor' ).insertBlock( rowContainerBlock, position, tableClientId );\n\t}\n};\n\n/**\n * Delete row container child block.\n *\n * @param {string} type Row container type.\n * @param {string} tableClientId The table block's client ID.\n */\nexport const deleteRowContainer = ( type: string = 'thead', tableClientId: string = '' ): void => {\n\t// Get table block.\n\tconst tableBlock = select( 'core/block-editor' ).getBlock( tableClientId );\n\tif ( ! tableBlock || ! tableBlock.innerBlocks.length ) {\n\t\treturn;\n\t}\n\n\t// Find the child block and delete it.\n\ttableBlock.innerBlocks.forEach( ( innerBlock ) => {\n\t\tif ( innerBlock.attributes?.type === type ) {\n\t\t\tdispatch( 'core/block-editor' ).removeBlock( innerBlock.clientId );\n\t\t}\n\t} );\n};\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n *\n * @return {JSX.Element} JSX Component.\n */\nfunction TableEdit( props: BlockEditProps ): JSX.Element {\n\tconst { className, attributes, clientId, setAttributes } = props;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, 'travelopia-table' ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( {}, {\n\t\tallowedBlocks: [ rowContainerBlockName ],\n\t\trenderAppender: undefined,\n\t} );\n\n\t// Set blockId attribute.\n\tuseEffect( () => {\n\t\tsetAttributes( { blockId: clientId } );\n\t}, [ clientId, setAttributes ] );\n\n\t/**\n\t * Handle THEAD change.\n\t *\n\t * @param {boolean} hasThead Has THEAD.\n\t */\n\tconst handleTheadChange = ( hasThead: boolean ): void => {\n\t\tif ( hasThead ) {\n\t\t\tcreateAndInsertRowContainer( 'thead', clientId );\n\t\t} else {\n\t\t\tdeleteRowContainer( 'thead', clientId );\n\t\t}\n\t\tsetAttributes( { hasThead } );\n\t};\n\n\t/**\n\t * Handle TFOOT change.\n\t *\n\t * @param {boolean} hasTfoot Has TFOOT.\n\t */\n\tconst handleTfootChange = ( hasTfoot: boolean ): void => {\n\t\tif ( hasTfoot ) {\n\t\t\tcreateAndInsertRowContainer( 'tfoot', clientId );\n\t\t} else {\n\t\t\tdeleteRowContainer( 'tfoot', clientId );\n\t\t}\n\t\tsetAttributes( { hasTfoot } );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t{\n\t\t\t\t\t/* Placeholder for initial state. */\n\t\t\t\t\t( 0 === attributes.rows || 0 === attributes.columns ) &&\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t{\n\t\t\t\t\t( 0 !== attributes.rows || 0 !== attributes.columns ) &&\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\n\t);\n}\n\nexport default TableEdit;\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockConfiguration } from '@wordpress/blocks';\nimport {\n\tInnerBlocks,\n} from '@wordpress/block-editor';\nimport {\n\tblockTable as icon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies.\n */\nimport edit from './edit';\n\n/**\n * Styles.\n */\nimport './editor.scss';\n\n/**\n * Frontend styles.\n */\nimport '../../../front-end/table/index.scss';\n\n/**\n * Block data.\n */\nexport const name: string = 'travelopia/table';\n\nexport const settings: BlockConfiguration = {\n\tapiVersion: 3,\n\ticon,\n\ttitle: __( 'Table', 'tp' ),\n\tdescription: __( 'Create structured content in rows and columns to display information.', 'tp' ),\n\tcategory: 'text',\n\tkeywords: [ __( 'table', 'tp' ) ],\n\tattributes: {\n\t\tanchor: {\n\t\t\ttype: 'string',\n\t\t},\n\t\trows: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 0,\n\t\t},\n\t\tcolumns: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 0,\n\t\t},\n\t\tblockId: {\n\t\t\ttype: 'string',\n\t\t},\n\t\thasThead: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\thasTfoot: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\tprovidesContext: {\n\t\t'travelopia/table-id': 'blockId' as never,\n\t\t'travelopia/table-total-rows': 'rows' as never,\n\t\t'travelopia/table-total-columns': 'columns' as never,\n\t\t'travelopia/table-has-thead': 'hasThead' as never,\n\t\t'travelopia/table-has-tfoot': 'hasTfoot' as never,\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t},\n\tedit,\n\tsave() {\n\t\treturn ;\n\t},\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockConfiguration, BlockEditProps } from '@wordpress/blocks';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies.\n */\nimport Toolbar from './table-column/toolbar';\n\n/**\n * Add context of table row and column to the block.\n */\naddFilter(\n\t'blocks.registerBlockType',\n\t'travelopia/table-row-column-context',\n\t( settings: BlockConfiguration ) => {\n\t\tconst requiredContexts = [\n\t\t\t'travelopia/table-row',\n\t\t\t'travelopia/table-column',\n\t\t\t'travelopia/table-id',\n\t\t\t'travelopia/table-row-container-id',\n\t\t\t'travelopia/table-column-id',\n\t\t];\n\n\t\tif ( settings.usesContext && Array.isArray( settings.usesContext ) ) {\n\t\t\trequiredContexts.forEach( ( context ) => {\n\t\t\t\tif ( ! settings.usesContext?.includes( context ) ) {\n\t\t\t\t\tsettings.usesContext?.push( context );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn settings;\n\t},\n);\n\n/**\n * Add toolbar to the table block.\n */\naddFilter( 'editor.BlockEdit', 'travelopia/table-toolbar', ( BlockEdit ) => {\n\treturn ( props: BlockEditProps ) => {\n\t\tconst { context, isSelected } = props;\n\n\t\tif ( ! context ) {\n\t\t\treturn ;\n\t\t}\n\n\t\tconst tableRow = context[ 'travelopia/table-row' ] as number;\n\t\tconst tableColumn = context[ 'travelopia/table-column' ] as number;\n\t\tconst tableId = context[ 'travelopia/table-id' ] as string;\n\t\tconst tableRowContainerId = context[ 'travelopia/table-row-container-id' ] as string;\n\t\tconst tableColumnId = context[ 'travelopia/table-column-id' ] as string;\n\n\t\tif (\n\t\t\t! tableRow ||\n\t\t\t! tableColumn ||\n\t\t\t! tableId ||\n\t\t\ttableColumn < 1 ||\n\t\t\ttableRow < 1\n\t\t) {\n\t\t\treturn ;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t};\n} );\n","/**\n * WordPress dependencies.\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Import blocks.\n */\nimport * as table from './table';\nimport * as tableRowContainer from './table-row-container';\nimport * as tableRow from './table-row';\nimport * as tableColumn from './table-column';\nimport * as tableCell from './table-cell';\n\n/**\n * Internal dependencies.\n */\nimport './block-toolbar';\n\n/**\n * Add blocks.\n */\nconst blocks = [\n\ttable,\n\ttableRowContainer,\n\ttableRow,\n\ttableColumn,\n\ttableCell,\n];\n\n/**\n * Register blocks.\n */\nblocks.forEach( ( { name, settings } ) => registerBlockType( name, settings ) );\n"],"names":["f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","Fragment","jsx","jsxs","module","window","hasOwn","classNames","classes","i","arguments","length","arg","appendClass","parseValue","Array","isArray","apply","toString","includes","value","newClass","default","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","get","obj","prop","r","toStringTag","createElement","SVG","viewBox","xmlns","Path","TablePlaceholder","setAttributes","clientId","rows","setRows","useState","columns","setColumns","Placeholder","label","__","icon","BlockIcon","showColors","instructions","className","onSubmit","preventDefault","createAndInsertRowContainer","TextControl","onChange","totalColumns","parseInt","min","totalRows","Button","variant","attributes","blockProps","useBlockProps","RichText","tagName","placeholder","content","settings","apiVersion","title","description","parent","category","keywords","source","supports","html","transforms","to","blocks","transform","innerBlocks","createBlock","level","edit","save","Content","Toolbar","isSelected","tableId","tableRow","tableColumn","rowContainerId","columnId","getBlock","canInsertBlockType","getBlockAttributes","canRemoveBlock","getAdjacentBlockClientId","select","removeBlock","removeBlocks","insertBlock","updateBlockAttributes","moveBlocksToPosition","dispatch","maximumColumnsInCurrentRow","setMaximumColumnsInCurrentRow","rowContainerBlockType","useMemo","useEffect","tableBlock","some","rowBlock","index","name","onInsertRow","insertionIndex","columnBlocks","push","newRowBlock","onInsertColumn","forEach","currentRowContainerBlock","newColumnBlock","mergeColumnsHorizontally","fromColumn","toColumn","mergeIntoAttributes","mergeFromAttributes","rowSpan","mergeIntoColspan","colSpan","mergeFromColspan","map","block","mergeColumnsVertically","mergeIntoRowspan","mergeFromRowspan","tableControls","isDisabled","onClick","rowContainerBlock","currentRowBlock","columnsToRemove","currentColumnBlock","currentBlock","previousBlockClientId","previousBlock","nextBlockClientId","nextBlock","columnToMergeInto","columnToMergeFrom","currentRowContainerBlockAttributes","rowIndex","rowNumber","columnBlock","columnIndex","columnNumber","BlockControls","group","ToolbarDropdownMenu","controls","context","isSticky","rowContainerType","innerBlocksProps","useInnerBlocksProps","template","templateLock","row","column","useSelect","getBlockIndex","rowClientId","getBlockRootClientId","blockId","Tag","InspectorControls","PanelBody","ToggleControl","checked","help","providesContext","usesContext","color","text","background","align","__experimentalBorder","style","width","__experimentalDefaultControls","InnerBlocks","allowedBlocks","tableClientId","j","replaceInnerBlocks","position","deleteRowContainer","innerBlock","renderAppender","hasThead","hasTfoot","anchor","addFilter","requiredContexts","BlockEdit","tableRowContainerId","tableColumnId","registerBlockType"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"./dist/editor/blocks.js","mappings":"wCASa,IAAIA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EAAET,EAAEU,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KAAKC,EAAE,KAAiF,IAAIH,UAAhF,IAASD,IAAIG,EAAE,GAAGH,QAAG,IAASD,EAAEN,MAAMU,EAAE,GAAGJ,EAAEN,UAAK,IAASM,EAAEL,MAAMU,EAAEL,EAAEL,KAAcK,EAAEd,EAAEoB,KAAKN,EAAEE,KAAKT,EAAEJ,eAAea,KAAKC,EAAED,GAAGF,EAAEE,IAAI,GAAGH,GAAGA,EAAEQ,aAAa,IAAIL,KAAKF,EAAED,EAAEQ,kBAAe,IAASJ,EAAED,KAAKC,EAAED,GAAGF,EAAEE,IAAI,MAAM,CAACM,SAAS1B,EAAE2B,KAAKV,EAAEL,IAAIU,EAAET,IAAIU,EAAEK,MAAMP,EAAEQ,OAAOrB,EAAEsB,QAAQ,CAACC,EAAQC,SAAS7B,EAAE4B,EAAQE,IAAIjB,EAAEe,EAAQG,KAAKlB,C,6BCPxWmB,EAAOJ,QAAU,EAAjB,I,uBCHFI,EAAOJ,QAAUK,OAAc,K,cCA/B,OAOC,WACA,aAEA,IAAIC,EAAS,CAAC,EAAE9B,eAEhB,S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E,EAAc0E,EAAS,2BACvB5E,EAAU4E,EAAS,uBACnB6C,EAAsB7C,EAAS,qCAC/B8C,EAAgB9C,EAAS,8BAE/B,OACG3E,IACAC,IACAF,GACFE,EAAc,GACdD,EAAW,GAEJ,SAACuH,EAAS,iBAAMhO,KAIvB,iCACC,SAACsG,EAAO,CACPC,WAAaA,EACbE,SAAWA,EACXC,YAAcA,EACdF,QAAUA,EACVG,eAAiBsH,EACjBrH,SAAWsH,KAEZ,SAACF,EAAS,iBAAMhO,MAEjB,ICxDY,CACd,EACA,EACA,EACA,EACA,GAMMqI,SAAS,EAAIF,OAAMjD,eAAgB,IAAAiJ,mBAAmBhG,EAAMjD,I","sources":["webpack://travelopia-wordpress-blocks/./node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://travelopia-wordpress-blocks/./node_modules/react/jsx-runtime.js","webpack://travelopia-wordpress-blocks/external window \"React\"","webpack://travelopia-wordpress-blocks/./node_modules/classnames/index.js","webpack://travelopia-wordpress-blocks/webpack/bootstrap","webpack://travelopia-wordpress-blocks/webpack/runtime/compat get default export","webpack://travelopia-wordpress-blocks/webpack/runtime/define property getters","webpack://travelopia-wordpress-blocks/webpack/runtime/hasOwnProperty shorthand","webpack://travelopia-wordpress-blocks/webpack/runtime/make namespace object","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"blocks\"]","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"i18n\"]","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"blockEditor\"]","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"primitives\"]","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/block-table.js","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"element\"]","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"components\"]","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"data\"]","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table/placeholder.tsx","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-row-before.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-row-after.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-row-delete.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-column-before.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-column-after.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table-column-delete.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/arrow-left.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/arrow-right.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/arrow-up.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/arrow-down.js","webpack://travelopia-wordpress-blocks/./node_modules/@wordpress/icons/build-module/library/table.js","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-cell/edit.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-cell/index.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-column/toolbar.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-column/edit.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-column/index.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-row/edit.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-row/index.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-row-container/edit.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table-row-container/index.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table/edit.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/table/index.tsx","webpack://travelopia-wordpress-blocks/external window [\"wp\",\"hooks\"]","webpack://travelopia-wordpress-blocks/./src/editor/blocks/block-toolbar.tsx","webpack://travelopia-wordpress-blocks/./src/editor/blocks/index.ts"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","module.exports = window[\"React\"];","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\nconst blockTable = createElement(SVG, {\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, createElement(Path, {\n 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\"\n}));\nexport default blockTable;\n//# sourceMappingURL=block-table.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { blockTable as icon } from '@wordpress/icons';\nimport {\n\tButton,\n\tTextControl,\n\tPlaceholder,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport {\n\tBlockEditProps,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies.\n */\nimport { createAndInsertRowContainer } from './edit';\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n *\n * @return {JSX.Element} JSX Component.\n */\nexport function TablePlaceholder( props: BlockEditProps ): JSX.Element {\n\tconst { setAttributes, clientId } = props;\n\tconst [ rows, setRows ] = useState( 2 );\n\tconst [ columns, setColumns ] = useState( 2 );\n\n\treturn (\n\t\t }\n\t\t\tinstructions={ __( 'Insert a table for sharing data.', 'tp' ) }\n\t\t>\n\t\t\t {\n\t\t\t\t\t// Prevent form submission.\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t// Set attributes.\n\t\t\t\t\tsetAttributes( { rows, columns } );\n\n\t\t\t\t\t// Create and insert row container.\n\t\t\t\t\tcreateAndInsertRowContainer( 'tbody', clientId );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t setColumns( parseInt( totalColumns ) ) }\n\t\t\t\t\tmin=\"1\"\n\t\t\t\t\tclassName=\"travelopia-table__placeholder-input\"\n\t\t\t\t/>\n\t\t\t\t setRows( parseInt( totalRows ) ) }\n\t\t\t\t\tmin=\"1\"\n\t\t\t\t\tclassName=\"travelopia-table__placeholder-input\"\n\t\t\t\t/>\n\t\t\t\t\n\t\t\t\t\t{ __( 'Create Table', 'tp' ) }\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableRowBefore = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableRowBefore;\n//# sourceMappingURL=table-row-before.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableRowAfter = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableRowAfter;\n//# sourceMappingURL=table-row-after.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableRowDelete = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableRowDelete;\n//# sourceMappingURL=table-row-delete.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableColumnBefore = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableColumnBefore;\n//# sourceMappingURL=table-column-before.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableColumnAfter = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableColumnAfter;\n//# sourceMappingURL=table-column-after.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst tableColumnDelete = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"-2 -2 24 24\"\n}, createElement(Path, {\n 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\"\n}));\nexport default tableColumnDelete;\n//# sourceMappingURL=table-column-delete.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst arrowLeft = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z\"\n}));\nexport default arrowLeft;\n//# sourceMappingURL=arrow-left.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst arrowRight = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z\"\n}));\nexport default arrowRight;\n//# sourceMappingURL=arrow-right.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst arrowUp = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z\"\n}));\nexport default arrowUp;\n//# sourceMappingURL=arrow-up.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst arrowDown = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z\"\n}));\nexport default arrowDown;\n//# sourceMappingURL=arrow-down.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst table = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z\"\n}));\nexport default table;\n//# sourceMappingURL=table.js.map","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockEditProps } from '@wordpress/blocks';\nimport {\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n *\n * @return {JSX.Element} JSX Component.\n */\nfunction TableCellEdit( props: BlockEditProps ): JSX.Element {\n\tconst { attributes, setAttributes } = props;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'travelopia-table__cell',\n\t} );\n\n\treturn (\n\t\t setAttributes( { content } ) }\n\t\t\tvalue={ attributes.content }\n\t\t/>\n\t);\n}\n\nexport default TableCellEdit;\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { RichText } from '@wordpress/block-editor';\nimport {\n\tBlockConfiguration,\n\tBlockInstance,\n\tBlockSaveProps,\n\tcreateBlock,\n\tTransformBlock,\n} from '@wordpress/blocks';\nimport {\n\tblockTable as icon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies.\n */\nimport edit from './edit';\n\n/**\n * Block data.\n */\nexport const name: string = 'travelopia/table-cell';\n\nexport const settings: BlockConfiguration = {\n\tapiVersion: 3,\n\ticon,\n\ttitle: __( 'Cell', 'tp' ),\n\tdescription: __( 'Individual cell of the table.', 'tp' ),\n\tparent: [ 'travelopia/table-column' ],\n\tcategory: 'text',\n\tkeywords: [ __( 'cell', 'tp' ) ],\n\tattributes: {\n\t\tcontent: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t},\n\t},\n\tsupports: {\n\t\thtml: true,\n\t\tclassName: false,\n\t},\n\ttransforms: {\n\t\tto: [\n\t\t\t{\n\t\t\t\ttype: 'block',\n\t\t\t\tblocks: [ 'core/heading' ],\n\t\t\t\ttransform: ( attributes: string[], innerBlocks: BlockInstance<{ [k: string]: any; }>[] | undefined ) => {\n\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t'core/heading', { ...attributes, level: '3' }, innerBlocks\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t} as unknown as TransformBlock,\n\t\t\t{\n\t\t\t\ttype: 'block',\n\t\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\t\ttransform: ( attributes: string[], innerBlocks: BlockInstance<{ [k: string]: any; }>[] | undefined ) => {\n\t\t\t\t\treturn createBlock( 'core/paragraph', attributes, innerBlocks );\n\t\t\t\t},\n\t\t\t} as unknown as TransformBlock,\n\t\t\t{\n\t\t\t\ttype: 'block',\n\t\t\t\tblocks: [ 'core/list' ],\n\t\t\t\ttransform: ( attributes: string[], innerBlocks: BlockInstance<{ [k: string]: any; }>[] | undefined ) => {\n\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t'core/list',\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tcreateBlock( 'core/list-item', attributes, innerBlocks ),\n\t\t\t\t\t\t]\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t} as unknown as TransformBlock,\n\t\t],\n\t},\n\tedit,\n\tsave( { attributes }: BlockSaveProps ) {\n\t\treturn (\n\t\t\t\n\t\t);\n\t},\n};\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockInstance, createBlock } from '@wordpress/blocks';\nimport { BlockControls } from '@wordpress/block-editor';\nimport { ToolbarDropdownMenu } from '@wordpress/components';\nimport { select, dispatch } from '@wordpress/data';\nimport { DropdownOption } from '@wordpress/components/build-types/dropdown-menu/types';\nimport {\n\tarrowLeft,\n\tarrowRight,\n\tarrowUp,\n\tarrowDown,\n\ttableColumnAfter,\n\ttableColumnBefore,\n\ttableColumnDelete,\n\ttableRowAfter,\n\ttableRowBefore,\n\ttableRowDelete,\n\ttable,\n} from '@wordpress/icons';\nimport {\n\tuseState,\n\tuseEffect,\n\tuseMemo,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies.\n */\nimport { name as columnBlockName } from './index';\nimport { name as rowBlockName } from '../table-row';\nimport { name as cellBlockName } from '../table-cell';\nimport { name as rowContainerBlockName } from '../table-row-container';\n\n/**\n * Column block toolbar.\n *\n * @param {Object} props Block properties.\n * @param {boolean} props.isSelected Is block selected.\n * @param {string} props.tableId Table block ID.\n * @param {number} props.tableRow Table row index.\n * @param {number} props.tableColumn Table column index.\n * @param {string} props.rowContainerId Table row container ID.\n * @param {string} props.columnId Column block ID.\n *\n * @return {JSX.Element} JSX Component.\n */\nexport default function Toolbar( {\n\tisSelected,\n\ttableId,\n\ttableRow,\n\ttableColumn,\n\trowContainerId,\n\tcolumnId,\n}: {\n\tisSelected: boolean;\n\ttableId: string;\n\ttableRow: number;\n\ttableColumn: number;\n\trowContainerId: string;\n\tcolumnId: string;\n} ): JSX.Element {\n\tconst {\n\t\tgetBlock,\n\t\tcanInsertBlockType,\n\t\tgetBlockAttributes,\n\t\t// @ts-ignore\n\t\tcanRemoveBlock,\n\t\tgetAdjacentBlockClientId,\n\t} = select( 'core/block-editor' );\n\n\tconst {\n\t\tremoveBlock,\n\t\tremoveBlocks,\n\t\tinsertBlock,\n\t\tupdateBlockAttributes,\n\t\t// @ts-ignore\n\t\tmoveBlocksToPosition,\n\t} = dispatch( 'core/block-editor' );\n\n\tconst [ maximumColumnsInCurrentRow, setMaximumColumnsInCurrentRow ] = useState( 0 );\n\tconst [ maximumRowsInCurrentColumn, setMaximumRowsInCurrentColumn ] = useState( 0 );\n\n\tconst rowContainerBlockType = useMemo( () => getBlock( rowContainerId )?.attributes?.type, [ rowContainerId, getBlock ] );\n\n\t/**\n\t * Set maximum columns in current row.\n\t */\n\tuseEffect( (): void => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if we have a block.\n\t\tif ( ! tableBlock ) {\n\t\t\tsetMaximumColumnsInCurrentRow( 0 );\n\t\t\treturn;\n\t\t}\n\n\t\t// Traverse table.\n\t\ttableBlock.innerBlocks.some( ( rowContainerBlock ): boolean => {\n\n\t\t\tif ( rowContainerBlock.name !== rowContainerBlockName || ! rowContainerBlock.innerBlocks.length ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlet maxRows = 0;\n\t\t\trowContainerBlock.innerBlocks.forEach( ( rowBlock, rowIndex ) => {\n\t\t\t\tif ( rowBlock.name !== rowBlockName || ! rowBlock.innerBlocks.length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Set maximum columns in current row.\n\t\t\t\tif ( rowIndex + 1 === tableRow ) {\n\t\t\t\t\tsetMaximumColumnsInCurrentRow( rowBlock.innerBlocks.length );\n\t\t\t\t}\n\n\t\t\t\trowBlock.innerBlocks.forEach( ( columnBlock, columnIndex ) => {\n\t\t\t\t\tif ( columnBlock.name !== columnBlockName || columnIndex + 1 !== tableColumn ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tmaxRows++;\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\tsetMaximumRowsInCurrentColumn( maxRows );\n\t\t\treturn true;\n\t\t});\n\t}, [ tableRow, tableColumn, getBlock, tableId ] );\n\n\t/**\n\t * Insert row.\n\t *\n\t * @param {0|-1} insertionIndex Insertion index. -1 for before and 0 for after.\n\t */\n\tconst onInsertRow = ( insertionIndex: 0 | -1 = 0 ) => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if the row block can be inserted.\n\t\tif ( ! canInsertBlockType( rowBlockName, rowContainerId ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Create column blocks.\n\t\tconst columnBlocks = [];\n\n\t\t// Loop through the table columns count attribute.\n\t\tfor ( let i = 0; i < tableBlock.attributes?.columns || 0; i++ ) {\n\t\t\tcolumnBlocks.push(\n\t\t\t\tcreateBlock( columnBlockName, {}, [ createBlock( cellBlockName ) ] ),\n\t\t\t);\n\t\t}\n\n\t\t// Create a new row block.\n\t\tconst newRowBlock = createBlock( rowBlockName, {}, columnBlocks );\n\n\t\t// Insert the new row block.\n\t\tinsertBlock( newRowBlock, tableRow + insertionIndex, rowContainerId );\n\n\t\t// Update the table block attributes.\n\t\tupdateBlockAttributes( tableId, {\n\t\t\trows: tableBlock.attributes?.rows + 1,\n\t\t} );\n\t};\n\n\t/**\n\t * Delete row.\n\t */\n\tconst onDeleteRow = () => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get current row container block.\n\t\tconst rowContainerBlock = getBlock( rowContainerId );\n\n\t\t// Check if the row container block exists.\n\t\tif ( ! rowContainerBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get current row block.\n\t\tconst currentRowBlock = rowContainerBlock.innerBlocks[ tableRow - 1 ];\n\n\t\t// Check if the current row block is removable.\n\t\tif (\n\t\t\t! currentRowBlock?.clientId ||\n\t\t\t! canRemoveBlock( currentRowBlock.clientId )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the current row block.\n\t\tremoveBlock( currentRowBlock.clientId );\n\n\t\t// Update the table block attributes.\n\t\tupdateBlockAttributes( tableId, {\n\t\t\trows: tableBlock.attributes?.rows - 1,\n\t\t} );\n\t};\n\n\t/**\n\t * Insert column.\n\t *\n\t * @param {0|-1} insertionIndex Insertion index. -1 for before and 0 for after.\n\t */\n\tconst onInsertColumn = ( insertionIndex: 0 | -1 = 0 ) => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get current row container block.\n\t\tconst rowContainerBlock = getBlock( rowContainerId );\n\n\t\t// Check if the row container block exists.\n\t\tif ( ! rowContainerBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Loop through the table row blocks and insert a new column block.\n\t\ttableBlock.innerBlocks.forEach( ( currentRowContainerBlock ) => {\n\t\t\t// Check the name of the row container block.\n\t\t\tif ( currentRowContainerBlock.name !== rowContainerBlockName ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Loop through the row container blocks.\n\t\t\tcurrentRowContainerBlock.innerBlocks.forEach( ( rowBlock ) => {\n\t\t\t\t// Check the name of the row block.\n\t\t\t\tif ( rowBlock.name !== rowBlockName ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Check if the column block can be inserted.\n\t\t\t\tif ( ! canInsertBlockType( columnBlockName, rowBlock.clientId ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Create a new column block.\n\t\t\t\tconst newColumnBlock = createBlock( columnBlockName, {}, [\n\t\t\t\t\tcreateBlock( cellBlockName ),\n\t\t\t\t] );\n\n\t\t\t\t// Insert the new column block.\n\t\t\t\tinsertBlock( newColumnBlock, tableColumn + insertionIndex, rowBlock.clientId );\n\t\t\t} );\n\t\t} );\n\n\t\t// Update the table block attributes.\n\t\tupdateBlockAttributes( tableId, {\n\t\t\tcolumns: tableBlock.attributes?.columns + 1,\n\t\t} );\n\t};\n\n\t/**\n\t * Delete column.\n\t */\n\tconst onDeleteColumn = () => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Columns to be removed.\n\t\tconst columnsToRemove: string[] = [];\n\n\t\t// Loop through the table row blocks.\n\t\ttableBlock.innerBlocks.forEach( ( currentRowContainerBlock ) => {\n\t\t\t// Check the name of the row container block.\n\t\t\tif ( currentRowContainerBlock.name !== rowContainerBlockName ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Loop through the row container blocks.\n\t\t\tcurrentRowContainerBlock.innerBlocks.forEach( ( rowBlock ) => {\n\t\t\t\t// Check the name of the row block.\n\t\t\t\tif ( rowBlock.name !== rowBlockName ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the current column block.\n\t\t\t\tconst currentColumnBlock = rowBlock.innerBlocks[ tableColumn - 1 ];\n\n\t\t\t\t// Check if the current column block is removable.\n\t\t\t\tif (\n\t\t\t\t\tcurrentColumnBlock?.clientId &&\n\t\t\t\t\tcanRemoveBlock( currentColumnBlock.clientId )\n\t\t\t\t) {\n\t\t\t\t\tcolumnsToRemove.push( currentColumnBlock.clientId );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\t// Remove the columns.\n\t\tremoveBlocks( columnsToRemove );\n\n\t\t// Update the table block attributes.\n\t\tupdateBlockAttributes( tableId, {\n\t\t\tcolumns: tableBlock.attributes?.columns - 1,\n\t\t} );\n\t};\n\n\t/**\n\t * Merge column left.\n\t */\n\tconst onMergeColumnLeft = (): void => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentBlock = getBlock( columnId );\n\t\tif ( ! currentBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previousBlockClientId = getAdjacentBlockClientId( columnId, -1 );\n\t\tif ( ! previousBlockClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previousBlock = getBlock( previousBlockClientId );\n\t\tif ( ! previousBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Merge columns.\n\t\tmergeColumnsHorizontally( currentBlock, previousBlock );\n\t};\n\n\t/**\n\t * Merge column right.\n\t */\n\tconst onMergeColumnRight = (): void => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentBlock = getBlock( columnId );\n\t\tif ( ! currentBlock ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextBlockClientId = getAdjacentBlockClientId( columnId, 1 );\n\t\tif ( ! nextBlockClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextBlock = getBlock( nextBlockClientId );\n\t\tif ( ! nextBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Merge columns.\n\t\tmergeColumnsHorizontally( nextBlock, currentBlock );\n\t};\n\n\t/**\n\t * Merge column up.\n\t */\n\tconst onMergeColumnUp = (): void => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get current row container block.\n\t\tconst rowContainerBlock = getBlock( rowContainerId );\n\n\t\t// Check if the row container block exists.\n\t\tif ( ! rowContainerBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prepare variables.\n\t\tlet columnToMergeInto: BlockInstance | undefined;\n\t\tlet columnToMergeFrom: BlockInstance | undefined;\n\n\t\t// Traverse rows.\n\t\ttableBlock.innerBlocks.some( ( currentRowContainerBlock ) => {\n\t\t\tif ( currentRowContainerBlock.name !== rowContainerBlockName ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Avoid merging thead/tfoot row with tbody row.\n\t\t\tconst currentRowContainerBlockAttributes = getBlockAttributes( currentRowContainerBlock.clientId );\n\t\t\tif ( currentRowContainerBlockAttributes?.type !== rowContainerBlock?.attributes?.type ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn currentRowContainerBlock.innerBlocks.some( ( rowBlock, rowIndex ): boolean => {\n\t\t\t\t// Get current row.\n\t\t\t\tconst rowNumber: number = rowIndex + 1;\n\t\t\t\tif ( rowBlock.name !== rowBlockName || ( rowNumber !== tableRow && rowNumber !== tableRow - 1 ) || ! rowBlock.innerBlocks.length ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Traverse columns in current row.\n\t\t\t\trowBlock.innerBlocks.some( ( columnBlock, columnIndex ): boolean => {\n\t\t\t\t\t// Get column to merge from and into.\n\t\t\t\t\tconst columnNumber: number = columnIndex + 1;\n\t\t\t\t\tif ( columnNumber === tableColumn && rowNumber === tableRow ) {\n\t\t\t\t\t\tcolumnToMergeFrom = columnBlock;\n\t\t\t\t\t} else if ( columnNumber === tableColumn && rowNumber === tableRow - 1 ) {\n\t\t\t\t\t\tcolumnToMergeInto = columnBlock;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Short circuit if we found them.\n\t\t\t\t\tif ( columnToMergeInto && columnToMergeFrom ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// We haven't found them, loop some more.\n\t\t\t\t\treturn false;\n\t\t\t\t} );\n\n\t\t\t\t// Check if we have a \"to\" and \"from\" column.\n\t\t\t\tif ( ! columnToMergeFrom || ! columnToMergeInto ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Merge columns.\n\t\t\t\tmergeColumnsVertically( columnToMergeFrom, columnToMergeInto );\n\n\t\t\t\t// Short-circuit loop.\n\t\t\t\treturn true;\n\t\t\t} );\n\t\t} );\n\t};\n\n\t/**\n\t * Merge column down.\n\t */\n\tconst onMergeColumnDown = (): void => {\n\t\t// Get table block.\n\t\tconst tableBlock = getBlock( tableId );\n\n\t\t// Check if the table block exists.\n\t\tif ( ! tableBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get current row container block.\n\t\tconst rowContainerBlock = getBlock( rowContainerId );\n\n\t\t// Check if the row container block exists.\n\t\tif ( ! rowContainerBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prepare variables.\n\t\tlet columnToMergeInto: BlockInstance | undefined;\n\t\tlet columnToMergeFrom: BlockInstance | undefined;\n\n\t\t// Traverse rows.\n\t\ttableBlock.innerBlocks.some( ( currentRowContainerBlock ) => {\n\t\t\tif ( currentRowContainerBlock.name !== rowContainerBlockName ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Avoid merging thead/tfoot row with tbody row.\n\t\t\tconst currentRowContainerBlockAttributes = getBlockAttributes( currentRowContainerBlock.clientId );\n\t\t\tif ( currentRowContainerBlockAttributes?.type !== rowContainerBlock?.attributes?.type ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn currentRowContainerBlock.innerBlocks.some( ( rowBlock, rowIndex ): boolean => {\n\t\t\t\t// Get current row.\n\t\t\t\tconst rowNumber: number = rowIndex + 1;\n\t\t\t\tif ( rowBlock.name !== rowBlockName || ( rowNumber !== tableRow && rowNumber !== tableRow + 1 ) || ! rowBlock.innerBlocks.length ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Traverse columns in current row.\n\t\t\t\trowBlock.innerBlocks.some( ( columnBlock, columnIndex ): boolean => {\n\t\t\t\t\t// Get column to merge from and into.\n\t\t\t\t\tconst columnNumber: number = columnIndex + 1;\n\t\t\t\t\tif ( columnNumber === tableColumn && rowNumber === tableRow ) {\n\t\t\t\t\t\tcolumnToMergeInto = columnBlock;\n\t\t\t\t\t} else if ( columnNumber === tableColumn && rowNumber === tableRow + 1 ) {\n\t\t\t\t\t\tcolumnToMergeFrom = columnBlock;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Short circuit if we found them.\n\t\t\t\t\tif ( columnToMergeInto && columnToMergeFrom ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// We haven't found them, loop some more.\n\t\t\t\t\treturn false;\n\t\t\t\t} );\n\n\t\t\t\t// Check if we have a \"to\" and \"from\" column.\n\t\t\t\tif ( ! columnToMergeFrom || ! columnToMergeInto ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Merge columns.\n\t\t\t\tmergeColumnsVertically( columnToMergeFrom, columnToMergeInto );\n\n\t\t\t\t// Short-circuit loop.\n\t\t\t\treturn true;\n\t\t\t} );\n\t\t} );\n\t};\n\n\t/**\n\t * Merge columns horizontally.\n\t *\n\t * @param {Object} fromColumn From column block instance.\n\t * @param {Object} toColumn To column block instance.\n\t */\n\tconst mergeColumnsHorizontally = ( fromColumn: BlockInstance, toColumn: BlockInstance ): void => {\n\t\t// Get colspans.\n\t\tconst mergeIntoAttributes = getBlockAttributes( toColumn.clientId );\n\t\tconst mergeFromAttributes = getBlockAttributes( fromColumn.clientId );\n\n\t\t// Get rowspans.\n\t\tconst mergeIntoRowspan: number = parseInt( mergeIntoAttributes?.rowSpan ?? 1 );\n\t\tconst mergeFromRowspan: number = parseInt( mergeFromAttributes?.rowSpan ?? 1 );\n\n\t\t// Invalid merge.\n\t\tif ( mergeIntoRowspan !== mergeFromRowspan ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mergeIntoColspan: number = parseInt( mergeIntoAttributes?.colSpan ?? 1 );\n\t\tconst mergeFromColspan: number = parseInt( mergeFromAttributes?.colSpan ?? 1 );\n\n\t\t// Update colspan.\n\t\tupdateBlockAttributes( toColumn.clientId, { colSpan: mergeIntoColspan + mergeFromColspan } );\n\n\t\t// If it is the current column, move children to previous column and delete current column.\n\t\tmoveBlocksToPosition(\n\t\t\tfromColumn.innerBlocks.map( ( block ) => block.clientId ),\n\t\t\tfromColumn.clientId,\n\t\t\ttoColumn.clientId\n\t\t);\n\n\t\t// Remove block that is being merged from.\n\t\tremoveBlock( fromColumn.clientId );\n\t};\n\n\t/**\n\t * Merge columns vertically.\n\t *\n\t * @param {Object} fromColumn From column block instance.\n\t * @param {Object} toColumn To column block instance.\n\t */\n\tconst mergeColumnsVertically = ( fromColumn: BlockInstance, toColumn: BlockInstance ): void => {\n\t\t// Get rowspans.\n\t\tconst mergeIntoAttributes = getBlockAttributes( toColumn.clientId );\n\t\tconst mergeFromAttributes = getBlockAttributes( fromColumn.clientId );\n\n\t\t// Get colspans.\n\t\tconst mergeIntoColspan: number = parseInt( mergeIntoAttributes?.colSpan ?? 1 );\n\t\tconst mergeFromColspan: number = parseInt( mergeFromAttributes?.colSpan ?? 1 );\n\n\t\t// Invalid merge.\n\t\tif ( mergeIntoColspan !== mergeFromColspan ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mergeIntoRowspan: number = parseInt( mergeIntoAttributes?.rowSpan ?? 1 );\n\t\tconst mergeFromRowspan: number = parseInt( mergeFromAttributes?.rowSpan ?? 1 );\n\n\t\t// Update rowspan.\n\t\tupdateBlockAttributes( toColumn.clientId, { rowSpan: mergeIntoRowspan + mergeFromRowspan } );\n\n\t\t// If it is the current column, move children to previous column and delete current column.\n\t\tmoveBlocksToPosition(\n\t\t\tfromColumn.innerBlocks.map( ( block ) => block.clientId ),\n\t\t\tfromColumn.clientId,\n\t\t\ttoColumn.clientId\n\t\t);\n\n\t\t// Remove block that is being merged from.\n\t\tremoveBlock( fromColumn.clientId );\n\t};\n\n\t/**\n\t * Table controls.\n\t */\n\tconst tableControls = [\n\t\t{\n\t\t\ticon: tableRowBefore,\n\t\t\ttitle: __( 'Insert row before', 'tp' ),\n\t\t\tisDisabled: ( ! isSelected || rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ),\n\t\t\tonClick: () => onInsertRow( -1 ),\n\t\t},\n\t\t{\n\t\t\ticon: tableRowAfter,\n\t\t\ttitle: __( 'Insert row after', 'tp' ),\n\t\t\tisDisabled: ( ! isSelected || rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ),\n\t\t\tonClick: onInsertRow,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowDelete,\n\t\t\ttitle: __( 'Delete row', 'tp' ),\n\t\t\tisDisabled: ( ! isSelected || rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ),\n\t\t\tonClick: onDeleteRow,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnBefore,\n\t\t\ttitle: __( 'Insert column before', 'tp' ),\n\t\t\tisDisabled: ! isSelected,\n\t\t\tonClick: () => onInsertColumn( -1 ),\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnAfter,\n\t\t\ttitle: __( 'Insert column after', 'tp' ),\n\t\t\tisDisabled: ! isSelected,\n\t\t\tonClick: onInsertColumn,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnDelete,\n\t\t\ttitle: __( 'Delete column', 'tp' ),\n\t\t\tisDisabled: ! isSelected,\n\t\t\tonClick: onDeleteColumn,\n\t\t},\n\t\t{\n\t\t\ticon: arrowLeft,\n\t\t\ttitle: __( 'Merge column left', 'tp' ),\n\t\t\tisDisabled: tableColumn < 2,\n\t\t\tonClick: onMergeColumnLeft,\n\t\t},\n\t\t{\n\t\t\ticon: arrowRight,\n\t\t\ttitle: __( 'Merge column right', 'tp' ),\n\t\t\tisDisabled: tableColumn === maximumColumnsInCurrentRow,\n\t\t\tonClick: onMergeColumnRight,\n\t\t},\n\t\t{\n\t\t\ticon: arrowUp,\n\t\t\ttitle: __( 'Merge column up', 'tp' ),\n\t\t\tisDisabled: ( tableRow < 2 || rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ),\n\t\t\tonClick: onMergeColumnUp,\n\t\t},\n\t\t{\n\t\t\ticon: arrowDown,\n\t\t\ttitle: __( 'Merge column down', 'tp' ),\n\t\t\tisDisabled: ( tableRow === maximumRowsInCurrentColumn || rowContainerBlockType === 'tfoot' || rowContainerBlockType === 'thead' ),\n\t\t\tonClick: onMergeColumnDown,\n\t\t},\n\t] as DropdownOption[];\n\n\t/**\n\t * Return block controls.\n\t */\n\treturn (\n\t\t<>\n\t\t\t{ /* @ts-ignore - Group is not defined in the prop-type. */ }\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","/**\n * WordPress dependencies.\n */\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n\tInspectorControls,\n} from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { BlockEditProps } from '@wordpress/blocks';\n\n/**\n * External dependencies.\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies.\n */\nimport Toolbar from './toolbar';\nimport { name as cellBlockName } from '../table-cell';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n * @param {string} props.className Class name.\n * @param {string} props.clientId Client ID.\n * @param {Object} props.attributes Attributes.\n * @param {Function} props.setAttributes Set attributes.\n * @param {boolean} props.isSelected Is block selected.\n * @param {Object} props.context Block context.\n *\n * @return {JSX.Element} JSX Component.\n */\nfunction TableColumnEdit( {\n\tclassName,\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tcontext,\n}: BlockEditProps ): JSX.Element {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, 'travelopia-table__column', {\n\t\t\t'travelopia-table__column--sticky': attributes.isSticky,\n\t\t} ),\n\t} );\n\n\tconst tableId: string = context[ 'travelopia/table-id' ] as string;\n\tconst rowContainerType: string = context[ 'travelopia/table-row-container-type' ] as string;\n\tconst rowContainerId: string = context[ 'travelopia/table-row-container-id' ] as string;\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\t...blockProps,\n\t\t\tcolSpan: attributes.colSpan,\n\t\t\trowSpan: attributes.rowSpan,\n\t\t},\n\t\t{\n\t\t\ttemplate: [ [ cellBlockName ] ],\n\t\t\ttemplateLock: false,\n\t\t},\n\t);\n\n\t// Get the row and column index.\n\tconst { row, column } = useSelect(\n\t\t( select: any ) => {\n\t\t\t// Calculate the row and column index.\n\t\t\tconst columnIndex = select( blockEditorStore ).getBlockIndex( clientId );\n\t\t\tconst rowClientId =\n\t\t\t\tselect( blockEditorStore ).getBlockRootClientId( clientId );\n\t\t\tconst rowIndex = select( blockEditorStore ).getBlockIndex( rowClientId );\n\n\t\t\treturn {\n\t\t\t\trow: rowIndex + 1, // Start index at 1.\n\t\t\t\tcolumn: columnIndex + 1,\n\t\t\t};\n\t\t},\n\t\t[ clientId ],\n\t);\n\n\t// Update the row and column index.\n\tuseEffect( () => {\n\t\tsetAttributes( { row, column } );\n\t}, [ row, column, setAttributes ] );\n\n\tuseEffect( () => {\n\t\tsetAttributes( { blockId: clientId } );\n\t}, [ clientId, setAttributes ] );\n\n\t// Determine tag.\n\tlet Tag: string = 'td';\n\tif ( 'tbody' !== rowContainerType ) {\n\t\tTag = 'th';\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t setAttributes( { isSticky } ) }\n\t\t\t\t\t\thelp={ __( 'Is this column sticky?', 'tp' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport default TableColumnEdit;\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockConfiguration } from '@wordpress/blocks';\nimport {\n\tInnerBlocks,\n} from '@wordpress/block-editor';\nimport {\n\tblockTable as icon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies.\n */\nimport edit from './edit';\n\n/**\n * Block data.\n */\nexport const name: string = 'travelopia/table-column';\n\nexport const settings: BlockConfiguration = {\n\tapiVersion: 3,\n\ticon,\n\ttitle: __( 'Column', 'tp' ),\n\tdescription: __( 'Individual column of the table.', 'tp' ),\n\tparent: [ 'travelopia/table-row' ],\n\tcategory: 'text',\n\tkeywords: [ __( 'column', 'tp' ) ],\n\tattributes: {\n\t\trow: {\n\t\t\ttype: 'number',\n\t\t},\n\t\tcolumn: {\n\t\t\ttype: 'number',\n\t\t},\n\t\tcolSpan: {\n\t\t\ttype: 'number',\n\t\t},\n\t\trowSpan: {\n\t\t\ttype: 'number',\n\t\t},\n\t\tisSticky: {\n\t\t\ttype: 'boolean',\n\t\t},\n\t\tblockId: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tprovidesContext: {\n\t\t'travelopia/table-row': 'row' as never,\n\t\t'travelopia/table-column': 'column' as never,\n\t\t'travelopia/table-column-id': 'blockId' as never,\n\t},\n\tusesContext: [\n\t\t'travelopia/table-row-container-type',\n\t\t'travelopia/table-row-container-id',\n\t],\n\tsupports: {\n\t\thtml: true,\n\t\tcolor: {\n\t\t\ttext: true,\n\t\t\tbackground: true,\n\t\t},\n\t\talign: [ 'left', 'center', 'right' ],\n\t\t// @ts-ignore\n\t\t__experimentalBorder: {\n\t\t\tcolor: true,\n\t\t\tstyle: true,\n\t\t\twidth: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tcolor: true,\n\t\t\t\tstyle: true,\n\t\t\t\twidth: true,\n\t\t\t},\n\t\t},\n\t},\n\tedit,\n\tsave() {\n\t\treturn ;\n\t},\n};\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport {\n\tBlockEditProps,\n} from '@wordpress/blocks';\n\n/**\n * External dependencies.\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies.\n */\nimport { name as columnBlockName } from '../table-column';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n *\n * @return {JSX.Element} JSX Component.\n */\nfunction TableRowEdit( props: BlockEditProps ): JSX.Element {\n\t// Block props.\n\tconst { className, clientId, setAttributes } = props;\n\n\t// Inner block props.\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, 'travelopia-table__row' ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( { ...blockProps }, {\n\t\tallowedBlocks: [ columnBlockName ],\n\t\ttemplateLock: false,\n\t} );\n\n\tuseEffect( () => {\n\t\tsetAttributes( { blockId: clientId } );\n\t}, [ clientId, setAttributes ] );\n\n\treturn (\n\t\t\n\t);\n}\n\nexport default TableRowEdit;\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockConfiguration } from '@wordpress/blocks';\nimport {\n\tInnerBlocks,\n} from '@wordpress/block-editor';\nimport {\n\tblockTable as icon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies.\n */\nimport edit from './edit';\n\n/**\n * Block data.\n */\nexport const name: string = 'travelopia/table-row';\n\nexport const settings: BlockConfiguration = {\n\tapiVersion: 3,\n\ticon,\n\ttitle: __( 'Row', 'tp' ),\n\tdescription: __( 'Individual row of the table.', 'tp' ),\n\tparent: [ 'travelopia/table-row-container' ],\n\tcategory: 'text',\n\tkeywords: [ __( 'row', 'tp' ) ],\n\tattributes: {\n\t\tblockId: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tusesContext: [\n\t\t'travelopia/table-row-container-type',\n\t],\n\tsupports: {\n\t\thtml: true,\n\t\tcolor: {\n\t\t\ttext: true,\n\t\t\tbackground: true,\n\t\t},\n\t\t// @ts-ignore\n\t\t__experimentalBorder: {\n\t\t\tcolor: true,\n\t\t\tstyle: true,\n\t\t\twidth: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tcolor: true,\n\t\t\t\tstyle: true,\n\t\t\t\twidth: true,\n\t\t\t},\n\t\t},\n\t},\n\tedit,\n\tsave() {\n\t\treturn ;\n\t},\n};\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tToggleControl,\n} from '@wordpress/components';\nimport {\n\tBlockEditProps,\n} from '@wordpress/blocks';\n\n/**\n * External dependencies.\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies.\n */\nimport { name as rowBlockName } from '../table-row';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n *\n * @return {JSX.Element} JSX Component.\n */\nfunction TableRowContainerEdit( props: BlockEditProps ): JSX.Element {\n\t// Block props.\n\tconst { className, attributes, setAttributes, clientId } = props;\n\n\t// Inner block props.\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, 'travelopia-table__row-container', {\n\t\t\t'travelopia-table__row-container--sticky': attributes.isSticky,\n\t\t} ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( { ...blockProps }, {\n\t\tallowedBlocks: [ rowBlockName ],\n\t} );\n\n\t// Determine tag.\n\tconst Tag: string = attributes.type;\n\n\tuseEffect( () => {\n\t\tsetAttributes( { blockId: clientId } );\n\t}, [ clientId, setAttributes ] );\n\n\t// Return component.\n\treturn (\n\t\t<>\n\t\t\t{ 'thead' === attributes.type &&\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t setAttributes( { isSticky } ) }\n\t\t\t\t\t\t\thelp={ __( 'Is this container sticky?', 'tp' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\n\t);\n}\n\nexport default TableRowContainerEdit;\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockConfiguration } from '@wordpress/blocks';\nimport {\n\tInnerBlocks,\n} from '@wordpress/block-editor';\nimport {\n\tblockTable as icon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies.\n */\nimport edit from './edit';\n\n/**\n * Block data.\n */\nexport const name: string = 'travelopia/table-row-container';\n\nexport const settings: BlockConfiguration = {\n\tapiVersion: 3,\n\ticon,\n\ttitle: __( 'Row Container', 'tp' ),\n\tdescription: __( 'A container for a row (THEAD, TBODY, TFOOT).', 'tp' ),\n\tparent: [ 'travelopia/table' ],\n\tcategory: 'text',\n\tkeywords: [\n\t\t__( 'thead', 'tp' ),\n\t\t__( 'tbody', 'tp' ),\n\t\t__( 'tfoot', 'tp' ),\n\t],\n\tattributes: {\n\t\ttype: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'tbody',\n\t\t},\n\t\tisSticky: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\tblockId: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tprovidesContext: {\n\t\t'travelopia/table-row-container-type': 'type' as never,\n\t\t'travelopia/table-row-container-sticky': 'isSticky' as never,\n\t\t'travelopia/table-row-container-id': 'blockId' as never,\n\t},\n\tsupports: {\n\t\thtml: false,\n\t},\n\tedit,\n\tsave() {\n\t\treturn ;\n\t},\n};\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport {\n\tBlockEditProps,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tPanelBody,\n\tToggleControl,\n} from '@wordpress/components';\nimport {\n\tselect,\n\tdispatch,\n} from '@wordpress/data';\n\n/**\n * External dependencies.\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies.\n */\nimport { TablePlaceholder } from './placeholder';\nimport { name as rowContainerBlockName } from '../table-row-container';\nimport { name as rowBlockName } from '../table-row';\nimport { name as columnBlockName } from '../table-column';\nimport { name as cellBlockName } from '../table-cell';\n\n/**\n * Create and insert a row container.\n *\n * @param {string} type Row container type.\n * @param {string} tableClientId The table block's client ID.\n */\nexport const createAndInsertRowContainer = ( type: string = 'tbody', tableClientId: string = '' ): void => {\n\t// Get table block.\n\tconst tableBlock = select( 'core/block-editor' ).getBlock( tableClientId );\n\tif ( ! tableBlock ) {\n\t\treturn;\n\t}\n\n\t// Create row container.\n\tconst rowContainerBlock = createBlock( rowContainerBlockName, { type } );\n\n\t// Determine number of rows to create.\n\tlet totalRows = tableBlock.attributes.rows;\n\tif ( 'tbody' !== type ) {\n\t\ttotalRows = 1;\n\t}\n\n\t// Add rows and columns to it.\n\tfor ( let i: number = 0; i < totalRows; i++ ) {\n\t\tconst columnBlocks = [];\n\t\tfor ( let j: number = 0; j < tableBlock.attributes.columns; j++ ) {\n\t\t\tcolumnBlocks.push(\n\t\t\t\tcreateBlock( columnBlockName, {}, [\n\t\t\t\t\tcreateBlock( cellBlockName ),\n\t\t\t\t] )\n\t\t\t);\n\t\t}\n\n\t\trowContainerBlock.innerBlocks.push(\n\t\t\tcreateBlock( rowBlockName, {}, columnBlocks )\n\t\t);\n\t}\n\n\t// Add newly created row and column blocks to the table.\n\tif ( 'tbody' === type ) {\n\t\tdispatch( 'core/block-editor' ).replaceInnerBlocks( tableClientId, [ rowContainerBlock ] );\n\t} else {\n\t\tconst position = 'thead' === type ? 0 : tableBlock.innerBlocks.length;\n\t\tdispatch( 'core/block-editor' ).insertBlock( rowContainerBlock, position, tableClientId );\n\t}\n};\n\n/**\n * Delete row container child block.\n *\n * @param {string} type Row container type.\n * @param {string} tableClientId The table block's client ID.\n */\nexport const deleteRowContainer = ( type: string = 'thead', tableClientId: string = '' ): void => {\n\t// Get table block.\n\tconst tableBlock = select( 'core/block-editor' ).getBlock( tableClientId );\n\tif ( ! tableBlock || ! tableBlock.innerBlocks.length ) {\n\t\treturn;\n\t}\n\n\t// Find the child block and delete it.\n\ttableBlock.innerBlocks.forEach( ( innerBlock ) => {\n\t\tif ( innerBlock.attributes?.type === type ) {\n\t\t\tdispatch( 'core/block-editor' ).removeBlock( innerBlock.clientId );\n\t\t}\n\t} );\n};\n\n/**\n * Edit function.\n *\n * @param {Object} props Edit properties.\n *\n * @return {JSX.Element} JSX Component.\n */\nfunction TableEdit( props: BlockEditProps ): JSX.Element {\n\tconst { className, attributes, clientId, setAttributes } = props;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, 'travelopia-table' ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( {}, {\n\t\tallowedBlocks: [ rowContainerBlockName ],\n\t\trenderAppender: undefined,\n\t} );\n\n\t// Set blockId attribute.\n\tuseEffect( () => {\n\t\tsetAttributes( { blockId: clientId } );\n\t}, [ clientId, setAttributes ] );\n\n\t/**\n\t * Handle THEAD change.\n\t *\n\t * @param {boolean} hasThead Has THEAD.\n\t */\n\tconst handleTheadChange = ( hasThead: boolean ): void => {\n\t\tif ( hasThead ) {\n\t\t\tcreateAndInsertRowContainer( 'thead', clientId );\n\t\t} else {\n\t\t\tdeleteRowContainer( 'thead', clientId );\n\t\t}\n\t\tsetAttributes( { hasThead } );\n\t};\n\n\t/**\n\t * Handle TFOOT change.\n\t *\n\t * @param {boolean} hasTfoot Has TFOOT.\n\t */\n\tconst handleTfootChange = ( hasTfoot: boolean ): void => {\n\t\tif ( hasTfoot ) {\n\t\t\tcreateAndInsertRowContainer( 'tfoot', clientId );\n\t\t} else {\n\t\t\tdeleteRowContainer( 'tfoot', clientId );\n\t\t}\n\t\tsetAttributes( { hasTfoot } );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t{\n\t\t\t\t\t/* Placeholder for initial state. */\n\t\t\t\t\t( 0 === attributes.rows || 0 === attributes.columns ) &&\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t{\n\t\t\t\t\t( 0 !== attributes.rows || 0 !== attributes.columns ) &&\n\t\t\t\t\t\t
\n\t\t\t\t}\n\t\t\t\n\t\t\n\t);\n}\n\nexport default TableEdit;\n","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockConfiguration } from '@wordpress/blocks';\nimport {\n\tInnerBlocks,\n} from '@wordpress/block-editor';\nimport {\n\tblockTable as icon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies.\n */\nimport edit from './edit';\n\n/**\n * Styles.\n */\nimport './editor.scss';\n\n/**\n * Frontend styles.\n */\nimport '../../../front-end/table/index.scss';\n\n/**\n * Block data.\n */\nexport const name: string = 'travelopia/table';\n\nexport const settings: BlockConfiguration = {\n\tapiVersion: 3,\n\ticon,\n\ttitle: __( 'Table', 'tp' ),\n\tdescription: __( 'Create structured content in rows and columns to display information.', 'tp' ),\n\tcategory: 'text',\n\tkeywords: [ __( 'table', 'tp' ) ],\n\tattributes: {\n\t\tanchor: {\n\t\t\ttype: 'string',\n\t\t},\n\t\trows: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 0,\n\t\t},\n\t\tcolumns: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 0,\n\t\t},\n\t\tblockId: {\n\t\t\ttype: 'string',\n\t\t},\n\t\thasThead: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\thasTfoot: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\tprovidesContext: {\n\t\t'travelopia/table-id': 'blockId' as never,\n\t\t'travelopia/table-total-rows': 'rows' as never,\n\t\t'travelopia/table-total-columns': 'columns' as never,\n\t\t'travelopia/table-has-thead': 'hasThead' as never,\n\t\t'travelopia/table-has-tfoot': 'hasTfoot' as never,\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t},\n\tedit,\n\tsave() {\n\t\treturn ;\n\t},\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","/**\n * WordPress dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { BlockConfiguration, BlockEditProps } from '@wordpress/blocks';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies.\n */\nimport Toolbar from './table-column/toolbar';\n\n/**\n * Add context of table row and column to the block.\n */\naddFilter(\n\t'blocks.registerBlockType',\n\t'travelopia/table-row-column-context',\n\t( settings: BlockConfiguration ) => {\n\t\tconst requiredContexts = [\n\t\t\t'travelopia/table-row',\n\t\t\t'travelopia/table-column',\n\t\t\t'travelopia/table-id',\n\t\t\t'travelopia/table-row-container-id',\n\t\t\t'travelopia/table-column-id',\n\t\t];\n\n\t\tif ( settings.usesContext && Array.isArray( settings.usesContext ) ) {\n\t\t\trequiredContexts.forEach( ( context ) => {\n\t\t\t\tif ( ! settings.usesContext?.includes( context ) ) {\n\t\t\t\t\tsettings.usesContext?.push( context );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn settings;\n\t},\n);\n\n/**\n * Add toolbar to the table block.\n */\naddFilter( 'editor.BlockEdit', 'travelopia/table-toolbar', ( BlockEdit ) => {\n\treturn ( props: BlockEditProps ) => {\n\t\tconst { context, isSelected } = props;\n\n\t\tif ( ! context ) {\n\t\t\treturn ;\n\t\t}\n\n\t\tconst tableRow = context[ 'travelopia/table-row' ] as number;\n\t\tconst tableColumn = context[ 'travelopia/table-column' ] as number;\n\t\tconst tableId = context[ 'travelopia/table-id' ] as string;\n\t\tconst tableRowContainerId = context[ 'travelopia/table-row-container-id' ] as string;\n\t\tconst tableColumnId = context[ 'travelopia/table-column-id' ] as string;\n\n\t\tif (\n\t\t\t! tableRow ||\n\t\t\t! tableColumn ||\n\t\t\t! tableId ||\n\t\t\ttableColumn < 1 ||\n\t\t\ttableRow < 1\n\t\t) {\n\t\t\treturn ;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t};\n} );\n","/**\n * WordPress dependencies.\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Import blocks.\n */\nimport * as table from './table';\nimport * as tableRowContainer from './table-row-container';\nimport * as tableRow from './table-row';\nimport * as tableColumn from './table-column';\nimport * as tableCell from './table-cell';\n\n/**\n * Internal dependencies.\n */\nimport './block-toolbar';\n\n/**\n * Add blocks.\n */\nconst blocks = [\n\ttable,\n\ttableRowContainer,\n\ttableRow,\n\ttableColumn,\n\ttableCell,\n];\n\n/**\n * Register blocks.\n */\nblocks.forEach( ( { name, settings } ) => registerBlockType( name, settings ) );\n"],"names":["f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","Fragment","jsx","jsxs","module","window","hasOwn","classNames","classes","i","arguments","length","arg","appendClass","parseValue","Array","isArray","apply","toString","includes","value","newClass","default","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","get","obj","prop","r","toStringTag","createElement","SVG","viewBox","xmlns","Path","TablePlaceholder","setAttributes","clientId","rows","setRows","useState","columns","setColumns","Placeholder","label","__","icon","BlockIcon","showColors","instructions","className","onSubmit","preventDefault","createAndInsertRowContainer","TextControl","onChange","totalColumns","parseInt","min","totalRows","Button","variant","attributes","blockProps","useBlockProps","RichText","tagName","placeholder","content","settings","apiVersion","title","description","parent","category","keywords","source","supports","html","transforms","to","blocks","transform","innerBlocks","createBlock","level","edit","save","Content","Toolbar","isSelected","tableId","tableRow","tableColumn","rowContainerId","columnId","getBlock","canInsertBlockType","getBlockAttributes","canRemoveBlock","getAdjacentBlockClientId","select","removeBlock","removeBlocks","insertBlock","updateBlockAttributes","moveBlocksToPosition","dispatch","maximumColumnsInCurrentRow","setMaximumColumnsInCurrentRow","maximumRowsInCurrentColumn","setMaximumRowsInCurrentColumn","rowContainerBlockType","useMemo","useEffect","tableBlock","some","rowContainerBlock","name","maxRows","forEach","rowBlock","rowIndex","columnBlock","columnIndex","onInsertRow","insertionIndex","columnBlocks","push","newRowBlock","onInsertColumn","currentRowContainerBlock","newColumnBlock","mergeColumnsHorizontally","fromColumn","toColumn","mergeIntoAttributes","mergeFromAttributes","rowSpan","mergeIntoColspan","colSpan","mergeFromColspan","map","block","mergeColumnsVertically","mergeIntoRowspan","mergeFromRowspan","tableControls","isDisabled","onClick","currentRowBlock","columnsToRemove","currentColumnBlock","currentBlock","previousBlockClientId","previousBlock","nextBlockClientId","nextBlock","columnToMergeInto","columnToMergeFrom","currentRowContainerBlockAttributes","rowNumber","columnNumber","BlockControls","group","ToolbarDropdownMenu","controls","context","isSticky","rowContainerType","innerBlocksProps","useInnerBlocksProps","template","templateLock","row","column","useSelect","getBlockIndex","rowClientId","getBlockRootClientId","blockId","Tag","InspectorControls","PanelBody","ToggleControl","checked","help","providesContext","usesContext","color","text","background","align","__experimentalBorder","style","width","__experimentalDefaultControls","InnerBlocks","allowedBlocks","tableClientId","j","replaceInnerBlocks","position","deleteRowContainer","innerBlock","renderAppender","hasThead","hasTfoot","anchor","addFilter","requiredContexts","BlockEdit","tableRowContainerId","tableColumnId","registerBlockType"],"sourceRoot":""} \ No newline at end of file From 4e9c26487c9744799afcd2af2df8a577cde3b616 Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Wed, 10 Jul 2024 00:06:28 +0530 Subject: [PATCH 6/6] EX-1142 fix eslint errors --- src/editor/blocks/table-column/toolbar.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/editor/blocks/table-column/toolbar.tsx b/src/editor/blocks/table-column/toolbar.tsx index c0a12b6..8a64335 100644 --- a/src/editor/blocks/table-column/toolbar.tsx +++ b/src/editor/blocks/table-column/toolbar.tsx @@ -100,7 +100,6 @@ export default function Toolbar( { // Traverse table. tableBlock.innerBlocks.some( ( rowContainerBlock ): boolean => { - if ( rowContainerBlock.name !== rowContainerBlockName || ! rowContainerBlock.innerBlocks.length ) { return false; } @@ -117,7 +116,7 @@ export default function Toolbar( { } rowBlock.innerBlocks.forEach( ( columnBlock, columnIndex ) => { - if ( columnBlock.name !== columnBlockName || columnIndex + 1 !== tableColumn ) { + if ( columnBlock.name !== columnBlockName || columnIndex + 1 !== tableColumn ) { return; } @@ -127,7 +126,7 @@ export default function Toolbar( { setMaximumRowsInCurrentColumn( maxRows ); return true; - }); + } ); }, [ tableRow, tableColumn, getBlock, tableId ] ); /**