-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New Block: Icon Block #71227
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
Merged
Merged
New Block: Icon Block #71227
Changes from 35 commits
Commits
Show all changes
158 commits
Select commit
Hold shift + click to select a range
c48652e
Add block.json and index.js.
ryanwelcher dce30d4
Update navigation block to allow the core/icon button.
ryanwelcher 32dff7c
Update registration and remove filters from the index file.
ryanwelcher f9e8cc2
Initial js files commit with linting fixes.
ryanwelcher d489478
Add CSS files
ryanwelcher e5b3a2c
Add icon block css to package.
ryanwelcher 5fcbfb0
Fix some issues with refactoring away the use of isEmpty.
ryanwelcher 9a62df0
Start with the icon set defined in #16484
ryanwelcher cfa3595
Disable custom svg icons via the filter default.
ryanwelcher fcc9ec0
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher aa9c2d7
Change index.scss to style.scss to match pattern of other blocks.
ryanwelcher 3fd0e6d
Remove social icons directory as they are not being added for initial…
ryanwelcher 630eb4e
Remove sparkles icon.
ryanwelcher f569ad8
Fix html-reacti-parser versioning.
ryanwelcher b0c7938
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher fbf6d01
Update dependencies to include html-react-parser
ryanwelcher 2dcecbd
Add schema to block.json
ryanwelcher 7335df1
Add basic fixture for icon block.
ryanwelcher 2cdef13
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 389ba25
Remove withIllustration prop and related className from Placeholder.
ryanwelcher d6c452f
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 71f632b
Decouple the saved icon from the @wordpress/icons library and display…
ryanwelcher e4d018d
Fix displaying custom SVG in the editor.
ryanwelcher db8d14a
Remove some empty categories from the list.
ryanwelcher f9e3511
Adjust the spacing between the custom SVG buttons based on A11y audit.
ryanwelcher 7406f9f
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher c82846d
Removing rotate, flipHor, flipVert, and percentWidth attributes and r…
ryanwelcher 69a33cc
Remove itemsJustification attribute and related controls.
ryanwelcher e232e2b
Remove iconColor and iconColorValue attributes and related controls.
ryanwelcher 7bcf763
Remove remaining color based attributes and related controls.
ryanwelcher f672cd1
Don't show the link rel if there is not a link defined.
ryanwelcher 671c1b7
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 1ed0c36
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 6e708af
Remove the link control.
ryanwelcher 3692eb0
Remove width and height attributes.
ryanwelcher d4bd2c3
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 92c99ae
Update packages/block-library/src/icon/icons/index.js
ryanwelcher 21bf61a
Update packages/block-library/src/icon/components/index.js
ryanwelcher 3c8668e
Update packages/block-library/src/icon/block.json
ryanwelcher 86e4aa7
Update packages/block-library/src/icon/components/icon-dropzone/index.js
ryanwelcher 894ba52
Update packages/block-library/src/icon/components/custom-inserter/ind…
ryanwelcher dd8fcb3
Update packages/block-library/src/icon/components/custom-inserter/ind…
ryanwelcher 38bdee0
Merge branch 'feature/add-icon-block' of github.com:WordPress/gutenbe…
ryanwelcher da41165
Add cautionFilled to the imports.
ryanwelcher caf1377
Remove the need for an inner wrapper. Move all styles and classes to …
ryanwelcher 8387ecd
Clean up css to remove outer div and rotation/flip rules.
ryanwelcher 6159196
Remove the icon-container class from edit. Remove more unused styles.
ryanwelcher 0bae3ba
Change selector to root class icon attribute. Remove edit icon that w…
ryanwelcher 456c1a2
Remove ariaLabel true until I know how it works.
ryanwelcher 21e8b8c
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 8a4ba8d
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 78a2e91
Opt into width and heigh dimension controls.
ryanwelcher 5a73067
Removing references to custom SVG upload as any custom icons should b…
ryanwelcher e5f8440
Remove components and logic associated with SVG uploading or direct i…
ryanwelcher 339f54c
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 990224a
Revert package-lock.json to trunk.
ryanwelcher 68a3da8
Remove some more items related to upload/insert SVG functionality.
ryanwelcher 774c88c
Remove some unused imports, functions, and hooks.
ryanwelcher bc19d64
Initial work to replace the custom inserter modal with one using Data…
ryanwelcher a712808
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 7ca5ffd
* Add fake API request for the icons and related logic to load icons …
ryanwelcher 4cb0c0e
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 030e594
Remove the custom inserter in favor of one that uses the DataViewsPicker
ryanwelcher 8064f92
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 82742d2
Make the icon block experimental as it's reliant on the SVG endpoint …
ryanwelcher a10c812
Fix conditional registration of Icon block
mcsf 979d70e
Fix full-content integration test for Icon block
mcsf a77dfcf
Fix missing spacing in Title attribute panel
mcsf 7fec0f4
Fix icon picker modal not showing which icon is in use
mcsf dca55d0
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 921def2
Remove hardcoded list of icons used before the API was available.
ryanwelcher 7d465fe
Make the icon block dynamic.
ryanwelcher b01ec7c
Remove some files that are not needed.
ryanwelcher 8a6904d
Updates to move the block to use dynamic rendering.
ryanwelcher 88a9d24
Fix the imports for the bolt icon. Change the example in the block re…
ryanwelcher 1c89dc7
Set the default size of the icon to 48px.
ryanwelcher 8b2664e
Clean up to the edit.
ryanwelcher 299c6ee
Join UI sentences with createInterpolateElement
mcsf 4670b3b
Fix block's textdomain
mcsf 77de48f
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 289ec94
Enforce the default width value if the width is set to 0 manualy or v…
ryanwelcher bd82250
There is no linking functionality provided by this block so all Icons…
ryanwelcher d415243
Drop explicit `style` attribute and default width
mcsf 24aae23
Apply useBlockProps consistently
mcsf 7b5682c
index.php: Cosmetic changes & remove outdated comment
mcsf 4ae2eee
Merge remote-tracking branch 'refs/remotes/origin/feature/add-icon-bl…
ryanwelcher 395a301
Condense title and label attributes:
ryanwelcher ee00a46
Some linting fixes.
ryanwelcher 7af2aa4
Changes to output structure to accomodate CSS changes.
ryanwelcher 7d6942f
Small linting fixes.
ryanwelcher 70fdc10
Remove commented out code.
ryanwelcher cba51d6
Regenerate block test fixtures.
ryanwelcher 18877de
Whitespace man...
ryanwelcher b114cd1
Fix incorrect spread assignment.
ryanwelcher 5dd367e
Modify the inserter modal
ryanwelcher f257ecd
Merge branch 'trunk' into feature/add-icon-block
t-hamano 6f2482e
Migrate label attributes to ariaLabel block support
t-hamano 081c8af
Update packages/block-library/src/icon/index.php
ryanwelcher 2376df4
Update packages/block-library/src/icon/block.json
ryanwelcher 1be21ec
Update packages/block-library/src/icon/block.json
ryanwelcher efb732b
Removing the title attribute from being added.
ryanwelcher 6b471bc
Remove unused section.
ryanwelcher a7b0773
Add some editor only CSS to address the label popover in contentOnly …
ryanwelcher a54bbbf
Remove some unneeded CSS for the toobar.
ryanwelcher a12f5f7
Use useToolsPanelDropdownMenuProps from the block-library package.
ryanwelcher 40405cf
Fix ariaLabel not being reset.
ryanwelcher 549f110
Remove parseIcon and related utilites in favor of HtmlRenderer
ryanwelcher a694436
Whitespace linting issue.
ryanwelcher 2dd3108
Add dataviews to the block-library tsconfig
ryanwelcher 29d0e6c
Re-instate a simplified version of the custom inserter from the origi…
ryanwelcher 19c244b
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher afe6752
Remove the DataViewsPicker UI implementation.
ryanwelcher 31f6769
Update packages/block-library/src/icon/components/custom-inserter/con…
ryanwelcher 69d90b1
Update packages/block-library/src/icon/components/custom-inserter/con…
ryanwelcher e34da36
Update packages/block-library/src/icon/components/custom-inserter/ind…
ryanwelcher b6b1d94
Update packages/block-library/src/icon/components/custom-inserter/ind…
ryanwelcher db323f2
Simplify the placeholder and update CSS selectors.
ryanwelcher fafca6e
Update the block icon.
ryanwelcher 5514be7
Make the icons smaller in the modal.
ryanwelcher b2fc611
Make modal title sentence case.
ryanwelcher ee047b0
Remove search results text from modal.
ryanwelcher fe78d42
Clean up the modal icon grid view.
ryanwelcher d4b3c97
Remove some unused selectors.
ryanwelcher 3fb223e
Remove unused class in the popover.
ryanwelcher fed9fc8
Remove the dataviews dependency.
ryanwelcher f9aa552
rebuild package-lock.json after removing the dataviews dependency.
ryanwelcher f9eced6
Add incorrectly removed whitespace line.
ryanwelcher 1b3fb4b
Use sprintf to output the final markup.
ryanwelcher 7f9686e
Simplify CSS
t-hamano 09deb30
Update packages/block-library/src/icon/icons/index.js
ryanwelcher 77aef6e
Update placeholder to use suggested approach.
ryanwelcher 0ac8cce
Remove useEffect and directly derive the active icon. Remove the rese…
ryanwelcher 65335bf
Set the default size to 24px and the minmum to 12px.
ryanwelcher c13d9be
Add private selector to core-data store to retrieve the icons.
ryanwelcher 54c7210
Update return type for the getIcons selector.
ryanwelcher 764a51b
Clean up block.json
ryanwelcher ac46721
Re-add the interactivity property to allow Query Loop blocks to load …
ryanwelcher 6b540e3
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher 4b9cc98
Inline the content header component.
ryanwelcher 60a7622
Update docs/reference-guides/core-blocks.md
ryanwelcher 7888785
Add 300ms debouce to the icon search.
ryanwelcher 0034a1b
Set the placeholder size based on the conrol value.
ryanwelcher b5e72ff
Update packages/block-library/src/icon/index.php
ryanwelcher 37968f9
Update packages/block-library/src/icon/index.php
ryanwelcher 05ea576
Update packages/block-library/src/icon/index.php
ryanwelcher 7764c64
Update packages/block-library/src/icon/index.php
ryanwelcher 0e3fb8d
Update packages/block-library/src/icon/edit.js
ryanwelcher de7ffaa
Update packages/block-library/src/icon/edit.js
ryanwelcher 8d10d49
Update packages/block-library/src/icon/components/custom-inserter/ind…
ryanwelcher 69260f8
Merge branch 'trunk' into feature/add-icon-block
ryanwelcher efec050
Rebuild docs after 75391 was merged.
ryanwelcher 3bdbd39
FIx linting error
ryanwelcher 2881dc8
Fix application of debounce pattern
mcsf e806400
Memoize search-term-matching icons with useMemo
mcsf a9fe6cc
Allow searching by icon label
mcsf 408d491
Search normalization: strip accents, trim
mcsf a52d20a
Memoise IconGrid's state setter
mcsf 81bd8ef
Use utility function
t-hamano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| { | ||
| "apiVersion": 3, | ||
| "$schema": "https://schemas.wp.org/trunk/block.json", | ||
| "name": "core/icon", | ||
| "title": "Icon", | ||
| "category": "media", | ||
| "description": "Insert an SVG icon or graphic.", | ||
| "keywords": [ "icon", "svg" ], | ||
| "attributes": { | ||
| "icon": { | ||
| "type": "string", | ||
| "source": "html", | ||
| "selector": ".icon-container", | ||
| "default": "", | ||
| "__experimentalRole": "content" | ||
| }, | ||
| "iconName": { | ||
| "type": "string", | ||
| "__experimentalRole": "content" | ||
| }, | ||
| "label": { | ||
| "type": "string" | ||
| }, | ||
|
t-hamano marked this conversation as resolved.
Outdated
|
||
| "title": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "supports": { | ||
| "anchor": true, | ||
| "align": true, | ||
|
ryanwelcher marked this conversation as resolved.
Outdated
|
||
| "html": false, | ||
| "interactivity": { | ||
| "clientNavigation": true | ||
| }, | ||
| "__experimentalBorder": { | ||
| "color": true, | ||
| "radius": true, | ||
| "style": true, | ||
| "width": true, | ||
| "__experimentalSelector": ".icon-container", | ||
| "__experimentalSkipSerialization": true, | ||
| "__experimentalDefaultControls": { | ||
| "color": false, | ||
| "radius": false, | ||
| "style": false, | ||
| "width": false | ||
| } | ||
| }, | ||
| "spacing": { | ||
| "padding": true, | ||
| "margin": true, | ||
| "__experimentalDefaultControls": { | ||
| "margin": false, | ||
| "padding": false | ||
| } | ||
| } | ||
| }, | ||
| "textdomain": "icon-block", | ||
| "editorScript": "file:./index.js", | ||
| "editorStyle": "file:./editor.css", | ||
| "style": "file:./style.css" | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.