Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archive Title Block: Refactor settings panel to use ToolsPanel #67915

Merged
Merged
Changes from 14 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
63f81c1
Image size fix in lightbox
karthick-murugan Dec 3, 2024
0e19583
Revert "Image size fix in lightbox"
karthick-murugan Dec 3, 2024
f226ae0
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 4, 2024
d074ba9
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 5, 2024
4d847ca
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 5, 2024
c9115b2
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 5, 2024
b81e6ff
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 6, 2024
efe57e5
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 9, 2024
228e924
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 10, 2024
c448a21
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 11, 2024
05bb54c
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 12, 2024
619fed3
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 12, 2024
d5e0910
Update toolspanel to archive title block
karthick-murugan Dec 13, 2024
846b7cb
Feedback changes updated
karthick-murugan Dec 16, 2024
301d70f
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 18, 2024
c80640f
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 19, 2024
6ed9ff3
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 20, 2024
09b4cf2
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 20, 2024
27e4bbc
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 20, 2024
52f809e
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 23, 2024
e7679f1
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 24, 2024
190b44e
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Jan 2, 2025
26aafe7
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Jan 6, 2025
fe1916c
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Jan 8, 2025
58dddf5
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Jan 9, 2025
e14c01d
Feedback changes updated
karthick-murugan Jan 13, 2025
355dd06
Feedback changes updated
karthick-murugan Jan 13, 2025
0fb88b9
Merge branch 'trunk' of github.com:karthick-murugan/gutenberg into ad…
karthick-murugan Jan 14, 2025
2679c19
Feedback updates
karthick-murugan Jan 14, 2025
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
76 changes: 57 additions & 19 deletions packages/block-library/src/query-title/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
Warning,
HeadingLevelDropdown,
} from '@wordpress/block-editor';
import { ToggleControl, PanelBody } from '@wordpress/components';
import {
ToggleControl,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
} from '@wordpress/components';
import { __, _x, sprintf } from '@wordpress/i18n';

/**
Expand Down Expand Up @@ -89,16 +93,35 @@ export default function QueryTitleEdit( {
titleElement = (
<>
<InspectorControls>
<PanelBody title={ __( 'Settings' ) }>
<ToggleControl
__nextHasNoMarginBottom
<ToolsPanel
label={ __( 'Settings' ) }
resetAll={ () =>
setAttributes( {
showPrefix: false,
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
} )
}
>
<ToolsPanelItem
hasValue={ () => showPrefix !== undefined }
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
label={ __( 'Show archive type in title' ) }
onChange={ () =>
setAttributes( { showPrefix: ! showPrefix } )
onDeselect={ () =>
setAttributes( { showPrefix: false } )
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
}
checked={ showPrefix }
/>
</PanelBody>
resetAllFilter="core/filter-reset-all-settings"
isShownByDefault
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
>
<ToggleControl
__nextHasNoMarginBottom
label={ __( 'Show archive type in title' ) }
onChange={ () =>
setAttributes( {
showPrefix: ! showPrefix,
} )
}
checked={ showPrefix }
/>
</ToolsPanelItem>
</ToolsPanel>
</InspectorControls>
<TagName { ...blockProps }>{ title }</TagName>
</>
Expand All @@ -109,18 +132,33 @@ export default function QueryTitleEdit( {
titleElement = (
<>
<InspectorControls>
<PanelBody title={ __( 'Settings' ) }>
<ToggleControl
__nextHasNoMarginBottom
<ToolsPanel
label={ __( 'Settings' ) }
resetAll={ () =>
setAttributes( {
showSearchTerm: false,
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
} )
}
>
<ToolsPanelItem
hasValue={ () => showSearchTerm !== undefined }
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
label={ __( 'Show search term in title' ) }
onChange={ () =>
setAttributes( {
showSearchTerm: ! showSearchTerm,
} )
onDeselect={ () =>
setAttributes( { showSearchTerm: false } )
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
}
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
checked={ showSearchTerm }
/>
</PanelBody>
>
<ToggleControl
__nextHasNoMarginBottom
label={ __( 'Show search term in title' ) }
onChange={ () =>
setAttributes( {
showSearchTerm: ! showSearchTerm,
} )
}
checked={ showSearchTerm }
/>
</ToolsPanelItem>
</ToolsPanel>
</InspectorControls>

<TagName { ...blockProps }>
Expand Down
Loading