Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"translation-revision-date":"2026-09-24 15:04+0200","generator":"WP-CLI\/2.11.0","source":"build\/blockparty-tabs-nav\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"Add tab":["Ajouter un onglet"],"Remove tab":["Supprimer l\u2019onglet"],"Settings":["R\u00e9glages"],"Label":["Libell\u00e9"],"Describe the purpose of this tabbed interface for assistive technologies.":["D\u00e9crivez l'objectif de cette interface \u00e0 onglets pour les technologies d'assistance."]}}}
{"translation-revision-date":"2026-09-29 13:46+0200","generator":"WP-CLI\/2.11.0","source":"build\/blockparty-tabs-nav\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"Add tab":["Ajouter un onglet"],"Remove tab":["Supprimer l\u2019onglet"],"Settings":["R\u00e9glages"],"Label":["Libell\u00e9"],"Describe the purpose of this tabbed interface for assistive technologies.":["D\u00e9crivez l'objectif de cette interface \u00e0 onglets pour les technologies d'assistance."]}}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"translation-revision-date":"2026-09-24 15:04+0200","generator":"WP-CLI\/2.11.0","source":"build\/blockparty-tabs-nav-item\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"Add tab":["Ajouter un onglet"],"Remove tab":["Supprimer l\u2019onglet"],"Move tab before":["D\u00e9placer l\u2019onglet \u00e0 gauche"],"Move tab after":["D\u00e9placer l\u2019onglet \u00e0 droite"],"Icon":["Ic\u00f4ne"],"Item\u2026":["\u00c9l\u00e9ment\u2026"]}}}
{"translation-revision-date":"2026-09-29 13:46+0200","generator":"WP-CLI\/2.11.0","source":"build\/blockparty-tabs-nav-item\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"Add tab":["Ajouter un onglet"],"Remove tab":["Supprimer l\u2019onglet"],"Move tab before":["D\u00e9placer l\u2019onglet \u00e0 gauche"],"Move tab after":["D\u00e9placer l\u2019onglet \u00e0 droite"],"Icon":["Ic\u00f4ne"],"Item\u2026":["\u00c9l\u00e9ment\u2026"]}}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"translation-revision-date":"2026-09-24 15:04+0200","generator":"WP-CLI\/2.11.0","source":"build\/blockparty-tabs-panel-item\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"Add tab":["Ajouter un onglet"],"Remove tab":["Supprimer l\u2019onglet"]}}}
{"translation-revision-date":"2026-09-29 13:46+0200","generator":"WP-CLI\/2.11.0","source":"build\/blockparty-tabs-panel-item\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"Add tab":["Ajouter un onglet"],"Remove tab":["Supprimer l\u2019onglet"]}}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"translation-revision-date":"2026-09-24 15:04+0200","generator":"WP-CLI\/2.11.0","source":"build\/blockparty-tabs\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"Add tab":["Ajouter un onglet"],"Remove tab":["Supprimer l\u2019onglet"],"Align top left":["Aligner en haut \u00e0 gauche"],"Align top center":["Aligner en haut au centre"],"Align top right":["Aligner en haut \u00e0 droite"],"Align top justified":["Aligner en haut justifi\u00e9"],"Align sidebar right":["Barre lat\u00e9rale \u00e0 droite"],"Align sidebar left":["Barre lat\u00e9rale \u00e0 gauche"]}}}
{"translation-revision-date":"2026-09-29 13:46+0200","generator":"WP-CLI\/2.11.0","source":"build\/blockparty-tabs\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"Add tab":["Ajouter un onglet"],"Remove tab":["Supprimer l\u2019onglet"],"Align top left":["Aligner en haut \u00e0 gauche"],"Align top center":["Aligner en haut au centre"],"Align top right":["Aligner en haut \u00e0 droite"],"Align top justified":["Aligner en haut justifi\u00e9"],"Align sidebar right":["Barre lat\u00e9rale \u00e0 droite"],"Align sidebar left":["Barre lat\u00e9rale \u00e0 gauche"]}}}
Binary file modified languages/blockparty-tabs-fr_FR.mo
Binary file not shown.
14 changes: 7 additions & 7 deletions languages/blockparty-tabs-fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Blockparty Tabs 1.0.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/blockparty-tabs\n"
"POT-Creation-Date: 2026-09-24T13:02:27+00:00\n"
"PO-Revision-Date: 2026-09-24 15:04+0200\n"
"POT-Creation-Date: 2026-09-29T11:45:30+00:00\n"
"PO-Revision-Date: 2026-09-29 13:46+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr_FR\n"
Expand All @@ -18,7 +18,7 @@ msgstr ""
#. Plugin Name of the plugin
#: blockparty-tabs.php
msgid "Blockparty Tabs"
msgstr ""
msgstr "Blockparty Onglets"

#. Description of the plugin
#: blockparty-tabs.php
Expand All @@ -37,15 +37,13 @@ msgstr "https://beapi.fr"

#: build/blockparty-tabs-nav-item/index.js:1
#: build/blockparty-tabs-nav/index.js:1
#: build/blockparty-tabs-panel-item/index.js:1
#: build/blockparty-tabs-panels/index.js:1 build/blockparty-tabs/index.js:1
#: build/blockparty-tabs-panel-item/index.js:1 build/blockparty-tabs/index.js:1
msgid "Add tab"
msgstr "Ajouter un onglet"

#: build/blockparty-tabs-nav-item/index.js:1
#: build/blockparty-tabs-nav/index.js:1
#: build/blockparty-tabs-panel-item/index.js:1
#: build/blockparty-tabs-panels/index.js:1 build/blockparty-tabs/index.js:1
#: build/blockparty-tabs-panel-item/index.js:1 build/blockparty-tabs/index.js:1
msgid "Remove tab"
msgstr "Supprimer l’onglet"

Expand Down Expand Up @@ -160,6 +158,8 @@ msgid ""
"Organize content into tabs so visitors can browse sections without scrolling "
"endlessly."
msgstr ""
"Organisez le contenu en onglets afin que les visiteurs puissent parcourir "
"les sections sans avoir à faire défiler la page indéfiniment."

#~ msgid "Add Item Before"
#~ msgstr "Ajouter un élément à gauche"
Expand Down
6 changes: 2 additions & 4 deletions languages/blockparty-tabs.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GPL-2.0-or-later.
msgid ""
msgstr ""
"Project-Id-Version: Blockparty Tabs 1.1.5\n"
"Project-Id-Version: Blockparty Tabs 2.0.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/blockparty-tabs\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2026-09-24T13:02:27+00:00\n"
"POT-Creation-Date: 2026-09-29T11:45:30+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: blockparty-tabs\n"
Expand Down Expand Up @@ -37,15 +37,13 @@ msgstr ""
#: build/blockparty-tabs-nav-item/index.js:1
#: build/blockparty-tabs-nav/index.js:1
#: build/blockparty-tabs-panel-item/index.js:1
#: build/blockparty-tabs-panels/index.js:1
#: build/blockparty-tabs/index.js:1
msgid "Add tab"
msgstr ""

#: build/blockparty-tabs-nav-item/index.js:1
#: build/blockparty-tabs-nav/index.js:1
#: build/blockparty-tabs-panel-item/index.js:1
#: build/blockparty-tabs-panels/index.js:1
#: build/blockparty-tabs/index.js:1
msgid "Remove tab"
msgstr ""
Expand Down
5 changes: 4 additions & 1 deletion src/blockparty-tabs-nav/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export default function Edit( { attributes, setAttributes, clientId } ) {

return (
<>
<TabsAddRemoveBlockControls clientId={ clientId } />
<TabsAddRemoveBlockControls
clientId={ clientId }
showRemove={ false }
/>
<InspectorControls>
<PanelBody
title={ __( 'Settings', 'blockparty-tabs' ) }
Expand Down
6 changes: 5 additions & 1 deletion src/blockparty-tabs-panel-item/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export default function Edit( {

return (
<>
<TabsAddRemoveBlockControls clientId={ clientId } index={ index } />
<TabsAddRemoveBlockControls
clientId={ clientId }
index={ index }
showAdd={ false }
/>
<div { ...blockProps }>
<InnerBlocks
allowedBlocks={ allowedBlocks }
Expand Down
10 changes: 2 additions & 8 deletions src/blockparty-tabs-panels/edit.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
import { TabsAddRemoveBlockControls } from '../blockparty-tabs/TabsAddRemoveControls';

const BLOCKS_CHILD = 'blockparty/tabs-panel-item';
const ALLOWED_BLOCKS = [ BLOCKS_CHILD ];
const LOCK_TEMPLATE = { lock: { move: true, remove: true } };

export default function Edit( { clientId } ) {
export default function Edit() {
const blockProps = useBlockProps();
const innerBlocksProps = useInnerBlocksProps( blockProps, {
allowedBlocks: ALLOWED_BLOCKS,
Expand All @@ -20,10 +19,5 @@ export default function Edit( { clientId } ) {
renderAppender: false,
} );

return (
<>
<TabsAddRemoveBlockControls clientId={ clientId } />
<section { ...innerBlocksProps } />
</>
);
return <section { ...innerBlocksProps } />;
}
73 changes: 53 additions & 20 deletions src/blockparty-tabs/TabsAddRemoveControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,25 +195,40 @@ export const useTabsMutations = ( clientId, index ) => {
/**
* Toolbar group with Add tab / Remove tab buttons.
*
* @param {Object} props Component props.
* @param {string} props.clientId Block clientId (any block in the tabs tree).
* @param {number} [props.index] Explicit tab index; falls back to tabsActive.
* @return {Element} Toolbar group.
* @param {Object} props Component props.
* @param {string} props.clientId Block clientId (any block in the tabs tree).
* @param {number} [props.index] Explicit tab index; falls back to tabsActive.
* @param {boolean} [props.showAdd] Whether to show the Add tab control.
* @param {boolean} [props.showRemove] Whether to show the Remove tab control.
* @return {Element|null} Toolbar group.
*/
export const TabsAddRemoveToolbar = ( { clientId, index } ) => {
export const TabsAddRemoveToolbar = ( {
clientId,
index,
showAdd = true,
showRemove = true,
} ) => {
const { canRemove, insertTabAfterActive, removeTab } = useTabsMutations(
clientId,
index
);

if ( ! showAdd && ! showRemove ) {
return null;
}

return (
<ToolbarGroup>
<ToolbarButton onClick={ insertTabAfterActive }>
{ __( 'Add tab', 'blockparty-tabs' ) }
</ToolbarButton>
<ToolbarButton isDisabled={ ! canRemove } onClick={ removeTab }>
{ __( 'Remove tab', 'blockparty-tabs' ) }
</ToolbarButton>
{ showAdd && (
<ToolbarButton onClick={ insertTabAfterActive }>
{ __( 'Add tab', 'blockparty-tabs' ) }
</ToolbarButton>
) }
{ showRemove && (
<ToolbarButton isDisabled={ ! canRemove } onClick={ removeTab }>
{ __( 'Remove tab', 'blockparty-tabs' ) }
</ToolbarButton>
) }
</ToolbarGroup>
);
};
Expand Down Expand Up @@ -241,13 +256,31 @@ export const TabsNavAppender = ( { clientId } ) => {
/**
* BlockControls wrapper for Add / Remove tab actions.
*
* @param {Object} props Component props.
* @param {string} props.clientId Block clientId (any block in the tabs tree).
* @param {number} [props.index] Explicit tab index; falls back to tabsActive.
* @return {Element} Block controls with shared toolbar.
* @param {Object} props Component props.
* @param {string} props.clientId Block clientId (any block in the tabs tree).
* @param {number} [props.index] Explicit tab index; falls back to tabsActive.
* @param {boolean} [props.showAdd] Whether to show the Add tab control.
* @param {boolean} [props.showRemove] Whether to show the Remove tab control.
* @return {Element|null} Block controls with shared toolbar.
*/
export const TabsAddRemoveBlockControls = ( { clientId, index } ) => (
<BlockControls>
<TabsAddRemoveToolbar clientId={ clientId } index={ index } />
</BlockControls>
);
export const TabsAddRemoveBlockControls = ( {
clientId,
index,
showAdd = true,
showRemove = true,
} ) => {
if ( ! showAdd && ! showRemove ) {
return null;
}

return (
<BlockControls>
<TabsAddRemoveToolbar
clientId={ clientId }
index={ index }
showAdd={ showAdd }
showRemove={ showRemove }
/>
</BlockControls>
);
};
5 changes: 4 additions & 1 deletion src/blockparty-tabs/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ export default function Edit( { attributes, setAttributes, clientId } ) {
setAttributes( { mode: newAlign } )
}
/>
<TabsAddRemoveToolbar clientId={ clientId } />
<TabsAddRemoveToolbar
clientId={ clientId }
showRemove={ false }
/>
</BlockControls>
<div { ...innerBlocksProps } />
</>
Expand Down
4 changes: 4 additions & 0 deletions src/blockparty-tabs/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
}
}

.wp-block-blockparty-tabs-panels {
margin-block-start: 0;
}

Comment thread
firestar300 marked this conversation as resolved.
&-panels {
.alignfull & {
padding: 0 !important;
Expand Down
Loading