forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
WP Updates #1
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
WP Updates #1
Conversation
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
…11168) * Try avoiding the deprecated findDOMNode API * Components: Use event handler in place of `ref`
* Create file blocks when dropping multiple files at once * Add changelog entry
* Fix missing period in block discriptions. * Update CONTRIBUTORS.md
## Description Removed duplicated word.
* api-fetch: Add Accept json header to l10n requests Fixes #11327. The server side localization switching requires an 'Accept' or 'Content-Type' header set to 'application/json` to detect that it is a JSON request. * Add tests to check if the accept header is properly applied. * Widen the Accept header to include */*. This indicates that JSON is preferred and is enough for the server to determine that it is a JSON request. * Use assign to simplify applying headers.
* Docs: custom block category add icon info * Update icon note Co-Authored-By: ajitbohra <[email protected]> * Update example to use svg icon
* Advanced Panels: Add support for the 'Custom Fields' meta box - Adds an option which allows the user to enable the existing 'postcustom' meta box included in WordPress. - Don't load the 'postcustom' assets when the option is disabled. - Stores the option as a site option. - Reload the editor when the option is changed. * Fix E2E tests The 'Enable Tips' checkbox is obscured by the first Tip now that the Options modal is taller. Work around this by only testing that tips can be re-enabled. * Custom Fields: Remove unnecessary jQuery selector We can simply interpolate $post->ID when initializing Custom Fields, rather than selecting from the #post_ID hidden field. * Custom Fields: Use user meta field instead of site option By using `get_user_meta()` instead of `get_option()`, the Custom Fields setting won't affect other users. * Custom Fields: Kill the process after redirecting * Custom Fields: Use hidden <form> instead of redirect Trigger the toggle_custom_fields action using a hidden <form> so that the action is triggered by a POST request rather than a GET request. * Custom Fields: Move meta box options into their own component * Custom Fields: Rename isEnabled → isChecked * Custom Fields: Only show option if custom fields are supported
* Update shortcut for removing link in FAQ * Update modal * Update keys
In the Gutenberg Design Handbook, https://wordpress.org/gutenberg/handbook/design/block-design/, the relative URLs to Github images did not work. This PR makes them absolute, so it should work.
* Try: Make gallery keyboardable The intent of this PR is to fix #3836, but for now this is just the barebones initial work. I would like your thoughts on the best approach to take before I optimize too far in one direction. As such, this PR does the bare minimum to get tabbing working for the gallery, and then we can go from there. For example, this PR simply adds a `tabIndex="0"` and an `onKeyDown` handler to the image, to make it accessible. It might be a better solution to wrap the image itself in a button, but this might regress editor styles. Perhaps this approach is necessary as an intermediate step towards better solutions? Your thoughts are most welcome. * Apply suggestion
* withHistory: ensure ignored action types are fully ignored * Polish
* Blocks: Upgrade hpq from 1.2.0 to 1.3.0 * Fix missing hpq dependency.
In #11320 we started running all parsers against the same set of unit tests. Unfortunately when the PHP-based parsers failed inside the PHP process or returned non-JSON data then the tests would fail without providing any information about why. My personal workaround was to manually run the PHP test runner from the command line to see the output. This was inefficient. In this patch we're trapping the response code from the PHP test runner and throwing an `Error` with the output from `php` so that our `jest` tests can see and report them. This will make it easier debug failing tests.
Corrects spelling of "converted" and clarifies wording of the explanation for why _.camelCase is not a viable alternative.
* data: Start split of registry with reducer This splits out the implementation of `registerReducer` into a separate file, with the intention of continuing the rest of the store implementation. This will make room for other possible implementations with a common interface. * data: Move registerSelectors and registerActions This moves the implementation of registerSelectors and registerActions to the namespace-store implementation file. * data: Untangle registerResolvers This untangles registerResolvers, puts more code into the namespace-store, and organizes the functions upon which it depends. * data: Centralize namespace registration This commit centralizes the logic for namespace registration, in order to support `registerStore` better. `register[Reducer|Actions|Selectors|Resolvers]` now are viewed as incomplete calls to `registerStore` * data: Add registerGenericStore This adds the registerGenericStore function and removes the `namespaces` object in favor of a more generic `stores` object. * data: Use store.subscribe() function * data: Make registerGenericStore public + add tests This makes `registry.registerGenericStore` accessible from the result of `createRegistry`, and adds tests for the functionality of it. * data: Add registerGenericStore to readme This adds information about `registerGenericStore` to the readme with two examples. * data: Export registerGenericStore from index This adds an export for `registerGenericStore` for the defaultRegistry. While the defaultRegistry may be going away in the future, it's here for now, so this should be there until it changes. * data: Fixes to readme * data: Deprecate registerX and use functions This deprecates the following functions from the registry: - registerReducer - registerSelectors - registerActions - registerResolvers - use registerStore should be used instead of the above register functions, and registerGenericStore should be used instead of plugins. * data: docs/changelog updates for deprecations This documents the deprecated.md and CHANGELOG.md files with information about th wp.data registry deprecations. It also sets the correct version for the deprecated calls to the next minor plugin version. * data: un-deprecate `registry.use` This removes the deprecation of `use` because it's internally referenced and breaks unit tests. The deprecation of `use` should be done in a future PR that changes the behavior to not call `use`. * data: Add deprected as script dependency to data This adds the `wp-deprecated` script as a js script dependency to `wp-data`.
#11332) * API Fetch: Avoid unnecessary options shallow clone on unhandled method * API Fetch: Test untouched as referentially equal
* Editor: Debounce autosave on last edit * Editor: Track last edits by reference change
* Try: Improve columns block This PR aims to improve the column block usability, as well as fix a few issues: 1. It makes the individual columns unclickable by using pointer events. Since these are not actionable yet, being able to select them is not really helpful. 2. It improves the UI around reusable blocks, by fixing an issue where even though contents should be disabled when in a reusable block, it was still selectable if there were nested blocks. 3. It further improves the reusable block UI by fixing a regression where the reusable block editing bar did not push down content sufficiently. 4. It refactors how margins in the columns block work, to be simpler and more predictable, and makes it behave similar to every other block in that regard. * Improve the margins of an empty colums block.
Fix a tiny-miny grammatical error in the CONTRIBUTORS.md file.
* Update media url only if it exists This is for handling situations where user just presses Cancel on the media picker. We don't want the image block to update in that case. * Fix lint issues
## Description This pr adds "Media & Text" <-> Video, Image transforms. ## How has this been tested? Add a video block. Transform it to Media & Text and verify it worked as expected. Add an image block. Transform it to Media & Text and verify it worked as expected. Transform both blocks back to video and image. Add a media text block select an image and transform it to image block. Add a media text block select a video and transform it to video block. Transform the image and videos back to media & text.
* fix: Only show aria-label when content is empty Fix issue introduced in #11560 * Improve aria labels so they reflect state of block/empty block
- @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected]
* Add URL validation functions * Add utility function for determining whether an href is valid * When an invalid link is added, display it in a red color and speak an assertive message for screenreaders * Add an e2e test to catch a11y regressions when adding an invalid link * Update changelog for URL package. * Update url package docs * Trim assertive content in e2e test * Added a few minor tweaks to the url changelog.
## Description This pr updates the documentation of @wordpress/components/FontSizePicker. The component was updated with additional props added and the structure of existing props changed but the updates to the docs were missing. ## How has this been tested? Just documentation updates. I checked the sample code works and does not contain linting error, by pasting it in an existing block.
* Further improve columns block. This PR is a followup to thoughts in #11620 (comment). It improves the columns block further by doing two things: 1. It hides the hover effect on the individual _column_ block in the initial state. 2. It changes the non-block "fake" appender to be a textarea instead of an input. To elaborate on 1, in #11620 we used pointer-events to disable the individual column blocks as selectable using the mouse. This is because those columns are not actionable at the moment, and in the current implementation of the column, being able to hover and select them only causes issues with selecting the parent columns block, which _is_ actionable. However pointer events was not enough for the _empty_ state of a columns block. In this state, the block features no inner blocks, except the individual column blocks, because no content has yet been inserted yet. In this state, you see the "appender", which is not actually a block even though it looks exactly the same as an empty paragraph. Because this is not technically a block, the deepest nested child is a _column_, which is then allowed to be hovered. In 1 I add a workaround to that, to simply visually hide the hover effect. I expect this to be refactored in a future columns update, but for the time being it makes it far more usable. To elaborate on 2, there has been a long time issue with the appender (again, not the block, the fake version that we use before an empty paragraph is inserted) wrapping text in translations. This is because text _cannot_ wrap in an `input` field, which the appender is. By changing this to a `textarea`, the text can wrap. This might affect themes which specify the input element for increased specificity in their editor styles, but overall it still seems like a worthwhile change to make, since it's the only way we can allow the writing prompt to wrap its text. * Fix by using TextareaAutosize. Props @aduth. Also adds resize: none;, props @chrisvanpatten. * Fix unit tests
* Try: Refactor contextual toolbar to work better with floats This is rather big surgery this late in the phase. There may be dragons, and it may be necessary to punt this to phase 2. This PR seeks to fix #4764 by doing a number of things: - Move the contextual toolbar into the block edit div, which is the one we float. This helps make it _connected_ to the content. - Add some complex clearing rules so we avoid many of the gnarly situations where a selected block after a floated block has a weirdly tall size. - Fixes so a paragraph block that follows a float does behave as it will on the frontend (i.e. won't clear), but also has a toolbar that is correctly positioned. This moving around of things caused subsequent issues, which means this PR also: - Fixes the toolbar appearance on mobile. - Improves upon the appearance of the toolbar on floated items on mobile. - Fixes hover label positioning, not only so they work with floats, but are positioned correctly as a result of this refactor. - Fixes issues with wide and fullwide toolbar positioning. * Use block navigator to select the blocks * Remove block and inline level rules This removes the rules that were specific to inline blocks or block level blocks and levels the playing field. The benefit is no special rules. The downside is that a block following a float still might not perfectly match the user expectation. This PR also fixes issues with mobile toolbars. Finally, it makes the block toolbar not float. This rule used to be necessary, but for whatever reason it no longer appears to be. * Fix rebase issue. * Fix classic block.
* Remove 4.3 deprecated APIs * Update changelogs * Remove useless package dependency * Remove useless snapshot and mock * Update docs
* Performance: Avoid unnecessary re-renders when navigating between blocks with keyboard * Small tweak per review
* Implement annotations Integrate Annotation API with Format API Keep annotations when applying formatting Change parameters for toTree after rebasing on master Fix unit test Add files after `npm run docs:build` Only re-render one block when adding annotation Do this by optimizing the annotations state to keep track of which annotations belongs to which block. This information can then be used in the selector to return the same reference if the annotations for a block haven't changed. Add unit tests for annotations reducer Also remove MOVE_ANNOTATION action. Rename block to blockClientId Remove block ID from RichText documentation It is not relevant at that level. Change block annotation to use selector property Build docs Fix low hanging fruit Add annotation support for block attributes Rename blockAttribute to richTextIdentifier Simplify annotations to only `start` and `end` Revert changes to to-tree Add annotation support to lists and headings Build docs Move the applyAnnotations call into formatToValue Refactor applyAnnotation to only loop once Add basic e2e test for annotation API Disallow invalid annotation ranges in state Drop general block annotation className Add assertions for annotations behavior Add selector to retrieve currently selected text Move removeAnnotations to valueToFormat Move applyAnnotations and removeAnnotations They don't use `this`, so it is only fair. Fix failing tests Build docs Move annotations state to @wordpress/annotations * Mark Annotation API as experimental * Move annotation format to annotation package * Move annotation application to annotation package * Remove getCurrentRichTextSelection selector * Remove richText selection remnants * Remove annotations from rich-text docs * Remove duplicate props * Move block annotation to annotations package * Properly define dependencies * Add _experimental flag to e2e tests * Remove wp-annotations as a dependency of wp-editor * Fix spacing * Annotations: Add missing uuid dependency * Annotations: Fix DocBlock inconsistency * Annotations: Add missing Lodash dependency * Annotations: Fix up a few more DocBlocks * Annotations: Add a basic description for package * Docs: Include Annotations document in root manifest * Update dependencies
…isibility (#11607) ## Description Closes: #10907 When pressing alt + f10 if the contextual toolbar was not visible because the user was typing, we did not focus the block contextual toolbar, and we focused the header instead. This PR addresses this problem. To solve the problem, the PR performs the following actions: Adds a prop to NavigableToolbar that enables it to focus when mounting. Adds an event handler for pressing alt+f10 key combination on BlockListBlock and state flag the indicates that the handling is in progress. ## How has this been tested? I checked the unified toolbar mode was not enabled. I added a paragraph, I wrote something until the toolbar disappears I pressed alt+f10, and I verified the block toolbar appeared with the first item focused. I repeated the test with other blocks, e.g., writing on the image caption.
* Toggle disabled if post is published * Return focus to Publish... button - Do not unmount Header settings components. - Hide the "Save draft" button because it's not hidden by the PostPublishPanel slide-in sidebar. * Sort dependencies * Extract props * Toggle should be disabled if post is published * Add toggleProps to button * Inline text for toggle within the button component * Always render the button component * Use aria-disabled instead of disabled to avoid focus loss * Improve comments * Update snapshots * Add deprecation notice in editor CHANGELOG * Add deprecation notice in plugin * Add deprecation in component * Add DotTip to PostPublishButton * Fix deprecation warning in tests * Update PostPublishButton e2e tests to use aria-disabled instead of disabled att * Update e2e test This was relying on the preview button not being mounted while the publish panel was opened. A better logic is to check whether the actual publish panel is shown. * Tweak comment * Update version * Update packages/editor/src/components/post-publish-panel/toggle.js * Place component in a separate line Co-Authored-By: nosolosw <[email protected]> * Update version number * Add comment * Update comment * Tweak comment * chore: Move deps to 4.5
Firestorm980
pushed a commit
that referenced
this pull request
Dec 20, 2018
…rdPress#12312) * Improve typing performance by splitting attributes in state tree. Attributes have been moved to `attributesByClientId` in order to reduce the impact of typing throughout the state tree. See WordPress#11782. Review fixes pass #1 Simplify block flattening code in reducers. Remove alignment toolbar optimization; should be a different PR Fix minor bug in test Fix failing getBlockDependantsCacheBust test Remove new `*WithoutAttributes` selectors. We'll go with a different approach: use the existing selectors, but keep the dependencies as they are. The attributes may get stale, but it doesn't matter if they're not being used. Change attributesById structure to not have an inner attributes Simplifying some selector dependencies Simplify withSaveReusableBlock a bit further and clarify its existence Reuse constant instead of running omit again Remove no longer needed mapClientIds Simplifying reducers after review comments. Further changes to selectors after review Fix types in JSDoc Renaming attributesByClientId to attributes Further selector fixes after review * Revert changes to getBlocks dependants
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
How has this been tested?
Screenshots
Types of changes
Checklist: