Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
678 commits
Select commit Hold shift + click to select a range
f039c65
Use `jest-circus` in unit tests (#31178)
kevin940726 Apr 27, 2021
e8d473b
E2E testing: Use JSON serialization for getAllBlocks (#31199)
david-szabo97 Apr 27, 2021
5d120a4
Fix preset class generation for border color in edit site (#31217)
nosolosw Apr 27, 2021
79a938b
Preset classes: generate them like in the front-end (all classes per …
nosolosw Apr 27, 2021
da84c65
Remove tests and make utility methods private (#31224)
nosolosw Apr 27, 2021
5558f6d
Block editor: create useBlockRef and useBlockElement for better acces…
ellatrix Apr 27, 2021
b45789d
fix typo (#31225)
aristath Apr 27, 2021
8206902
components: Remove wp-g2 imports from visually-hidden (#31210)
sarayourfriend Apr 27, 2021
dd69887
components: Remove G2 portal and refactor Popover to no longer use G2…
sarayourfriend Apr 27, 2021
a5a2e45
Try: Toolbar gap. (#30983)
jasmussen Apr 27, 2021
4275b19
Blocks: Introduce registerBlockTypeFromMetadata API (#30293)
gziolo Apr 27, 2021
8fc6a76
components: Remove wp-g2 imports from ui/divider (#31212)
sarayourfriend Apr 27, 2021
9908387
components: Remove wp-g2 from scrollable (#31207)
sarayourfriend Apr 27, 2021
59f02e7
Fix navigation screen collapsing regression. (#31228)
jasmussen Apr 27, 2021
01131b1
In-between inserter: use useRefCallback, use showInsertionPoint (#30285)
ellatrix Apr 27, 2021
ae1ea2d
Use a darker frame for template mode and previews (#31044)
youknowriad Apr 27, 2021
e541770
components: Remove wp-g2 imports from shortcut (#31229)
sarayourfriend Apr 27, 2021
620c9a0
components: Remove wp-g2 from form-group and control-label (#31234)
sarayourfriend Apr 27, 2021
99057cc
components: Remove wp-g2 from tooltip (#31232)
sarayourfriend Apr 27, 2021
b6c1f59
components: Remove wp-g2 imports from elevation (#31230)
sarayourfriend Apr 27, 2021
96f91e2
components: Remove wp-g2 from surface (#31238)
sarayourfriend Apr 27, 2021
d9cca20
components: Remove wp-g2 from flex, vstack, hstack, spinner and contr…
sarayourfriend Apr 27, 2021
3c5543b
Fix snapshots broken in trunk (#31247)
sarayourfriend Apr 27, 2021
65d8f93
Table: Add colors block support (#30791)
aaronrobertshaw Apr 27, 2021
7b6f265
Mobile Release v1.51.1 (#31242)
dcalhoun Apr 28, 2021
33f32ac
Fix unable to get block refs in widgets customizer (#31262)
kevin940726 Apr 28, 2021
2d34d85
Block Patterns Doc Updates (#31060)
DaisyOlsen Apr 28, 2021
ceece95
Add e2e tests for Widgets Customizer (#31185)
kevin940726 Apr 28, 2021
ce182c5
In-between inserter: preserve original behaviour (#31266)
ellatrix Apr 28, 2021
9b97dc4
Add wrapper in Query block and `align` support (#30804)
ntsekouras Apr 28, 2021
8f871a2
[Fix] Inlined core block styles should not override user-added inline…
aristath Apr 28, 2021
e6f3757
Block Supports: Allow skipping serialization of font size (#30879)
ockham Apr 28, 2021
c7d0ffa
Constrain tabbing inside the multi entity save panel (#31136)
vdwijngaert Apr 28, 2021
71e6223
Fix: Make media playable on video and audio block backend. (#31257)
jorgefilipecosta Apr 28, 2021
326f846
Rebuild block-specific styles in dev mode (#31274)
vdwijngaert Apr 28, 2021
bf07d3c
Left-align query patterns in the carousel (#31233)
kjellr Apr 28, 2021
6ac5cd7
Fix padding and cursor for nav menu item placeholder. (#31275)
jasmussen Apr 28, 2021
72eda31
Fix submenu hover issue. (#31195)
jasmussen Apr 28, 2021
3a4489e
components: Stop auto-memo antipattern and remove senseless default v…
sarayourfriend Apr 28, 2021
ea421b1
Template part - add patterns placeholder selection. (#31155)
Addison-Stavlo Apr 28, 2021
a4a347d
components: Remove wp-g2 fontsize control (#31287)
sarayourfriend Apr 28, 2021
15a574a
components: Remove all remenants of wp-g2 (#31292)
sarayourfriend Apr 28, 2021
a268beb
Bump plugin version to 10.5.0
gutenbergplugin Apr 28, 2021
034a126
Fix redo/undo icons on RTL (#31219)
ntsekouras Apr 28, 2021
c967273
Update Changelog for 10.5.0
gutenbergplugin Apr 28, 2021
1e00d41
components: Promote VisuallyHidden from ui into full components (#31244)
sarayourfriend Apr 28, 2021
7de07d5
Update @ajlende in CODEOWNERS (#31294)
ajlende Apr 28, 2021
2188be0
Border Block Support: Add utilities to get border classes and styles …
aaronrobertshaw Apr 29, 2021
38a85b9
Table: Add border block support (#31265)
aaronrobertshaw Apr 29, 2021
5f93daa
Legacy Widget: Add 'Convert to blocks' button for text widgets (#31215)
noisysocks Apr 29, 2021
dc619bd
Fix the broken links of register block type documentation (#31285)
thisissandip Apr 29, 2021
41783c8
[RNMobile] Add improvements to Reusable block (#30966)
fluiddot Apr 29, 2021
148423a
I18n: Update the CHANGELOG file
gziolo Apr 29, 2021
d05bbae
Block editor: move block tools components and styles to separate fold…
ellatrix Apr 29, 2021
553bde0
Packages: Drop suppport for IE 11 and non-LTS Node.js versions (#31270)
gziolo Apr 29, 2021
a6c9a05
Data: Update `redux` dependency to the latest version (#31318)
gziolo Apr 29, 2021
d519e70
Fix Inserter Drag and Drop (#31319)
youknowriad Apr 29, 2021
915a9b2
Fix "Undefined variable: $image_default_size" (#31324)
them-es Apr 29, 2021
883ff92
Select mode: fix navigate by pointer (#31321)
ellatrix Apr 29, 2021
6a63209
Plugin: Unregister only registered block patterns (#31325)
gziolo Apr 29, 2021
94536d5
Global Styles: Add theme origin to getStyle (#31267)
aaronrobertshaw Apr 29, 2021
a70687a
FSE: Verify if php template exists for a hybrid/universal theme with …
MaggieCabrera Apr 29, 2021
ac9ba82
Bump plugin version to 10.5.1
gutenbergplugin Apr 29, 2021
2659b64
Update Changelog for 10.5.1
gutenbergplugin Apr 29, 2021
2962dff
Bump plugin version to 10.5.2
gutenbergplugin Apr 29, 2021
0253967
Update Changelog for 10.5.2
gutenbergplugin Apr 29, 2021
ac2403a
Update changelog files
gziolo Apr 29, 2021
cff7394
chore(release): publish
gziolo Apr 29, 2021
3459ad7
Update: Target global styles to the body element instead of :root (#3…
jorgefilipecosta Apr 29, 2021
17cc640
compose: Add types to `createHigherOrderComponent`, `ifCondition` and…
sarayourfriend Apr 29, 2021
81a6f97
Only split block styles loading for block themes (#31309)
aristath Apr 29, 2021
52b87bb
Multi-select: move handlers to block ref callback (#31334)
ellatrix Apr 29, 2021
bc2fc55
Writing flow: move selector calls to event handlers (#31332)
ellatrix Apr 29, 2021
280cab2
Include margin in width calc for 100% button when it has sibling butt…
stacimc Apr 29, 2021
0f2ed52
wp-env: Fix checkout of unknown tags. (#31271)
yansern Apr 29, 2021
efdb346
Spacing Support: Update padding support to allow configurable sides (…
aaronrobertshaw Apr 30, 2021
407eb71
Scripts: Add `postcss` as a dependency to ensure that the correct ver…
gziolo Apr 30, 2021
823b8b4
[Doc] Include a high level overview of major FSE projects (#31295)
annezazu Apr 30, 2021
6099804
Prevent PostDate as link to load inside an iframe (#31350)
ntsekouras Apr 30, 2021
218ea89
Docs: Update contributing documentation with callout notice usage (#3…
mkaz Apr 30, 2021
da223c6
components: Promote ui/Flex and deprecate `isReversed` prop (#31297)
sarayourfriend Apr 30, 2021
aed044d
Fix navigation screen padding again. (#31372)
jasmussen Apr 30, 2021
7d6e5e8
Use UnitControl for font-size (#31314)
aristath Apr 30, 2021
bf169e5
Render out HTML characters in post and category titles (#30661)
moorscode Apr 30, 2021
fbfbc17
components: Promote Text to full components export (#31291)
sarayourfriend Apr 30, 2021
e4e8b6f
components: Promote Heading (#31299)
sarayourfriend Apr 30, 2021
307c7f7
Site Editor: use EditorNotices component for notices (#31303)
creativecoder Apr 30, 2021
1eccbd9
Navigation Editor: Fixes vertical alignment (#31376)
javierarce Apr 30, 2021
ca79aba
Site Editor: Check whether the data is loaded. If the data is loaded …
boblinthorst Apr 30, 2021
58fcbbb
Bump plugin version to 10.5.3
gutenbergplugin Apr 30, 2021
1f03793
Improve the typing performance by render hooks panels for selected bl…
youknowriad Apr 30, 2021
91b5313
Update Changelog for 10.5.3
gutenbergplugin Apr 30, 2021
c06db84
Site Editor: Add show more settings to block toolbars (#31305)
creativecoder Apr 30, 2021
c7a853a
Fix parameter name typo in useRefEffect (#30597)
ribaricplusplus Apr 30, 2021
a299c81
Mobile Release v1.52.0 (#31388)
cameronvoell May 1, 2021
b8bea0b
FSE: fix popover/inspector scrolling (#31395)
ellatrix May 1, 2021
3227ed2
Multi-selection: move shift+click logic to hook (#31358)
ellatrix May 1, 2021
5dd787e
Fix issue with missing styles for Page List in navigation. (#31368)
jasmussen May 3, 2021
47f8271
Block Library: Move translatable fields to `block.json` files (#31120)
gziolo May 3, 2021
82e3ab3
Rich text: move format boundaries to ref callback and separate file (…
ellatrix May 3, 2021
45fa2f4
Workflows: Run tests on release branches (#31354)
ockham May 3, 2021
f7a8582
Remove the block wrapper component (#31419)
youknowriad May 3, 2021
ef0c766
E2E wpDataSelect: Explain why undefined is returned sometimes (#31227)
david-szabo97 May 3, 2021
ef242fb
Update versions in WordPress to include 5.7.1 & 5.8 (#31439)
annezazu May 3, 2021
9620776
Moves hermes and react-native mirror to S3 (#31441)
oguzkocer May 4, 2021
f6a9556
Fix Legacy Widget block in Customizer (#31405)
noisysocks May 4, 2021
d4ec72b
Remove widget screen dead code (#31411)
talldan May 4, 2021
ed18ecb
Fix entity deletion in widgets screen (#31404)
tellthemachines May 4, 2021
b5c8097
[Block Library - Query]: Add semantic wrapper element (#31421)
ntsekouras May 4, 2021
45ddb72
Plugin: Call deprecated hooks only when new filters not present (#31027)
gziolo May 4, 2021
e8f54e9
Add a new endpoint that exposes block editor settings through the RES…
May 4, 2021
133b579
Stabilize some theme blocks for WP 5.8 release (#31423)
youknowriad May 4, 2021
7ec9350
Standardise and fix parsing and serialization of blocks and nav menu …
getdave May 4, 2021
616c302
Focus control in widgets customizer (#31308)
kevin940726 May 4, 2021
981ce78
Add experimental util to allow fetch remote url data from REST API (…
getdave May 4, 2021
d7a0d60
Docs: Minor design updates using callout (#31398)
mkaz May 4, 2021
4e8c2b1
Remove tools dropdown menu from medium viewport when text labels mode…
youknowriad May 4, 2021
ec3a560
Update "trash" icon. (#31463)
jasmussen May 4, 2021
808afb7
FSE: Fix template loading order for child themes when no explicit tem…
MaggieCabrera May 4, 2021
e509121
Fix selection clearer ref passed to motion.div (#31469)
ellatrix May 4, 2021
1e32a49
Stabilise typewriter e2e test (#31472)
ellatrix May 4, 2021
25d89b1
Widgets editor: Improve theme switching experience (#31407)
noisysocks May 5, 2021
564e70b
Show blocks from plugins in the widget customizer (#31406)
talldan May 5, 2021
07dc412
Navigation Editor: Move selected menu ID to the store (#31320)
Mamaduka May 5, 2021
654c117
Post Content: Prevent infinite recursion (#31455)
mcsf May 5, 2021
c17c168
Legacy Widget: Refactor Form to not use React (#31444)
noisysocks May 5, 2021
4521ec2
Use gutenberg_get_block_categories (#31486)
talldan May 5, 2021
0eaeb86
Legacy Widget: Ensure the control form's IDs have a consistent number…
noisysocks May 5, 2021
e76bba3
Fix unable to publish edited legacy widgets in the customizer (#31484)
kevin940726 May 5, 2021
f3ab9f4
Update shape of theme.json and introduce the concept of elements (#30…
nosolosw May 5, 2021
3f03883
Fix submenu direction justification regression (#31414)
jasmussen May 5, 2021
2a56d39
Nav block placeholder, fix font inheritance (#31410)
jasmussen May 5, 2021
b1cc5f1
Add customize widgets editor white background (#31487)
talldan May 5, 2021
cced599
Mobile - Move the chevronBackIOS icon from the icons library to the c…
May 5, 2021
147af2f
Rich text: extract "undo automatic change" logic (#31449)
ellatrix May 5, 2021
beb2855
Fix adding new legacy widget (#31490)
kevin940726 May 5, 2021
8182f54
'Move to widget area' iterations and fixes (#31445)
talldan May 5, 2021
5fdebb6
Make the entire customize widgets editor sidebar have a white backgro…
talldan May 5, 2021
e009584
Fix for template order logic bug introduced in 10.5 (#31478)
vdwijngaert May 5, 2021
d478795
Bump plugin version to 10.5.4
gutenbergplugin May 5, 2021
d866032
Mark the __experimentalBlockSettingsMenuFirstItem slot as unstable (#…
youknowriad May 5, 2021
7908d50
Update Changelog for 10.5.4
gutenbergplugin May 5, 2021
58ab209
Fix 'move to widget area' item checkmark in standalone editor (#31494)
talldan May 5, 2021
87a450e
Rename "Modes" to "Tools" in the header. (#31430)
mtias May 5, 2021
786ddc7
Unify the post tags and post categories block under a unique post ter…
youknowriad May 5, 2021
c177c08
cleanup to default values (#31473)
Addison-Stavlo May 5, 2021
ea3f079
Mark the loginout block as stable for 5.8 release (#31499)
youknowriad May 5, 2021
5d31f60
Remove specificify for link color (#31497)
nosolosw May 5, 2021
53a035c
Navigation Editor: Indicate unsaved changes (#31119)
Mamaduka May 5, 2021
6da25ad
Navigation Screen: Correctly display menu used on location text (#31500)
Mamaduka May 5, 2021
57b8ee4
Block Library: Remove no longer necessary render_callback for Cover b…
gziolo May 5, 2021
b057b71
Editor: Display ten most used terms (#30598)
Mamaduka May 5, 2021
ae8a276
Rename experimental-theme.json to theme.json and add a fallback for b…
aristath May 5, 2021
88cce2e
Iframe the template editor (#31375)
ellatrix May 5, 2021
02b222f
Handbook: Add a deprecation notice to meta block attribute sources (#…
priethor May 5, 2021
493a804
Update docs for theme.json (#31507)
nosolosw May 5, 2021
d0f59ec
Bump plugin version to 10.6.0-rc.1
gutenbergplugin May 5, 2021
0282fd0
Expand the site tagline block description. (#31426)
mtias May 5, 2021
4048a1a
Update Changelog for 10.6.0-rc.1
gutenbergplugin May 5, 2021
36169e1
compose: Add types to withInstanceId and corresponding hook (#31341)
sarayourfriend May 5, 2021
e0f93c5
Navigation: add unit tests for onChange handler and fix cases around …
gwwar May 5, 2021
21cb620
placeCaretAtHorizontalEdge: allow scrolling on initial call (#31506)
ellatrix May 5, 2021
ea4390f
[RNMobile] Fix Issue with Search block stealing focus after media upd…
AmandaRiu May 5, 2021
f71c507
Rebulid docs after #31507
ellatrix May 5, 2021
0052615
Gallery Block: Use better key for gallery list items (#30555)
Mamaduka May 6, 2021
a8f63ba
Fix: Allow post comment button to inherit button & global styles auto…
aristath May 6, 2021
960e775
Fix nav screen margin. (#31493)
jasmussen May 6, 2021
10d8b35
components: Promote VStack and HStack (#31300)
sarayourfriend May 6, 2021
2b1d4dd
Site logo: Add link toggle option (#31162)
carolinan May 6, 2021
af98f10
Remove color.link and alphabetize the rest (#31516)
nosolosw May 6, 2021
cc42d27
Improve the navigation block setup state / placeholder. (#31371)
jasmussen May 6, 2021
00f6ef7
Add reset button to Layout controls (#30828)
Mamaduka May 6, 2021
1cec545
[RNMobile] Bottom-sheet: Add custom header (#30291)
fluiddot May 6, 2021
04e4873
Add ToolbarDropdownMenu to render dropdown menus properly inside tool…
youknowriad May 6, 2021
cb47f61
Fix global styles settings retrieval for REST. (#31534)
nosolosw May 6, 2021
828b0e8
Scripts: Fix the CHANGELOG for `@wordpress/scripts` package (#31532)
gziolo May 6, 2021
0548623
Fix link to ESNext in callout (#31512)
mkaz May 6, 2021
e092a8c
Docgen: split `getIntermediateRepresentation` unit tests in smaller t…
ciampo May 6, 2021
9484b27
[Block Library - Site Logo]: Return nothing if logo is not set (#31513)
jffng May 6, 2021
e8e85a7
components: Add Spacer (#31509)
sarayourfriend May 6, 2021
60c0a9f
[Block Library - Site Logo]: Fix `supports` declaration (#31544)
ntsekouras May 6, 2021
703bed7
Capitalize GitHub property (#31549)
zackkrida May 6, 2021
643ff37
Fix remove widget not working in customizer (#31535)
kevin940726 May 6, 2021
cd8a262
Typo in translator notes (#31541)
vlad-timotei May 6, 2021
cd13f13
Block editor styles: memoize transform (#31553)
ellatrix May 6, 2021
0fa74d6
Chore: Remove: Declarations parameter from compute_style_properties (…
jorgefilipecosta May 6, 2021
85348d5
Multi-select: use writing flow container for focus (#31572)
ellatrix May 6, 2021
502fce8
Stacked/unified block toolbar (#31134)
ellatrix May 7, 2021
efb6a4b
Add required “directory” prop to package template (#31570)
getdave May 7, 2021
a83ac1f
Widget Screen: Add default notices support (#31578)
Mamaduka May 7, 2021
182e298
Add missing ToolbarDropdownMenu import for mobile (#31581)
May 7, 2021
8b81b7f
Mark the inserter slot as unstable (#31417)
youknowriad May 7, 2021
db3956c
Fixes color picker segmented control rendering and scrolling issues (…
antonis May 7, 2021
d47d838
compose: Add types useAsyncList (#31523)
sarayourfriend May 7, 2021
6aa454d
Create block metadata for all blocks (#31590)
nosolosw May 7, 2021
ef139a5
Improve packages docs - document root package json and public API kno…
getdave May 7, 2021
f75460a
components: Promote Grid (#31559)
sarayourfriend May 7, 2021
c499fb2
Post excerpt: Update read more placeholder text (#30959)
carolinan May 7, 2021
91a2a23
compose: Add types useConstrainedTabbing (#31548)
sarayourfriend May 7, 2021
9f06a93
Chore: remove declarations so API has coherence (#31596)
nosolosw May 7, 2021
9ffb187
Improve `get_merged_data` API so it requires less knowledge from the …
nosolosw May 7, 2021
90b75df
Cover against a block being unregistered (#31588)
nosolosw May 7, 2021
9e8b74f
components: Promote View (#31542)
sarayourfriend May 7, 2021
39ee7a9
components: Promote Divider and use readable prop names (#31556)
sarayourfriend May 7, 2021
057b2f3
Update Glossary with more FSE terminology (#31525)
annezazu May 7, 2021
d6fcc73
[Block Library - Post Featured Image]: Change wrapper element to `fig…
ntsekouras May 7, 2021
09a2537
Mobile Release v1.52.1 (#31609)
fluiddot May 7, 2021
98fd6b3
Post Comments: Add some basic CSS to the post comments block (#30382)
scruffian May 8, 2021
2f86a46
Rich text: each hook should create own ref (#31477)
ellatrix May 8, 2021
5222224
First pass at docs for the Widgets Block Editor (#31577)
noisysocks May 8, 2021
9eee244
Rich text: extract paste handler (#31619)
ellatrix May 8, 2021
2e8ae54
Clear selected block when focusing on element outside the editor (#31…
kevin940726 May 8, 2021
0d68293
Rich text: extract select object (#31627)
ellatrix May 8, 2021
10fc3c9
Rich text: extract indent list item on space (#31628)
ellatrix May 8, 2021
aeac420
Block popover: move scroll handling to block tools (#31611)
ellatrix May 8, 2021
090f4aa
Rich text: extract input and selection (#31631)
ellatrix May 9, 2021
c1a359e
Rich text: consolidate applying content from props (#31635)
ellatrix May 9, 2021
6da8424
Navigation Editor: Introduce useMenuEntityProp hook (#31132)
Mamaduka May 10, 2021
d4ca78a
Fix stylesheet dependency for the post-comment-form block (#31528)
aristath May 10, 2021
9e69dc3
Rich text: extract internal delete handling (#31637)
ellatrix May 10, 2021
b9833d6
Fix storybook build
youknowriad May 10, 2021
ae37975
[RNMobile] Bottom-sheet: Limit layout animation to header changes (#3…
fluiddot May 10, 2021
e933c37
Bring implementations of convert nav menu items to blocks back into s…
getdave May 10, 2021
f356d35
Navigation Editor: Fix menu location assignment (#31594)
Mamaduka May 10, 2021
dffb4a5
Add padding for nav screen. (#31583)
jasmussen May 10, 2021
7839d06
Fix toolbar and notice positioning (#31582)
talldan May 10, 2021
d29e4d1
Remove duplicate 1.52.0 changelog entry (#31659)
dcalhoun May 10, 2021
f8090c2
Handbook: Add dedicated Block Styles page under Block API directory (…
DaisyOlsen May 10, 2021
09b6b09
Rich text: move implementation specific delete and enter handling (#3…
ellatrix May 10, 2021
47c0dad
Navigation Editor: "Add new pages" use menu entity (#31643)
Mamaduka May 10, 2021
6450f7a
Update: Use wp_theme taxonomy for wp_global_styles cpt. (#31436)
jorgefilipecosta May 10, 2021
c668cf5
Chore: remove unused code (#31666)
nosolosw May 10, 2021
456b4ba
Standardize block styles cursor on hover (#31188)
devfle May 10, 2021
90be94d
Update: fix small issue with block supports.
jorgefilipecosta May 10, 2021
4f26148
Block Library: Add home link block (#30926)
gwwar May 10, 2021
ffb3256
Rich text: fix showing toolbar when caret enters formatting (and extr…
ellatrix May 10, 2021
ff8a0c4
Rich text: move implementation specific attributes (#31674)
ellatrix May 10, 2021
61eb2f6
Cover block: remove fixed background when cover block previewed in pa…
glendaviesnz May 10, 2021
fff1a2d
Rich text: extract implementation specific undo handling of automatic…
ellatrix May 10, 2021
906205d
Rich text: remove tag name dependency (#31679)
ellatrix May 10, 2021
38dfe2e
chore(release): publish
gziolo Apr 30, 2021
7919502
Fix core-block-patterns support on GB (#31546)
MaggieCabrera May 11, 2021
a452506
Site Logo: Rename sitelogo to site_logo (#31511)
creativecoder May 11, 2021
0d02480
Spacing Support: Add margin block support with configurable sides (#3…
aaronrobertshaw May 11, 2021
636195f
Scripts: Update PostCSS minimum version to ensure it is secure (#31685)
gziolo May 11, 2021
fda88a8
Packages: Update lodash to the latest patch version (#31686)
gziolo May 11, 2021
75111cb
[Block Library - Post Featured Image]: Fix uneditable placeholder whe…
ntsekouras May 11, 2021
d388e85
Restore figure margins (#31650)
youknowriad May 11, 2021
0e5900c
Fix toolbar alignment in widget block editor
donnapep May 11, 2021
c2b8b67
Fix linter issues
donnapep May 11, 2021
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
Prev Previous commit
Next Next commit
Site logo: Add link toggle option (#31162)
* Site logo: Add link toggle option
Co-authored-by: Ari Stathopoulos <aristath@gmail.com>
  • Loading branch information
2 people authored and donnapep committed May 19, 2021
commit 2b1d4dd9a9b026388bd63da957a996150428390b
8 changes: 8 additions & 0 deletions packages/block-library/src/site-logo/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
},
"width": {
"type": "number"
},
"isLink": {
"type": "boolean",
"default": true
},
"linkTarget": {
"type": "string",
"default": "_self"
}
},
"supports": {
Expand Down
84 changes: 53 additions & 31 deletions packages/block-library/src/site-logo/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
RangeControl,
ResizableBox,
Spinner,
ToggleControl,
} from '@wordpress/components';
import { useViewportMatch } from '@wordpress/compose';
import {
Expand Down Expand Up @@ -46,7 +47,7 @@ const ACCEPT_MEDIA_STRING = 'image/*';

const SiteLogo = ( {
alt,
attributes: { align, width, height },
attributes: { align, width, height, isLink, linkTarget },
containerRef,
isSelected,
setAttributes,
Expand All @@ -59,7 +60,7 @@ const SiteLogo = ( {
const isResizable = ! isWideAligned && isLargeViewport;
const [ { naturalWidth, naturalHeight }, setNaturalSize ] = useState( {} );
const { toggleSelection } = useDispatch( blockEditorStore );
const classes = classnames( {
const classes = classnames( 'custom-logo-link', {
'is-transient': isBlobURL( logoUrl ),
} );
const { maxWidth, title } = useSelect( ( select ) => {
Expand All @@ -83,35 +84,38 @@ const SiteLogo = ( {
}

const img = (
// Disable reason: Image itself is not meant to be interactive, but
// should direct focus to block.
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
<a
href={ siteUrl }
className={ classes }
rel="home"
title={ title }
onClick={ ( event ) => event.preventDefault() }
>
<span className="custom-logo-link">
<img
className="custom-logo"
src={ logoUrl }
alt={ alt }
onLoad={ ( event ) => {
setNaturalSize(
pick( event.target, [
'naturalWidth',
'naturalHeight',
] )
);
} }
/>
</span>
</a>
/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
<img
className="custom-logo"
src={ logoUrl }
alt={ alt }
onLoad={ ( event ) => {
setNaturalSize(
pick( event.target, [ 'naturalWidth', 'naturalHeight' ] )
);
} }
/>
);

let imgWrapper = img;

// Disable reason: Image itself is not meant to be interactive, but
// should direct focus to block.
if ( isLink ) {
imgWrapper = (
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
<a
href={ siteUrl }
className={ classes }
rel="home"
title={ title }
onClick={ ( event ) => event.preventDefault() }
>
{ img }
</a>
/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
);
}

let imageWidthWithinContainer;

if ( clientWidth && naturalWidth && naturalHeight ) {
Expand All @@ -120,7 +124,7 @@ const SiteLogo = ( {
}

if ( ! isResizable || ! imageWidthWithinContainer ) {
return <div style={ { width, height } }>{ img }</div>;
return <div style={ { width, height } }>{ imgWrapper }</div>;
}

const currentWidth = width || imageWidthWithinContainer;
Expand Down Expand Up @@ -192,6 +196,24 @@ const SiteLogo = ( {
value={ width || '' }
disabled={ ! isResizable }
/>
<ToggleControl
label={ __( 'Link image to home' ) }
onChange={ () => setAttributes( { isLink: ! isLink } ) }
checked={ isLink }
/>
{ isLink && (
<>
<ToggleControl
label={ __( 'Open in new tab' ) }
onChange={ ( value ) =>
setAttributes( {
linkTarget: value ? '_blank' : '_self',
} )
}
checked={ linkTarget === '_blank' }
/>
</>
) }
</PanelBody>
</InspectorControls>
<ResizableBox
Expand All @@ -217,7 +239,7 @@ const SiteLogo = ( {
} );
} }
>
{ img }
{ imgWrapper }
</ResizableBox>
</>
);
Expand Down
15 changes: 14 additions & 1 deletion packages/block-library/src/site-logo/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,20 @@ function render_block_core_site_logo( $attributes ) {

add_filter( 'wp_get_attachment_image_src', $adjust_width_height_filter );
$custom_logo = get_custom_logo();
$classnames = array();

if ( ! $attributes['isLink'] ) {
// Remove the link.
$custom_logo = preg_replace( '#<a.*?>(.*?)</a>#i', '\1', $custom_logo );
}

if ( $attributes['isLink'] && '_blank' === $attributes['linkTarget'] ) {
// Add the link target after the rel="home".
// Add an aria-label for informing that the page opens in a new tab.
$aria_label = 'aria-label="' . esc_attr__( '(Home link, opens in a new tab)' ) . '"';
$custom_logo = str_replace( 'rel="home"', 'rel="home" target="' . $attributes['linkTarget'] . '"' . $aria_label, $custom_logo );
}

$classnames = array();
if ( ! empty( $attributes['className'] ) ) {
$classnames[] = $attributes['className'];
}
Expand Down
5 changes: 4 additions & 1 deletion packages/e2e-tests/fixtures/blocks/core__site-logo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"clientId": "_clientId_0",
"name": "core/site-logo",
"isValid": true,
"attributes": {},
"attributes": {
"isLink": true,
"linkTarget": "_self"
},
"innerBlocks": [],
"originalContent": ""
}
Expand Down