Skip to content

Conversation

@Firestorm980
Copy link
Owner

Description

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

danielbachhuber and others added 30 commits November 9, 2018 12:54
I made a PR which got accepted. 🎉

Here is the link → `https://github.com/WordPress/gutenberg/pull/11656#issuecomment-437374775` 

Adding my name to CONTRIBUTORS.md file. ✌️
The code editor is an odd beast when it comes to text direction.
There's a confusing interplay of stored bytes, styling, and
internal directionality in the display of text.

If we set `dir="rtl"` on the code editor, which happens when chaining
down from the same attribute on the `<html>` tag, then the block
comments display incorrectly. The browser is smart enough to handle
text and HTML tags/attributes but gets confused in the comments.

With this change we force the browser to treat the textarea for the
code editor as `ltr` for its display to preserve the ability to interact
with the block delimiters. It's noteworthy that the browser still
properly handles RTL text snippets.

This change may mean that the cursor doesn't appear on the right side
of the code editor when an RTL language is set, but once we start
typing characters associated with RTL directions they should display
fine, maybe left-aligned.

There is a tradeoff here in semantics, which is more appropriate: that
RTL languages display right-aligned or that structural content is
preserved. I think that the preservation of the block comments in the
code view is most important. Since this is a display issue it's worth
pointing out that the underlying stream of bytes doesn't change and so
no block comments are broken with the `rtl` value, but they _look_
broken and become hard to work with.
Since the introduction of the default parsers we have had a bug in the
PHP version whereby inner blocks were being popped onto the output
stack as PHP classes instead of as simple associated arrays. Blocks
that weren't inner blocks were being properly type-casted as arrays.

This patch adds the cast in where it's needed in order to fix this
inconsistent behavior.

So far this hasn't caused any troubles or exposed itself but while
working on other PRs like #11434 it became evident in test code.
This patch updates a couple of inconsistent behaviors when dealing with
empty attributes and with the way PHP and JS treat empty objects differently.

## PHP empty attributes
When returning blocks without attributes the spec PHP parser has been
sending `[]` instead of `{}` due to complications of how PHP serializes
empty arrays to JSON.

In this patch we're adding a new test to verify the behavior and then
fixing the spec parser so that the output from the PHP version matches
the output from the JS version identically.

## Bug with empty attributes in comments
The default parser introduced a bug where `<!-- wp:anything {} /-->` would
fail to parse because it expected some content inside the curly brackets for
the JSOn attributes.

This is fixed in this patch by changing the `+?` quantifier in the RegExp
tokenizer with a `*?` to allow for empty attributes.

A test suite has been added to verify that when we parse an array of different
block formulations that they produce what we expect. A bug in a test was the
reason I didn't originally find this bug.
…1141)

Updates do_blocks() and gutenberg_render_block() so that we can support nested blocks inside of dynamic blocks. This replaces the use of the partial parser which extracts registered dynamic blocks with the full parser.

This change will allow dynamic blocks which contain nested blocks inside of them and it will pave the way for a filtering API to structurally process blocks.

The partial parser came about at a time before the default parser was written; it was faster than the spec parser and was a tradeoff to get dynamic blocks rendering. The default parser, however, has been fast enough for a while to run on page render and so this PR exists to finally get it into the pipeline.
 - @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 min-width to audio block.

Fixes #11740.

The audio block has no intrinsic width, and collapses if we don't set an explicit min-width on it. This PR does that.

* Update changelog

* Move to style.scss instead.

* Refactor, address feedback.
* Fix multiselection for float elements

* Update changelog

* Add a comment to explain the fix

* revert unrelated change
Using `per_page=-1` triggers the `apiFetch()` middleware to resolve all
items.
* Make cssnano remove all comments

As referenced by @jasmussen [here](#11752 (comment)), this should fix the fact that `/*` style comments are not removed by cssnano.

* Linting.
…11649)

* remove unnecessary locale and is12Hour passthru props to DatePicker component

* add changelog entries
## Description
<!-- Please describe what you have changed or added -->

I merged #11649 to master but the changelog entries ended up getting merged to the wrong section.
* Only refresh the popover if the anchor position changes (#11751)

* Update plugin version to 4.3.0
* Add toolbar to image block

* Refactor edit.native.js to make it similar to web

* Raplace BlockFormatControls usage with BlockControls
* Squashing commits - default alt values editor

* adds suggestions by @talldan review - THANKS!

* makes second group non-capturing

* adds back the re-enable of no-lonely-if

* removes url check as it will never be false when this function is used

* changes defaultAlt logic

* makes use of getPath and last to determine the file name

* removes extra function from merge conflict
* merge from upstream

* linting

* removed submodule

* updated commenting in the URL input component

* Delete merge from upstream

* chore: Tweak comments
* Copy guidelines formatting tweaks

I made some formatting consistency tweaks to @michelleweber's fine work and added some bold emphasis that I believe was supposed to be there in the original PR. Props also to @karmatosed.

* docs: Tweak wording and dash usage

* docs: A few tweaks
…11694)

* Only check MediaPlaceholder allowedTypes array length if allowedTypes prop exists

Fixes #11692

Adds basic unit test to demonstrate the bug described in #11692.

* Initialize allowedTypes to [] instead of modifying conditional

* Reinstate array length check
The text/code editor had a max-width, but no _width_, which made it sort of just choose its own width. Now it matches the $content-width.
aduth and others added 29 commits November 19, 2018 14:00
* Make it possible to undo prefix transforms

* Same for backticks

* Tests: Refactor tests to stop using META_KEY
…1826)

* Add ability to specify a different default font

Using the language translation, allows specifying a different
Google font to load and what the CSS font-family should be.

* Switch translation name to not be specific to Noto
* Reduce specificity of button CSS

* increase specificity of color utility CSS

* Add a comment in the colors stylesheet.
…supports them (#9481)

Full and wide aligns block alignments were always shown in the editor provided they were previously set or set because of a default value even if the current theme does not support them.

This PR does not make the editor change anything that has been saved. It just updates the editor to not show wide and full alignments on existing blocks (and default attributes) when they are not supported by the current theme so what the user sees in backend matches the front-end.
Unless explicitly changed by the user the aligns continue to be wide/full and if later the user changes to a theme that supports this aligns the editor will show again wide/full without any change.

The wide and full alignments were already not being shown in the Block alignment toolbar if the theme does not support them.
)

Allow transitioning from Audio and Image block to relevant embed when pasting a url in the insert URL field.
…1737)

* Restore the block hover and focus styles in Unified Toolbar mode.

* Remove hover outlines in Top Toolbar mode.
…aration (#12003)

* Framework: Preserve unknown attributes in block render

* Framework: Respect null as a valid attribute type

* REST API: Update block renderer test to omit undefined defaults

* REST API: Assign default for block renderer attributes

Previously we would pass `NULL` to `render`. While `render` provides a default `array()` value, since an explicit value is provided, it would not take effect. With this change, the endpoint assures a default value to be provided as a parameter to get the `get_item` callback that is compatible with the function signature of `WP_BlockType::render`.

Alternatively, it could be considered to have separate invocations of `render`, depending on whether the request parameter is set.
Match the Classic Editor's behaviour by appending _thumbnail_id to the
post preview URL so that changes to the featured image are visible.
This PR is a better replacement for #12096.

In IE11, in the toolbar markup, you can briefly see the appearance of a new HTML element called <jscomp_symbol_react.fragment16>. This is obviously not a real element, but it is rendered by IE11 as a real element, which means it breaks the flexing of the actual children of the toolbar.

This PR, props to @youknowriad, adds a change to the assets so the element doesn't appear in the first place.
* Set the preview url once metabox and autosaves are complete.

* when previewing, requestMetaBoxUpdates

* move preview autosave logic into edit-post effects

* update docs & save logic

* Fix save metaboxes condition

* Refresh preview after metabox save

* Fix consecutive previews

* Fix unit tests

* Fix autosaving status

* Always return a boolean value from isAutosave selector.
…nt.raw (#12084)

* Reusable blocks: Use view context

Existing reusable blocks on a post would not render if the user was an
author or a contributor. This happened because requests to fetch a
single block or post are blocked when ?context=edit is passed and the
current user is not an editor.

The fix is to stop passing `?context=edit` to block requests, but this
causes another problem which is that Gutenberg needs access to both
`title.raw` and `content.raw` in the API response.

We therefore both stop passing `?context=edit` to block requests *and*
modify the blocks API so that `title.raw` and `content.raw` are always
provided.

Lastly, we modify the blocks API to always omit `content.rendered`, as
it doesn't make sense for a reusable block to have rendered content on
its own, since rendering a block requires it to be inside a post or a
page.

* Delete fake user after each test case, not after all test cases

* Typo: /** → /*

Co-Authored-By: noisysocks <[email protected]>

* Create all fake data before any test runs

* Omit `title.rendered` from the blocks REST API

The rendered title isn't used, so we may as well remove it so that
`content` and `title` are aligned.

* Fix fetching when using reusable blocks as a contributor

* Fix reusable block effect tests

* Fix reusable block E2E tests
This PR fixes #12066.

I believe the issue is caused by the border on the button being an inset shadow, which stacks below the background colors of the content inside the preview. By making it a border, this becomes a non issue.
It has some duplicates with the main help modal, but many things are specific for the classic block. Also, can be "tweaked" specificlly for the classic block in the `wordpress` MCE plugin (in core).
* Remove permalink features from nonpublic CPTs

* Use lodash get to get post type 'viewable' setting
…lent

* convert unhandled to html

* restore correcting invalid list when converting blocks

* Add e2e tests
* Add localizations to global moment

* Add day-of-week support

* Add date formats to moment

* Code Sniffer
* Fix the TinyMCE init array

- Added "manual" convert from php to js, same as in class-wp-editor.php.
- Reformated the code so it's more readable.

* Fix missing space to fix failing tests...

* Fix phpcs
* Fix issue with disabled togglecontrol double border

Fixes #12049.

This PR fixes an issue where a togglecontrol, wrapped in a Disabled component, would show a double border. The issue was that it inherited a border from the parent checkbox style (because the toggle is technically a reskinned checkbox).

* Address feedback.

- Add a better disabled state that works for both checked and unchecked states.
- Move code to the right component.
- Fix some additional bleed issues.
* preserve quote content

* Add comment
* Initial reworking; props @0aveRyan

* Fixes for the manifest/generators

* A few missed items and small formatting tweaks

* Simplify/flatten the directory structure

* Cheat my way around a merge conflict pt1

* fight the git powers

* JSON version of TOC instead of YML

* Ensure all files have good titles

* Add a generator script and re-generate the root-manifest

* Update docs/designers-developers/designers/block-design.md

Co-Authored-By: chrisvanpatten <[email protected]>

* Update docs/designers-developers/key-concepts.md

Co-Authored-By: chrisvanpatten <[email protected]>

* Get a handful of internal link references fixed

* Another batch of internal links

* Update docs/tool/manifest.js

Co-Authored-By: chrisvanpatten <[email protected]>

* Additional broken internal link fixes

* A few more links

* Revert use of lt/gt symbols in link

* Fix more broken internal links

* Remove docs generator

* Broken manifest.json
@Firestorm980 Firestorm980 merged commit a42e5d6 into Firestorm980:master Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.