', $wrapper_attributes, $content );
}
/**
diff --git a/packages/block-library/src/post-excerpt/style.scss b/packages/block-library/src/post-excerpt/style.scss
new file mode 100644
index 00000000000000..e7b3e18491177e
--- /dev/null
+++ b/packages/block-library/src/post-excerpt/style.scss
@@ -0,0 +1,3 @@
+.wp-block-post-excerpt__more-link {
+ display: inline-block;
+}
diff --git a/packages/block-library/src/style.scss b/packages/block-library/src/style.scss
index 61735577c88258..50a06336c25b62 100644
--- a/packages/block-library/src/style.scss
+++ b/packages/block-library/src/style.scss
@@ -27,6 +27,7 @@
@import "./paragraph/style.scss";
@import "./post-author/style.scss";
@import "./post-comments-form/style.scss";
+@import "./post-excerpt/style.scss";
@import "./preformatted/style.scss";
@import "./pullquote/style.scss";
@import "./query-loop/style.scss";
From f2fb0b9966ef0d55a9ffd7313233f1337eb70cc8 Mon Sep 17 00:00:00 2001
From: Joen A <1204802+jasmussen@users.noreply.github.com>
Date: Tue, 6 Apr 2021 10:20:53 +0200
Subject: [PATCH 003/125] Fix fullwide regression. (#30520)
---
packages/block-library/src/reset.scss | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/packages/block-library/src/reset.scss b/packages/block-library/src/reset.scss
index 2890fde40b8a0d..8e9894f81b14f4 100644
--- a/packages/block-library/src/reset.scss
+++ b/packages/block-library/src/reset.scss
@@ -17,10 +17,11 @@
line-height: initial;
color: initial;
- // For full-wide blocks, we compensate for these 10px.
+ // For full-wide blocks, we compensate for the base padding.
+ // These margins should match the padding value above.
.block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"] {
- margin-left: -10px;
- margin-right: -10px;
+ margin-left: -8px;
+ margin-right: -8px;
}
.wp-align-wrapper {
From b5293ff7ceddea77f18d56357fe2cc7251a8beb4 Mon Sep 17 00:00:00 2001
From: Grzegorz Ziolkowski
Date: Tue, 6 Apr 2021 10:08:11 +0200
Subject: [PATCH 004/125] Update changelog files
---
packages/api-fetch/CHANGELOG.md | 2 ++
packages/api-fetch/package.json | 2 +-
packages/babel-preset-default/CHANGELOG.md | 2 ++
packages/babel-preset-default/package.json | 2 +-
packages/create-block-tutorial-template/CHANGELOG.md | 2 ++
packages/create-block-tutorial-template/package.json | 2 +-
packages/create-block/CHANGELOG.md | 2 ++
packages/create-block/package.json | 2 +-
packages/date/CHANGELOG.md | 2 ++
packages/date/package.json | 2 +-
packages/interface/CHANGELOG.md | 2 ++
packages/interface/package.json | 2 +-
packages/scripts/CHANGELOG.md | 2 ++
packages/scripts/package.json | 2 +-
14 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/packages/api-fetch/CHANGELOG.md b/packages/api-fetch/CHANGELOG.md
index b69ef5840fe9e4..713c493ab63115 100644
--- a/packages/api-fetch/CHANGELOG.md
+++ b/packages/api-fetch/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 3.23.0 (2021-04-06)
+
### New Feature
- Publish TypeScript definitions.
diff --git a/packages/api-fetch/package.json b/packages/api-fetch/package.json
index d19dedf66ab44d..c608af64bafd55 100644
--- a/packages/api-fetch/package.json
+++ b/packages/api-fetch/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/api-fetch",
- "version": "3.22.0",
+ "version": "3.23.0-prerelease",
"description": "Utility to make WordPress REST API requests.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/babel-preset-default/CHANGELOG.md b/packages/babel-preset-default/CHANGELOG.md
index b966b9757147ea..d8f5f0130a2c2a 100644
--- a/packages/babel-preset-default/CHANGELOG.md
+++ b/packages/babel-preset-default/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.2.0 (2021-04-06)
+
### Enhancements
- The bundled `@babel/core` dependency has been updated from requiring `^7.12.9` to requiring `^7.13.10` ([#30018](https://github.com/WordPress/gutenberg/pull/30018)).
diff --git a/packages/babel-preset-default/package.json b/packages/babel-preset-default/package.json
index 9757bf5caa02fd..52e24d2d97fb36 100644
--- a/packages/babel-preset-default/package.json
+++ b/packages/babel-preset-default/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/babel-preset-default",
- "version": "5.1.0",
+ "version": "5.2.0-prerelease",
"description": "Default Babel preset for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/create-block-tutorial-template/CHANGELOG.md b/packages/create-block-tutorial-template/CHANGELOG.md
index 004a0c6cacbda9..1044355d6a91c2 100644
--- a/packages/create-block-tutorial-template/CHANGELOG.md
+++ b/packages/create-block-tutorial-template/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 1.2.0 (2021-04-06)
+
### Enhancement
- Scaffolded plugin requires WordPress 5.7 now ([#29757](https://github.com/WordPress/gutenberg/pull/29757).
diff --git a/packages/create-block-tutorial-template/package.json b/packages/create-block-tutorial-template/package.json
index 5a60c5887d3099..4c846606b470d8 100644
--- a/packages/create-block-tutorial-template/package.json
+++ b/packages/create-block-tutorial-template/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/create-block-tutorial-template",
- "version": "1.1.0",
+ "version": "1.2.0-prerelease",
"description": "Template for @wordpress/create-block used in the official WordPress tutorial.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/create-block/CHANGELOG.md b/packages/create-block/CHANGELOG.md
index 0f1f8eb155ee95..f5f440220b8c0b 100644
--- a/packages/create-block/CHANGELOG.md
+++ b/packages/create-block/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 2.2.0 (2021-04-06)
+
### Enhancement
- Scaffolded plugin requires WordPress 5.7 now ([#29757](https://github.com/WordPress/gutenberg/pull/29757)).
diff --git a/packages/create-block/package.json b/packages/create-block/package.json
index c42d64d4b29329..7c6df7aa7d5a73 100644
--- a/packages/create-block/package.json
+++ b/packages/create-block/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/create-block",
- "version": "2.1.0",
+ "version": "2.2.0-prerelease",
"description": "Generates PHP, JS and CSS code for registering a block for a WordPress plugin.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/date/CHANGELOG.md b/packages/date/CHANGELOG.md
index 831375aefd6a12..37d9c84498cbd6 100644
--- a/packages/date/CHANGELOG.md
+++ b/packages/date/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 3.15.0 (2021-04-06)
+
### New Feature
- Bundle type definitions.
diff --git a/packages/date/package.json b/packages/date/package.json
index 94df3dbcfbd620..ef0ef2a082f334 100644
--- a/packages/date/package.json
+++ b/packages/date/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/date",
- "version": "3.14.0",
+ "version": "3.15.0-prerelease",
"description": "Date module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/interface/CHANGELOG.md b/packages/interface/CHANGELOG.md
index 8fe1eb16ff1a96..13392b234397a4 100644
--- a/packages/interface/CHANGELOG.md
+++ b/packages/interface/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 2.0.0 (2021-04-06)
+
### Breaking Changes
- Passing a tuple of components with `as` prop to `ActionItem.Slot` component is no longer supported. Please pass a component with `as` prop instead ([#30417](https://github.com/WordPress/gutenberg/pull/30417)).
diff --git a/packages/interface/package.json b/packages/interface/package.json
index cb73744455a39b..578d7d83d5e923 100644
--- a/packages/interface/package.json
+++ b/packages/interface/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/interface",
- "version": "1.1.0",
+ "version": "2.0.0-prerelease",
"description": "Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/scripts/CHANGELOG.md b/packages/scripts/CHANGELOG.md
index d246897734a572..7ca1dce263b8bb 100644
--- a/packages/scripts/CHANGELOG.md
+++ b/packages/scripts/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 14.1.0 (2021-04-06)
+
### Enhancements
- The bundled `babel-loader` dependency has been updated from requiring `^8.1.0` to requiring `^8.2.2` ([#30018](https://github.com/WordPress/gutenberg/pull/30018)).
diff --git a/packages/scripts/package.json b/packages/scripts/package.json
index c2573c916e54dc..3b59a505f3f61e 100644
--- a/packages/scripts/package.json
+++ b/packages/scripts/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/scripts",
- "version": "14.0.1",
+ "version": "14.1.0-prerelease",
"description": "Collection of reusable scripts for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
From 899286307be533a5643dd1dc168f32d92a204b64 Mon Sep 17 00:00:00 2001
From: Grzegorz Ziolkowski
Date: Tue, 6 Apr 2021 10:12:10 +0200
Subject: [PATCH 005/125] chore(release): publish
- @wordpress/a11y@2.15.1
- @wordpress/annotations@1.25.1
- @wordpress/api-fetch@3.23.0
- @wordpress/autop@2.12.1
- @wordpress/babel-plugin-import-jsx-pragma@3.0.2
- @wordpress/babel-plugin-makepot@4.1.1
- @wordpress/babel-preset-default@5.2.0
- @wordpress/base-styles@3.4.1
- @wordpress/blob@2.13.1
- @wordpress/block-directory@1.19.1
- @wordpress/block-editor@5.3.1
- @wordpress/block-library@2.29.1
- @wordpress/block-serialization-default-parser@3.10.1
- @wordpress/block-serialization-spec-parser@3.8.1
- @wordpress/blocks@8.0.1
- @wordpress/browserslist-config@3.0.2
- @wordpress/components@13.0.1
- @wordpress/compose@3.25.1
- @wordpress/core-data@2.26.1
- @wordpress/create-block-tutorial-template@1.2.0
- @wordpress/create-block@2.2.0
- @wordpress/custom-templated-path-webpack-plugin@2.0.2
- @wordpress/data-controls@1.21.1
- @wordpress/data@4.27.1
- @wordpress/date@3.15.0
- @wordpress/dependency-extraction-webpack-plugin@3.1.1
- @wordpress/deprecated@2.12.1
- @wordpress/docgen@1.16.1
- @wordpress/dom-ready@2.13.1
- @wordpress/dom@2.17.1
- @wordpress/e2e-test-utils@5.1.1
- @wordpress/e2e-tests@2.1.2
- @wordpress/edit-post@3.27.1
- @wordpress/edit-site@1.17.1
- @wordpress/edit-widgets@1.3.1
- @wordpress/editor@9.26.1
- @wordpress/element@2.20.1
- @wordpress/env@4.0.1
- @wordpress/escape-html@1.12.1
- @wordpress/eslint-plugin@9.0.2
- @wordpress/format-library@1.27.1
- @wordpress/hooks@2.12.1
- @wordpress/html-entities@2.11.1
- @wordpress/i18n@3.19.1
- @wordpress/icons@2.10.1
- @wordpress/interface@2.0.0
- @wordpress/is-shallow-equal@3.1.1
- @wordpress/jest-console@4.0.2
- @wordpress/jest-preset-default@7.0.2
- @wordpress/jest-puppeteer-axe@3.0.2
- @wordpress/keyboard-shortcuts@1.14.1
- @wordpress/keycodes@2.19.1
- @wordpress/lazy-import@1.2.2
- @wordpress/library-export-default-webpack-plugin@2.0.2
- @wordpress/list-reusable-blocks@1.26.1
- @wordpress/media-utils@1.20.1
- @wordpress/notices@2.13.1
- @wordpress/npm-package-json-lint-config@4.0.2
- @wordpress/nux@3.25.1
- @wordpress/plugins@2.25.1
- @wordpress/postcss-plugins-preset@2.1.1
- @wordpress/postcss-themes@3.0.2
- @wordpress/prettier-config@1.0.2
- @wordpress/primitives@1.12.1
- @wordpress/priority-queue@1.11.1
- @wordpress/project-management-automation@1.12.1
- @wordpress/react-i18n@1.0.1
- @wordpress/redux-routine@3.14.1
- @wordpress/reusable-blocks@1.2.1
- @wordpress/rich-text@3.25.1
- @wordpress/scripts@14.1.0
- @wordpress/server-side-render@1.21.1
- @wordpress/shortcode@2.13.1
- @wordpress/stylelint-config@19.0.2
- @wordpress/token-list@1.15.1
- @wordpress/url@2.22.1
- @wordpress/viewport@2.26.1
- @wordpress/warning@1.4.1
- @wordpress/wordcount@2.15.1
---
packages/a11y/package.json | 2 +-
packages/annotations/package.json | 2 +-
packages/api-fetch/package.json | 2 +-
packages/autop/package.json | 2 +-
packages/babel-plugin-import-jsx-pragma/package.json | 2 +-
packages/babel-plugin-makepot/package.json | 2 +-
packages/babel-preset-default/package.json | 2 +-
packages/base-styles/package.json | 2 +-
packages/blob/package.json | 2 +-
packages/block-directory/package.json | 2 +-
packages/block-editor/package.json | 2 +-
packages/block-library/package.json | 2 +-
packages/block-serialization-default-parser/package.json | 2 +-
packages/block-serialization-spec-parser/package.json | 2 +-
packages/blocks/package.json | 2 +-
packages/browserslist-config/package.json | 2 +-
packages/components/package.json | 2 +-
packages/compose/package.json | 2 +-
packages/core-data/package.json | 2 +-
packages/create-block-tutorial-template/package.json | 2 +-
packages/create-block/package.json | 2 +-
packages/custom-templated-path-webpack-plugin/package.json | 2 +-
packages/data-controls/package.json | 2 +-
packages/data/package.json | 2 +-
packages/date/package.json | 2 +-
packages/dependency-extraction-webpack-plugin/package.json | 2 +-
packages/deprecated/package.json | 2 +-
packages/docgen/package.json | 2 +-
packages/dom-ready/package.json | 2 +-
packages/dom/package.json | 2 +-
packages/e2e-test-utils/package.json | 2 +-
packages/e2e-tests/package.json | 2 +-
packages/edit-post/package.json | 2 +-
packages/edit-site/package.json | 2 +-
packages/edit-widgets/package.json | 2 +-
packages/editor/package.json | 2 +-
packages/element/package.json | 2 +-
packages/env/package.json | 2 +-
packages/escape-html/package.json | 2 +-
packages/eslint-plugin/package.json | 2 +-
packages/format-library/package.json | 2 +-
packages/hooks/package.json | 2 +-
packages/html-entities/package.json | 2 +-
packages/i18n/package.json | 2 +-
packages/icons/package.json | 2 +-
packages/interface/package.json | 2 +-
packages/is-shallow-equal/package.json | 2 +-
packages/jest-console/package.json | 2 +-
packages/jest-preset-default/package.json | 2 +-
packages/jest-puppeteer-axe/package.json | 2 +-
packages/keyboard-shortcuts/package.json | 2 +-
packages/keycodes/package.json | 2 +-
packages/lazy-import/package.json | 2 +-
packages/library-export-default-webpack-plugin/package.json | 2 +-
packages/list-reusable-blocks/package.json | 2 +-
packages/media-utils/package.json | 2 +-
packages/notices/package.json | 2 +-
packages/npm-package-json-lint-config/package.json | 2 +-
packages/nux/package.json | 2 +-
packages/plugins/package.json | 2 +-
packages/postcss-plugins-preset/package.json | 2 +-
packages/postcss-themes/package.json | 2 +-
packages/prettier-config/package.json | 2 +-
packages/primitives/package.json | 2 +-
packages/priority-queue/package.json | 2 +-
packages/project-management-automation/package.json | 2 +-
packages/react-i18n/package.json | 2 +-
packages/redux-routine/package.json | 2 +-
packages/reusable-blocks/package.json | 2 +-
packages/rich-text/package.json | 2 +-
packages/scripts/package.json | 2 +-
packages/server-side-render/package.json | 2 +-
packages/shortcode/package.json | 2 +-
packages/stylelint-config/package.json | 2 +-
packages/token-list/package.json | 2 +-
packages/url/package.json | 2 +-
packages/viewport/package.json | 2 +-
packages/warning/package.json | 2 +-
packages/wordcount/package.json | 2 +-
79 files changed, 79 insertions(+), 79 deletions(-)
diff --git a/packages/a11y/package.json b/packages/a11y/package.json
index 90a10c4e5172f4..c7d0fb8216b510 100644
--- a/packages/a11y/package.json
+++ b/packages/a11y/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/a11y",
- "version": "2.15.0",
+ "version": "2.15.1",
"description": "Accessibility (a11y) utilities for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/annotations/package.json b/packages/annotations/package.json
index 88aa5eb0bc0a82..a8fbd8d65f1f74 100644
--- a/packages/annotations/package.json
+++ b/packages/annotations/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/annotations",
- "version": "1.25.0",
+ "version": "1.25.1",
"description": "Annotate content in the Gutenberg editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/api-fetch/package.json b/packages/api-fetch/package.json
index c608af64bafd55..4a253d7c61181a 100644
--- a/packages/api-fetch/package.json
+++ b/packages/api-fetch/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/api-fetch",
- "version": "3.23.0-prerelease",
+ "version": "3.23.0",
"description": "Utility to make WordPress REST API requests.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/autop/package.json b/packages/autop/package.json
index b798cca499b356..2b496fdfc98e43 100644
--- a/packages/autop/package.json
+++ b/packages/autop/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/autop",
- "version": "2.12.0",
+ "version": "2.12.1",
"description": "WordPress's automatic paragraph functions `autop` and `removep`.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/babel-plugin-import-jsx-pragma/package.json b/packages/babel-plugin-import-jsx-pragma/package.json
index 911417bd509ca6..f8cfd18cd043a6 100644
--- a/packages/babel-plugin-import-jsx-pragma/package.json
+++ b/packages/babel-plugin-import-jsx-pragma/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/babel-plugin-import-jsx-pragma",
- "version": "3.0.1",
+ "version": "3.0.2",
"description": "Babel transform plugin for automatically injecting an import to be used as the pragma for the React JSX Transform plugin.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/babel-plugin-makepot/package.json b/packages/babel-plugin-makepot/package.json
index 84cf5c9d4b011b..bd58664eae8b01 100644
--- a/packages/babel-plugin-makepot/package.json
+++ b/packages/babel-plugin-makepot/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/babel-plugin-makepot",
- "version": "4.1.0",
+ "version": "4.1.1",
"description": "WordPress Babel internationalization (i18n) plugin.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/babel-preset-default/package.json b/packages/babel-preset-default/package.json
index 52e24d2d97fb36..ee497208fd5fa0 100644
--- a/packages/babel-preset-default/package.json
+++ b/packages/babel-preset-default/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/babel-preset-default",
- "version": "5.2.0-prerelease",
+ "version": "5.2.0",
"description": "Default Babel preset for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/base-styles/package.json b/packages/base-styles/package.json
index 98820fdd73634e..e48030208b4866 100644
--- a/packages/base-styles/package.json
+++ b/packages/base-styles/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/base-styles",
- "version": "3.4.0",
+ "version": "3.4.1",
"description": "Base SCSS utilities and variables for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/blob/package.json b/packages/blob/package.json
index 8e6afc34e1ce81..1e992112231450 100644
--- a/packages/blob/package.json
+++ b/packages/blob/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/blob",
- "version": "2.13.0",
+ "version": "2.13.1",
"description": "Blob utilities for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/block-directory/package.json b/packages/block-directory/package.json
index 3842faaf1688dd..8030c99ad45250 100644
--- a/packages/block-directory/package.json
+++ b/packages/block-directory/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-directory",
- "version": "1.19.0",
+ "version": "1.19.1",
"description": "Extend editor with block directory features to search, download and install blocks.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/block-editor/package.json b/packages/block-editor/package.json
index ca8c954dc53e2d..f2a1c71191c5f8 100644
--- a/packages/block-editor/package.json
+++ b/packages/block-editor/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-editor",
- "version": "5.3.0",
+ "version": "5.3.1",
"description": "Generic block editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/block-library/package.json b/packages/block-library/package.json
index a08d7dbdf1d435..b3c877980084a7 100644
--- a/packages/block-library/package.json
+++ b/packages/block-library/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-library",
- "version": "2.29.0",
+ "version": "2.29.1",
"description": "Block library for the WordPress editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/block-serialization-default-parser/package.json b/packages/block-serialization-default-parser/package.json
index 6840b77e78a28d..971f2e699ff030 100644
--- a/packages/block-serialization-default-parser/package.json
+++ b/packages/block-serialization-default-parser/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-serialization-default-parser",
- "version": "3.10.0",
+ "version": "3.10.1",
"description": "Block serialization specification parser for WordPress posts.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/block-serialization-spec-parser/package.json b/packages/block-serialization-spec-parser/package.json
index 9e31cfd05d4e20..98b5d9215df539 100644
--- a/packages/block-serialization-spec-parser/package.json
+++ b/packages/block-serialization-spec-parser/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-serialization-spec-parser",
- "version": "3.8.0",
+ "version": "3.8.1",
"description": "Block serialization specification parser for WordPress posts.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/blocks/package.json b/packages/blocks/package.json
index f85da354ec8ee4..90fbe55e5724ff 100644
--- a/packages/blocks/package.json
+++ b/packages/blocks/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/blocks",
- "version": "8.0.0",
+ "version": "8.0.1",
"description": "Block API for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/browserslist-config/package.json b/packages/browserslist-config/package.json
index c77ef09ee229f8..49247cfa5b6e85 100644
--- a/packages/browserslist-config/package.json
+++ b/packages/browserslist-config/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/browserslist-config",
- "version": "3.0.1",
+ "version": "3.0.2",
"description": "WordPress Browserslist shared configuration.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/components/package.json b/packages/components/package.json
index 94a149c75f907a..aae55b5eea34ca 100644
--- a/packages/components/package.json
+++ b/packages/components/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/components",
- "version": "13.0.0",
+ "version": "13.0.1",
"description": "UI components for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/compose/package.json b/packages/compose/package.json
index 9165672206d97b..1bd92b05d76715 100644
--- a/packages/compose/package.json
+++ b/packages/compose/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/compose",
- "version": "3.25.0",
+ "version": "3.25.1",
"description": "WordPress higher-order components (HOCs).",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/core-data/package.json b/packages/core-data/package.json
index cf26b01a42e066..c045146b1eff43 100644
--- a/packages/core-data/package.json
+++ b/packages/core-data/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/core-data",
- "version": "2.26.0",
+ "version": "2.26.1",
"description": "Access to and manipulation of core WordPress entities.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/create-block-tutorial-template/package.json b/packages/create-block-tutorial-template/package.json
index 4c846606b470d8..25878b301a718e 100644
--- a/packages/create-block-tutorial-template/package.json
+++ b/packages/create-block-tutorial-template/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/create-block-tutorial-template",
- "version": "1.2.0-prerelease",
+ "version": "1.2.0",
"description": "Template for @wordpress/create-block used in the official WordPress tutorial.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/create-block/package.json b/packages/create-block/package.json
index 7c6df7aa7d5a73..af92fef98d09b9 100644
--- a/packages/create-block/package.json
+++ b/packages/create-block/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/create-block",
- "version": "2.2.0-prerelease",
+ "version": "2.2.0",
"description": "Generates PHP, JS and CSS code for registering a block for a WordPress plugin.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/custom-templated-path-webpack-plugin/package.json b/packages/custom-templated-path-webpack-plugin/package.json
index 52a7c6b311c4f7..a0ca1f46660be1 100644
--- a/packages/custom-templated-path-webpack-plugin/package.json
+++ b/packages/custom-templated-path-webpack-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/custom-templated-path-webpack-plugin",
- "version": "2.0.1",
+ "version": "2.0.2",
"description": "Webpack plugin for creating custom path template tags.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/data-controls/package.json b/packages/data-controls/package.json
index 75d94c55c37c3c..c07169187ff0b3 100644
--- a/packages/data-controls/package.json
+++ b/packages/data-controls/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/data-controls",
- "version": "1.21.0",
+ "version": "1.21.1",
"description": "A set of common controls for the @wordpress/data api.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/data/package.json b/packages/data/package.json
index f601037fff3216..58bb49e8e7b4d0 100644
--- a/packages/data/package.json
+++ b/packages/data/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/data",
- "version": "4.27.0",
+ "version": "4.27.1",
"description": "Data module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/date/package.json b/packages/date/package.json
index ef0ef2a082f334..339a16efc89c4a 100644
--- a/packages/date/package.json
+++ b/packages/date/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/date",
- "version": "3.15.0-prerelease",
+ "version": "3.15.0",
"description": "Date module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/dependency-extraction-webpack-plugin/package.json b/packages/dependency-extraction-webpack-plugin/package.json
index 95097596f2f4aa..1638be3898b68b 100644
--- a/packages/dependency-extraction-webpack-plugin/package.json
+++ b/packages/dependency-extraction-webpack-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/dependency-extraction-webpack-plugin",
- "version": "3.1.0",
+ "version": "3.1.1",
"description": "Extract WordPress script dependencies from webpack bundles.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/deprecated/package.json b/packages/deprecated/package.json
index 6a9a552ac0863f..f17158b8905ad8 100644
--- a/packages/deprecated/package.json
+++ b/packages/deprecated/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/deprecated",
- "version": "2.12.0",
+ "version": "2.12.1",
"description": "Deprecation utility for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/docgen/package.json b/packages/docgen/package.json
index e6846fde1d4184..c516c61ef60292 100644
--- a/packages/docgen/package.json
+++ b/packages/docgen/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/docgen",
- "version": "1.16.0",
+ "version": "1.16.1",
"description": "Autogenerate public API documentation from exports and JSDoc comments.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/dom-ready/package.json b/packages/dom-ready/package.json
index 0f16aa2adb3e55..1e833be3ac99dd 100644
--- a/packages/dom-ready/package.json
+++ b/packages/dom-ready/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/dom-ready",
- "version": "2.13.0",
+ "version": "2.13.1",
"description": "Execute callback after the DOM is loaded.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/dom/package.json b/packages/dom/package.json
index 2fabf1204c0e64..066598d9ba49bc 100644
--- a/packages/dom/package.json
+++ b/packages/dom/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/dom",
- "version": "2.17.0",
+ "version": "2.17.1",
"description": "DOM utilities module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/e2e-test-utils/package.json b/packages/e2e-test-utils/package.json
index 89e25d997e5c99..7fb0bd843c98fc 100644
--- a/packages/e2e-test-utils/package.json
+++ b/packages/e2e-test-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/e2e-test-utils",
- "version": "5.1.0",
+ "version": "5.1.1",
"description": "End-To-End (E2E) test utils for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json
index e7f28f8137126a..511874e6021943 100644
--- a/packages/e2e-tests/package.json
+++ b/packages/e2e-tests/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/e2e-tests",
- "version": "2.1.1",
+ "version": "2.1.2",
"description": "End-To-End (E2E) tests for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/edit-post/package.json b/packages/edit-post/package.json
index 2d5f7af3c145d9..535240e3950aac 100644
--- a/packages/edit-post/package.json
+++ b/packages/edit-post/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/edit-post",
- "version": "3.27.0",
+ "version": "3.27.1",
"description": "Edit Post module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/edit-site/package.json b/packages/edit-site/package.json
index c24367cff3fc56..cb69cd56dbd3b3 100644
--- a/packages/edit-site/package.json
+++ b/packages/edit-site/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/edit-site",
- "version": "1.17.0",
+ "version": "1.17.1",
"description": "Edit Site Page module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/edit-widgets/package.json b/packages/edit-widgets/package.json
index 6daa7221451ebf..8842784ed0b474 100644
--- a/packages/edit-widgets/package.json
+++ b/packages/edit-widgets/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/edit-widgets",
- "version": "1.3.0",
+ "version": "1.3.1",
"description": "Widgets Page module for WordPress..",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/editor/package.json b/packages/editor/package.json
index 07de55c5868861..4d34408ad1d939 100644
--- a/packages/editor/package.json
+++ b/packages/editor/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/editor",
- "version": "9.26.0",
+ "version": "9.26.1",
"description": "Enhanced block editor for WordPress posts.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/element/package.json b/packages/element/package.json
index b072325d18283a..a6902344fec291 100644
--- a/packages/element/package.json
+++ b/packages/element/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/element",
- "version": "2.20.0",
+ "version": "2.20.1",
"description": "Element React module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/env/package.json b/packages/env/package.json
index 39e1c32e2a75e0..35a39702fdebf3 100644
--- a/packages/env/package.json
+++ b/packages/env/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/env",
- "version": "4.0.0",
+ "version": "4.0.1",
"description": "A zero-config, self contained local WordPress environment for development and testing.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/escape-html/package.json b/packages/escape-html/package.json
index cbbf3119984f67..9fbf57f03b8710 100644
--- a/packages/escape-html/package.json
+++ b/packages/escape-html/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/escape-html",
- "version": "1.12.0",
+ "version": "1.12.1",
"description": "Escape HTML utils.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json
index f05aa17fae5b01..14f9aa62d91315 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/eslint-plugin",
- "version": "9.0.1",
+ "version": "9.0.2",
"description": "ESLint plugin for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/format-library/package.json b/packages/format-library/package.json
index 53a0f38e57a395..6a9afd017ccb76 100644
--- a/packages/format-library/package.json
+++ b/packages/format-library/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/format-library",
- "version": "1.27.0",
+ "version": "1.27.1",
"description": "Format library for the WordPress editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/hooks/package.json b/packages/hooks/package.json
index cc3eea4f6f8787..adffe4477a29e4 100644
--- a/packages/hooks/package.json
+++ b/packages/hooks/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/hooks",
- "version": "2.12.0",
+ "version": "2.12.1",
"description": "WordPress hooks library.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/html-entities/package.json b/packages/html-entities/package.json
index 094f0ddfc81e67..4fb9d4a6b895b0 100644
--- a/packages/html-entities/package.json
+++ b/packages/html-entities/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/html-entities",
- "version": "2.11.0",
+ "version": "2.11.1",
"description": "HTML entity utilities for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/i18n/package.json b/packages/i18n/package.json
index 72e169346cffd9..d08084e6a655ed 100644
--- a/packages/i18n/package.json
+++ b/packages/i18n/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/i18n",
- "version": "3.19.0",
+ "version": "3.19.1",
"description": "WordPress internationalization (i18n) library.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/icons/package.json b/packages/icons/package.json
index 423a4ecdf7630e..c3bb1a1ee86086 100644
--- a/packages/icons/package.json
+++ b/packages/icons/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/icons",
- "version": "2.10.0",
+ "version": "2.10.1",
"description": "WordPress Icons package, based on dashicon.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/interface/package.json b/packages/interface/package.json
index 578d7d83d5e923..36f66c0fe3e0b8 100644
--- a/packages/interface/package.json
+++ b/packages/interface/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/interface",
- "version": "2.0.0-prerelease",
+ "version": "2.0.0",
"description": "Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/is-shallow-equal/package.json b/packages/is-shallow-equal/package.json
index 16f14b78d6c94b..41015ebbb29014 100644
--- a/packages/is-shallow-equal/package.json
+++ b/packages/is-shallow-equal/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/is-shallow-equal",
- "version": "3.1.0",
+ "version": "3.1.1",
"description": "Test for shallow equality between two objects or arrays.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/jest-console/package.json b/packages/jest-console/package.json
index 71b592a5cf401a..d488edef91eff6 100644
--- a/packages/jest-console/package.json
+++ b/packages/jest-console/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/jest-console",
- "version": "4.0.1",
+ "version": "4.0.2",
"description": "Custom Jest matchers for the Console object.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/jest-preset-default/package.json b/packages/jest-preset-default/package.json
index 4e04d66575bac2..2d39d055adaed8 100644
--- a/packages/jest-preset-default/package.json
+++ b/packages/jest-preset-default/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/jest-preset-default",
- "version": "7.0.1",
+ "version": "7.0.2",
"description": "Default Jest preset for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/jest-puppeteer-axe/package.json b/packages/jest-puppeteer-axe/package.json
index e1e4fd1f2327dc..607ea7447afee0 100644
--- a/packages/jest-puppeteer-axe/package.json
+++ b/packages/jest-puppeteer-axe/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/jest-puppeteer-axe",
- "version": "3.0.1",
+ "version": "3.0.2",
"description": "Axe API integration with Jest and Puppeteer.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/keyboard-shortcuts/package.json b/packages/keyboard-shortcuts/package.json
index 5e25e4829cc2ef..0723873ad6e203 100644
--- a/packages/keyboard-shortcuts/package.json
+++ b/packages/keyboard-shortcuts/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/keyboard-shortcuts",
- "version": "1.14.0",
+ "version": "1.14.1",
"description": "Handling keyboard shortcuts.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/keycodes/package.json b/packages/keycodes/package.json
index 835b65df347ec6..715dc24c293eff 100644
--- a/packages/keycodes/package.json
+++ b/packages/keycodes/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/keycodes",
- "version": "2.19.0",
+ "version": "2.19.1",
"description": "Keycodes utilities for WordPress. Used to check for keyboard events across browsers/operating systems.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/lazy-import/package.json b/packages/lazy-import/package.json
index cdabf38f10e2d8..63adc1811da0ae 100644
--- a/packages/lazy-import/package.json
+++ b/packages/lazy-import/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/lazy-import",
- "version": "1.2.1",
+ "version": "1.2.2",
"description": "Lazily import a module, installing it automatically if missing.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/library-export-default-webpack-plugin/package.json b/packages/library-export-default-webpack-plugin/package.json
index 0ab9346677be94..4232c777b812d0 100644
--- a/packages/library-export-default-webpack-plugin/package.json
+++ b/packages/library-export-default-webpack-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/library-export-default-webpack-plugin",
- "version": "2.0.1",
+ "version": "2.0.2",
"description": "Webpack plugin for exporting default property for selected libraries.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/list-reusable-blocks/package.json b/packages/list-reusable-blocks/package.json
index ad54ffa8027a13..2d79b7b0823f7a 100644
--- a/packages/list-reusable-blocks/package.json
+++ b/packages/list-reusable-blocks/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/list-reusable-blocks",
- "version": "1.26.0",
+ "version": "1.26.1",
"description": "Adding Export/Import support to the reusable blocks listing.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/media-utils/package.json b/packages/media-utils/package.json
index 8fd428398f3c20..eb1c9fbe6a323a 100644
--- a/packages/media-utils/package.json
+++ b/packages/media-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/media-utils",
- "version": "1.20.0",
+ "version": "1.20.1",
"description": "WordPress Media Upload Utils.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/notices/package.json b/packages/notices/package.json
index b03242933a39f0..cf4a505b64c43e 100644
--- a/packages/notices/package.json
+++ b/packages/notices/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/notices",
- "version": "2.13.0",
+ "version": "2.13.1",
"description": "State management for notices.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/npm-package-json-lint-config/package.json b/packages/npm-package-json-lint-config/package.json
index 52d2d789c460de..c374dcb7d12f0a 100644
--- a/packages/npm-package-json-lint-config/package.json
+++ b/packages/npm-package-json-lint-config/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/npm-package-json-lint-config",
- "version": "4.0.1",
+ "version": "4.0.2",
"description": "WordPress npm-package-json-lint shareable configuration.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/nux/package.json b/packages/nux/package.json
index 3bfa3d24319c0a..388a688f882078 100644
--- a/packages/nux/package.json
+++ b/packages/nux/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/nux",
- "version": "3.25.0",
+ "version": "3.25.1",
"description": "NUX (New User eXperience) module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/plugins/package.json b/packages/plugins/package.json
index 1b29f991433ffe..5e6f877f112749 100644
--- a/packages/plugins/package.json
+++ b/packages/plugins/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/plugins",
- "version": "2.25.0",
+ "version": "2.25.1",
"description": "Plugins module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/postcss-plugins-preset/package.json b/packages/postcss-plugins-preset/package.json
index e771d7c2abb6a3..c23581582b5e7a 100644
--- a/packages/postcss-plugins-preset/package.json
+++ b/packages/postcss-plugins-preset/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/postcss-plugins-preset",
- "version": "2.1.0",
+ "version": "2.1.1",
"description": "PostCSS sharable plugins preset for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/postcss-themes/package.json b/packages/postcss-themes/package.json
index feeddd53ef1f5d..a7525a70143328 100644
--- a/packages/postcss-themes/package.json
+++ b/packages/postcss-themes/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/postcss-themes",
- "version": "3.0.1",
+ "version": "3.0.2",
"description": "PostCSS plugin to generate theme colors.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/prettier-config/package.json b/packages/prettier-config/package.json
index 0b6e79149c4fb6..07a487e74633e4 100644
--- a/packages/prettier-config/package.json
+++ b/packages/prettier-config/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/prettier-config",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "WordPress Prettier shared configuration.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/primitives/package.json b/packages/primitives/package.json
index e6a22c9fb34064..09eed904263576 100644
--- a/packages/primitives/package.json
+++ b/packages/primitives/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/primitives",
- "version": "1.12.0",
+ "version": "1.12.1",
"description": "WordPress cross-platform primitives.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/priority-queue/package.json b/packages/priority-queue/package.json
index 50a9d7d9e1414d..934abadc7e510f 100644
--- a/packages/priority-queue/package.json
+++ b/packages/priority-queue/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/priority-queue",
- "version": "1.11.0",
+ "version": "1.11.1",
"description": "Generic browser priority queue.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/project-management-automation/package.json b/packages/project-management-automation/package.json
index d9feff55a0c8fa..9fa55f873de621 100644
--- a/packages/project-management-automation/package.json
+++ b/packages/project-management-automation/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/project-management-automation",
- "version": "1.12.0",
+ "version": "1.12.1",
"description": "GitHub Action that implements various automation to assist with managing the Gutenberg GitHub repository.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/react-i18n/package.json b/packages/react-i18n/package.json
index 6b93601635c721..0ede28f0433136 100644
--- a/packages/react-i18n/package.json
+++ b/packages/react-i18n/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/react-i18n",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "React bindings for @wordpress/i18n.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/redux-routine/package.json b/packages/redux-routine/package.json
index baca540dee7df9..2a48bd93d4b1a6 100644
--- a/packages/redux-routine/package.json
+++ b/packages/redux-routine/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/redux-routine",
- "version": "3.14.0",
+ "version": "3.14.1",
"description": "Redux middleware for generator coroutines.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/reusable-blocks/package.json b/packages/reusable-blocks/package.json
index 3571fbaf791879..dddf1fc75fb9e4 100644
--- a/packages/reusable-blocks/package.json
+++ b/packages/reusable-blocks/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/reusable-blocks",
- "version": "1.2.0",
+ "version": "1.2.1",
"description": "Reusable blocks utilities.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/rich-text/package.json b/packages/rich-text/package.json
index 969604faf28b79..bb8237be5123d0 100644
--- a/packages/rich-text/package.json
+++ b/packages/rich-text/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/rich-text",
- "version": "3.25.0",
+ "version": "3.25.1",
"description": "Rich text value and manipulation API.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/scripts/package.json b/packages/scripts/package.json
index 3b59a505f3f61e..d77fc29cadfe8c 100644
--- a/packages/scripts/package.json
+++ b/packages/scripts/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/scripts",
- "version": "14.1.0-prerelease",
+ "version": "14.1.0",
"description": "Collection of reusable scripts for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/server-side-render/package.json b/packages/server-side-render/package.json
index 41c4df74b4a2d5..5199c0929d07d7 100644
--- a/packages/server-side-render/package.json
+++ b/packages/server-side-render/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/server-side-render",
- "version": "1.21.0",
+ "version": "1.21.1",
"description": "The component used with WordPress to server-side render a preview of dynamic blocks to display in the editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/shortcode/package.json b/packages/shortcode/package.json
index 866e44031d6c27..f57fcf672d98b1 100644
--- a/packages/shortcode/package.json
+++ b/packages/shortcode/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/shortcode",
- "version": "2.13.0",
+ "version": "2.13.1",
"description": "Shortcode module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/stylelint-config/package.json b/packages/stylelint-config/package.json
index c67d85d287400c..7bedb0062e090d 100644
--- a/packages/stylelint-config/package.json
+++ b/packages/stylelint-config/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/stylelint-config",
- "version": "19.0.1",
+ "version": "19.0.2",
"description": "stylelint config for WordPress development.",
"author": "The WordPress Contributors",
"license": "MIT",
diff --git a/packages/token-list/package.json b/packages/token-list/package.json
index 7447295f485208..cbf2d21fc7f6b5 100644
--- a/packages/token-list/package.json
+++ b/packages/token-list/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/token-list",
- "version": "1.15.0",
+ "version": "1.15.1",
"description": "Constructable, plain JavaScript DOMTokenList implementation, supporting non-browser runtimes.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/url/package.json b/packages/url/package.json
index 5dffbea26b43d4..4b6e45992a99a7 100644
--- a/packages/url/package.json
+++ b/packages/url/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/url",
- "version": "2.22.0",
+ "version": "2.22.1",
"description": "WordPress URL utilities.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/viewport/package.json b/packages/viewport/package.json
index f6d3f1d1e31dfb..7befbacb490770 100644
--- a/packages/viewport/package.json
+++ b/packages/viewport/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/viewport",
- "version": "2.26.0",
+ "version": "2.26.1",
"description": "Viewport module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/warning/package.json b/packages/warning/package.json
index 6ea1a0670cffa9..a8cc6b296ef0d1 100644
--- a/packages/warning/package.json
+++ b/packages/warning/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/warning",
- "version": "1.4.0",
+ "version": "1.4.1",
"description": "Warning utility for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/wordcount/package.json b/packages/wordcount/package.json
index feb5680bd5d111..38384c3488f19a 100644
--- a/packages/wordcount/package.json
+++ b/packages/wordcount/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/wordcount",
- "version": "2.15.0",
+ "version": "2.15.1",
"description": "WordPress word count utility.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
From efd90deb58fd04aa1e342cb377c9ff8158022f8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9?=
Date: Tue, 6 Apr 2021 12:47:56 +0200
Subject: [PATCH 006/125] Use "Custom Styles" title to signal there are global
styles changes in the saving panel of the site editor (#30521)
* Set title in the global styles CPT
* Enable title for CPT
---
lib/class-wp-theme-json-resolver.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/class-wp-theme-json-resolver.php b/lib/class-wp-theme-json-resolver.php
index 6815dc68ecca2e..bacadea73bb7a2 100644
--- a/lib/class-wp-theme-json-resolver.php
+++ b/lib/class-wp-theme-json-resolver.php
@@ -362,6 +362,7 @@ private static function get_user_data_from_custom_post_type( $should_create_cpt
array(
'post_content' => '{}',
'post_status' => 'publish',
+ 'post_title' => __( 'Custom Styles' ),
'post_type' => $post_type_filter,
'post_name' => $post_name_filter,
),
@@ -471,6 +472,7 @@ public static function register_user_custom_post_type() {
),
'map_meta_cap' => true,
'supports' => array(
+ 'title',
'editor',
'revisions',
),
From b28dc9e69ed475c6969e5a3f9261ab9895de4ce1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?=
Date: Tue, 6 Apr 2021 13:05:12 +0200
Subject: [PATCH 007/125] Server side renderer: Fix errors in template part
editor context (#29246)
---
packages/server-side-render/src/index.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/packages/server-side-render/src/index.js b/packages/server-side-render/src/index.js
index 30af329d429a5f..5797d784743dd1 100644
--- a/packages/server-side-render/src/index.js
+++ b/packages/server-side-render/src/index.js
@@ -19,7 +19,11 @@ const ExportedServerSideRender = withSelect( ( select ) => {
const coreEditorSelect = select( 'core/editor' );
if ( coreEditorSelect ) {
const currentPostId = coreEditorSelect.getCurrentPostId();
- if ( currentPostId ) {
+ // For templates and template parts we use a custom ID format.
+ // Since they aren't real posts, we don't want to use their ID
+ // for server-side rendering. Since they use a string based ID,
+ // we can assume real post IDs are numbers.
+ if ( currentPostId && typeof currentPostId.id === 'number' ) {
return {
currentPostId,
};
From ea2f6f83152f21beb4914e38f91825479acf4769 Mon Sep 17 00:00:00 2001
From: Grzegorz
Date: Tue, 6 Apr 2021 13:17:22 +0200
Subject: [PATCH 008/125] revert #27717 (#30524)
Co-authored-by: grzim
---
.../src/components/post-text-editor/index.js | 18 +++-----------
.../components/post-text-editor/test/index.js | 24 ++-----------------
2 files changed, 5 insertions(+), 37 deletions(-)
diff --git a/packages/editor/src/components/post-text-editor/index.js b/packages/editor/src/components/post-text-editor/index.js
index 577f4741927018..b764c02014f44f 100644
--- a/packages/editor/src/components/post-text-editor/index.js
+++ b/packages/editor/src/components/post-text-editor/index.js
@@ -7,13 +7,12 @@ import Textarea from 'react-autosize-textarea';
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
-import { useState, useEffect } from '@wordpress/element';
+import { useState } from '@wordpress/element';
import { parse } from '@wordpress/blocks';
import { useDispatch, useSelect } from '@wordpress/data';
import { useInstanceId } from '@wordpress/compose';
import { VisuallyHidden } from '@wordpress/components';
-export const DEBOUNCE_TIME = 300;
export default function PostTextEditor() {
const postContent = useSelect(
( select ) => select( 'core/editor' ).getEditedPostContent(),
@@ -30,18 +29,6 @@ export default function PostTextEditor() {
setValue( postContent );
}
- const saveText = () => {
- const blocks = parse( value );
- resetEditorBlocks( blocks );
- };
-
- useEffect( () => {
- const timeoutId = setTimeout( saveText, DEBOUNCE_TIME );
- return () => {
- clearTimeout( timeoutId );
- };
- }, [ value ] );
-
/**
* Handles a textarea change event to notify the onChange prop callback and
* reflect the new value in the component's own state. This marks the start
@@ -67,7 +54,8 @@ export default function PostTextEditor() {
*/
const stopEditing = () => {
if ( isDirty ) {
- saveText();
+ const blocks = parse( value );
+ resetEditorBlocks( blocks );
setIsDirty( false );
}
};
diff --git a/packages/editor/src/components/post-text-editor/test/index.js b/packages/editor/src/components/post-text-editor/test/index.js
index c6f8492a1fb58d..d132c3b47cd79a 100644
--- a/packages/editor/src/components/post-text-editor/test/index.js
+++ b/packages/editor/src/components/post-text-editor/test/index.js
@@ -7,14 +7,13 @@ import Textarea from 'react-autosize-textarea';
/**
* WordPress dependencies
*/
-import * as wp from '@wordpress/data';
+import { useSelect } from '@wordpress/data';
/**
* Internal dependencies
*/
-import PostTextEditor, { DEBOUNCE_TIME } from '../';
+import PostTextEditor from '../';
-const useSelect = wp.useSelect;
// "Downgrade" ReactAutosizeTextarea to a regular textarea. Assumes aligned
// props interface.
jest.mock( 'react-autosize-textarea', () => ( props ) => (
@@ -176,23 +175,4 @@ describe( 'PostTextEditor', () => {
expect( textarea.props.value ).toBe( 'Goodbye World' );
} );
- it( 'debounce value update after given time', () => {
- let wrapper;
- act( () => {
- wrapper = create( );
- } );
- const mockDispatchFn = jest.fn();
- jest.mock( '@wordpress/data/src/components/use-dispatch', () => ( {
- useDispatch: () => ( {
- editPost: jest.fn(),
- resetEditorBlocks: mockDispatchFn,
- } ),
- } ) );
-
- const textarea = wrapper.root.findByType( Textarea );
- act( () => textarea.props.onChange( { target: { value: 'text' } } ) );
- setTimeout( () => {
- expect( mockDispatchFn ).toHaveBeenCalled();
- }, DEBOUNCE_TIME );
- } );
} );
From 3882276868b98d0e3ae4fd5a8d81b404ba2fc616 Mon Sep 17 00:00:00 2001
From: Riad Benguella
Date: Tue, 6 Apr 2021 12:54:27 +0100
Subject: [PATCH 009/125] Remove the default block margins from themes with
theme.json file (#30375)
---
lib/client-assets.php | 14 +++
packages/block-library/src/editor.scss | 7 --
packages/block-library/src/spacer/editor.scss | 1 -
packages/edit-post/src/classic.scss | 113 ++++++++++++++++++
.../edit-post/src/components/layout/index.js | 3 -
.../src/components/layout/style.scss | 109 -----------------
6 files changed, 127 insertions(+), 120 deletions(-)
create mode 100644 packages/edit-post/src/classic.scss
diff --git a/lib/client-assets.php b/lib/client-assets.php
index c1814fc858385c..15c752bf88504a 100644
--- a/lib/client-assets.php
+++ b/lib/client-assets.php
@@ -360,6 +360,11 @@ function gutenberg_register_packages_styles( $styles ) {
'wp-reusable-blocks',
);
+ // Only load the default layout and margin styles for themes without theme.json file.
+ if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
+ $wp_edit_blocks_dependencies[] = 'wp-editor-classic-layout-styles';
+ }
+
global $editor_styles;
if ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) {
// Include opinionated block styles if no $editor_styles are declared, so the editor never appears broken.
@@ -375,6 +380,15 @@ function gutenberg_register_packages_styles( $styles ) {
);
$styles->add_data( 'wp-reset-editor-styles', 'rtl', 'replace' );
+ gutenberg_override_style(
+ $styles,
+ 'wp-editor-classic-layout-styles',
+ gutenberg_url( 'build/edit-post/classic.css' ),
+ array(),
+ $version
+ );
+ $styles->add_data( 'wp-editor-classic-layout-styles', 'rtl', 'replace' );
+
gutenberg_override_style(
$styles,
'wp-edit-blocks',
diff --git a/packages/block-library/src/editor.scss b/packages/block-library/src/editor.scss
index 7e466ee3d54a1b..9cd49fb82cfed7 100644
--- a/packages/block-library/src/editor.scss
+++ b/packages/block-library/src/editor.scss
@@ -97,13 +97,6 @@
* This allows us to create normalization styles that are easily overridden by editor styles.
*/
-// Provide every block with a default base margin. This margin provides a consistent spacing
-// between blocks in the editor.
-.block-editor-block-list__block {
- margin-top: $default-block-margin;
- margin-bottom: $default-block-margin;
-}
-
// This tag marks the end of the styles that apply to editing canvas contents and need to be manipulated when we resize the editor.
#end-resizable-editor-section {
display: none;
diff --git a/packages/block-library/src/spacer/editor.scss b/packages/block-library/src/spacer/editor.scss
index 3d80b997668702..c1c1aec88e38d7 100644
--- a/packages/block-library/src/spacer/editor.scss
+++ b/packages/block-library/src/spacer/editor.scss
@@ -21,7 +21,6 @@
.block-library-spacer__resize-container {
clear: both;
- margin-bottom: $default-block-margin;
// Don't show the horizontal indicator.
.components-resizable-box__handle::before {
diff --git a/packages/edit-post/src/classic.scss b/packages/edit-post/src/classic.scss
new file mode 100644
index 00000000000000..a58b9b07052b90
--- /dev/null
+++ b/packages/edit-post/src/classic.scss
@@ -0,0 +1,113 @@
+// This needs specificity to override the editor styles.
+.editor-styles-wrapper .wp-block {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+// Depreacted style needed for the block widths and alignments.
+// for themes that don't support the new layout (theme.json)
+.wp-block {
+ max-width: $content-width;
+
+ // Provide every block with a default base margin. This margin provides a consistent spacing
+ // between blocks in the editor.
+ margin-top: $default-block-margin;
+ margin-bottom: $default-block-margin;
+
+ &[data-align="wide"] {
+ max-width: $wide-content-width;
+ }
+
+ &[data-align="full"] {
+ max-width: none;
+ }
+
+ // Alignments.
+ &[data-align="left"],
+ &[data-align="right"] {
+ width: 100%;
+
+ // When images are floated, the block itself should collapse to zero height.
+ height: 0;
+
+ &::before {
+ content: none;
+ }
+ }
+
+ // Left.
+ &[data-align="left"] > * {
+ /*!rtl:begin:ignore*/
+ float: left;
+ margin-right: 2em;
+ /*!rtl:end:ignore*/
+ }
+
+ // Right.
+ &[data-align="right"] > * {
+ /*!rtl:begin:ignore*/
+ float: right;
+ margin-left: 2em;
+ /*!rtl:end:ignore*/
+ }
+
+ // Wide and full-wide.
+ &[data-align="full"],
+ &[data-align="wide"] {
+ clear: both;
+ }
+}
+
+// Full Width Blocks
+// specificity required to only target immediate child Blocks of a Group
+.wp-block-group > [data-align="full"] {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+// Full Width Blocks with a background (ie: has padding)
+.wp-block-group.has-background > [data-align="full"] {
+ // note: using position `left` causes hoz scrollbars so
+ // we opt to use margin instead
+ // the 30px matches the hoz padding applied in `theme.scss`
+ // added when the Block has a background set
+ margin-left: -30px;
+
+ // 60px here is x2 the hoz padding from `theme.scss` added when
+ // the Block has a background set
+ // note: also duplicated below for full width Groups
+ width: calc(100% + 60px);
+}
+
+/**
+* Group: Full Width Alignment
+*/
+[data-align="full"] .wp-block-group {
+ // Non-full Width Blocks
+ // specificity required to only target immediate child Blocks of Group
+ > .wp-block {
+ padding-left: $block-padding;
+ padding-right: $block-padding;
+
+ @include break-small() {
+ padding-left: 0;
+ padding-right: 0;
+ }
+ }
+
+ // Full Width Blocks
+ // specificity required to only target immediate child Blocks of Group
+ > [data-align="full"] {
+ padding-right: 0;
+ padding-left: 0;
+ left: 0;
+ width: 100%;
+ max-width: none;
+ }
+
+ // Full Width Blocks with a background (ie: has padding)
+ // note: also duplicated above for all Group widths
+ &.has-background > [data-align="full"] {
+ width: calc(100% + 60px);
+ }
+}
diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js
index 0c9da0ae76a82e..e65447be8cb6bc 100644
--- a/packages/edit-post/src/components/layout/index.js
+++ b/packages/edit-post/src/components/layout/index.js
@@ -94,7 +94,6 @@ function Layout( { styles } ) {
showIconLabels,
hasReducedUI,
showBlockBreadcrumbs,
- supportsLayout,
} = useSelect( ( select ) => {
const editorSettings = select( 'core/editor' ).getEditorSettings();
return {
@@ -115,7 +114,6 @@ function Layout( { styles } ) {
isInserterOpened: select( editPostStore ).isInserterOpened(),
mode: select( editPostStore ).getEditorMode(),
isRichEditingEnabled: editorSettings.richEditingEnabled,
- supportsLayout: editorSettings.supportsLayout,
hasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),
previousShortcut: select(
keyboardShortcutsStore
@@ -141,7 +139,6 @@ function Layout( { styles } ) {
'has-fixed-toolbar': hasFixedToolbar,
'has-metaboxes': hasActiveMetaboxes,
'show-icon-labels': showIconLabels,
- 'supports-layout': supportsLayout,
} );
const openSidebarPanel = () =>
openGeneralSidebar(
diff --git a/packages/edit-post/src/components/layout/style.scss b/packages/edit-post/src/components/layout/style.scss
index 3a5fee6452b076..f1d29371aad63b 100644
--- a/packages/edit-post/src/components/layout/style.scss
+++ b/packages/edit-post/src/components/layout/style.scss
@@ -115,112 +115,3 @@
height: 100%;
}
}
-
-// Depreacted style needed for the block widths and alignments.
-// for themes that don't support the new layout (theme.json)
-.edit-post-layout:not(.supports-layout) {
- .wp-block {
- max-width: $content-width;
- margin-left: auto;
- margin-right: auto;
-
- &[data-align="wide"] {
- max-width: $wide-content-width;
- }
-
- &[data-align="full"] {
- max-width: none;
- }
-
- // Alignments.
- &[data-align="left"],
- &[data-align="right"] {
- width: 100%;
-
- // When images are floated, the block itself should collapse to zero height.
- height: 0;
-
- &::before {
- content: none;
- }
- }
-
- // Left.
- &[data-align="left"] > * {
- /*!rtl:begin:ignore*/
- float: left;
- margin-right: 2em;
- /*!rtl:end:ignore*/
- }
-
- // Right.
- &[data-align="right"] > * {
- /*!rtl:begin:ignore*/
- float: right;
- margin-left: 2em;
- /*!rtl:end:ignore*/
- }
-
- // Wide and full-wide.
- &[data-align="full"],
- &[data-align="wide"] {
- clear: both;
- }
-
- }
-
- // Full Width Blocks
- // specificity required to only target immediate child Blocks of a Group
- .wp-block-group > [data-align="full"] {
- margin-left: auto;
- margin-right: auto;
- }
-
- // Full Width Blocks with a background (ie: has padding)
- .wp-block-group.has-background > [data-align="full"] {
- // note: using position `left` causes hoz scrollbars so
- // we opt to use margin instead
- // the 30px matches the hoz padding applied in `theme.scss`
- // added when the Block has a background set
- margin-left: -30px;
-
- // 60px here is x2 the hoz padding from `theme.scss` added when
- // the Block has a background set
- // note: also duplicated below for full width Groups
- width: calc(100% + 60px);
- }
-
- /**
- * Group: Full Width Alignment
- */
- [data-align="full"] .wp-block-group {
-
- // Non-full Width Blocks
- // specificity required to only target immediate child Blocks of Group
- > .wp-block {
- padding-left: $block-padding;
- padding-right: $block-padding;
-
- @include break-small() {
- padding-left: 0;
- padding-right: 0;
- }
- }
-
- // Full Width Blocks
- // specificity required to only target immediate child Blocks of Group
- > [data-align="full"] {
- padding-right: 0;
- padding-left: 0;
- left: 0;
- width: 100%;
- max-width: none;
- }
-
- // Full Width Blocks with a background (ie: has padding)
- // note: also duplicated above for all Group widths
- &.has-background > [data-align="full"] {
- width: calc(100% + 60px);
- }
- }
-}
From fc3a5a173195674df64b6f8a99838b736b4662df Mon Sep 17 00:00:00 2001
From: George Mamadashvili
Date: Tue, 6 Apr 2021 16:20:02 +0400
Subject: [PATCH 010/125] Use getAuthors for 'showCombobox' check (#30218)
* Use getAuthors for 'showCombobox' check
* Add inline comment
---
packages/editor/src/components/post-author/index.js | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/packages/editor/src/components/post-author/index.js b/packages/editor/src/components/post-author/index.js
index 90affecc2291e0..0739d75e5e9ed9 100644
--- a/packages/editor/src/components/post-author/index.js
+++ b/packages/editor/src/components/post-author/index.js
@@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
+import { store as coreStore } from '@wordpress/core-data';
/**
* Internal dependencies
@@ -13,10 +14,8 @@ const minimumUsersForCombobox = 25;
function PostAuthor() {
const showCombobox = useSelect( ( select ) => {
- const authors = select( 'core' ).getUsers( {
- who: 'authors',
- per_page: minimumUsersForCombobox + 1,
- } );
+ // Not using `getUsers()` because it requires `list_users` capability.
+ const authors = select( coreStore ).getAuthors();
return authors?.length >= minimumUsersForCombobox;
}, [] );
From 07abb2b515ff73805eb48bb879ceeee1366192c7 Mon Sep 17 00:00:00 2001
From: George Mamadashvili
Date: Tue, 6 Apr 2021 16:21:21 +0400
Subject: [PATCH 011/125] Gallery: Set 'addToGallery' prop to false when images
don't have IDs. (#30122)
This also sets MediaPlaceholder value to an empty object. With both props set to "falsy" values, the gallery media frame is initialized in the "Create Gallery" state. This lets users replace placeholder images from patterns.
---
packages/block-library/src/gallery/edit.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/packages/block-library/src/gallery/edit.js b/packages/block-library/src/gallery/edit.js
index a0ffc6ed9bc332..a888ead72fbb9c 100644
--- a/packages/block-library/src/gallery/edit.js
+++ b/packages/block-library/src/gallery/edit.js
@@ -324,10 +324,11 @@ function GalleryEdit( props ) {
}, [ linkTo ] );
const hasImages = !! images.length;
+ const hasImageIds = hasImages && images.some( ( image ) => !! image.id );
const mediaPlaceholder = (
Date: Tue, 6 Apr 2021 08:29:55 -0400
Subject: [PATCH 012/125] Docs: Fix typos in
block-controls-toolbar-and-sidebar.md (#30513)
---
.../block-tutorial/block-controls-toolbar-and-sidebar.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar.md b/docs/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar.md
index eecbd3d0977c15..5e50c08322c9bd 100644
--- a/docs/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar.md
+++ b/docs/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar.md
@@ -229,8 +229,8 @@ registerBlockType( 'create-block/gutenpride', {
return (
-
-
+
+
);
diff --git a/packages/components/src/date-time/index.js b/packages/components/src/date-time/index.js
index fecc9e302f29e1..f433011786379f 100644
--- a/packages/components/src/date-time/index.js
+++ b/packages/components/src/date-time/index.js
@@ -4,6 +4,7 @@
// Needed to initialise the default datepicker styles.
// See: https://github.com/airbnb/react-dates#initialize
import 'react-dates/initialize';
+import { noop } from 'lodash';
/**
* WordPress dependencies
@@ -25,7 +26,7 @@ function DateTimePicker(
currentDate,
is12Hour,
isInvalidDate,
- onMonthPreviewed,
+ onMonthPreviewed = noop,
onChange,
events,
},
@@ -52,8 +53,8 @@ function DateTimePicker(
currentDate={ currentDate }
onChange={ onChange }
isInvalidDate={ isInvalidDate }
- onMonthPreviewed={ onMonthPreviewed }
events={ events }
+ onMonthPreviewed={ onMonthPreviewed }
/>
>
) }
diff --git a/packages/components/src/date-time/style.scss b/packages/components/src/date-time/style.scss
index 7c56708e1fd32b..43f95756c8d706 100644
--- a/packages/components/src/date-time/style.scss
+++ b/packages/components/src/date-time/style.scss
@@ -111,6 +111,31 @@
}
}
+.components-datetime__date .CalendarDay .components-datetime__date__day {
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-content: center;
+ flex-direction: column;
+ position: relative;
+
+ &.has-events::before {
+ content: " ";
+ width: 4px;
+ height: 4px;
+ border-radius: 2px;
+ position: absolute;
+ left: 50%;
+ margin-left: -2px;
+ bottom: 0;
+ background-color: $white;
+ }
+}
+
+.components-datetime__date .CalendarDay:not(.CalendarDay__selected) .components-datetime__date__day.has-events::before {
+ background: var(--wp-admin-theme-color);
+}
+
.components-datetime__time {
padding-bottom: $grid-unit-20;
diff --git a/packages/e2e-tests/specs/editor/various/post-visibility.test.js b/packages/e2e-tests/specs/editor/various/post-visibility.test.js
index 6844b9bd97345b..c395ea87952364 100644
--- a/packages/e2e-tests/specs/editor/various/post-visibility.test.js
+++ b/packages/e2e-tests/specs/editor/various/post-visibility.test.js
@@ -51,7 +51,7 @@ describe( 'Post visibility', () => {
);
await (
await page.$x(
- '//td[contains(concat(" ", @class, " "), " CalendarDay ")][text() = "15"]'
+ '//td[contains(concat(" ", @class, " "), " CalendarDay ")]/div[contains(concat(" ", @class, " "), " components-datetime__date__day ")][text() = "15"]'
)
)[ 0 ].click();
diff --git a/packages/editor/src/components/post-schedule/index.js b/packages/editor/src/components/post-schedule/index.js
index 06266f1bd68d9f..89526384b2ba1d 100644
--- a/packages/editor/src/components/post-schedule/index.js
+++ b/packages/editor/src/components/post-schedule/index.js
@@ -2,14 +2,68 @@
* WordPress dependencies
*/
import { __experimentalGetSettings } from '@wordpress/date';
-import { withSelect, withDispatch } from '@wordpress/data';
-import { compose } from '@wordpress/compose';
+import { useDispatch, useSelect } from '@wordpress/data';
import { DateTimePicker } from '@wordpress/components';
-import { useRef } from '@wordpress/element';
+import { useRef, useState, useMemo } from '@wordpress/element';
+import { store as coreStore } from '@wordpress/core-data';
+
+/**
+ * Internal dependencies
+ */
+import { store as editorStore } from '../../store';
+
+function getDayOfTheMonth( date = new Date(), firstDay = true ) {
+ const d = new Date( date );
+ return new Date(
+ d.getFullYear(),
+ d.getMonth() + ( firstDay ? 0 : 1 ),
+ firstDay ? 1 : 0
+ ).toISOString();
+}
+
+export default function PostSchedule() {
+ const { postDate, postType } = useSelect(
+ ( select ) => ( {
+ postDate: select( editorStore ).getEditedPostAttribute( 'date' ),
+ postType: select( editorStore ).getCurrentPostType(),
+ } ),
+ []
+ );
+
+ const { editPost } = useDispatch( editorStore );
+ const onUpdateDate = ( date ) => editPost( { date } );
+
+ const [ previewedMonth, setPreviewedMonth ] = useState(
+ getDayOfTheMonth( postDate )
+ );
+
+ // Pick up published and schduled site posts.
+ const eventsByPostType = useSelect(
+ ( select ) =>
+ select( coreStore ).getEntityRecords( 'postType', postType, {
+ status: 'publish,future',
+ after: getDayOfTheMonth( previewedMonth ),
+ before: getDayOfTheMonth( previewedMonth, false ),
+ exclude: [ select( editorStore ).getCurrentPostId() ],
+ } ),
+ [ previewedMonth, postType ]
+ );
+
+ const events = useMemo(
+ () =>
+ ( eventsByPostType || [] ).map(
+ ( { title, type, date: eventDate } ) => ( {
+ title: title?.rendered,
+ type,
+ date: new Date( eventDate ),
+ } )
+ ),
+ [ eventsByPostType ]
+ );
-export function PostSchedule( { date, onUpdateDate } ) {
const ref = useRef();
const settings = __experimentalGetSettings();
+
// To know if the current timezone is a 12 hour time with look for "a" in the time format
// We also make sure this a is not escaped by a "/"
const is12HourTime = /a(?!\\)/i.test(
@@ -30,24 +84,11 @@ export function PostSchedule( { date, onUpdateDate } ) {
return (
);
}
-
-export default compose( [
- withSelect( ( select ) => {
- return {
- date: select( 'core/editor' ).getEditedPostAttribute( 'date' ),
- };
- } ),
- withDispatch( ( dispatch ) => {
- return {
- onUpdateDate( date ) {
- dispatch( 'core/editor' ).editPost( { date } );
- },
- };
- } ),
-] )( PostSchedule );
From ba4408396e0d3774564461bb7929b88c83371641 Mon Sep 17 00:00:00 2001
From: Bernie Reiter
Date: Thu, 8 Apr 2021 16:06:06 +0200
Subject: [PATCH 054/125] Plugin Build Workflow: Pull trunk before pushing
(#30615)
The build workflow recently [failed to push the cherry-picked version bump commit to `trunk`](https://github.com/WordPress/gutenberg/runs/2288075442?check_suite_focus=true). Our best guess is that this happened because a [PR was merged](https://github.com/WordPress/gutenberg/pull/30539#event-4562689224) (on Apr 7 at 13:58 UTC) after the workflow [was started](https://github.com/WordPress/gutenberg/actions/runs/726230952) (on Apr 7, also at 13:58 UTC), so the workflow's checked out copy of `trunk` didn't match the remote.
The remedy should be to pull `trunk` right before cherry-picking and pushing.
---
.github/workflows/build-plugin-zip.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml
index 19cf5ca106a040..e2707e81f5d7cb 100644
--- a/.github/workflows/build-plugin-zip.yml
+++ b/.github/workflows/build-plugin-zip.yml
@@ -92,6 +92,7 @@ jobs:
- name: Cherry-pick to trunk
run: |
git checkout trunk
+ git pull
TRUNK_VERSION=$(jq --raw-output '.version' package.json)
if [[ ${{ steps.get_version.outputs.old_version }} == "$TRUNK_VERSION" ]]; then
git cherry-pick "${{ steps.get_version.outputs.release_branch }}"
@@ -112,7 +113,7 @@ jobs:
- name: Use Node.js 14.x
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
with:
- node-version: 14.x
+ node-version: 14.x
- name: Cache node modules
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
From c71a99778274b049e055678c88fb28584622decd Mon Sep 17 00:00:00 2001
From: Matt Chowning
Date: Thu, 8 Apr 2021 10:18:04 -0400
Subject: [PATCH 055/125] Interim dual license license of future contributions
(#30383)
* Interim dual-license for future contributions
* Fill in dates in interim license
* Update PR template
* Cleanup MPL and GPL references in license
* Clarify PR comment that new contributions are dual-licensed
* Minor cleanup
* Move incorporates other work language under project license section
* Update initial copyright year to match first contribution to Gutenberg repo
* Clarify project license is unchaged
* Remove duplicative "(or later)" clause
* Fix link in license
---
.github/PULL_REQUEST_TEMPLATE.md | 2 +
LICENSE.md | 428 ++++++++++++++++++++++++++++++-
2 files changed, 417 insertions(+), 13 deletions(-)
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 75b32fa346231d..45bad9c0612a1a 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,5 +1,7 @@
+
+
## Description
diff --git a/LICENSE.md b/LICENSE.md
index a6523290d51581..12a2176511cbe2 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,20 +1,24 @@
-### WordPress - Web publishing software
+## Gutenberg
- Copyright 2011-2021 by the contributors
+ Copyright 2016-2021 by the contributors
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+**License for Contributions (on and after April 15, 2021)**
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+All code contributed to the Gutenberg project is dual-licensed,
+and released under both of the following licenses:
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+the GNU General Public License as published by the Free Software Foundation;
+either version 2 of the License or (at your option) any later version (the “GPL”)
+and the Mozilla Public License, Version 2.0 (the “MPL”).
+
+**Project License**
+
+The Gutenberg project license is not affected by the License for Contributions (as
+discussed in the [Dual License section](#dual-license) below). The Gutenberg project
+continues to be free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License or (at your option) any
+later version (the “GPL”).
This program incorporates work covered by the following copyright and
permission notices:
@@ -35,8 +39,50 @@ and
WordPress is released under the GPL
+
+### Dual License
+
+**We are currently in the process of changing Gutenberg’s software license from
+GPL to a dual license: GPL and MPL.**
+
+**This process involves two independent steps (1) obtaining permission for dual
+licensing from contributors of already contributed Gutenberg code and (2)
+dual licensing of all contributions to Gutenberg that are made on or after
+April 15, 2021.**
+
+**For part (1): We’re reaching out to everyone who has contributed code, prior
+to April 15, 2021, and asking that they agree to dual license their
+contribution to the project. We expect this process to be completed by
+mid-year, 2021.**
+
+**For part (2): We have changed the license for contributed code to this
+repository to make clear that all contributions on or after April 15, 2021
+will be made under the dual-license.**
+
+**When we have received all necessary rights and permissions to dual license
+the pre-April 15, 2021 code of the Gutenberg project (Part 1 above), you will
+have the option to use and distribute all of the Gutenberg project under
+either the GPL or MPL license. At this time we will change the “Project
+License” to the following:**
+
+ The Gutenberg project is free software; you can redistribute it and/or modify
+ it under the terms of either of the following licenses:
+
+ 1. the GNU General Public License as published by the Free Software Foundation;
+ either version 2 of the License or (at your option) any later version (the
+ “GPL”) OR
+
+ 2. the Mozilla Public License Version 2.0 (the “MPL”).
+
---
+## Full Text of Referenced Licenses
+
+1. [GNU General Public License, Version 2](#gnu-general-public-license-version-2)
+2. [Mozilla Public License, Version 2.0](#mozilla-public-license-version-20)
+
+## GNU General Public License, Version 2
+
### GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
@@ -398,3 +444,359 @@ applications with the library. If this is what you want to do, use the
[GNU Lesser General Public
License](http://www.gnu.org/licenses/lgpl.html) instead of this
License.
+
+---
+## Mozilla Public License, Version 2.0
+
+### 1. Definitions
+
+**1.1. “Contributor”**
+ means each individual or legal entity that creates, contributes to
+ the creation of, or owns Covered Software.
+
+**1.2. “Contributor Version”**
+ means the combination of the Contributions of others (if any) used
+ by a Contributor and that particular Contributor's Contribution.
+
+**1.3. “Contribution”**
+ means Covered Software of a particular Contributor.
+
+**1.4. “Covered Software”**
+ means Source Code Form to which the initial Contributor has attached
+ the notice in Exhibit A, the Executable Form of such Source Code
+ Form, and Modifications of such Source Code Form, in each case
+ including portions thereof.
+
+**1.5. “Incompatible With Secondary Licenses”**
+ means
+
+* **(a)** that the initial Contributor has attached the notice described
+ in Exhibit B to the Covered Software; or
+* **(b)** that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the
+ terms of a Secondary License.
+
+**1.6. “Executable Form”**
+ means any form of the work other than Source Code Form.
+
+**1.7. “Larger Work”**
+ means a work that combines Covered Software with other material, in
+ a separate file or files, that is not Covered Software.
+
+**1.8. “License”**
+ means this document.
+
+**1.9. “Licensable”**
+ means having the right to grant, to the maximum extent possible,
+ whether at the time of the initial grant or subsequently, any and
+ all of the rights conveyed by this License.
+
+**1.10. “Modifications”**
+ means any of the following:
+
+* **(a)** any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered
+ Software; or
+* **(b)** any new file in Source Code Form that contains any Covered
+ Software.
+
+**1.11. “Patent Claims” of a Contributor**
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the
+ License, by the making, using, selling, offering for sale, having
+ made, import, or transfer of either its Contributions or its
+ Contributor Version.
+
+**1.12. “Secondary License”**
+ means either the GNU General Public License, Version 2.0, the GNU
+ Lesser General Public License, Version 2.1, the GNU Affero General
+ Public License, Version 3.0, or any later versions of those
+ licenses.
+
+**1.13. “Source Code Form”**
+ means the form of the work preferred for making modifications.
+
+**1.14. “You” (or “Your”)**
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, “You” includes any entity that
+ controls, is controlled by, or is under common control with You. For
+ purposes of this definition, “control” means **(a)** the power, direct
+ or indirect, to cause the direction or management of such entity,
+ whether by contract or otherwise, or **(b)** ownership of more than
+ fifty percent (50%) of the outstanding shares or beneficial
+ ownership of such entity.
+
+
+### 2. License Grants and Conditions
+
+#### 2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+* **(a)** under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+* **(b)** under Patent Claims of such Contributor to make, use, sell, offer
+ for sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+#### 2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+#### 2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+* **(a)** for any code that a Contributor has removed from Covered Software;
+ or
+* **(b)** for infringements caused by: **(i)** Your and any other third party's
+ modifications of Covered Software, or **(ii)** the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+* **(c)** under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+#### 2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+#### 2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+#### 2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+#### 2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+
+### 3. Responsibilities
+
+#### 3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+#### 3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+* **(a)** such Covered Software must also be made available in Source Code
+ Form, as described in Section 3.1, and You must inform recipients of
+ the Executable Form how they can obtain a copy of such Source Code
+ Form by reasonable means in a timely manner, at a charge no more
+ than the cost of distribution to the recipient; and
+
+* **(b)** You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter
+ the recipients' rights in the Source Code Form under this License.
+
+#### 3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+#### 3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+#### 3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+
+### 4. Inability to Comply Due to Statute or Regulation
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: **(a)** comply with
+the terms of this License to the maximum extent possible; and **(b)**
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+
+### 5. Termination
+
+**5.1.** The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated **(a)** provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and **(b)** on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+**5.2.** If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+
+### 6. Disclaimer of Warranty
+
+> Covered Software is provided under this License on an “as is”
+> basis, without warranty of any kind, either expressed, implied, or
+> statutory, including, without limitation, warranties that the
+> Covered Software is free of defects, merchantable, fit for a
+> particular purpose or non-infringing. The entire risk as to the
+> quality and performance of the Covered Software is with You.
+> Should any Covered Software prove defective in any respect, You
+> (not any Contributor) assume the cost of any necessary servicing,
+> repair, or correction. This disclaimer of warranty constitutes an
+> essential part of this License. No use of any Covered Software is
+> authorized under this License except under this disclaimer.
+
+### 7. Limitation of Liability
+
+> Under no circumstances and under no legal theory, whether tort
+> (including negligence), contract, or otherwise, shall any
+> Contributor, or anyone who distributes Covered Software as
+> permitted above, be liable to You for any direct, indirect,
+> special, incidental, or consequential damages of any character
+> including, without limitation, damages for lost profits, loss of
+> goodwill, work stoppage, computer failure or malfunction, or any
+> and all other commercial damages or losses, even if such party
+> shall have been informed of the possibility of such damages. This
+> limitation of liability shall not apply to liability for death or
+> personal injury resulting from such party's negligence to the
+> extent applicable law prohibits such limitation. Some
+> jurisdictions do not allow the exclusion or limitation of
+> incidental or consequential damages, so this exclusion and
+> limitation may not apply to You.
+
+
+### 8. Litigation
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+
+### 9. Miscellaneous
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+
+### 10. Versions of the License
+
+#### 10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+#### 10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+#### 10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+## Exhibit A - Source Code Form License Notice
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+## Exhibit B - “Incompatible With Secondary Licenses” Notice
+
+ This Source Code Form is "Incompatible With Secondary Licenses", as
+ defined by the Mozilla Public License, v. 2.0.
From 8aa446b4e6845c91c10e1fb35a23ee44c257200b Mon Sep 17 00:00:00 2001
From: sarayourfriend
Date: Thu, 8 Apr 2021 07:32:18 -0700
Subject: [PATCH 056/125] Components: Add create-styles (#30509)
* Components: Add create-styles
* Fix disallowed syntaxes
* Add missing TS resolution
* Remove ThemeProvider and duplicated hooks
* Clean up READMEs
* Remove unnecessary deps
* Remove stray `is` import
* Change namespace to experimental to avoid introducing new public APIs
* Remove stray mentions of g2
* Remove `css` prop and automatic prop filtering
---
package-lock.json | 28 +++
packages/components/package.json | 5 +
.../create-styles/create-compiler/README.md | 55 ++++++
.../create-compiler/create-compiler.js | 120 +++++++++++
.../create-compiler/create-css.js | 65 ++++++
.../ui/create-styles/create-compiler/index.js | 3 +
.../create-compiler/plugins/README.md | 33 ++++
.../create-compiler/plugins/css-variables.js | 77 ++++++++
.../plugins/extra-specificity.js | 61 ++++++
.../create-compiler/plugins/index.js | 37 ++++
.../create-compiler/plugins/utils.js | 20 ++
.../create-compiler/responsive.js | 54 +++++
.../create-compiler/test/responsive.js | 34 ++++
.../ui/create-styles/create-compiler/utils.js | 15 ++
.../create-style-system/README.md | 101 ++++++++++
.../create-style-system/constants.js | 22 +++
.../create-core-element.js | 145 ++++++++++++++
.../create-core-elements.js | 34 ++++
.../create-style-system.js | 151 ++++++++++++++
.../create-styled-components.js | 175 ++++++++++++++++
.../create-style-system/generate-theme.js | 84 ++++++++
.../create-style-system/index.js | 7 +
.../polymorphic-component.ts | 62 ++++++
.../create-styles/create-style-system/tags.js | 141 +++++++++++++
.../test/create-style-system.js | 89 +++++++++
.../create-style-system/types.d.ts | 1 +
.../create-style-system/utils.js | 186 ++++++++++++++++++
.../create-root-store.js | 111 +++++++++++
.../css-custom-properties/get-prop-value.js | 71 +++++++
.../css-custom-properties/index.js | 2 +
.../transform-content.js | 98 +++++++++
.../css-custom-properties/utils.js | 54 +++++
.../src/ui/create-styles/hooks/index.js | 1 +
.../hooks/use-hydrate-global-styles.js | 52 +++++
.../components/src/ui/create-styles/index.js | 3 +
.../ui/create-styles/stories/create-styles.js | 30 +++
.../style-system-string-interpolation.js | 47 +++++
packages/components/tsconfig.json | 6 +-
typings/styled-griddie/index.d.ts | 10 +
39 files changed, 2289 insertions(+), 1 deletion(-)
create mode 100644 packages/components/src/ui/create-styles/create-compiler/README.md
create mode 100644 packages/components/src/ui/create-styles/create-compiler/create-compiler.js
create mode 100644 packages/components/src/ui/create-styles/create-compiler/create-css.js
create mode 100644 packages/components/src/ui/create-styles/create-compiler/index.js
create mode 100644 packages/components/src/ui/create-styles/create-compiler/plugins/README.md
create mode 100644 packages/components/src/ui/create-styles/create-compiler/plugins/css-variables.js
create mode 100644 packages/components/src/ui/create-styles/create-compiler/plugins/extra-specificity.js
create mode 100644 packages/components/src/ui/create-styles/create-compiler/plugins/index.js
create mode 100644 packages/components/src/ui/create-styles/create-compiler/plugins/utils.js
create mode 100644 packages/components/src/ui/create-styles/create-compiler/responsive.js
create mode 100644 packages/components/src/ui/create-styles/create-compiler/test/responsive.js
create mode 100644 packages/components/src/ui/create-styles/create-compiler/utils.js
create mode 100644 packages/components/src/ui/create-styles/create-style-system/README.md
create mode 100644 packages/components/src/ui/create-styles/create-style-system/constants.js
create mode 100644 packages/components/src/ui/create-styles/create-style-system/create-core-element.js
create mode 100644 packages/components/src/ui/create-styles/create-style-system/create-core-elements.js
create mode 100644 packages/components/src/ui/create-styles/create-style-system/create-style-system.js
create mode 100644 packages/components/src/ui/create-styles/create-style-system/create-styled-components.js
create mode 100644 packages/components/src/ui/create-styles/create-style-system/generate-theme.js
create mode 100644 packages/components/src/ui/create-styles/create-style-system/index.js
create mode 100644 packages/components/src/ui/create-styles/create-style-system/polymorphic-component.ts
create mode 100644 packages/components/src/ui/create-styles/create-style-system/tags.js
create mode 100644 packages/components/src/ui/create-styles/create-style-system/test/create-style-system.js
create mode 100644 packages/components/src/ui/create-styles/create-style-system/types.d.ts
create mode 100644 packages/components/src/ui/create-styles/create-style-system/utils.js
create mode 100644 packages/components/src/ui/create-styles/css-custom-properties/create-root-store.js
create mode 100644 packages/components/src/ui/create-styles/css-custom-properties/get-prop-value.js
create mode 100644 packages/components/src/ui/create-styles/css-custom-properties/index.js
create mode 100644 packages/components/src/ui/create-styles/css-custom-properties/transform-content.js
create mode 100644 packages/components/src/ui/create-styles/css-custom-properties/utils.js
create mode 100644 packages/components/src/ui/create-styles/hooks/index.js
create mode 100644 packages/components/src/ui/create-styles/hooks/use-hydrate-global-styles.js
create mode 100644 packages/components/src/ui/create-styles/index.js
create mode 100644 packages/components/src/ui/create-styles/stories/create-styles.js
create mode 100644 packages/components/src/ui/create-styles/stories/style-system-string-interpolation.js
create mode 100644 typings/styled-griddie/index.d.ts
diff --git a/package-lock.json b/package-lock.json
index b4632ec138116f..6a2ba428674d33 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12465,6 +12465,7 @@
"@babel/runtime": "^7.13.10",
"@emotion/core": "^10.1.1",
"@emotion/css": "^10.0.22",
+ "@emotion/hash": "^0.8.0",
"@emotion/native": "^10.0.22",
"@emotion/styled": "^10.0.23",
"@wordpress/a11y": "file:packages/a11y",
@@ -12486,12 +12487,15 @@
"@wp-g2/styles": "^0.0.160",
"@wp-g2/utils": "^0.0.160",
"classnames": "^2.2.5",
+ "create-emotion": "^10.0.27",
"dom-scroll-into-view": "^1.2.1",
"downshift": "^6.0.15",
"gradient-parser": "^0.1.5",
"highlight-words-core": "^1.2.2",
+ "hoist-non-react-statics": "^3.3.2",
"lodash": "^4.17.19",
"memize": "^1.1.0",
+ "mitt": "^2.1.0",
"moment": "^2.22.1",
"re-resizable": "^6.4.0",
"react-dates": "^17.1.1",
@@ -12500,8 +12504,32 @@
"react-use-gesture": "^9.0.0",
"reakit": "^1.3.5",
"rememo": "^3.0.0",
+ "styled-griddie": "^0.1.3",
"tinycolor2": "^1.4.2",
"uuid": "^8.3.0"
+ },
+ "dependencies": {
+ "@emotion/is-prop-valid": {
+ "version": "0.8.8",
+ "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz",
+ "integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==",
+ "requires": {
+ "@emotion/memoize": "0.7.4"
+ }
+ },
+ "@emotion/memoize": {
+ "version": "0.7.4",
+ "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz",
+ "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw=="
+ },
+ "hoist-non-react-statics": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
+ "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
+ "requires": {
+ "react-is": "^16.7.0"
+ }
+ }
}
},
"@wordpress/compose": {
diff --git a/packages/components/package.json b/packages/components/package.json
index aae55b5eea34ca..ade5e6ca72d8a6 100644
--- a/packages/components/package.json
+++ b/packages/components/package.json
@@ -29,6 +29,7 @@
"@babel/runtime": "^7.13.10",
"@emotion/core": "^10.1.1",
"@emotion/css": "^10.0.22",
+ "@emotion/hash": "^0.8.0",
"@emotion/native": "^10.0.22",
"@emotion/styled": "^10.0.23",
"@wordpress/a11y": "file:../a11y",
@@ -50,12 +51,15 @@
"@wp-g2/styles": "^0.0.160",
"@wp-g2/utils": "^0.0.160",
"classnames": "^2.2.5",
+ "create-emotion": "^10.0.27",
"dom-scroll-into-view": "^1.2.1",
"downshift": "^6.0.15",
"gradient-parser": "^0.1.5",
"highlight-words-core": "^1.2.2",
+ "hoist-non-react-statics": "^3.3.2",
"lodash": "^4.17.19",
"memize": "^1.1.0",
+ "mitt": "^2.1.0",
"moment": "^2.22.1",
"re-resizable": "^6.4.0",
"react-dates": "^17.1.1",
@@ -64,6 +68,7 @@
"react-use-gesture": "^9.0.0",
"reakit": "^1.3.5",
"rememo": "^3.0.0",
+ "styled-griddie": "^0.1.3",
"tinycolor2": "^1.4.2",
"uuid": "^8.3.0"
},
diff --git a/packages/components/src/ui/create-styles/create-compiler/README.md b/packages/components/src/ui/create-styles/create-compiler/README.md
new file mode 100644
index 00000000000000..76773b7a2ca1de
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/README.md
@@ -0,0 +1,55 @@
+# create-compiler
+
+This module creates the Emotion instance that backs the style system. It integrates plugins and creates the core `css` function that wraps Emotion's `css` function adding support for breakpoint values on each property.
+
+## Breakpoint values
+
+Breakpoint values are supported by passing an array of values to a CSS property. For example:
+
+```js
+css({
+ width: [300, 500, 700],
+});
+```
+
+This will dynamically respond to breakpoints and render the appropriate width for each `min-width`. The breakpoints are documented in the code in [`utils.js`](./utils.js).
+
+## Plugins
+
+`createCompiler` supports passing certain parameters to plugins. Plugin initialization should be contained to [`plugins/index.js`](./plugins/index.js).
+
+The individual plugins are documented in [`plugins/README.md`](./plugins/README.md).
+
+## Custom iframe support
+
+Emotion by default does not support iframe styling. This style system solves this by implementing a custom `sheet.insert` that exposes a `sheet.insert` event which can be listened to by style providers to receive styles from outside of the current iframe.
+
+## Interplated Components
+
+`css` also supports passing style system-connected components as selectors in the same style as `styled-components`. It does this _without any Babel transformations_. Interpolated components are transformed to a special interpolated class name by the `css` function. Components are given an interpolation class name (prefixed by `ic-`) by either the `contextConnect` hook or by `styled` itself. `css` then detects when a component has been passed in and transorms it into a CSS selector.
+
+For example:
+
+```js
+const Text = styled.div`
+ color: red;
+`;
+
+const greenText = css`
+ ${Text} {
+ color: green;
+ }
+`;
+```
+
+Now any child `Text` of a component that applies the `greenText` generated class name will be targeted with the `color: green` styles.
+
+Psueudo selectors against the interpolated component are possible as well:
+
+```js
+const blueText = css`
+ ${Text}:first-child {
+ color: blue;
+ }
+`;
+```
diff --git a/packages/components/src/ui/create-styles/create-compiler/create-compiler.js b/packages/components/src/ui/create-styles/create-compiler/create-compiler.js
new file mode 100644
index 00000000000000..9885f59678b28f
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/create-compiler.js
@@ -0,0 +1,120 @@
+/**
+ * External dependencies
+ */
+import createEmotion from 'create-emotion';
+import mitt from 'mitt';
+
+/**
+ * Internal dependencies
+ */
+import { RootStore } from '../css-custom-properties';
+import { createCSS } from './create-css';
+import { createPlugins } from './plugins';
+import { breakpoints, generateInterpolationName } from './utils';
+
+const defaultOptions = {
+ key: 'css',
+ specificityLevel: 1,
+ rootStore: new RootStore(),
+};
+
+/* eslint-disable jsdoc/valid-types */
+/**
+ * @typedef {import('create-emotion').Emotion & {
+ * breakpoints: typeof breakpoints,
+ * __events: import('mitt').Emitter,
+ * generateInterpolationName(): string,
+ * }} Compiler
+ */
+/* eslint-enable jsdoc/valid-types */
+
+/**
+ * @typedef {import('create-emotion').Options & {
+ * key?: string,
+ * specificityLevel?: number,
+ * rootStore: import('../css-custom-properties').RootStore
+ * }} CreateCompilerOptions
+ */
+
+/**
+ * @param {CreateCompilerOptions} options
+ * @return {Compiler} The compiler.
+ */
+export function createCompiler( options ) {
+ const mergedOptions = {
+ ...defaultOptions,
+ ...options,
+ };
+
+ const { key, rootStore, specificityLevel } = mergedOptions;
+
+ const defaultPlugins = createPlugins( {
+ key,
+ specificityLevel,
+ rootStore,
+ } );
+
+ if ( options.stylisPlugins ) {
+ if ( Array.isArray( options.stylisPlugins ) ) {
+ mergedOptions.stylisPlugins = [
+ ...defaultPlugins,
+ ...options.stylisPlugins,
+ ];
+ } else if ( typeof options.stylisPlugins !== 'undefined' ) {
+ // just a single plugin was passed in, as is allowed by emotion
+ mergedOptions.stylisPlugins = [
+ ...defaultPlugins,
+ options.stylisPlugins,
+ ];
+ } else {
+ mergedOptions.stylisPlugins = defaultPlugins;
+ }
+ } else {
+ mergedOptions.stylisPlugins = defaultPlugins;
+ }
+
+ /**
+ * We're creating a custom Emotion instance to ensure that the style system
+ * does not conflict with (potential) existing Emotion instances.
+ *
+ * We're also able to provide createEmotion with our custom Stylis plugins.
+ */
+ const customEmotionInstance = {
+ ...createEmotion( mergedOptions ),
+ /**
+ * Exposing the breakpoints used in the internal Style system.
+ */
+ breakpoints,
+ /**
+ * An internal custom event emitter (pub/sub) for Emotion.
+ * This is currently used in
+ * to subscribe to and sync style injection.
+ */
+ __events: mitt(),
+ generateInterpolationName,
+ };
+
+ /**
+ * Enhance the base css function from Emotion to add features like responsive
+ * value handling and compiling an Array of css() calls.
+ */
+ const { css } = customEmotionInstance;
+ customEmotionInstance.css = createCSS( css );
+
+ /**
+ * Modify the sheet.insert method to emit a `sheet.insert` event
+ * within the internal custom event emitter.
+ */
+ const __insert = customEmotionInstance.sheet.insert;
+ customEmotionInstance.sheet.insert = (
+ /* eslint-disable jsdoc/valid-types */
+ /** @type {[rule: string]} */ ...args
+ ) =>
+ /* eslint-enable jsdoc/valid-types */
+ {
+ __insert.apply( customEmotionInstance.sheet, [ ...args ] );
+ customEmotionInstance.__events.emit( 'sheet.insert', ...args );
+ };
+
+ return customEmotionInstance;
+}
diff --git a/packages/components/src/ui/create-styles/create-compiler/create-css.js b/packages/components/src/ui/create-styles/create-compiler/create-css.js
new file mode 100644
index 00000000000000..9fe62e7a671664
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/create-css.js
@@ -0,0 +1,65 @@
+/**
+ * External dependencies
+ */
+import { isPlainObject } from 'lodash';
+
+/**
+ * Internal dependencies
+ */
+import { responsive } from './responsive';
+
+/**
+ * @param {CSS} compile
+ * @return {CSS} The CSS function
+ */
+export function createCSS( compile ) {
+ /**
+ * An enhanced version of the compiler's (Emotion) CSS function.
+ * This enhanced CSS supports dynamic responsive (breakpoint-based) styles if
+ * the value is an array of values.
+ *
+ * @example
+ * ```js
+ * // The following will render a CSS rule where the widths will be:
+ * // 100px for mobile
+ * // 200px for tablet
+ * // 500px for desktop
+ * css({
+ * width: [100, 200, 500]
+ * })
+ * ```
+ * @param {Parameters} args
+ * @return {ReturnType} The compiled CSS className associated with the styles.
+ */
+ function css( ...args ) {
+ const [ arg, ...rest ] = args;
+
+ if ( isPlainObject( arg ) ) {
+ return compile(
+ responsive( /** @type {ObjectInterpolation} */ ( arg ) )
+ );
+ }
+
+ if ( Array.isArray( arg ) ) {
+ for ( let i = 0, len = arg.length; i < len; i++ ) {
+ const n = arg[ i ];
+ if ( isPlainObject( n ) ) {
+ arg[ i ] = responsive(
+ /** @type {ObjectInterpolation} */ ( n )
+ );
+ }
+ }
+ return compile( ...[ arg, ...rest ] );
+ }
+
+ return compile( ...args );
+ }
+
+ // @ts-ignore No amount of zhuzhing will convince TypeScript that a function with the parameters and return type for CSS is in fact the same type
+ return css;
+}
+
+/* eslint-disable jsdoc/valid-types */
+/** @typedef {import('create-emotion').Emotion['css']} CSS */
+/** @typedef {import('create-emotion').ObjectInterpolation} ObjectInterpolation */
+/* eslint-enable jsdoc/valid-types */
diff --git a/packages/components/src/ui/create-styles/create-compiler/index.js b/packages/components/src/ui/create-styles/create-compiler/index.js
new file mode 100644
index 00000000000000..2daae99d0b6cb6
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/index.js
@@ -0,0 +1,3 @@
+export * from './create-compiler';
+export * from './create-css';
+export * from './responsive';
diff --git a/packages/components/src/ui/create-styles/create-compiler/plugins/README.md b/packages/components/src/ui/create-styles/create-compiler/plugins/README.md
new file mode 100644
index 00000000000000..1526ad4374e120
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/plugins/README.md
@@ -0,0 +1,33 @@
+# plugins
+
+This foler contains all the applied plugins in the style system.
+
+**Nota bene**: All of the plugins can be removed once IE11 support is officially dropped.
+
+## Extra Specificity
+
+This plugin automatically compounds selector specificity by simply repeating the selector x number of times. For example, if a specificity of 3 is passed in, the plugin will transform:
+
+```css
+.css-abc123 {
+ color: red;
+}
+```
+
+into:
+
+```css
+.css-abc123.css-abc123.css-abc123 {
+ color: red;
+}
+```
+
+This is meant to prevent "hacks" from being applied to the component system via regular css selection (or rather to make it difficult/annoying to do so), forcing consumers to use the style system itself, for example, the `css` prop and theme variables, to apply custom styles.
+
+It is currently set to a specificity of 1 to disable it. This may be reversed in the future. If it isn't reversed in the future, at some point we shoiuld just remove it.
+
+## CSS Variable Fallback
+
+The [`css-variables.js` ](./css-variables.js) plugin automatically generates fallback variables to support browsers that lack CSS variable support.
+
+Given WordPress core is dropping IE11 support,we might be able to drop this plugin altogether.
diff --git a/packages/components/src/ui/create-styles/create-compiler/plugins/css-variables.js b/packages/components/src/ui/create-styles/create-compiler/plugins/css-variables.js
new file mode 100644
index 00000000000000..23771469048e7f
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/plugins/css-variables.js
@@ -0,0 +1,77 @@
+/**
+ * Internal dependencies
+ */
+import { createRootStore } from '../../css-custom-properties';
+import { transformContent } from '../../css-custom-properties/transform-content';
+import { hasVariable } from '../../css-custom-properties/utils';
+import { STYLIS_CONTEXTS, STYLIS_TOKENS } from './utils';
+
+// Detects native CSS varialble support
+// https://github.com/jhildenbiddle/css-vars-ponyfill/blob/master/src/index.js
+const isNativeSupport =
+ typeof window !== 'undefined' && window?.CSS?.supports?.( '(--a: 0)' );
+
+/*
+ * This plugin is for the stylis library. It's the CSS compiler used by
+ * CSS-in-JS libraries like Emotion.
+ *
+ * https://github.com/thysultan/stylis.js
+ */
+
+const defaultOptions = {
+ rootStore: createRootStore(),
+ skipSupportedBrowsers: true,
+};
+
+/*
+ * Generates fallback values for CSS rule declarations that contain CSS var().
+ * This plugin parses uses specified fallback values within the var()
+ * function. If one is not provided, it will attempt to use the matching
+ * variable declared at the :root scope.
+ */
+function stylisPluginCssVariables(
+ /* istanbul ignore next */
+ options = {}
+) {
+ const { rootStore, skipSupportedBrowsers } = {
+ ...defaultOptions,
+ ...options,
+ };
+
+ const plugin = (
+ /** @type {number} */ context,
+ /** @type {string} */ content,
+ /** @type {unknown} */ _,
+ /** @type {unknown} */ __,
+ /** @type {unknown} */ ___,
+ /** @type {unknown} */ ____,
+ /** @type {unknown} */ _____,
+ /** @type {number} */ type
+ ) => {
+ // Skip generating CSS variable fallbacks for supported browsers
+ if ( skipSupportedBrowsers && isNativeSupport ) return;
+
+ // Borrowed guard implementation from:
+ // https://github.com/Andarist/stylis-plugin-extra-scope/blob/master/src/index.js#L15
+ /* istanbul ignore next */
+ if (
+ context !== STYLIS_CONTEXTS.SELECTOR_BLOCK ||
+ type === STYLIS_TOKENS.KEYFRAME
+ ) {
+ return;
+ }
+
+ // We only need to process the content if a CSS var() is used.
+ if ( ! hasVariable( content ) ) return;
+
+ // We'll parse the content to match variables to their custom properties (if possible).
+ const nextContent = transformContent( content, rootStore );
+
+ // Lastly, we'll provide stylis with our enhanced CSS variable supported content.
+ return nextContent;
+ };
+
+ return plugin;
+}
+
+export default stylisPluginCssVariables;
diff --git a/packages/components/src/ui/create-styles/create-compiler/plugins/extra-specificity.js b/packages/components/src/ui/create-styles/create-compiler/plugins/extra-specificity.js
new file mode 100644
index 00000000000000..3449b5bcf83169
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/plugins/extra-specificity.js
@@ -0,0 +1,61 @@
+/**
+ * External dependencies
+ */
+import { clamp, repeat } from 'lodash';
+
+const seen = new WeakSet();
+const seenMatch = new Set();
+
+const defaultOptions = {
+ key: 'wp-css',
+ level: 7,
+};
+
+/**
+ * @typedef ExtraSpecificityPluginOptions
+ * @property {string} [key='wp-css'] The key that prefixes styles.
+ * @property {number} [level=7] The level of specificity to use.
+ */
+
+/**
+ * Custom stylis plugin that increases the scope of generated selectors.
+ * The default compounding "level" is 7.
+ *
+ * For example, a selector of `.css-ah12df` would result in a final selector
+ * of `.css-ah12df.css-ah12df.css-ah12df.css-ah12df.css-ah12df.css-ah12df.css-ah12df`.
+ *
+ * @param {ExtraSpecificityPluginOptions} options Options to adjust the plugin
+ */
+function stylisExtraSpecificityPlugin( options = defaultOptions ) {
+ const { key, level } = { ...defaultOptions, ...options };
+ const repeatLevel = clamp( level, 0, 20 );
+
+ return (
+ /** @type {number} */ _,
+ /** @type {string} */ __,
+ /** @type {string[]} */ selectors
+ ) => {
+ if ( seen.has( selectors ) ) return;
+ seen.add( selectors );
+
+ const regex = new RegExp( `.${ key }-[\\w|\\d]*`, 'g' );
+
+ for ( let i = 0; i < selectors.length; i++ ) {
+ let item = selectors[ i ];
+ const [ match ] = item.match( regex ) || [];
+
+ if ( match ) {
+ if ( seenMatch.has( match ) ) return;
+ seenMatch.add( match );
+
+ item = item
+ .replace( new RegExp( match, 'g' ), match )
+ .replace( match, repeat( match, repeatLevel ) );
+
+ selectors[ i ] = item;
+ }
+ }
+ };
+}
+
+export default stylisExtraSpecificityPlugin;
diff --git a/packages/components/src/ui/create-styles/create-compiler/plugins/index.js b/packages/components/src/ui/create-styles/create-compiler/plugins/index.js
new file mode 100644
index 00000000000000..b83b8b25c7b882
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/plugins/index.js
@@ -0,0 +1,37 @@
+/**
+ * External dependencies
+ */
+import cssGridPlugin from 'styled-griddie';
+
+/**
+ * Internal dependencies
+ */
+import cssVariablesPlugin from './css-variables';
+import specificityPlugin from './extra-specificity';
+
+const isProd = process.env.NODE_ENV === 'production';
+
+/**
+ * A collection of custom Stylis plugins to enhance the way the compiler (Emotion)
+ * generates selectors and CSS rules.
+ *
+ * @param {Object} options
+ * @param {number} [options.specificityLevel=7]
+ * @param {string} [options.key='css']
+ * @param {boolean} [options.skipSupportedBrowsers]
+ * @param {import('../../css-custom-properties').RootStore} [options.rootStore]
+ * @return {import('@emotion/stylis').Plugin[]} The list of stylis plugins.
+ */
+export function createPlugins( {
+ specificityLevel = 1,
+ key = 'css',
+ rootStore,
+ skipSupportedBrowsers = isProd,
+} ) {
+ return [
+ cssVariablesPlugin( { skipSupportedBrowsers, rootStore } ),
+ specificityPlugin( { level: specificityLevel, key } ),
+ // @ts-ignore styled-griddie imports StylisPlugin from `styled-components` which has different types from the actual one we're using here
+ cssGridPlugin,
+ ];
+}
diff --git a/packages/components/src/ui/create-styles/create-compiler/plugins/utils.js b/packages/components/src/ui/create-styles/create-compiler/plugins/utils.js
new file mode 100644
index 00000000000000..941f0c302e7b5c
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/plugins/utils.js
@@ -0,0 +1,20 @@
+/**
+ * Plugin contexts:
+ * https://github.com/thysultan/stylis.js/blob/4561e9bc830fccf1cb0e9e9838488b4d1d5cebf5/stylis.js#L150
+ */
+export const STYLIS_CONTEXTS = {
+ AT_RULE: 3,
+ NEWLINE: 0,
+ POST_PROCESS: -2,
+ PREPARATION: -1,
+ PROPERTY: 1,
+ SELECTOR_BLOCK: 2,
+};
+
+/**
+ * Character codes and special identifiers:
+ * https://github.com/thysultan/stylis.js/blob/4561e9bc830fccf1cb0e9e9838488b4d1d5cebf5/stylis.js#L92
+ */
+export const STYLIS_TOKENS = {
+ KEYFRAME: 107,
+};
diff --git a/packages/components/src/ui/create-styles/create-compiler/responsive.js b/packages/components/src/ui/create-styles/create-compiler/responsive.js
new file mode 100644
index 00000000000000..f4b3c9fc526440
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/responsive.js
@@ -0,0 +1,54 @@
+/**
+ * Internal dependencies
+ */
+import { breakpoints } from './utils';
+
+// https://github.com/system-ui/theme-ui/blob/master/packages/css/src/index.ts#L224
+/**
+ * A utility function that generates responsive styles if the value is an array.
+ *
+ * @param {import('@emotion/serialize').ObjectInterpolation} styles A styles object
+ * @param {(key: string, value: any) => any} [getScaleValue]
+ * @return {import('@emotion/serialize').ObjectInterpolation} An adjusted styles object with responsive styles (if applicable).
+ */
+export const responsive = (
+ styles = {},
+ getScaleValue = ( _, value ) => value
+) => {
+ /** @type {import('@emotion/serialize').ObjectInterpolation} */
+ const next = {};
+ const mediaQueries = [
+ null,
+ ...breakpoints.map( ( n ) => `@media screen and (min-width: ${ n })` ),
+ ];
+
+ for ( const k in styles ) {
+ const key = k;
+ const value = styles[ key ];
+
+ if ( value === null ) continue;
+
+ if ( ! Array.isArray( value ) ) {
+ next[ key ] = value;
+ continue;
+ }
+
+ for (
+ let i = 0;
+ i < value.slice( 0, mediaQueries.length ).length;
+ i++
+ ) {
+ const media = mediaQueries[ i ];
+ if ( ! media ) {
+ next[ key ] = getScaleValue( key, value[ i ] );
+ continue;
+ }
+ next[ media ] = next[ media ] || {};
+ if ( value[ i ] === null ) continue;
+ // @ts-ignore One line above we ensure that it is not null
+ next[ media ][ key ] = getScaleValue( key, value[ i ] );
+ }
+ }
+
+ return next;
+};
diff --git a/packages/components/src/ui/create-styles/create-compiler/test/responsive.js b/packages/components/src/ui/create-styles/create-compiler/test/responsive.js
new file mode 100644
index 00000000000000..a67574ad7baabf
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/test/responsive.js
@@ -0,0 +1,34 @@
+/**
+ * Internal dependencies
+ */
+import { responsive } from '../responsive';
+
+describe( 'responsive', () => {
+ test( 'should transform responsive space values', () => {
+ const styles = {
+ gap: [ 5, null, 10 ],
+ };
+
+ expect( responsive( styles ) ).toEqual( {
+ gap: 5,
+ '@media screen and (min-width: 40em)': {},
+ '@media screen and (min-width: 52em)': {
+ gap: 10,
+ },
+ } );
+ } );
+
+ test( 'should transform responsive space string values', () => {
+ const styles = {
+ gap: [ '5px', null, '10em' ],
+ };
+
+ expect( responsive( styles ) ).toEqual( {
+ gap: '5px',
+ '@media screen and (min-width: 40em)': {},
+ '@media screen and (min-width: 52em)': {
+ gap: '10em',
+ },
+ } );
+ } );
+} );
diff --git a/packages/components/src/ui/create-styles/create-compiler/utils.js b/packages/components/src/ui/create-styles/create-compiler/utils.js
new file mode 100644
index 00000000000000..65f5384fa9fbc1
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-compiler/utils.js
@@ -0,0 +1,15 @@
+/**
+ * Breakpoint values used for responsive style rendering.
+ */
+/**
+ * @type {['40em', '52em', '64em']}
+ */
+export const breakpoints = [ '40em', '52em', '64em' ];
+
+let currentInterpolationId = 0;
+/**
+ * @return {string} Interpolation class name.
+ */
+export const generateInterpolationName = () => {
+ return `interpolatable-component-${ currentInterpolationId++ }`;
+};
diff --git a/packages/components/src/ui/create-styles/create-style-system/README.md b/packages/components/src/ui/create-styles/create-style-system/README.md
new file mode 100644
index 00000000000000..a2ef57916c894d
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/README.md
@@ -0,0 +1,101 @@
+# create-style-system
+
+This module creates the `styled` utility as well as the overall style system.
+
+## styled
+
+`styled` works just as Emotion's and `styled-components`'s `styled` function objects. It is able to accept a component as an argument to style as well as is a collection of "core elements" that can be used to create styled elements on the fly.
+
+For example:
+
+```js
+const Text = styled.span`
+ color: blue;
+`;
+```
+
+`Text` is a React component that will render a `span` with the custom styles applied.
+
+`styled` can also be used as a function to apply custom styles to existing components:
+
+```jsx
+const Component = ({ className }) => {
+ return
My Favorite Component
;
+};
+
+const StyledComponent = styled(Component)`
+ color: green;
+`;
+```
+
+For a component to be able to be passed to `styled`, the only requirement is that it forward the `className` prop.
+
+Ultimately `styled` is just an interface for `css` that automatically applies the generated class name from the CSS to a given component, whether that is one of the core elements or a passed in component. That is why passed in components must forward the `className` prop.
+
+`styled` also supports component interpolation. See [`css`'s documentation here](../create-compiler/README.md) for more information on how it works. A breif example is here:
+
+```js
+const Text = styled.span`
+ color: red;
+`;
+
+const Container = styled.div`
+ display: flex;
+
+ ${Text} {
+ color: blue;
+ }
+`;
+```
+
+Now any child component `Text` of `Container` will be targeted with the `color: blue` style, while `Text` itself will continue to render the `color: red` style.
+
+## Polymorphic Component
+
+This module also exposes the concept of the Polymorphic Component. This concept is not new to this style system but the style and component system use it extensively and it is one of the more powerful aspects of this style system.
+
+Poylmorphic components are able to accept an `as` prop that will accept any React component or JSX Element name. For example:
+
+```jsx
+
+```
+
+Will render everything `View` renders but as a `span`.
+
+This is even more powerful when combining elements:
+
+```jsx
+
+
+
+ Click me!
+
+
+
+```
+
+As you can see, the component polymorphism allows you to powerfully compose the component system with itself and with other component systems. Even passing `as={ ReakitComponent }` for example will work, enabling powerful accessibility patterns while still maintaining the power of the style system on the core `View` component.
+
+Component polymorphism is documented via the `PolymorphicComponent` type in `polymorphic-component.ts`.
+
+The same module also exposes a `ViewOwnProps` type which gives the `as` props to a regular `Props` interface:
+
+```tsx
+interface Props {
+ foo: string;
+}
+
+function MyButton(props: ViewOwnProps) {
+ return ;
+}
+```
+
+The second parameter to `ViewOwnProps` should indicate the _default_ `as` value for the component. That is, if the component renders a `button` as the example above does, it should be `button`. This will give the `props` type all of the appropriate `HTMLAttributes` for the given intrinsic element. For example, our `MyButton` component above is able to accept a strongly typed `onClick` for a `MouseEvent`. Likewise, this will automagically change if `as` is passed as a different value:
+
+```jsx
+
+ Code is Poetry
+
+```
+
+`href` will be strongly typed to the `HTMLAnchorAttributes` prop.
diff --git a/packages/components/src/ui/create-styles/create-style-system/constants.js b/packages/components/src/ui/create-styles/create-style-system/constants.js
new file mode 100644
index 00000000000000..ca84e8336118c2
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/constants.js
@@ -0,0 +1,22 @@
+/**
+ * Uses the the prefix for the CSS variables compiled by the system.
+ */
+export const NAMESPACE = '--wp-experimental';
+
+export const DARK_MODE_ATTR_PROP = 'data-system-ui-mode';
+export const HIGH_CONTRAST_MODE_ATTR_PROP = 'data-system-ui-contrast-mode';
+export const COLOR_BLIND_MODE_ATTR_PROP = 'data-system-ui-color-blind-mode';
+export const REDUCED_MOTION_MODE_ATTR_PROP =
+ 'data-system-ui-reduced-motion-mode';
+
+export const DARK_MODE_ATTR = `[${ DARK_MODE_ATTR_PROP }="dark"]`;
+export const HIGH_CONTRAST_MODE_MODE_ATTR = `[${ HIGH_CONTRAST_MODE_ATTR_PROP }="high"]`;
+
+export const COLOR_BLIND_MODE_ATTR = `[${ COLOR_BLIND_MODE_ATTR_PROP }="true"]`;
+export const REDUCED_MOTION_MODE_ATTR = `[${ REDUCED_MOTION_MODE_ATTR_PROP }="true"]`;
+
+export const DARK_HIGH_CONTRAST_MODE_MODE_ATTR = `${ DARK_MODE_ATTR }${ HIGH_CONTRAST_MODE_MODE_ATTR }`;
+
+export const MODE_SPECIFICITY_COMPOUND_LEVEL = 3;
+
+export const INTERPOLATION_CLASS_NAME = '__interpolationClassName__';
diff --git a/packages/components/src/ui/create-styles/create-style-system/create-core-element.js b/packages/components/src/ui/create-styles/create-style-system/create-core-element.js
new file mode 100644
index 00000000000000..3ad94350b7bd6f
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/create-core-element.js
@@ -0,0 +1,145 @@
+/**
+ * WordPress dependencies
+ */
+import { useMergeRefs } from '@wordpress/compose';
+import { forwardRef, createElement } from '@wordpress/element';
+
+/**
+ * Internal dependencies
+ */
+import { useHydrateGlobalStyles } from '../hooks';
+import {
+ INTERPOLATION_CLASS_NAME,
+ REDUCED_MOTION_MODE_ATTR,
+} from './constants';
+import {
+ DEFAULT_STYLE_SYSTEM_OPTIONS,
+ getInterpolatedClassName,
+} from './utils';
+
+const defaultOptions = DEFAULT_STYLE_SYSTEM_OPTIONS;
+
+/**
+ * @typedef CreateCoreElementOptions
+ * @property {import('create-emotion').ObjectInterpolation} baseStyles The baseStyles from the Style system.
+ * @property {import('../create-compiler').Compiler} compiler The injectGlobal from the Style system's compiler.
+ * @property {import('./generate-theme').GenerateThemeResults} globalStyles The globalStyles from the Style system.
+ */
+
+/**
+ * Creates the core styled elements for the Style system. These elements are
+ * an in-between of Emotion's solution and a styled.div``
+ * solution.
+ *
+ * createCoreElement is a super light-weight higher-order wrapper that
+ * enhances base elements (like `div`, `input`, or even Components) with
+ * features provided by the Style system.
+ *
+ * A styled element also has built-in baseStyles (which can be adjusted using
+ * the createStyleSystem factory).
+ *
+ * @example
+ * ```jsx
+ * const alwaysBlueDiv = createCoreElement('div', { baseStyles: { background: 'blue' }})
+ * ```
+ *
+ * @template {keyof JSX.IntrinsicElements} TTagName
+ * @param {TTagName} tagName The HTMLElement/React.Component to connect with the Style system.
+ * @param {CreateCoreElementOptions} options Options to custom coreElement styles.
+ * @return {import('./polymorphic-component').PolymorphicComponent} The Style system wrapped HTMLElement/React.Component.
+ */
+export const createCoreElement = ( tagName, options ) => {
+ const { baseStyles, compiler, globalStyles } = {
+ ...defaultOptions,
+ ...options,
+ };
+
+ const { css, cx, injectGlobal } = compiler;
+
+ /**
+ * Default baseStyles for the system.
+ */
+ const styles = {
+ Base: css( {
+ // Automatic box-sizing resets.
+ boxSizing: 'border-box',
+ } ),
+ // Enforced reduced-motion preferred styles.
+ reduceMotion: css`
+ @media ( prefers-reduced-motion ) {
+ transition: none !important;
+ }
+ ${ REDUCED_MOTION_MODE_ATTR } & {
+ transition: none !important;
+ }
+ `,
+ };
+
+ const compiledBaseStyles = css( baseStyles );
+ const interpolationClassName = getInterpolatedClassName( tagName );
+
+ /**
+ * @param {any} props
+ * @param {import('react').Ref} ref
+ */
+ const Render = (
+ { as, children, className: classNameProp, forwardedRef, ...props },
+ ref
+ ) => {
+ /**
+ * useHydrateGlobalStyles an incredibly important hook, and is vital
+ * to the Style system. It automatically injects the variables Style
+ * system configs (configs, dark mode, etc...) on first-render.
+ *
+ * This way avoids....
+ *
+ * 1. The need to wrap coreElements / styled components in any .
+ * 2. The need to use Context connectors (e.g. for ThemeProvider), which is HUGE for performance.
+ */
+ useHydrateGlobalStyles( { globalStyles, injectGlobal } );
+
+ const element = as || tagName;
+ const className =
+ typeof classNameProp !== 'string'
+ ? cx( classNameProp )
+ : classNameProp;
+
+ /**
+ * Compiles all of the custom styles into classNames before binding it
+ * to the HTMLElement / React.Component.
+ */
+ const classes = cx(
+ styles.Base,
+ styles.reduceMotion,
+ compiledBaseStyles,
+ className,
+ interpolationClassName
+ );
+
+ const refs = useMergeRefs( [ forwardedRef, ref ] );
+
+ return createElement(
+ element,
+ {
+ className: classes,
+ ref: refs,
+ ...props,
+ },
+ children
+ );
+ };
+
+ const SystemComponent = forwardRef( Render );
+
+ if ( process.env.NODE_ENV === 'development' ) {
+ const displayName = typeof tagName === 'string' ? tagName : 'Component';
+
+ SystemComponent.displayName = displayName;
+ }
+
+ // @ts-ignore internal property
+ SystemComponent[ INTERPOLATION_CLASS_NAME ] = interpolationClassName;
+
+ // @ts-ignore
+ return SystemComponent;
+};
diff --git a/packages/components/src/ui/create-styles/create-style-system/create-core-elements.js b/packages/components/src/ui/create-styles/create-style-system/create-core-elements.js
new file mode 100644
index 00000000000000..23a27aff0975c6
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/create-core-elements.js
@@ -0,0 +1,34 @@
+/**
+ * Internal dependencies
+ */
+import { createCoreElement } from './create-core-element';
+import { tags } from './tags';
+
+/**
+ * @typedef CreateCoreElementProps
+ * @property {import('create-emotion').ObjectInterpolation} baseStyles Base styles for the coreElements.
+ * @property {import('../create-compiler').Compiler} compiler The injectGlobal from the Style system's compiler.
+ * @property {import('./generate-theme').GenerateThemeResults} globalStyles Global styles for the coreElements.
+ */
+
+/**
+ * Generates a set of coreElements based on React supported HTML tags.
+ *
+ * @param {CreateCoreElementProps} props Properties to create coreElements with.
+ * @return {import('./polymorphic-component').CoreElements} A set of coreElements.
+ */
+export function createCoreElements( { baseStyles, compiler, globalStyles } ) {
+ /** @type {import('./polymorphic-component').CoreElements} */
+ // @ts-ignore We fill in the missing properties in the loop below
+ const core = {};
+
+ const _createStyledElement = (
+ /** @type {keyof JSX.IntrinsicElements} */ tagName
+ ) => createCoreElement( tagName, { baseStyles, compiler, globalStyles } );
+
+ for ( const tagName of tags ) {
+ core[ tagName ] = _createStyledElement( tagName );
+ }
+
+ return core;
+}
diff --git a/packages/components/src/ui/create-styles/create-style-system/create-style-system.js b/packages/components/src/ui/create-styles/create-style-system/create-style-system.js
new file mode 100644
index 00000000000000..90c21d2c2cddc0
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/create-style-system.js
@@ -0,0 +1,151 @@
+/**
+ * Internal dependencies
+ */
+import { createCompiler } from '../create-compiler';
+import { createRootStore } from '../css-custom-properties';
+import { createCoreElement } from './create-core-element';
+import { createCoreElements } from './create-core-elements';
+import { createStyledComponents } from './create-styled-components';
+import { generateTheme } from './generate-theme';
+import { createToken, DEFAULT_STYLE_SYSTEM_OPTIONS } from './utils';
+
+const defaultOptions = DEFAULT_STYLE_SYSTEM_OPTIONS;
+
+/* eslint-disable jsdoc/valid-types */
+/**
+ * @template {Record} TConfig
+ * @template {Record} TDarkConfig
+ * @template {Record} THCConfig
+ * @template {Record} TDarkHCConfig
+ * @template {string} TGeneratedTokens
+ * @typedef CreateStyleSystemObjects
+ * @property {import('./polymorphic-component').CoreElements} core A set of coreElements.
+ * @property {import('../create-compiler').Compiler} compiler The Style system compiler (a custom Emotion instance).
+ * @property {(tagName: keyof JSX.IntrinsicElements) => ReturnType} createCoreElement A function to create a coreElement (with settings from the Style system).
+ * @property {import('../create-compiler').Compiler['css']} css A function to compile CSS styles.
+ * @property {import('../create-compiler').Compiler['cx']} cx A function to resolve + combine classNames.
+ * @property {(tokenName: string) => string} createToken A function to generate a design token (CSS variable) used by the system.
+ * @property {(value: keyof (TConfig & TDarkConfig & THCConfig & TDarkHCConfig) | TGeneratedTokens) => string} get The primary function to retrieve Style system variables.
+ * @property {import('./polymorphic-component').CreateStyled} styled A set of styled components.
+ * @property {import('react').ComponentType} View The base component.
+ * @property {import('../css-custom-properties').RootStore} rootStore The root store.
+ */
+
+/**
+ * @template {Record} TConfig
+ * @template {Record} TDarkConfig
+ * @template {Record} THCConfig
+ * @template {Record} TDarkHCConfig
+ * @template {string} TGeneratedTokens
+ * @typedef CreateStyleSystemOptions
+ * @property {import('create-emotion').ObjectInterpolation} baseStyles The base styles.
+ * @property {TConfig} config The base theme config.
+ * @property {TDarkConfig} darkModeConfig The dark mode theme config.
+ * @property {THCConfig} highContrastModeConfig The high contrast mode theme config.
+ * @property {TDarkHCConfig} darkHighContrastModeConfig The dark-high contrast mode theme config.
+ * @property {import('../create-compiler').CreateCompilerOptions} [compilerOptions] The compiler options.
+ */
+/* eslint-enable jsdoc/valid-types */
+
+/**
+ * Creates a Style system using a set of baseStyles and configs.
+ *
+ * @example
+ * ```js
+ * const baseStyles = { background: 'blue' };
+ * const blueStyleSystem = createStyleSystem({ baseStyles });
+ * ```
+ *
+ * @template {Record} TConfig
+ * @template {Record} TDarkConfig
+ * @template {Record} THCConfig
+ * @template {Record} TDarkHCConfig
+ * @template {string} TGeneratedTokens
+ * @param {CreateStyleSystemOptions} options Options to create a Style system with.
+ * @return {CreateStyleSystemObjects} A collection of functions and elements from the generated Style system.
+ */
+export function createStyleSystem( options = defaultOptions ) {
+ const {
+ baseStyles,
+ compilerOptions,
+ config,
+ darkHighContrastModeConfig,
+ darkModeConfig,
+ highContrastModeConfig,
+ } = {
+ ...defaultOptions,
+ ...options,
+ };
+
+ const globalStyles = generateTheme( {
+ config,
+ darkHighContrastModeConfig,
+ darkModeConfig,
+ highContrastModeConfig,
+ } );
+
+ const rootStore = createRootStore( globalStyles.globalVariables );
+ rootStore.setState( globalStyles.globalVariables );
+
+ /**
+ * Compiler (Custom Emotion instance).
+ */
+ const compiler = createCompiler( {
+ ...compilerOptions,
+ rootStore,
+ } );
+ const { css, cx } = compiler;
+
+ /**
+ * Core elements.
+ *
+ * @example
+ * ```jsx
+ *
+ * ```
+ */
+ const core = createCoreElements( { baseStyles, compiler, globalStyles } );
+
+ /**
+ * Styled components.
+ *
+ * @example
+ * ```jsx
+ * const StyledDiv = styled.div``
+ *
+ *
+ * ```
+ */
+ const styled = createStyledComponents( { compiler, core } );
+
+ /**
+ * Export prebound createCoreElement factory.
+ *
+ * @param {keyof JSX.IntrinsicElements} tagName
+ */
+ const _createCoreElement = ( tagName ) =>
+ createCoreElement( tagName, { baseStyles, compiler, globalStyles } );
+
+ const View = core.div;
+
+ const styleSystem = {
+ compiler,
+ core,
+ createCoreElement: _createCoreElement,
+ createToken,
+ css,
+ cx,
+ get: (
+ /* eslint-disable jsdoc/no-undefined-types */
+ /** @type {keyof TConfig | keyof TDarkConfig | keyof THCConfig | keyof TDarkHCConfig | TGeneratedTokens} */ key
+ /* eslint-enable jsdoc/no-undefined-types */
+ ) => `var(${ createToken( key.toString() ) })`,
+ styled,
+ View,
+ rootStore,
+ };
+
+ return styleSystem;
+}
+
+export default createStyleSystem;
diff --git a/packages/components/src/ui/create-styles/create-style-system/create-styled-components.js b/packages/components/src/ui/create-styles/create-style-system/create-styled-components.js
new file mode 100644
index 00000000000000..ed28c959ccee71
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/create-styled-components.js
@@ -0,0 +1,175 @@
+/**
+ * External dependencies
+ */
+import hoistNonReactStatics from 'hoist-non-react-statics';
+
+/**
+ * WordPress dependencies
+ */
+import { forwardRef } from '@wordpress/element';
+
+/**
+ * Internal dependencies
+ */
+import { INTERPOLATION_CLASS_NAME } from './constants';
+import { tags } from './tags';
+import { compileInterpolatedStyles, getInterpolatedClassName } from './utils';
+
+/**
+ * @typedef CreateStyledComponentsProps
+ * @property {import('../create-compiler').Compiler} compiler The (custom) Emotion instance.
+ * @property {import('./polymorphic-component').CoreElements} core The collection of coreElements.
+ */
+
+/**
+ * Creates a set of styled components for the Style system.
+ * These styled components are similarly to Emotion's or Styled-Components styled.div``.
+ *
+ * A big difference is that the Style system's styled components do NOT require
+ * context connection at all. This is HUGE for performance as there are far less
+ * React.Component nodes within the render tree.
+ *
+ * This is thanks to how the Style system compiles and coordinates style values.
+ *
+ * @param {CreateStyledComponentsProps} props Props to create styled components with.
+ * @return {import('./polymorphic-component').CreateStyled} A set of styled components.
+ */
+export function createStyledComponents( { compiler, core } ) {
+ const { css, cx, generateInterpolationName } = compiler;
+
+ /**
+ * That's all a is :). A core.div.
+ */
+ const Box = core.div;
+
+ /**
+ *
+ * @param {import('react').ElementType} tagName
+ * @param {any} options
+ */
+ function createStyled( tagName, options = {} ) {
+ const {
+ /**
+ * A way to pass in extraProps when created a styled component.
+ */
+ props: extraProps,
+ } = options;
+
+ return ( /** @type {any[]} */ ...interpolatedProps ) => {
+ const interpolationClassName = getInterpolatedClassName(
+ generateInterpolationName()
+ );
+ /** @type {import('react').ForwardRefRenderFunction} */
+ const Render = ( { as: asProp, className, ...props }, ref ) => {
+ // Combine all of the props together.
+ const mergedProps = { ...extraProps, ...props, ref };
+
+ const baseTag = asProp || tagName;
+
+ // Resolves prop interpolation.
+ const interpolatedStyles = compileInterpolatedStyles(
+ interpolatedProps,
+ props
+ );
+
+ const classes = cx(
+ css( ...interpolatedStyles ),
+ className,
+ interpolationClassName
+ );
+
+ return (
+
+ );
+ };
+
+ const StyledComponent = forwardRef( Render );
+
+ /*
+ * Enhancing the displayName.
+ */
+ if ( typeof tagName === 'string' ) {
+ StyledComponent.displayName = `Styled(${ getDisplayName(
+ tagName
+ ) })`;
+ } else if ( typeof tagName?.displayName !== 'undefined' ) {
+ StyledComponent.displayName = tagName.displayName;
+ } else {
+ StyledComponent.displayName = `Styled(${ getDisplayName(
+ tagName
+ ) })`;
+ }
+
+ /*
+ * Enhancing .withComponent()
+ * https://github.com/emotion-js/emotion/blob/master/packages/styled-base/src/index.js#L210
+ *
+ * This step is essential as we want styled components generated with
+ * .withComponent to have the correct baseStyles.
+ */
+ // @ts-ignore
+ StyledComponent.withComponent = (
+ /** @type {import('react').ElementType} */ nextTag,
+ /** @type {any} */ nextOptions
+ ) => {
+ return createStyled(
+ nextTag,
+ nextOptions !== undefined
+ ? { ...( options || {} ), ...nextOptions }
+ : options
+ )( ...interpolatedProps );
+ };
+
+ // @ts-ignore internal property
+ StyledComponent[
+ INTERPOLATION_CLASS_NAME
+ ] = interpolationClassName;
+
+ if ( typeof tagName !== 'string' ) {
+ /*
+ * Hoisting statics one last time, if the tagName is a Component,
+ * rather than an HTML tag, like `div`.
+ */
+ return hoistNonReactStatics( StyledComponent, tagName );
+ }
+ return StyledComponent;
+ };
+ }
+
+ // Bind it to avoid mutating the original function. Just like @emotion/styled:
+ // https://github.com/emotion-js/emotion/blob/master/packages/styled/src/index.js
+ /* eslint-disable jsdoc/valid-types */
+ /** @type {typeof createStyled & { [P in keyof JSX.IntrinsicElements]: ReturnType}} */
+ // @ts-ignore We fill in the missing properties below
+ const styled = createStyled.bind( undefined );
+ /* eslint-enable jsdoc/valid-types */
+
+ // Generating the core collection of styled[tagName], with our enhanced
+ // version of styled.
+ tags.forEach( ( tagName ) => {
+ styled[ tagName ] = createStyled( tagName );
+ } );
+
+ // @ts-ignore We cannot convince TypeScript that we've taken care of everything here, we're doing too many JavaScript magics for this to work without an ignore
+ return styled;
+}
+
+/**
+ * Gets the displayName of a React Component or element.
+ *
+ * @param {string | import('react').ComponentType} tagName
+ *
+ * @return {string} The display name of the Component / tagName.
+ */
+export function getDisplayName( tagName ) {
+ const displayName =
+ typeof tagName === 'string'
+ ? tagName
+ : tagName.displayName || tagName.name || 'Component';
+
+ return displayName;
+}
diff --git a/packages/components/src/ui/create-styles/create-style-system/generate-theme.js b/packages/components/src/ui/create-styles/create-style-system/generate-theme.js
new file mode 100644
index 00000000000000..177664a74b7197
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/generate-theme.js
@@ -0,0 +1,84 @@
+/**
+ * External dependencies
+ */
+import { repeat } from 'lodash';
+
+/**
+ * Internal dependencies
+ */
+import {
+ DARK_HIGH_CONTRAST_MODE_MODE_ATTR,
+ DARK_MODE_ATTR,
+ HIGH_CONTRAST_MODE_MODE_ATTR,
+ MODE_SPECIFICITY_COMPOUND_LEVEL,
+} from './constants';
+import {
+ transformValuesToReferences,
+ transformValuesToVariables,
+ transformValuesToVariablesString,
+} from './utils';
+
+/**
+ * @typedef GenerateThemeProps
+ * @property {import('./utils').StyleConfigValues} config Default theme config.
+ * @property {import('./utils').StyleConfigValues} darkModeConfig Dark mode theme config.
+ * @property {import('./utils').StyleConfigValues} highContrastModeConfig High contrast mode theme config.
+ * @property {import('./utils').StyleConfigValues} darkHighContrastModeConfig Dark high contrast mode theme config.
+ */
+
+/**
+ * @typedef GenerateThemeResults
+ * @property {import('./utils').StyleConfig} theme A set of theme style references.
+ * @property {import('./utils').StyleConfig} globalVariables A set of global variables.
+ * @property {string} globalCSSVariables The compiled CSS string for global variables.
+ * @property {string} darkModeCSSVariables The compiled CSS string for global dark variables.
+ * @property {string} highContrastModeCSSVariables The compiled CSS string for global high contrast variables.
+ * @property {string} darkHighContrastModeCSSVariables The compiled CSS string for global dark high contrast variables.
+ */
+
+/**
+ * Generates theme references and compiles CSS variables to be used by the Style System.
+ *
+ * @param {GenerateThemeProps} props Props to generate a Style system theme with.
+ * @return {GenerateThemeResults} A set of variables and content for the System.
+ */
+export function generateTheme( {
+ config = {},
+ darkModeConfig = {},
+ highContrastModeConfig = {},
+ darkHighContrastModeConfig = {},
+} ) {
+ const theme = transformValuesToReferences( config );
+ const globalVariables = transformValuesToVariables( config );
+ const globalCSSVariables = transformValuesToVariablesString(
+ ':root',
+ config
+ );
+
+ const darkModeCSSVariables = transformValuesToVariablesString(
+ repeat( DARK_MODE_ATTR, MODE_SPECIFICITY_COMPOUND_LEVEL ),
+ darkModeConfig
+ );
+
+ const highContrastModeCSSVariables = transformValuesToVariablesString(
+ repeat( HIGH_CONTRAST_MODE_MODE_ATTR, MODE_SPECIFICITY_COMPOUND_LEVEL ),
+ highContrastModeConfig
+ );
+
+ const darkHighContrastModeCSSVariables = transformValuesToVariablesString(
+ repeat(
+ DARK_HIGH_CONTRAST_MODE_MODE_ATTR,
+ MODE_SPECIFICITY_COMPOUND_LEVEL
+ ),
+ darkHighContrastModeConfig
+ );
+
+ return {
+ theme,
+ globalVariables,
+ globalCSSVariables,
+ darkModeCSSVariables,
+ highContrastModeCSSVariables,
+ darkHighContrastModeCSSVariables,
+ };
+}
diff --git a/packages/components/src/ui/create-styles/create-style-system/index.js b/packages/components/src/ui/create-styles/create-style-system/index.js
new file mode 100644
index 00000000000000..e874b6bcaa16df
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/index.js
@@ -0,0 +1,7 @@
+export * from './constants';
+export * from './utils';
+
+export * from './create-style-system';
+export * from './tags';
+
+export * from './polymorphic-component';
diff --git a/packages/components/src/ui/create-styles/create-style-system/polymorphic-component.ts b/packages/components/src/ui/create-styles/create-style-system/polymorphic-component.ts
new file mode 100644
index 00000000000000..2511de54a9189d
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/polymorphic-component.ts
@@ -0,0 +1,62 @@
+/**
+ * External dependencies
+ */
+// eslint-disable-next-line no-restricted-imports
+import type * as React from 'react';
+import type { As, RenderProp, ExtractHTMLAttributes } from 'reakit-utils/types';
+import type { Interpolation, ObjectInterpolation } from 'create-emotion';
+
+/**
+ * Based on https://github.com/reakit/reakit/blob/master/packages/reakit-utils/src/types.ts
+ */
+export type ViewOwnProps< P, T extends As > = P &
+ Omit< React.ComponentPropsWithRef< T >, 'as' | 'css' | keyof P > & {
+ as?: T | keyof JSX.IntrinsicElements;
+ children?: React.ReactNode | RenderProp< ExtractHTMLAttributes< any > >;
+ css?: ObjectInterpolation< undefined > | string;
+ };
+
+export type ElementTypeFromViewOwnProps< P > = P extends ViewOwnProps<
+ unknown,
+ infer T
+>
+ ? T
+ : never;
+
+export type PropsFromViewOwnProps< P > = P extends ViewOwnProps< infer PP, any >
+ ? PP
+ : never;
+
+export type PolymorphicComponent< T extends As, O > = {
+ < TT extends As >(
+ props: ViewOwnProps< O, TT > & { as: TT }
+ ): JSX.Element | null;
+ ( props: ViewOwnProps< O, T > ): JSX.Element | null;
+ displayName?: string;
+ __interpolationClassName__: string;
+};
+
+export type CreatePolymorphicComponent< T extends As, P > = (
+ template: TemplateStringsArray,
+ ...styles: (
+ | Interpolation< undefined >
+ | PolymorphicComponent< any, any >
+ )[]
+) => PolymorphicComponent< T, P >;
+
+export type ForwardedRef< TElement extends HTMLElement > =
+ | ( ( instance: TElement | null ) => void )
+ | React.MutableRefObject< TElement | null >
+ | null;
+
+export type CoreElements = {
+ [ P in keyof JSX.IntrinsicElements ]: PolymorphicComponent< P, {} >;
+};
+
+type CreateStyledComponents = {
+ [ P in keyof JSX.IntrinsicElements ]: CreatePolymorphicComponent< P, {} >;
+};
+
+export type CreateStyled = CreateStyledComponents & {
+ < T extends As >( component: T ): CreatePolymorphicComponent< T, {} >;
+};
diff --git a/packages/components/src/ui/create-styles/create-style-system/tags.js b/packages/components/src/ui/create-styles/create-style-system/tags.js
new file mode 100644
index 00000000000000..1fe5adbafab223
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/tags.js
@@ -0,0 +1,141 @@
+/**
+ * A collection of React HTMLElements.
+ */
+/** @type {(keyof JSX.IntrinsicElements)[]} */
+export const tags = [
+ 'a',
+ 'abbr',
+ 'address',
+ 'area',
+ 'article',
+ 'aside',
+ 'audio',
+ 'b',
+ 'base',
+ 'bdi',
+ 'bdo',
+ 'big',
+ 'blockquote',
+ 'body',
+ 'br',
+ 'button',
+ 'canvas',
+ 'caption',
+ 'cite',
+ 'code',
+ 'col',
+ 'colgroup',
+ 'data',
+ 'datalist',
+ 'dd',
+ 'del',
+ 'details',
+ 'dfn',
+ 'dialog',
+ 'div',
+ 'dl',
+ 'dt',
+ 'em',
+ 'embed',
+ 'fieldset',
+ 'figcaption',
+ 'figure',
+ 'footer',
+ 'form',
+ 'h1',
+ 'h2',
+ 'h3',
+ 'h4',
+ 'h5',
+ 'h6',
+ 'head',
+ 'header',
+ 'hgroup',
+ 'hr',
+ 'html',
+ 'i',
+ 'iframe',
+ 'img',
+ 'input',
+ 'ins',
+ 'kbd',
+ 'keygen',
+ 'label',
+ 'legend',
+ 'li',
+ 'link',
+ 'main',
+ 'map',
+ 'mark',
+ 'menu',
+ 'menuitem',
+ 'meta',
+ 'meter',
+ 'nav',
+ 'noscript',
+ 'object',
+ 'ol',
+ 'optgroup',
+ 'option',
+ 'output',
+ 'p',
+ 'param',
+ 'picture',
+ 'pre',
+ 'progress',
+ 'q',
+ 'rp',
+ 'rt',
+ 'ruby',
+ 's',
+ 'samp',
+ 'script',
+ 'section',
+ 'select',
+ 'small',
+ 'source',
+ 'span',
+ 'strong',
+ 'style',
+ 'sub',
+ 'summary',
+ 'sup',
+ 'table',
+ 'tbody',
+ 'td',
+ 'textarea',
+ 'tfoot',
+ 'th',
+ 'thead',
+ 'time',
+ 'title',
+ 'tr',
+ 'track',
+ 'u',
+ 'ul',
+ 'var',
+ 'video',
+ 'wbr',
+
+ // SVG
+ 'circle',
+ 'clipPath',
+ 'defs',
+ 'ellipse',
+ 'foreignObject',
+ 'g',
+ 'image',
+ 'line',
+ 'linearGradient',
+ 'mask',
+ 'path',
+ 'pattern',
+ 'polygon',
+ 'polyline',
+ 'radialGradient',
+ 'rect',
+ 'stop',
+ 'svg',
+ 'text',
+ 'tspan',
+];
diff --git a/packages/components/src/ui/create-styles/create-style-system/test/create-style-system.js b/packages/components/src/ui/create-styles/create-style-system/test/create-style-system.js
new file mode 100644
index 00000000000000..85b817cdf19707
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/test/create-style-system.js
@@ -0,0 +1,89 @@
+/**
+ * External dependencies
+ */
+import { render } from '@testing-library/react';
+
+/**
+ * Internal dependencies
+ */
+import { createStyleSystem } from '../index';
+
+describe( 'createStyleSystem', () => {
+ let compiler;
+
+ const testCreateStyleSystem = ( ...args ) => {
+ const styleSystem = createStyleSystem( ...args );
+ compiler = styleSystem.compiler;
+ return styleSystem;
+ };
+
+ afterAll( () => {
+ if ( compiler?.flush ) {
+ compiler.flush();
+ }
+ } );
+
+ test( 'should include a styled element, View, and styled component that renders', () => {
+ const { View, core, styled } = testCreateStyleSystem();
+
+ const Box = styled.p`
+ padding: 10px;
+ `;
+ const { container } = render(
+ <>
+
+
+
+ >
+ );
+
+ expect( container.querySelector( 'input' ) ).toHaveStyle( {
+ boxSizing: 'border-box',
+ } );
+ expect( container.querySelector( 'span' ) ).toHaveStyle( {
+ boxSizing: 'border-box',
+ } );
+ expect( container.querySelector( 'p' ) ).toHaveStyle( {
+ boxSizing: 'border-box',
+ padding: '10px',
+ } );
+ } );
+
+ test( 'should render custom baseStyles', () => {
+ const { View } = testCreateStyleSystem( {
+ baseStyles: {
+ background: 'blue',
+ },
+ } );
+
+ const { container } = render( );
+
+ expect( container.querySelector( 'div' ) ).toHaveStyle( {
+ boxSizing: 'border-box',
+ background: 'blue',
+ } );
+ } );
+
+ test( 'should support multiple nested style system instances', () => {
+ const { View } = testCreateStyleSystem();
+ const { View: AnotherView } = testCreateStyleSystem( {
+ baseStyles: {
+ padding: '2em',
+ },
+ } );
+
+ const { container } = render(
+
+
+
+ );
+
+ expect( container.querySelector( 'div' ) ).toHaveStyle( {
+ boxSizing: 'border-box',
+ } );
+ expect( container.querySelector( 'span' ) ).toHaveStyle( {
+ boxSizing: 'border-box',
+ padding: '2em',
+ } );
+ } );
+} );
diff --git a/packages/components/src/ui/create-styles/create-style-system/types.d.ts b/packages/components/src/ui/create-styles/create-style-system/types.d.ts
new file mode 100644
index 00000000000000..1a94ff4bb72fcd
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/types.d.ts
@@ -0,0 +1 @@
+declare module '@wordpress/compose';
diff --git a/packages/components/src/ui/create-styles/create-style-system/utils.js b/packages/components/src/ui/create-styles/create-style-system/utils.js
new file mode 100644
index 00000000000000..e8b0ca7e063137
--- /dev/null
+++ b/packages/components/src/ui/create-styles/create-style-system/utils.js
@@ -0,0 +1,186 @@
+/**
+ * External dependencies
+ */
+import hash from '@emotion/hash';
+import { kebabCase } from 'lodash';
+
+/**
+ * Internal dependencies
+ */
+import { INTERPOLATION_CLASS_NAME, NAMESPACE } from './constants';
+
+/**
+ * @type {{
+ baseStyles: any;
+ config: any;
+ darkModeConfig: any;
+ highContrastModeConfig: any;
+ darkHighContrastModeConfig: any;
+ compilerOptions: any;
+ }}
+ */
+export const DEFAULT_STYLE_SYSTEM_OPTIONS = {
+ baseStyles: {},
+ config: {},
+ darkModeConfig: {},
+ highContrastModeConfig: {},
+ darkHighContrastModeConfig: {},
+ compilerOptions: undefined,
+};
+
+/**
+ * Creates the (CSS Variable) design token used by the Style system.
+ *
+ * @param {string} key The variable (key).
+ * @return {string} The token (CSS variable).
+ */
+export function createToken( key ) {
+ return `${ NAMESPACE }-${ kebabCase( key ) }`;
+}
+
+/**
+ * The primary mechanism to retrieve Style system configs values - values that
+ * have been transformed into CSS variables with a dedicated namespace.
+ *
+ * @example
+ * ```js
+ * get('colorAdmin'); // var(--wp-color-admin, 'blue');
+ * ```
+ * @template {Record} TConfig
+ * @template {Record} TDarkConfig
+ * @template {Record} THCConfig
+ * @template {Record} TDarkHCConfig
+ * @template {string} TGeneratedTokens
+ * @param {keyof (TConfig & TDarkConfig & THCConfig & TDarkHCConfig) | TGeneratedTokens} key The config variable to retrieve.
+ * @return {string} The compiled CSS variable associated with the config key.
+ */
+export function get( key ) {
+ return `var(${ createToken( key.toString() ) })`;
+}
+
+/** @typedef {Record} StyleConfigValues */
+/** @typedef {Record} StyleConfig */
+
+/**
+ * Transforms a series of config values into set of namespaced CSS
+ * references for the Style system.
+ *
+ * @param {StyleConfigValues} values Style config values to transform into CSS variables.
+ * @return {StyleConfig} The set of CSS variables, transformed from config values.
+ */
+export function transformValuesToReferences( values = {} ) {
+ /** @type {StyleConfig} */
+ const next = {};
+ for ( const [ key, value ] of Object.entries( values ) ) {
+ const ref = `var(${ createToken( key ) }, ${ value })`;
+ next[ key ] = ref;
+ }
+ return next;
+}
+
+/**
+ * Transforms a series of config values into set of namespaced CSS
+ * variables for the Style system. These values can then be safely and predictable
+ * retrieved using the get() function.
+ *
+ * @param {StyleConfigValues} values Style config values to transform into CSS variables.
+ * @return {StyleConfig} The set of CSS variables, transformed from config values.
+ */
+export function transformValuesToVariables( values = {} ) {
+ /** @type {StyleConfig} */
+ const next = {};
+
+ for ( const [ key, value ] of Object.entries( values ) ) {
+ const ref = value;
+ next[ `${ createToken( key ) }` ] = ref?.toString();
+ }
+
+ return next;
+}
+
+/**
+ * Transforms a series of config values into set of namespaced CSS
+ * references for the Style system. These values are then transformed into
+ * a CSS style value (`string`) that can be injected into the DOM, within a
+ *