Skip to content
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

[RNMobile] Native mobile release v1.17.0 #18426

Closed
wants to merge 185 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
7478b41
Adds correct escaping for urls (#17932)
Oct 14, 2019
cb3b787
Add an apiFetch middleware to automatically handle media upload failu…
youknowriad Oct 14, 2019
1e45acc
Fix: Gradient presets to verify some MU kses rules (#17940)
jorgefilipecosta Oct 14, 2019
090b89e
Bump plugin version to 6.7.0-rc.1
epiqueras Oct 14, 2019
5051d6a
Code Style: Change name of accumulated variables when using reduce fu…
lozinska Oct 15, 2019
77c676c
Fix:Image Block: Hide 'noreferrer' and 'noopener' in Link Rel (#17398)
donmhico Oct 15, 2019
be83661
Change Cover block min height input step size to 1 (#17927)
ZebulanStanphill Oct 15, 2019
693c0b8
chore(release): publish
youknowriad Oct 15, 2019
d7cd263
Update changelogs after the npm release
youknowriad Oct 15, 2019
9515a53
Prevent prependHttp from failing if url is not defined (#17928)
glendaviesnz Oct 16, 2019
2ea41bf
List block: move default style (#17958)
ellatrix Oct 16, 2019
0ee2b78
Storybook: Add stories for Checkbox control component (#17891)
mkaz Oct 16, 2019
a24a56d
RNMobile Add size options to mobile image block (#17245)
cameronvoell Oct 16, 2019
79f910f
Improve columns flex rule, round 2. (#17968)
jasmussen Oct 16, 2019
979ac4a
Bump plugin version to 6.7.0
youknowriad Oct 16, 2019
2da693e
Small changes to Git Workflow docs (#17662)
dphiffer Oct 16, 2019
f38e178
Codeowners: Remove gziolo from some folders (#17971)
gziolo Oct 16, 2019
f5f824e
Fix: Invalid import statement for deprecated in the modal component (…
gziolo Oct 16, 2019
d0079a9
Add empty line (#17981)
mkaz Oct 16, 2019
2c11c83
Try setting a block display name for the Block Navigator. (#17519)
talldan Oct 16, 2019
d79a840
[RNMobile] add RangeControl mobile implementation (slider) (#17282)
jbinda Oct 17, 2019
a284f26
Split e2e tests into multiple folders (#17990)
youknowriad Oct 17, 2019
5991eeb
Playground: Add link to components storybook. (#17982)
epiqueras Oct 17, 2019
013ed32
Fix image native test (#17989)
lukewalczak Oct 17, 2019
ed24c2f
Update: Refactor button edit to use a functional component (#18006)
jorgefilipecosta Oct 18, 2019
55dce15
Optimize exports of the wp/compose package (#17945)
jsnajdr Oct 18, 2019
69f6a69
[RNMobile] Introduce grouping in the block settings inspector (#17703)
lukewalczak Oct 18, 2019
c73d5be
Fix the performance tests (#18020)
youknowriad Oct 18, 2019
4e5e7fa
Storybook: Add knobs to ColorIndicator (#18015)
mkaz Oct 18, 2019
2052317
Add dashicon component to storybook (#18027)
mkaz Oct 18, 2019
a26a263
Fix Publish Button!!! (#18016)
jasmussen Oct 19, 2019
ba4793b
Update MediaPlaceholder README.md (#17980)
phwebi Oct 19, 2019
5d58806
removes decleration of Select button (#18007)
anthonyburchell Oct 21, 2019
26795ca
Fix MediaUpload README value prop description (#18039)
mkevins Oct 21, 2019
dc95b6f
Tests: Clean up skipped e2e tests (#18003)
gziolo Oct 21, 2019
4df25af
chore(release): publish
youknowriad Oct 21, 2019
a2856b1
Chore: Fix issues related to Node 12 becoming LTS (#18054)
gziolo Oct 22, 2019
87e4431
Fix issue when providing multiple shortcode aliases for a new block (…
jg314 Oct 22, 2019
6da4593
Chore: Update the lock file to use newer version of fsevents (#18057)
gziolo Oct 22, 2019
0d93d0c
Env: Add support for custom ports. (#17697)
epiqueras Oct 22, 2019
a5c9b11
Add isInvalidDate prop to DatePicker (#17498)
manzoorwanijk Oct 22, 2019
a25fe28
navigation-menu: Implement colors selector button. (#17832)
retrofox Oct 22, 2019
de715f6
Update design-systems:dev script to build packages (#18073)
mkaz Oct 23, 2019
9783474
Add `@wordpress/base-styles` package (#17883)
simison Oct 23, 2019
04e142e
Add Site Title block and required functionality. (#17207)
epiqueras Oct 23, 2019
f77ed22
Table: remove wrapper around cells (#17711)
ellatrix Oct 23, 2019
53eca43
Implement core template loader overrides to rely on wp_template posts…
felixarntz Oct 23, 2019
6cf43ac
Add logic for basic (temporary) wp_template editing UI (#17625)
felixarntz Oct 23, 2019
d4528d8
url-input: ensuring value is defined on key down (#18088)
retrofox Oct 24, 2019
7515397
Code style: Fix ESLint warnings reported for JSDoc definitions (#18025)
gziolo Oct 24, 2019
0b76cc9
Local autosave: Clear after successful save (#18051)
mcsf Oct 24, 2019
f2b9682
Chore: Fix: Do not show Gradient panel if gradients are not av… (#18091)
jorgefilipecosta Oct 24, 2019
29fc723
Fix regression with Gallery margin. (#18019)
jasmussen Oct 24, 2019
dd8885b
Add platform component (#18058)
SergioEstevao Oct 24, 2019
63a0e56
Fix: End to end tests do not disable the experiments (#18093)
jorgefilipecosta Oct 24, 2019
b99748f
Fix: Custom button background color not reflected on reload (#18037)
jorgefilipecosta Oct 24, 2019
ffc4795
List Block: Do not merge list with previous block if deleting first l…
gwwar Oct 24, 2019
59f7102
Add gradients in cover block (#18001)
jorgefilipecosta Oct 24, 2019
abbdb2b
Components: Add VisuallyHidden component (#18022)
mkaz Oct 24, 2019
bef4943
Storybook: Apply a set of enhancements to the existing stories (#18030)
gziolo Oct 24, 2019
2cedba7
Env: Add support for running in themes. (#17732)
epiqueras Oct 25, 2019
3cf81c7
Storybook: Add Color Palette Component (#17997)
mkaz Oct 25, 2019
576009f
Preserve attributes on split (#18102)
ellatrix Oct 25, 2019
56e730b
[rnmobile] Breadcrumbs (#17471)
dratwas Oct 25, 2019
f8b62bd
Add a block selection breadcrumb to the bottom of the editor (#17838)
youknowriad Oct 25, 2019
0f216d8
RNMobile: Add image alignment controls (#17962)
mchowning Oct 25, 2019
ce2e71c
Fix checkboxes for postmeta. (#18108)
jasmussen Oct 25, 2019
5ac763a
Add block inspector to the Gutenberg playground. (#18077)
jorgefilipecosta Oct 25, 2019
434bb66
Block Editor: Implement new colors hook. (#16781)
epiqueras Oct 25, 2019
cb96083
Fix: Font size picker component relies on WordPress styles (#18078)
jorgefilipecosta Oct 26, 2019
936ec69
Nav menu item enhancements: display toolbar and remove dropdown (#17986)
tellthemachines Oct 27, 2019
dda7d96
Fix overlapping controls in the Inline Image formatting toolbar (#18090)
noisysocks Oct 28, 2019
9023ca2
Raw handling: Fix strikethrough formatting when copy/pasting from Goo…
noisysocks Oct 28, 2019
a6e1252
Tutorial: Specify block naming restrictions (#18117)
jblz Oct 28, 2019
5a88ec3
Components: ExternalLink, add story (#18084)
Oct 28, 2019
711f9ff
Storybook: Add ColorPicker component (#18013)
mkaz Oct 28, 2019
f0dc07c
Add class mechanism for preset gradients. (#18008)
jorgefilipecosta Oct 28, 2019
3a0a929
Allow media upload post processing for all 5xx responses (#18106)
youknowriad Oct 28, 2019
567216f
Allow travis builds in all wp/* branches
youknowriad Oct 28, 2019
4f2e7f2
Add `DimensionControl` component (#16791)
getdave Oct 28, 2019
ef2ecc7
Paste: allow list attributes (#17144)
ellatrix Oct 28, 2019
b616e28
Add grandient fixtures to cover block (#18002)
jorgefilipecosta Oct 28, 2019
b3ad226
Bump plugin version to 6.8.0-rc.1
ellatrix Oct 28, 2019
702b11c
Fix RN build after merge with master (#18133)
SergioEstevao Oct 28, 2019
669da7a
Commander: switch cloning method to HTTPS (#18136)
ellatrix Oct 28, 2019
2980cb9
Add horizontal option for the block movers (#16615)
draganescu Oct 29, 2019
bd8dc3b
Update ExternalLink Component to fix visually hidden text (#18142)
mkaz Oct 29, 2019
9158c3c
Add Spinner component to storybook (#18145)
brentswisher Oct 29, 2019
f56110d
Smart block appender (#16708)
draganescu Oct 29, 2019
876272d
Components: Draggable, add story (#18070)
Oct 29, 2019
e6d8284
Block Directory: Convert it to UI Plugin to avoid bundling into Core …
gziolo Oct 29, 2019
e390bf8
Make the AsyncModeProvider API a stable API (#18154)
youknowriad Oct 29, 2019
c3ea270
Make the mediaUpload block editor setting a stable API (#18156)
youknowriad Oct 29, 2019
3febc48
Fix columns full-wide regression. (#18021)
jasmussen Oct 29, 2019
7aabe96
Resyncs RichText mobile components with web counterparts. (#17897)
SergioEstevao Oct 29, 2019
078b024
[RNMobile] Add a subtitle for unsupported blocks (#18107)
maxme Oct 29, 2019
152cbf1
Navigation: Explore default frontend styles (#18094)
frontdevde Oct 29, 2019
818d974
NavigationMenu: set attributes rightly (#18150)
retrofox Oct 29, 2019
095c0e4
Update packages/block-editor/src/components/colors/use-colors.js (#18…
jorgefilipecosta Oct 29, 2019
bc8a136
[RNMobile] Added support for giphy and pexels images (#18026)
marecar3 Oct 29, 2019
5eb2f23
Scripts: Bump the version of npm-package-json-lint (#18160)
gziolo Oct 29, 2019
d6ce94c
Experimental Link creation interface (#17846)
getdave Oct 30, 2019
d56979d
[RNMobile] Hotfix 1.15.2 (#18128)
etoledom Oct 30, 2019
cd9a4cc
Add RangeControl component to Storyboard (#18146)
brentswisher Oct 30, 2019
2ce17a8
Bump plugin version to 6.8.0
ellatrix Oct 30, 2019
96f7d34
Update ColorPalette component to accept disableAlpha parameter (#18175)
mkaz Oct 30, 2019
43db91b
Add config file support to @wordpress/env (#18121)
noahtallen Oct 30, 2019
6f172cd
Fix navigation menu insertion issues (#18178)
talldan Oct 31, 2019
d833744
Update README screenshot (#18187)
mapk Oct 31, 2019
35aa0ad
Navigation Block: remove font-family styles and let the block inherit…
mtias Oct 31, 2019
e43023a
Navigation Block: Add text indicating that a menu is loading. (#18188)
mtias Oct 31, 2019
a021d90
Remove "experimental" name from navigation block. (#18185)
mtias Oct 31, 2019
7ca10d6
Navigation Block: use RichText for navigation menu item instead of Te…
mtias Oct 31, 2019
ddb44d7
Some minor code quality updates to the RangeControl stories (#18198)
brentswisher Oct 31, 2019
1338951
Show appender only when item has submenu (#18153)
tellthemachines Oct 31, 2019
ad11af4
Fix function name (camel case) (#18204)
mlbrgl Oct 31, 2019
a1bc23e
Add FontSizePicker component to Storybook (#18149)
brentswisher Oct 31, 2019
085c31a
Components: Modal, add story (#18083)
Oct 31, 2019
ab59ea9
Testing: Upgrade puppeteer to v2.0 to fix the broken interactive mode…
gziolo Oct 31, 2019
0892d70
Fix component name in readme (#18218)
Mahjouba91 Oct 31, 2019
9529670
Fix: consecutive updates may trigger a blocks reset (#18219)
jorgefilipecosta Oct 31, 2019
60d666e
Add block navigator to sidebar panel for nav block (#18202)
talldan Oct 31, 2019
36494a4
makes the submenu items stacked vertically (#18221)
draganescu Oct 31, 2019
5a5baed
Removed gif from README (#18200)
mapk Oct 31, 2019
83e7216
Colors Selector: replace `Aa` text by SVG icon (#18222)
retrofox Nov 1, 2019
281d924
Rename Component to WPComponent in docstring (#18226)
mkaz Nov 1, 2019
a353bc9
Fix mover for floats. (#18230)
jasmussen Nov 1, 2019
afdd6df
Add experimental `ResponsiveBlockControl` component (#16790)
getdave Nov 1, 2019
f73ebe6
[RNMobile] Add mobile Spacer component (#17896)
lukewalczak Nov 1, 2019
3b19415
enables horizontal movers in social blocks (#18234)
draganescu Nov 1, 2019
680a085
Add "Image Title Attribute" as an editable attribute on the image blo…
brentswisher Nov 1, 2019
85b0729
Add editor-gradient-presets to get_theme_support (#17841)
spacedmonkey Nov 1, 2019
e4003c4
Add a README file for storybook directory (#18245)
mkaz Nov 2, 2019
3d6392d
Template Loader: Add theme block template resolution. (#18247)
epiqueras Nov 4, 2019
5d0c03e
[rnmobile] Release 1.16.0 to master (#18261)
etoledom Nov 4, 2019
3d2b41a
Components: Switch screen-reader-text to VisuallyHidden (#18165)
mkaz Nov 4, 2019
38da131
Fix postmeta radio regression. (#18183)
jasmussen Nov 4, 2019
61753df
Fix default featured image size (#15844)
derweili Nov 4, 2019
fd5edfc
Fix: setting a preset color on pullquote default style makes the bloc…
jorgefilipecosta Nov 4, 2019
e8e115d
Update: Default gradients. (#18214)
jorgefilipecosta Nov 5, 2019
0124b2e
link-control: fix spinner position (#18278)
retrofox Nov 5, 2019
3c98627
Editor: Fix move to trash redirect save race conditions. (#18275)
epiqueras Nov 5, 2019
0d8ee84
Revert img, iframe styles to block editor container scope (#18287)
aduth Nov 5, 2019
c3af33c
Use URL in clipboard, if available, to create a new link (#18279)
SergioEstevao Nov 5, 2019
711f1f7
[RN Mobile] Fix Rich-Text setSelection call on Android when BR tags a…
daniloercoli Nov 5, 2019
bb0529f
link-control: implement onEdit mode (#18225)
retrofox Nov 5, 2019
73189e1
Add appender to Block Navigator (#18100)
talldan Nov 6, 2019
f3fb987
Handle non-existant wp-env.json file (#18294)
talldan Nov 6, 2019
b138818
NavigationMenu: <LinkControl /> integration. (#18062)
retrofox Nov 6, 2019
51fee9a
Block Merge: guard for undefined attribute definition (#17937)
ellatrix Nov 6, 2019
1d8ccc5
[RNMobile] RangeControl markup (#18036)
jbinda Nov 6, 2019
0e1564b
navigation-menu: apply colors correctly in edition mode (#18172)
retrofox Nov 6, 2019
3ab9fb6
Update `LinkControl` component to utilitse dynamic settings for addit…
getdave Nov 6, 2019
59da6ed
Show new block indicator in default appender too (#18289)
hypest Nov 6, 2019
e22ba17
Fix: useColors crash when themes remove the color pallete
jorgefilipecosta Nov 5, 2019
497b42b
Update packages/block-editor/src/components/colors/use-colors.js
epiqueras Nov 5, 2019
4a49e3a
navigation-menu-item: rename link ID to `id` (#18346)
retrofox Nov 7, 2019
a5c974b
Remove custom paragraph options for media-text (#18284)
koke Nov 7, 2019
03b1e80
Try: Remove complex left/right block margins. (#17877)
jasmussen Nov 7, 2019
ac9a5a6
Escape Editable HTML (#17994)
ellatrix Nov 7, 2019
78c6e86
Code block: remove escaping from native file (#18369)
ellatrix Nov 7, 2019
da5a61a
navigation-menu: apply colors using block attributes (#18376)
retrofox Nov 7, 2019
9283978
List Block: disable indent/outdent buttons (#17819)
ellatrix Nov 7, 2019
62b9bc2
Link UI: Fix focus styles w/ suggestions showing (#18292)
obenland Nov 7, 2019
8f92b64
Verse: Example: Fix string concatenation, add `translators` string (#…
mcsf Nov 7, 2019
d213d8b
[RNMobile] Instruct haste/jest to look for modules in RN/Libraries/Ut…
hypest Nov 7, 2019
f4cbd5f
navigation-menu-item: fix showing input placholder (#18374)
retrofox Nov 7, 2019
e1fb88e
Change Detection: Add a test case for post trashing. (#18290)
epiqueras Nov 7, 2019
a71241c
Blocks: Add initial API for Block Patterns (#18270)
gziolo Nov 8, 2019
79636ce
[RNMobile] Block title in unsupported block (#18268)
hypest Nov 8, 2019
3bed7e5
Fix watching e2e tests (#18391)
talldan Nov 8, 2019
8b912dd
Include PR template check for .native.js refactorings (#15468)
hypest Nov 8, 2019
eba7de4
Preserves style of menu items when in edit mode (#18367)
draganescu Nov 8, 2019
2c3310f
[RNMobile] Media & Text alignment options (#18300)
lukewalczak Nov 8, 2019
a6450c6
Merge branch 'rnmobile/releases' into rnmobile/release-v1.17.0
hypest Nov 11, 2019
168bf7d
Fix merge errors
hypest Nov 11, 2019
5b02715
More fixing of merge errors
hypest Nov 11, 2019
e9f5566
Activate preformatted block in the RN app (#17906)
SergioEstevao Nov 12, 2019
639d3c4
[RNMobile] Simplify bridge requestMediaPick methods (#18303)
etoledom Nov 14, 2019
3d1ef4b
Fix paste in post title in GB-mobile. (#18479)
SergioEstevao Nov 14, 2019
262cca4
[RNMobile] Add content alignment options to paragraph block (#18433)
mchowning Nov 14, 2019
aba13e2
[RNMobile] Image block makes call to native for fullscreen preview (#…
cameronvoell Nov 14, 2019
e76d087
[RNMobile] Add separate options for capturing photo and video (#18505)
mkevins Nov 15, 2019
862c6c2
Fix lint issues
hypest Nov 15, 2019
9c5e2c1
Added native label to android and ios Platforms element (#18539)
marecar3 Nov 15, 2019
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
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
- [ ] My code follows the accessibility standards. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/accessibility-coding-standards/ -->
- [ ] My code has proper inline documentation. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/ -->
- [ ] I've included developer documentation if appropriate. <!-- Handbook: https://developer.wordpress.org/block-editor/ -->
- [ ] I've updated all React Native files affected by any refactorings/renamings in this PR. <!-- React Native mobile Gutenberg guidelines: https://github.com/WordPress/gutenberg/blob/master/docs/contributors/native-mobile.md -->.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Build Status](https://img.shields.io/travis/com/WordPress/gutenberg/master.svg)](https://travis-ci.com/WordPress/gutenberg)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org)

![Screenshot of the Gutenberg Editor, editing a post in WordPress](https://cldup.com/H0oKBfpidk.png)
![Screenshot of the Gutenberg Editor, editing a post in WordPress](https://cldup.com/R84R5fNgrI.png)

This repo is the development hub for the <a href="https://make.wordpress.org/core/2017/01/04/focus-tech-and-design-leads/">editor focus in WordPress Core</a>. `Gutenberg` is the project name.

Expand Down Expand Up @@ -32,7 +32,6 @@ Here's why we're looking at the whole editing screen, as opposed to just the con
4. **A fresh look at content creation.** Considering the whole interface lays a solid foundation for the next focus: full site customization.
5. **Modern tooling.** Looking at the full editor screen also gives WordPress the opportunity to drastically modernize the foundation, and take steps towards a more fluid and JavaScript-powered future that fully leverages the WordPress REST API.

![Writing in Gutenberg 1.6](https://make.wordpress.org/core/files/2017/10/gutenberg-typing-1_6.gif)

## Blocks

Expand Down
1 change: 1 addition & 0 deletions docs/contributors/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ The following resources offer additional information for developers who wish to
* [Managing Packages](/docs/contributors/managing-packages.md).
* [Gutenberg Release Process](/docs/contributors/release.md) - a checklist for the different type of releases for Gutenberg project.
* [Localizing Gutenberg Plugin](/docs/contributors/localizing.md) - a guide on how to translate Gutenberg in your locale or language.
* [React Native mobile Gutenberg](/docs/contributors/native-mobile.md) - a guide on the React Native based mobile Gutenberg editor.
4 changes: 2 additions & 2 deletions docs/contributors/document.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ To add a new documentation page:

1. Create a Markdown file in the [docs](https://github.com/WordPress/gutenberg/tree/master/docs) folder
2. Add item to the [toc.json](https://github.com/WordPress/gutenberg/blob/master/docs/toc.json) hierarchy
3. Update manifest.json by running `npm run docs:build`
4. Commit manifest.json with other files updated
3. Update `manifest-devhub.json` by running `npm run docs:build`
4. Commit `manifest-devhub.json` with other files updated

## Using Links

Expand Down
6 changes: 6 additions & 0 deletions docs/contributors/native-mobile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# React Native based mobile Gutenberg
Intertwined with the web codepaths, the Gutenberg repo also includes the [React Native](https://facebook.github.io/react-native/) based mobile tree. The mobile client is packaged and released via the [official WordPress apps](https://wordpress.org/mobile/). Even though the build pipeline is rather different and lives in its own repo for now ([here's the native mobile repo](https://github.com/wordpress-mobile/gutenberg-mobile)), the source code itself is taken directly from this repo and the "web" side codepaths.
## Native mobile specific files
The majority of the code shared with native mobile is in the very same JavaScript module and SASS style files. In the cases where the code paths need to diverge, a `.native.js` or `.native.scss` variant of the file is created. In some cases, platform specific files can be also found for Android (`.android.js`) or iOS (`.ios.js`).
## Mind the mobile
Our tooling isn't as good yet as we'd like to and it's hard to have a good awareness of those native mobile files. That means that contributors need to manually pay attention to update the native mobile files during code refactorings. For example, renaming a function or a prop should also be performed in the native modules too, otherwise, the mobile client will break. We are in the process of putting some more safeguards in place in PRs, but we're still far from done. Please bear with us and thank you in advance. ❤️🙇‍
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Block Registration

## `register_block_type`
## `registerBlockType`

* **Type:** `Function`

Expand Down
40 changes: 40 additions & 0 deletions docs/designers-developers/developers/themes/theme-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,46 @@ Themes are responsible for creating the classes that apply the colors in differe

The class name is built appending 'has-', followed by the class name _using_ kebab case and ending with the context name.

### Block Gradient Presents

Different blocks have the possibility of selecting from a list of predined of gradients. The block editor provides a default gradient presets, but a theme can overwrite them and provide its own:

```php
add_theme_support(
'__experimental-editor-gradient-presets',
array(
array(
'name' => __( 'Vivid cyan blue to vivid purple', 'themeLangDomain' ),
'gradient' => 'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)',
'slug' => 'vivid-cyan-blue-to-vivid-purple'
),
array(
'name' => __( 'Vivid green cyan to vivid cyan blue', 'themeLangDomain' ),
'gradient' => 'linear-gradient(135deg,rgba(0,208,132,1) 0%,rgba(6,147,227,1) 100%)',
'slug' => 'vivid-green-cyan-to-vivid-cyan-blue',
),
array(
'name' => __( 'Light green cyan to vivid green cyan', 'themeLangDomain' ),
'gradient' => 'linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)',
'slug' => 'light-green-cyan-to-vivid-green-cyan',
),
array(
'name' => __( 'Luminous vivid amber to luminous vivid orange', 'themeLangDomain' ),
'gradient' => 'linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)',
'slug' => 'luminous-vivid-amber-to-luminous-vivid-orange',
),
array(
'name' => __( 'Luminous vivid orange to vivid red', 'themeLangDomain' ),
'gradient' => 'linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)',
'slug' => 'luminous-vivid-orange-to-vivid-red',
),
)
);
```

`name` is a human-readable label (demonstrated above) that appears in the tooltip and provides a meaningful description of the gradient to users. It is especially important for those who rely on screen readers or would otherwise have difficulty perceiving the color. `gradient` is a CSS value of a gradient applied to a background-image of the block. Details of valid gradient types can be found in the [mozilla documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Images/Using_CSS_gradients). `slug` is a unique identifier for the gradient and is used to generate the CSS classes used by the block editor.


### Block Font Sizes:

Blocks may allow the user to configure the font sizes they use, e.g., the paragraph block. The block provides a default set of font sizes, but a theme can overwrite it and provide its own:
Expand Down
6 changes: 6 additions & 0 deletions docs/manifest-devhub.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@
"markdown_source": "../docs/contributors/localizing.md",
"parent": "develop"
},
{
"title": "React Native based mobile Gutenberg",
"slug": "native-mobile",
"markdown_source": "../docs/contributors/native-mobile.md",
"parent": "develop"
},
{
"title": "Documentation Contributions",
"slug": "document",
Expand Down
3 changes: 2 additions & 1 deletion docs/toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
{ "docs/contributors/scripts.md": [] },
{ "docs/contributors/managing-packages.md": [] },
{ "docs/contributors/release.md": [] },
{ "docs/contributors/localizing.md": [] }
{ "docs/contributors/localizing.md": [] },
{ "docs/contributors/native-mobile.md": [] }
] },
{ "docs/contributors/document.md": [
{ "docs/contributors/copy-guide.md": [] }
Expand Down
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Gutenberg
* Plugin URI: https://github.com/WordPress/gutenberg
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
* Version: 6.8.0-rc.1
* Version: 6.8.0
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
6 changes: 6 additions & 0 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ function gutenberg_experiments_editor_settings( $settings ) {
'__experimentalEnableFullSiteEditing' => gutenberg_is_experiment_enabled( 'gutenberg-full-site-editing' ),

);

$gradient_presets = current( (array) get_theme_support( '__experimental-editor-gradient-presets' ) );
if ( false !== $gradient_presets ) {
$experiments_settings['gradients'] = $gradient_presets;
}

return array_merge( $settings, $experiments_settings );
}
add_filter( 'block_editor_settings', 'gutenberg_experiments_editor_settings' );
62 changes: 54 additions & 8 deletions lib/template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function gutenberg_override_query_template( $template, $type, array $templates =
* @return string Path to the canvas file to include.
*/
function gutenberg_find_template( $template_file ) {
global $_wp_current_template_post, $_wp_current_template_hierarchy;
global $_wp_current_template_content, $_wp_current_template_hierarchy;

// Bail if no relevant template hierarchy was determined, or if the template file
// was overridden another way.
Expand All @@ -105,8 +105,56 @@ function gutenberg_find_template( $template_file ) {
);

if ( $template_query->have_posts() ) {
$template_posts = $template_query->get_posts();
$_wp_current_template_post = array_shift( $template_posts );
$template_posts = $template_query->get_posts();
$current_template_post = array_shift( $template_posts );

// Build map of template slugs to their priority in the current hierarchy.
$slug_priorities = array_flip( $slugs );

// See if there is a theme block template with higher priority than the resolved template post.
$higher_priority_block_template_path = null;
$higher_priority_block_template_priority = PHP_INT_MAX;
$block_template_files = glob( get_stylesheet_directory() . '/block-templates/*.html', 1 );
if ( is_child_theme() ) {
$block_template_files = array_merge( $block_template_files, glob( get_template_directory() . '/block-templates/*.html', 1 ) );
}
foreach ( $block_template_files as $path ) {
$theme_block_template_priority = $slug_priorities[ basename( $path, '.html' ) ];
if (
isset( $theme_block_template_priority ) &&
$theme_block_template_priority < $higher_priority_block_template_priority &&
$theme_block_template_priority < $slug_priorities[ $current_template_post->post_name ]
) {
$higher_priority_block_template_path = $path;
$higher_priority_block_template_priority = $theme_block_template_priority;
}
}

// If there is, use it instead.
if ( isset( $higher_priority_block_template_path ) ) {
$post_name = basename( $path, '.html' );
$current_template_post = array(
'post_content' => file_get_contents( $higher_priority_block_template_path ),
'post_title' => ucfirst( $post_name ),
'post_status' => 'auto-draft',
'post_type' => 'wp_template',
'post_name' => $post_name,
);
if ( is_admin() ) {
// Only create auto-draft of block template for editing
// in admin screens, similarly to how we do it for new
// posts in the editor.
$current_template_post = get_post(
wp_insert_post( $current_template_post )
);
} else {
$current_template_post = new WP_Post(
(object) $current_template_post
);
}
}

$_wp_current_template_content = $current_template_post->post_content;
}

// Add extra hooks for template canvas.
Expand All @@ -131,17 +179,15 @@ function gutenberg_render_title_tag() {
* Renders the markup for the current template.
*/
function gutenberg_render_the_template() {
global $_wp_current_template_post;
global $_wp_current_template_content;
global $wp_embed;

if ( ! $_wp_current_template_post || 'wp_template' !== $_wp_current_template_post->post_type ) {
if ( ! $_wp_current_template_content ) {
echo '<h1>' . esc_html__( 'No matching template found', 'gutenberg' ) . '</h1>';
return;
}

$content = $_wp_current_template_post->post_content;

$content = $wp_embed->run_shortcode( $content );
$content = $wp_embed->run_shortcode( $_wp_current_template_content );
$content = $wp_embed->autoembed( $content );
$content = do_blocks( $content );
$content = wptexturize( $content );
Expand Down
Loading