-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix registerFormatType type #62771
Fix registerFormatType type #62771
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @gutenbergplugin. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
I've investigated those failed tests, but they seem to be unrelated to my PR, though it's possible I'm missing something. If it's something I can fix, I'd appreciate some advice on how to proceed. |
Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
) An escape keypress previously toggled the state between editing and select mode. This returns the behavior to the previous implementation of Escape clearing block focus and returning focus to the wrapping region, if available, showing a blue outline. If no region is available, it will focus the editor iframe or content region.
* CustomSelectControl V2: fix trigger text alignment in RTL languages * CHANGELOG --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: jffng <jffng@git.wordpress.org> Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org> Co-authored-by: ockham <bernhard-reiter@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
…rdPress#62896) * Remove the const `TOOLSPANEL_DROPDOWNMENU_PROPS` in favour of a hook that returns different popover props depending on the viewport width * Remove offset completely * Add to block support panels * Replace in block library. Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
…ess#62894) Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
…S is generated (WordPress#62768) * Render styles after the variation style overrides have been saved to stage. Getting closer. But the overrides in state need to be merged with incoming revision styles. * For every current override, update the variation CSS with the incoming config from the revision. * Rename hook Destructure in hook so the consumer doesn't have to clone Only send the override overrides to EditorStyles that need to be overridden. * Fetching overrides in the hook * Feedback suggestions from review: add overrides to dep array in Editor Styles rename hook * Return getBlockStyles from the useSelect callback * Refactor so we don't have to change the EditorStyles props Register revision overrides with useStyleOverride * Adding some explanatory comments Add rudimentary E2E test covering block style partials, applying them, updating them and viewing styles revisions. * Removed unused style fixture Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
…dPress#61871) When a `core/group` block has only one variation available, skip the placeholder step and select the variation. Co-authored-by: costasovo <costasovo@git.wordpress.org> Co-authored-by: ockham <bernhard-reiter@git.wordpress.org>
* Fix issue of HTML entities rendering in command menu * Update link to API in block-editor README.md * Undo previous changes * Fix issue of HTML entities rendering in command menu * Add @wordpress/html-entities dependency in packages/core-commands
…#62844) * Add minimum width to select popover * CHANGELOG --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>
…es (WordPress#62828) * Remove only supported attributes * Try alternative approach * Update comment * Return early while editing the original pattern * Move conditional inside conditional * Add missing check * Go back to running always bindings * Use block context to detect presence of parent pattern for overrides (WordPress#62861) * Use block context to detect presence of parent pattern * Regenerate fixtures * Update image block to use context for checking a parent pattern block exists * Rename context to `pattern/overrides` to be consistent with php code * Move pattern overrides context shim to pattern overrides hooks * Remove shim Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: SantosGuillamot <santosguillamot@git.wordpress.org> * Reduce diff * Change array order --------- Co-authored-by: SantosGuillamot <santosguillamot@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org>
…#62912) - Change 'color' to 'colors' in destructured parameter of example code - Update ensures the example code accurately demonstrates correct usage Co-authored-by: byeongin <byeongin@shoplic.kr> Unlinked contributors: byeongin@shoplic.kr.
Co-authored-by: desrosj <desrosj@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
…mikeybinns/gutenberg into improve-rich-text-package-types
Argh! sorry, was just trying to update my branch to the latest trunk version and it's messed up the PR, I will sort this or recreate the PR if needed. |
Okay, after carefully considering some different options, I think while it's possible I could fix the branch in Git, I think GitHub has now subscribed a lot of people to this PR automatically, so to avoid annoying those people with updates to a PR they didn't subscribe to, I'm going to close this PR and open a new one. Sorry again. |
What?
Fixing the type of the
registerFormatType
function which is currently incorrect due to JSDoc types.Why?
Currently this function throws a type error if you don't specify the name parameter in the settings parameter, which is incorrect because the name is provided as the first argument.
How?
I have converted the
registerFormatType
file, the Redux store files and all related test files to TypeScript.I converted the WPFormat JSDoc type to a TypeScript type and moved it into the
./types
file.I updated the name to be
RichTextFormatFull
instead ofWPFormat
. This should really beRichTextFormat
however I didn't want to conflict with the JSDoc type of the same name so I've used this temporary name for now, and I've exported it asRichTextFormat
as the old type wasn't exported.I also added some missing / undocumented properties to the
RichTextFormatFull
and changed theinteractive
prop to optional.I have avoided changing the base JS as much as possible to make sure this is only a types improvement, however there's a few minor places where I had to change some JS things, however all tests should still pass, and they are only minor changes which shouldn't affect functionality.
Testing Instructions
Note: these changes are all covered by existing automated tests, but here's how to test manually.
registerFormatType
from the public package version.registerFormatType
from this PR change and note how the type error is now fixed, and allows a couple new properties such asattributes
.Screenshots or screencast