From 433be2b61877a4660082e38019c33972d3b78636 Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Wed, 19 Oct 2022 16:56:13 +0000 Subject: [PATCH] Merge changes published in the Gutenberg plugin "release/14.4" branch --- .eslintrc.js | 7 + .github/dependabot.yml | 10 + .github/workflows/build-plugin-zip.yml | 22 +- .github/workflows/bundle-size.yml | 6 +- .github/workflows/create-block.yml | 4 +- .github/workflows/end2end-test-playwright.yml | 8 +- .github/workflows/end2end-test.yml | 8 +- .github/workflows/flaky-tests.yml | 4 +- .github/workflows/performance.yml | 8 +- .github/workflows/publish-npm-packages.yml | 6 +- .github/workflows/pull-request-automation.yml | 6 +- .github/workflows/rnmobile-android-runner.yml | 14 +- .github/workflows/rnmobile-ios-runner.yml | 14 +- .../stale-issue-add-needs-testing.yml | 19 - .github/workflows/stale-issue-flaky-test.yml | 19 - .github/workflows/stale-issue-gardening.yml | 53 ++ .github/workflows/stale-issue-mark-stale.yml | 20 - .github/workflows/stale-issue-needs-info.yml | 19 - .github/workflows/static-checks.yml | 4 +- .github/workflows/storybook-pages.yml | 6 +- .github/workflows/unit-test.yml | 12 +- .../upload-release-to-plugin-repo.yml | 6 +- .gitignore | 1 + bin/cherry-pick.mjs | 2 +- bin/plugin/commands/performance.js | 7 +- changelog.txt | 285 ++++++++++ docs/contributors/versions-in-wordpress.md | 2 + docs/explanations/architecture/styles.md | 102 +++- docs/how-to-guides/README.md | 2 + .../applying-styles-with-stylesheets.md | 2 +- .../block-tutorial/creating-dynamic-blocks.md | 2 +- .../extending-the-query-loop-block.md | 26 +- .../javascript/versions-and-building.md | 2 +- .../platform/custom-block-editor/tutorial.md | 2 +- docs/how-to-guides/plugin-sidebar-0.md | 2 +- docs/how-to-guides/propagating-updates.md | 12 +- docs/manifest.json | 14 +- .../block-api/block-supports.md | 14 + docs/reference-guides/core-blocks.md | 12 +- .../data/data-core-block-editor.md | 11 +- .../filters/editor-filters.md | 2 +- .../filters/global-styles-filters.md | 10 +- .../theme-json-reference/theme-json-living.md | 26 +- docs/toc.json | 3 + gutenberg.php | 2 +- lib/block-supports/typography.php | 155 ++++- lib/blocks.php | 1 + lib/client-assets.php | 4 +- .../edit-site-routes-backwards-compat.php | 2 +- .../wordpress-6.1/block-template-utils.php | 12 +- lib/compat/wordpress-6.1/blocks.php | 14 +- .../wordpress-6.1/class-wp-theme-json-6-1.php | 14 +- .../class-wp-theme-json-resolver-6-1.php | 6 +- lib/compat/wordpress-6.1/script-loader.php | 38 +- lib/compat/wordpress-6.2/script-loader.php | 30 + ...class-wp-theme-json-resolver-gutenberg.php | 4 +- .../html/class-wp-html-tag-processor.php | 16 +- lib/load.php | 3 + package-lock.json | 386 ++++++++----- package.json | 8 +- packages/a11y/src/test/add-container.test.js | 27 +- packages/a11y/src/test/clear.test.js | 4 +- packages/a11y/src/test/index.test.js | 14 +- packages/base-styles/_z-index.scss | 3 - .../test/index.js | 8 +- .../downloadable-blocks-list/test/index.js | 4 +- packages/block-editor/CHANGELOG.md | 10 + packages/block-editor/README.md | 41 ++ .../components/block-breadcrumb/test/index.js | 2 +- .../block-draggable/draggable-chip.js | 6 +- .../src/components/block-inspector/index.js | 15 +- .../block-list/block-list-compact.native.js | 1 + .../src/components/block-list/block.js | 118 +++- .../src/components/block-list/block.native.js | 132 ++++- .../src/components/block-list/style.scss | 219 +++---- .../block-list/use-in-between-inserter.js | 27 +- .../src/components/block-lock/modal.js | 19 +- .../src/components/block-mover/style.scss | 1 - .../components/block-parent-selector/index.js | 6 +- .../components/block-patterns-list/index.js | 14 +- .../components/block-patterns-list/style.scss | 10 +- .../src/components/block-popover/README.md | 8 + .../src/components/block-popover/drop-zone.js | 63 +++ .../src/components/block-popover/index.js | 3 +- .../src/components/block-popover/style.scss | 18 +- .../src/components/block-preview/auto.js | 2 +- .../src/components/block-preview/index.js | 15 +- .../src/components/block-preview/live.js | 9 +- .../components/block-preview/test/index.js | 8 +- .../block-selection-clearer/index.js | 9 +- .../block-selection-clearer/test/index.js | 118 ++++ .../block-settings-dropdown.js | 36 +- .../test/block-mode-toggle.js | 34 +- .../src/components/block-styles/index.js | 75 +-- .../components/block-switcher/test/index.js | 4 +- .../src/components/block-toolbar/index.js | 10 +- .../src/components/block-toolbar/style.scss | 52 +- .../src/components/block-tools/back-compat.js | 1 + .../components/block-tools/insertion-point.js | 59 +- .../block-tools/selected-block-popover.js | 15 +- .../button-block-appender/style.scss | 6 +- .../test/__snapshots__/control.js.snap | 84 ++- .../components/color-palette/test/control.js | 26 +- .../components/colors-gradients/control.js | 4 +- .../panel-color-gradient-settings.js | 7 +- .../colors-gradients/test/control.js | 126 ++--- .../src/components/font-sizes/fluid-utils.js | 296 ++++++++++ .../src/components/font-sizes/index.js | 1 + .../components/font-sizes/test/fluid-utils.js | 168 ++++++ .../image-size-control/test/index.js | 107 ++-- packages/block-editor/src/components/index.js | 1 - .../use-inner-block-template-sync.js | 5 +- .../inserter-draggable-blocks/index.js | 14 +- .../components/inserter-list-item/style.scss | 21 +- .../components/inserter/block-patterns-tab.js | 330 +++++++---- .../src/components/inserter/menu.js | 17 +- .../src/components/inserter/pattern-panel.js | 93 --- .../src/components/inserter/style.scss | 103 +++- .../inserter/test/reusable-blocks-tab.js | 12 +- .../src/components/link-control/test/index.js | 2 +- .../list-view/use-list-view-drop-zone.js | 22 +- .../panel-color-settings/test/index.js | 8 +- .../src/components/preview-options/index.js | 4 +- .../src/components/preview-options/style.scss | 2 +- .../provider/test/use-block-sync.js | 296 +++++----- .../responsive-block-control/test/index.js | 8 +- .../spacing-input-control.js | 18 +- .../spacing-sizes-control/style.scss | 45 +- .../components/use-block-drop-zone/index.js | 215 ++++--- .../use-block-drop-zone/test/index.js | 414 +++++++++++--- .../src/components/use-on-block-drop/index.js | 23 +- .../src/components/use-on-block-drop/types.ts | 1 + packages/block-editor/src/hooks/align.js | 5 +- .../block-editor/src/hooks/align.native.js | 13 +- packages/block-editor/src/hooks/font-size.js | 75 +++ packages/block-editor/src/hooks/margin.js | 9 +- packages/block-editor/src/hooks/padding.js | 1 + packages/block-editor/src/hooks/style.js | 125 +++- packages/block-editor/src/hooks/test/style.js | 207 ++++++- .../src/hooks/test/use-typography-props.js | 22 + .../src/hooks/use-typography-props.js | 21 +- packages/block-editor/src/hooks/utils.js | 8 +- packages/block-editor/src/store/actions.js | 32 +- packages/block-editor/src/store/defaults.js | 3 + packages/block-editor/src/store/reducer.js | 55 +- .../block-editor/src/store/test/actions.js | 9 - packages/block-editor/src/utils/math.js | 17 + .../src/utils/pre-parse-patterns.js | 19 +- packages/block-library/CHANGELOG.md | 1 - packages/block-library/src/archives/edit.js | 1 + .../block-library/src/archives/style.scss | 5 + packages/block-library/src/avatar/index.php | 2 +- .../test/__snapshots__/edit.native.js.snap | 13 + .../src/code/test/edit.native.js | 78 +-- .../src/comment-template/edit.js | 81 +-- .../block-library/src/comments-title/edit.js | 25 +- .../block-library/src/comments/block.json | 6 +- .../src/comments/edit/placeholder.js | 8 +- .../block-library/src/comments/style.scss | 2 + .../block-library/src/cover/edit/index.js | 9 +- .../src/cover/edit/use-cover-is-dark.js | 22 +- packages/block-library/src/cover/editor.scss | 7 + .../block-library/src/embed/variations.js | 2 +- .../block-library/src/gallery/transforms.js | 13 +- packages/block-library/src/gallery/v1/edit.js | 4 +- packages/block-library/src/group/editor.scss | 1 + packages/block-library/src/image/editor.scss | 5 +- packages/block-library/src/image/image.js | 88 ++- .../block-library/src/image/transforms.js | 8 +- .../block-library/src/list-item/block.json | 15 +- packages/block-library/src/list-item/edit.js | 3 +- .../src/list-item/edit.native.js | 3 +- .../src/list-item/hooks/use-merge.js | 27 +- .../list-item/hooks/use-outdent-list-item.js | 8 +- .../src/list/test/edit.native.js | 105 +++- packages/block-library/src/list/transforms.js | 11 + .../block-library/src/navigation-link/edit.js | 2 +- .../src/navigation-link/index.php | 9 +- .../src/navigation-submenu/index.php | 9 +- .../block-library/src/navigation/block.json | 5 +- .../src/navigation/edit/index.js | 72 ++- .../src/navigation/edit/inner-blocks.js | 7 +- .../use-convert-classic-menu-to-block-menu.js | 37 +- .../edit/use-create-navigation-menu.js | 7 +- .../block-library/src/navigation/editor.scss | 1 + .../block-library/src/navigation/index.php | 109 +++- .../block-library/src/page-list/block.json | 6 +- .../block-library/src/page-list/index.php | 14 +- .../block-library/src/paragraph/drop-zone.js | 105 ---- packages/block-library/src/paragraph/edit.js | 15 +- .../block-library/src/paragraph/editor.scss | 20 - packages/block-library/src/pattern/edit.js | 13 +- .../src/post-comments-form/form.js | 5 +- .../query/edit/inspector-controls/index.js | 7 +- .../inspector-controls/taxonomy-controls.js | 169 +++--- packages/block-library/src/rss/index.php | 6 +- packages/block-library/src/search/edit.js | 7 +- packages/block-library/src/search/index.php | 34 +- packages/block-library/src/site-logo/edit.js | 18 +- .../block-library/src/site-logo/editor.scss | 1 + .../src/table-of-contents/edit.js | 4 +- packages/block-library/src/table/state.js | 4 +- .../block-library/src/tag-cloud/block.json | 8 + packages/block-library/src/tag-cloud/edit.js | 2 +- .../block-library/src/tag-cloud/style.scss | 3 + .../block-library/src/template-part/index.php | 4 + packages/blocks/src/api/utils.js | 8 +- packages/components/CHANGELOG.md | 36 +- packages/components/CONTRIBUTING.md | 20 + .../components/src/base-field/test/index.js | 10 +- .../border-box-control/component.tsx | 2 + .../border-box-control/hook.ts | 4 + .../src/border-box-control/test/index.js | 9 +- .../border-control/border-control/README.md | 6 + .../border-control/component.tsx | 2 + .../components/src/border-control/types.ts | 4 + packages/components/src/button/style.scss | 50 +- packages/components/src/button/test/index.js | 8 +- .../src/combobox-control/test/index.js | 2 +- .../components/src/confirm-dialog/types.ts | 6 + .../src/date-time/time/test/index.tsx | 8 +- packages/components/src/disabled/index.tsx | 44 +- .../components/src/disabled/test/index.tsx | 96 +--- .../components/src/dropdown/test/index.js | 7 +- .../components/src/font-size-picker/index.tsx | 2 +- .../components/src/font-size-picker/styles.ts | 4 +- .../src/font-size-picker/test/index.tsx | 4 +- .../src/font-size-picker/test/utils.ts | 10 +- .../components/src/font-size-picker/utils.ts | 2 +- .../src/form-file-upload/test/index.tsx | 2 +- .../src/form-token-field/suggestions-list.tsx | 10 +- .../with-fallback-styles/index.js | 8 +- .../with-focus-outside/test/index.js | 89 ++- .../with-focus-return/test/index.js | 64 ++- .../higher-order/with-notices/test/index.js | 2 +- packages/components/src/index.js | 3 +- .../src/input-control/test/index.js | 4 +- .../components/src/item-group/test/index.js | 4 +- .../components/src/menu-item/test/index.js | 3 - .../bottom-sheet/test/range-cell.native.js | 30 +- packages/components/src/modal/README.md | 107 ++-- .../modal/{aria-helper.js => aria-helper.ts} | 12 +- .../src/modal/{index.js => index.tsx} | 60 +- .../src/modal/stories/{index.js => index.tsx} | 89 +-- .../test/{aria-helper.js => aria-helper.ts} | 0 .../src/modal/test/{index.js => index.tsx} | 16 +- packages/components/src/modal/types.ts | 144 +++++ .../components/src/navigation/test/index.js | 2 +- packages/components/src/navigator/index.ts | 8 +- .../navigator-back-button/component.tsx | 8 +- .../navigator/navigator-back-button/index.ts | 2 +- .../navigator/navigator-button/component.tsx | 8 +- .../src/navigator/navigator-button/index.ts | 2 +- .../navigator-provider/component.tsx | 10 +- .../src/navigator/navigator-provider/index.ts | 2 +- .../navigator/navigator-screen/component.tsx | 46 +- .../src/navigator/navigator-screen/index.ts | 2 +- .../components/src/navigator/stories/index.js | 194 ------- .../src/navigator/stories/index.tsx | 210 +++++++ .../components/src/navigator/test/index.js | 472 ---------------- .../components/src/navigator/test/index.tsx | 509 +++++++++++++++++ packages/components/src/navigator/types.ts | 2 + .../notice/test/__snapshots__/index.js.snap | 77 +-- packages/components/src/notice/test/index.js | 51 +- packages/components/src/notice/test/list.js | 20 +- .../src/number-control/test/index.js | 5 +- packages/components/src/panel/test/body.js | 4 +- .../components/src/placeholder/style.scss | 5 + packages/components/src/sandbox/index.js | 109 ++-- .../components/src/sandbox/index.native.js | 124 ++-- packages/components/src/sandbox/test/index.js | 17 +- .../components/src/shortcut/test/index.tsx | 2 +- .../bubbles-virtually/slot-fill-provider.js | 8 +- packages/components/src/style.scss | 4 + packages/components/src/tab-panel/index.tsx | 11 +- .../src/text-highlight/test/index.tsx | 4 +- packages/components/src/theme/README.md | 34 ++ packages/components/src/theme/index.tsx | 51 ++ .../components/src/theme/stories/index.tsx | 47 ++ packages/components/src/theme/styles.ts | 28 + packages/components/src/theme/test/index.tsx | 101 ++++ packages/components/src/theme/types.ts | 21 + .../src/toolbar-group/test/index.js | 16 +- packages/components/src/toolbar/test/index.js | 4 +- .../components/src/tools-panel/test/index.js | 10 +- .../src/tools-panel/tools-panel-item/hook.ts | 20 +- .../src/tools-panel/tools-panel/hook.ts | 11 +- packages/components/src/tooltip/index.js | 3 + .../components/src/tooltip/index.native.js | 15 + .../src/tooltip/test/index.native.js | 3 +- .../tree-grid/test/__snapshots__/cell.js.snap | 4 +- .../roving-tab-index-item.js.snap | 32 +- .../tree-grid/test/__snapshots__/row.js.snap | 46 +- .../components/src/tree-grid/test/cell.js | 8 +- .../tree-grid/test/roving-tab-index-item.js | 16 +- .../src/tree-grid/test/roving-tab-index.js | 6 +- packages/components/src/tree-grid/test/row.js | 36 +- .../components/src/truncate/test/index.tsx | 8 +- .../components/src/ui/shortcut/test/index.js | 3 +- .../components/src/ui/spinner/test/index.js | 27 +- .../components/src/ui/tooltip/test/index.js | 30 +- .../components/src/utils/theme-variables.scss | 8 + .../components/src/visually-hidden/README.md | 4 + packages/compose/README.md | 3 + .../with-global-events/test/index.js | 47 +- .../src/higher-order/with-state/test/index.js | 39 +- .../compose/src/hooks/use-disabled/index.js | 197 ------- .../compose/src/hooks/use-disabled/index.ts | 81 +++ .../src/hooks/use-disabled/test/index.js | 40 +- .../src/hooks/use-focus-outside/test/index.js | 89 ++- .../src/hooks/use-instance-id/test/index.js | 25 +- .../src/hooks/use-media-query/test/index.js | 86 ++- .../hooks/use-resize-observer/index.native.js | 6 +- .../use-resize-observer/test/index.native.js | 40 +- .../hooks/use-viewport-match/test/index.js | 156 ++--- .../src/hooks/test/use-query-select.js | 6 +- packages/create-block/CHANGELOG.md | 4 + .../create-block/docs/external-template.md | 2 + packages/create-block/lib/init-block.js | 2 + .../create-block/lib/init-package-json.js | 2 + packages/create-block/lib/scaffold.js | 4 + .../use-dispatch/test/use-dispatch.js | 211 +++---- .../src/components/use-select/test/index.js | 194 +++---- .../components/use-select/test/suspense.js | 12 +- .../components/with-dispatch/test/index.js | 294 ++++------ .../src/components/with-select/test/index.js | 533 ++++++++---------- packages/data/src/redux-store/test/index.js | 6 +- .../src/editor/index.ts | 2 + .../src/editor/insert-block.ts | 4 +- .../src/editor/preview.ts | 5 +- .../src/editor/set-content.ts | 22 + .../src/page-utils/drag-files.ts | 20 +- .../e2e-test-utils-playwright/src/test.ts | 5 + packages/e2e-test-utils/src/inserter.js | 8 +- packages/e2e-test-utils/src/list-view.js | 4 +- packages/e2e-test-utils/src/site-editor.js | 2 +- packages/e2e-tests/plugins/nonce.php | 16 - .../specs/editor/blocks/gallery.test.js | 3 +- .../specs/editor/plugins/nonce.test.js | 34 -- .../editor/various/block-switcher.test.js | 4 +- .../editor/various/splitting-merging.test.js | 30 +- .../site-editor/multi-entity-saving.test.js | 2 +- .../site-editor/settings-sidebar.test.js | 4 +- .../site-editor/site-editor-inserter.test.js | 4 +- packages/edit-navigation/src/store/actions.js | 2 +- .../src/components/block-manager/category.js | 7 +- .../src/components/device-preview/index.js | 2 + .../test/listener-hooks.js | 96 ++-- .../edit-post/src/components/header/index.js | 43 +- .../src/components/header/more-menu/index.js | 2 +- .../src/components/header/style.scss | 44 ++ .../components/header/writing-menu/index.js | 55 +- .../components/keyboard-shortcuts/index.js | 52 +- .../edit-post/src/components/layout/index.js | 24 +- .../src/components/layout/style.scss | 7 + .../src/components/preferences-modal/index.js | 54 +- .../options/enable-feature.js | 7 +- .../enable-custom-fields.js.snap | 260 +++++---- .../options/test/enable-custom-fields.js | 65 ++- .../test/__snapshots__/index.js.snap | 105 ++-- .../preferences-modal/test/index.js | 6 +- .../test/__snapshots__/index.js.snap | 2 +- .../plugin-post-status-info/test/index.js | 8 +- packages/edit-post/src/editor.js | 15 +- packages/edit-post/src/editor.native.js | 7 +- packages/edit-post/src/store/actions.js | 7 +- packages/edit-post/src/store/reducer.js | 2 +- .../block-editor/block-inspector-button.js | 2 +- .../src/components/block-editor/index.js | 40 +- .../edit-site/src/components/editor/index.js | 6 +- .../src/components/global-styles/preview.js | 139 +++-- .../global-styles/screen-style-variations.js | 43 +- .../global-styles/test/typography-utils.js | 436 ++++++++++---- .../test/use-global-styles-output.js | 60 +- .../global-styles/typography-panel.js | 15 +- .../global-styles/typography-utils.js | 229 ++------ .../global-styles/use-global-styles-output.js | 16 + .../document-actions/index.js | 113 ++-- .../document-actions/style.scss | 0 .../{header => header-edit-mode}/index.js | 56 +- .../mode-switcher/index.js | 0 .../more-menu/copy-content-menu-item.js | 0 .../more-menu/index.js | 0 .../more-menu/site-export.js | 0 .../more-menu/welcome-guide-menu-item.js | 0 .../plugin-more-menu-item/index.js | 0 .../plugin-sidebar-more-menu-item/index.js | 0 .../{header => header-edit-mode}/style.scss | 70 +-- .../tools-more-menu-group/index.js | 0 .../undo-redo/redo.js | 0 .../undo-redo/undo.js | 0 .../components/keyboard-shortcuts/index.js | 2 +- .../constants.js | 0 .../default-sidebar.js | 0 .../global-styles-sidebar.js | 0 .../{sidebar => sidebar-edit-mode}/index.js | 2 +- .../navigation-menu-sidebar/index.js | 0 .../navigation-inspector.js | 0 .../navigation-menu.js | 0 .../navigation-menu-sidebar/style.scss | 0 .../plugin-sidebar/index.js | 2 +- .../settings-header/index.js | 4 +- .../settings-header/style.scss | 4 +- .../{sidebar => sidebar-edit-mode}/style.scss | 2 +- .../template-card/index.js | 0 .../template-card/style.scss | 0 .../template-card/template-actions.js | 0 .../template-card/template-areas.js | 0 packages/edit-site/src/index.js | 6 +- packages/edit-site/src/style.scss | 12 +- .../src/components/layout/interface.js | 3 +- .../components/document-outline/test/index.js | 8 +- .../post-preview-button/test/index.js | 2 +- .../post-taxonomies/most-used-terms.js | 9 +- .../src/components/post-taxonomies/style.scss | 3 +- .../components/post-text-editor/test/index.js | 120 ++-- .../post-type-support-check/test/index.js | 25 +- .../provider/use-block-editor-settings.js | 2 +- .../src/test/create-interpolate-element.js | 26 +- packages/env/README.md | 4 +- packages/env/lib/download-wp-phpunit.js | 2 +- .../format-library/src/text-color/index.js | 12 +- packages/icons/src/index.js | 1 + packages/icons/src/library/arrow-down.js | 2 +- packages/icons/src/library/arrow-left.js | 2 +- packages/icons/src/library/arrow-right.js | 2 +- packages/icons/src/library/arrow-up.js | 2 +- packages/icons/src/library/caption.js | 16 + .../components/fullscreen-mode/test/index.js | 67 +-- .../components/interface-skeleton/index.js | 36 +- packages/jest-preset-default/package.json | 4 +- .../scripts/setup-globals.js | 2 + packages/keycodes/src/index.js | 2 +- .../preference-toggle-menu-item/index.js | 4 + packages/prettier-config/CHANGELOG.md | 5 + packages/prettier-config/README.md | 8 +- .../react-native-aztec/android/build.gradle | 6 +- .../src/main/res/values/template-dimens.xml | 1 + packages/react-native-aztec/package.json | 2 +- .../android/react-native-bridge/build.gradle | 4 +- packages/react-native-bridge/package.json | 2 +- packages/react-native-editor/CHANGELOG.md | 3 + .../gutenberg-editor-initial-html.test.js | 21 +- .../__device-tests__/helpers/caps.js | 12 +- .../android/app/src/main/AndroidManifest.xml | 3 +- .../react-native-editor/android/build.gradle | 6 +- packages/react-native-editor/ios/Podfile.lock | 32 +- packages/react-native-editor/package.json | 20 +- packages/react-native-editor/src/globals.js | 2 + packages/scripts/scripts/check-licenses.js | 1 + packages/server-side-render/CHANGELOG.md | 4 + packages/server-side-render/README.md | 9 + .../src/server-side-render.js | 31 +- packages/server-side-render/src/test/index.js | 67 ++- packages/style-engine/CHANGELOG.md | 6 + ...class-wp-style-engine-css-declarations.php | 32 ++ .../style-engine/src/styles/border/index.ts | 4 +- packages/style-engine/src/styles/utils.ts | 4 +- packages/url/src/clean-for-slug.js | 2 + packages/url/src/test/index.js | 5 + packages/viewport/package.json | 3 +- packages/viewport/src/listener.js | 38 +- packages/viewport/src/listener.native.js | 24 +- .../viewport/src/test/if-viewport-matches.js | 43 +- .../viewport/src/test/with-viewport-match.js | 62 +- packages/viewport/src/with-viewport-match.js | 32 +- .../src/with-viewport-match.native.js | 25 +- .../src/blocks/legacy-widget/index.php | 2 +- .../widgets/src/blocks/widget-group/index.php | 2 +- phpunit.xml.dist | 3 - phpunit/block-supports/typography-test.php | 503 ++++++++++++++++- .../style.css | 8 + .../theme.json | 9 + .../wp-html-tag-processor-standalone-test.php | 170 +++--- .../html/wp-html-tag-processor-wp-test.php | 2 +- ...-wp-style-engine-css-declarations-test.php | 56 +- .../class-wp-style-engine-css-rule-test.php | 40 +- ...s-wp-style-engine-css-rules-store-test.php | 58 +- .../class-wp-style-engine-processor-test.php | 72 +-- .../style-engine}/style-engine-test.php | 68 +-- schemas/json/block.json | 4 +- schemas/json/theme.json | 62 +- storybook/decorators/with-theme.js | 28 + storybook/preview.js | 21 +- ...xited-to-selected-paragraph-1-chromium.txt | 9 + test/e2e/specs/editor/blocks/image.spec.js | 11 +- test/e2e/specs/editor/blocks/list.spec.js | 81 +++ .../e2e/specs/editor/blocks/paragraph.spec.js | 417 ++++++++++++-- test/e2e/specs/editor/plugins/nonce.spec.js | 85 +++ .../e2e/specs/editor/various/new-post.spec.js | 4 +- test/e2e/specs/editor/various/preview.spec.js | 6 +- .../specs/widgets/customizing-widgets.spec.js | 2 +- tools/webpack/blocks.js | 1 + tools/webpack/packages.js | 4 + 494 files changed, 11027 insertions(+), 6543 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/stale-issue-add-needs-testing.yml delete mode 100644 .github/workflows/stale-issue-flaky-test.yml create mode 100644 .github/workflows/stale-issue-gardening.yml delete mode 100644 .github/workflows/stale-issue-mark-stale.yml delete mode 100644 .github/workflows/stale-issue-needs-info.yml create mode 100644 lib/compat/wordpress-6.2/script-loader.php create mode 100644 packages/block-editor/src/components/block-popover/drop-zone.js create mode 100644 packages/block-editor/src/components/block-selection-clearer/test/index.js create mode 100644 packages/block-editor/src/components/font-sizes/fluid-utils.js create mode 100644 packages/block-editor/src/components/font-sizes/test/fluid-utils.js delete mode 100644 packages/block-editor/src/components/inserter/pattern-panel.js create mode 100644 packages/block-editor/src/components/use-on-block-drop/types.ts create mode 100644 packages/block-library/src/code/test/__snapshots__/edit.native.js.snap delete mode 100644 packages/block-library/src/paragraph/drop-zone.js rename packages/components/src/modal/{aria-helper.js => aria-helper.ts} (84%) rename packages/components/src/modal/{index.js => index.tsx} (73%) rename packages/components/src/modal/stories/{index.js => index.tsx} (54%) rename packages/components/src/modal/test/{aria-helper.js => aria-helper.ts} (100%) rename packages/components/src/modal/test/{index.js => index.tsx} (82%) create mode 100644 packages/components/src/modal/types.ts delete mode 100644 packages/components/src/navigator/stories/index.js create mode 100644 packages/components/src/navigator/stories/index.tsx delete mode 100644 packages/components/src/navigator/test/index.js create mode 100644 packages/components/src/navigator/test/index.tsx create mode 100644 packages/components/src/theme/README.md create mode 100644 packages/components/src/theme/index.tsx create mode 100644 packages/components/src/theme/stories/index.tsx create mode 100644 packages/components/src/theme/styles.ts create mode 100644 packages/components/src/theme/test/index.tsx create mode 100644 packages/components/src/theme/types.ts create mode 100644 packages/components/src/utils/theme-variables.scss delete mode 100644 packages/compose/src/hooks/use-disabled/index.js create mode 100644 packages/compose/src/hooks/use-disabled/index.ts create mode 100644 packages/e2e-test-utils-playwright/src/editor/set-content.ts delete mode 100644 packages/e2e-tests/plugins/nonce.php delete mode 100644 packages/e2e-tests/specs/editor/plugins/nonce.test.js rename packages/edit-site/src/components/{header => header-edit-mode}/document-actions/index.js (57%) rename packages/edit-site/src/components/{header => header-edit-mode}/document-actions/style.scss (100%) rename packages/edit-site/src/components/{header => header-edit-mode}/index.js (80%) rename packages/edit-site/src/components/{header => header-edit-mode}/mode-switcher/index.js (100%) rename packages/edit-site/src/components/{header => header-edit-mode}/more-menu/copy-content-menu-item.js (100%) rename packages/edit-site/src/components/{header => header-edit-mode}/more-menu/index.js (100%) rename packages/edit-site/src/components/{header => header-edit-mode}/more-menu/site-export.js (100%) rename packages/edit-site/src/components/{header => header-edit-mode}/more-menu/welcome-guide-menu-item.js (100%) rename packages/edit-site/src/components/{header => header-edit-mode}/plugin-more-menu-item/index.js (100%) rename packages/edit-site/src/components/{header => header-edit-mode}/plugin-sidebar-more-menu-item/index.js (100%) rename packages/edit-site/src/components/{header => header-edit-mode}/style.scss (73%) rename packages/edit-site/src/components/{header => header-edit-mode}/tools-more-menu-group/index.js (100%) rename packages/edit-site/src/components/{header => header-edit-mode}/undo-redo/redo.js (100%) rename packages/edit-site/src/components/{header => header-edit-mode}/undo-redo/undo.js (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/constants.js (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/default-sidebar.js (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/global-styles-sidebar.js (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/index.js (98%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/navigation-menu-sidebar/index.js (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/navigation-menu-sidebar/navigation-inspector.js (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/navigation-menu-sidebar/navigation-menu.js (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/navigation-menu-sidebar/style.scss (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/plugin-sidebar/index.js (98%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/settings-header/index.js (92%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/settings-header/style.scss (93%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/style.scss (98%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/template-card/index.js (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/template-card/style.scss (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/template-card/template-actions.js (100%) rename packages/edit-site/src/components/{sidebar => sidebar-edit-mode}/template-card/template-areas.js (100%) create mode 100644 packages/icons/src/library/caption.js create mode 100644 phpunit/data/themedir1/block-theme-child-with-fluid-typography/style.css create mode 100644 phpunit/data/themedir1/block-theme-child-with-fluid-typography/theme.json rename {packages/style-engine/phpunit => phpunit/style-engine}/class-wp-style-engine-css-declarations-test.php (81%) rename {packages/style-engine/phpunit => phpunit/style-engine}/class-wp-style-engine-css-rule-test.php (68%) rename {packages/style-engine/phpunit => phpunit/style-engine}/class-wp-style-engine-css-rules-store-test.php (66%) rename {packages/style-engine/phpunit => phpunit/style-engine}/class-wp-style-engine-processor-test.php (75%) rename {packages/style-engine/phpunit => phpunit/style-engine}/style-engine-test.php (89%) create mode 100644 storybook/decorators/with-theme.js create mode 100644 test/e2e/specs/editor/blocks/__snapshots__/List-can-be-exited-to-selected-paragraph-1-chromium.txt create mode 100644 test/e2e/specs/editor/plugins/nonce.spec.js diff --git a/.eslintrc.js b/.eslintrc.js index 9d0776c1730c69..87a98f5429d10b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -97,6 +97,7 @@ module.exports = { 'dropRight', 'each', 'escapeRegExp', + 'every', 'extend', 'findIndex', 'findKey', @@ -134,6 +135,7 @@ module.exports = { 'negate', 'noop', 'nth', + 'omitBy', 'once', 'overEvery', 'partial', @@ -318,6 +320,11 @@ module.exports = { excludedFiles: [ 'test/e2e/**/*.js' ], extends: [ 'plugin:@wordpress/eslint-plugin/test-unit' ], }, + { + files: [ '**/test/**/*.js' ], + excludedFiles: [ '**/*.@(android|ios|native).js' ], + extends: [ 'plugin:jest-dom/recommended' ], + }, { files: [ 'packages/e2e-test*/**/*.js' ], excludedFiles: [ 'packages/e2e-test-utils-playwright/**/*.js' ], diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000000..59542a88ffa3dd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# Configure Dependabot scanning. +version: 2 + +updates: + # Check for updates to GitHub Actions. + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 10 diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index 30a598c93c7ef0..82758b78e1f29c 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -69,7 +69,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: token: ${{ secrets.GUTENBERG_TOKEN }} @@ -164,12 +164,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: ref: ${{ needs.bump-version.outputs.release_branch || github.ref }} - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -180,7 +180,7 @@ jobs: NO_CHECKS: 'true' - name: Upload artifact - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 with: name: gutenberg-plugin path: ./gutenberg.zip @@ -203,7 +203,7 @@ jobs: - name: Upload release notes artifact if: ${{ needs.bump-version.outputs.new_version }} - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 with: name: release-notes path: ./release-notes.txt @@ -219,7 +219,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: fetch-depth: 2 ref: ${{ needs.bump-version.outputs.release_branch }} @@ -266,12 +266,12 @@ jobs: run: echo ::set-output name=version::$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' ) - name: Download Plugin Zip Artifact - uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8 + uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0 with: name: gutenberg-plugin - name: Download Release Notes Artifact - uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8 + uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0 with: name: release-notes @@ -307,13 +307,13 @@ jobs: if: ${{ endsWith( needs.bump-version.outputs.new_version, '-rc.1' ) }} steps: - name: Checkout (for CLI) - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: path: main ref: trunk - name: Checkout (for publishing) - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: path: publish # Later, we switch this branch in the script that publishes packages. @@ -327,7 +327,7 @@ jobs: git config user.email gutenberg@wordpress.org - name: Setup Node (for CLI) - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: 'main/.nvmrc' registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml index d2b1298e484bbc..5a07b367ffa114 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -37,17 +37,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: fetch-depth: 1 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm - - uses: preactjs/compressed-size-action@df6e03e187079aef959a2878311639c77b95ee2e # v2.2.0 + - uses: preactjs/compressed-size-action@8119d3d31b6e57b167e09c81dfa877eada3bcb35 # v2.5.0 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' pattern: '{build/**/*.min.js,build/**/*.css}' diff --git a/.github/workflows/create-block.yml b/.github/workflows/create-block.yml index ba264fed3bfc14..9b98d3d9d41165 100644 --- a/.github/workflows/create-block.yml +++ b/.github/workflows/create-block.yml @@ -24,10 +24,10 @@ jobs: os: [macos-latest, ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version: ${{ matrix.node }} cache: npm diff --git a/.github/workflows/end2end-test-playwright.yml b/.github/workflows/end2end-test-playwright.yml index b67c15834b832c..c65f56b824c91f 100644 --- a/.github/workflows/end2end-test-playwright.yml +++ b/.github/workflows/end2end-test-playwright.yml @@ -24,10 +24,10 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -50,7 +50,7 @@ jobs: npm run test:e2e:playwright - name: Archive debug artifacts (screenshots, traces) - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 if: always() with: name: failures-artifacts @@ -58,7 +58,7 @@ jobs: if-no-files-found: ignore - name: Archive flaky tests report - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 if: always() with: name: flaky-tests-report-playwright diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml index e8e140bcd0e776..5dadd996945a7a 100644 --- a/.github/workflows/end2end-test.yml +++ b/.github/workflows/end2end-test.yml @@ -26,10 +26,10 @@ jobs: part: [1, 2, 3, 4] steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -49,7 +49,7 @@ jobs: $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests ) - name: Archive debug artifacts (screenshots, HTML snapshots) - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 if: always() with: name: failures-artifacts @@ -57,7 +57,7 @@ jobs: if-no-files-found: ignore - name: Archive flaky tests report - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 if: always() with: name: flaky-tests-report-${{ matrix.part }} diff --git a/.github/workflows/flaky-tests.yml b/.github/workflows/flaky-tests.yml index 80ed85d498733c..6f457f6b2292c5 100644 --- a/.github/workflows/flaky-tests.yml +++ b/.github/workflows/flaky-tests.yml @@ -14,12 +14,12 @@ jobs: steps: # Checkout defaults to using the branch which triggered the event, which # isn't necessarily `trunk` (e.g. in the case of a merge). - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: ref: trunk - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index f45c1f229666ab..27b89697f9656a 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -21,10 +21,10 @@ jobs: if: ${{ github.repository == 'WordPress/gutenberg' }} steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -63,13 +63,13 @@ jobs: WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}" ./bin/plugin/cli.js perf --ci $GITHUB_SHA debd225d007f4e441ceec80fbd6fa96653f94737 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR" - - uses: actions/github-script@0.3.0 + - uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2 if: github.event_name == 'push' id: commit-timestamp with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - const commit_details = await github.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha}); + const commit_details = await github.rest.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha}); return parseInt((new Date( commit_details.data.author.date ).getTime() / 1000).toFixed(0)) - name: Publish performance results diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml index b0644c7368e635..5a8249e1d1be9c 100644 --- a/.github/workflows/publish-npm-packages.yml +++ b/.github/workflows/publish-npm-packages.yml @@ -30,13 +30,13 @@ jobs: environment: WordPress packages steps: - name: Checkout (for CLI) - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: path: main ref: trunk - name: Checkout (for publishing) - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: path: publish # Later, we switch this branch in the script that publishes packages. @@ -50,7 +50,7 @@ jobs: git config user.email gutenberg@wordpress.org - name: Setup Node (for CLI) - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: 'main/.nvmrc' registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/pull-request-automation.yml b/.github/workflows/pull-request-automation.yml index 5337acc848134c..e6e4f1bdfb84ec 100644 --- a/.github/workflows/pull-request-automation.yml +++ b/.github/workflows/pull-request-automation.yml @@ -15,17 +15,17 @@ jobs: steps: # Checkout defaults to using the branch which triggered the event, which # isn't necessarily `trunk` (e.g. in the case of a merge). - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: ref: trunk - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version: ${{ matrix.node }} - name: Cache NPM packages - uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 + uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11 with: # npm cache files are stored in `~/.npm` on Linux/macOS path: ~/.npm diff --git a/.github/workflows/rnmobile-android-runner.yml b/.github/workflows/rnmobile-android-runner.yml index 226ed1a1ba864d..5b35e24d091cb3 100644 --- a/.github/workflows/rnmobile-android-runner.yml +++ b/.github/workflows/rnmobile-android-runner.yml @@ -22,17 +22,17 @@ jobs: steps: - name: checkout - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of Java - uses: actions/setup-java@v2 + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # v3.5.1 with: distribution: 'temurin' java-version: '11' cache: 'gradle' - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -40,25 +40,25 @@ jobs: - run: npm ci - name: Restore Gradle cache - uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 + uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - - uses: reactivecircus/android-emulator-runner@5de26e4bd23bf523e8a4b7f077df8bfb8e52b50e # v2.19.1 + - uses: reactivecircus/android-emulator-runner@d7b53ddc6e44254e1f4cf4a6ad67345837027a66 # v2.26.0 with: api-level: 28 emulator-build: 7425822 # https://github.com/ReactiveCircus/android-emulator-runner/issues/160#issuecomment-868615730 profile: pixel_xl script: npm run native test:e2e:android:local ${{ matrix.native-test-name }} - - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 if: always() with: name: android-screen-recordings path: packages/react-native-editor/android-screen-recordings - - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 if: always() with: name: appium-logs diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 96b69bf43ad6d7..6d1a127f058171 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -19,14 +19,14 @@ jobs: strategy: matrix: xcode: ['13.2.1'] - device: ['iPhone 11'] + device: ['iPhone 13'] native-test-name: [gutenberg-editor-initial-html] steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -37,7 +37,7 @@ jobs: run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt - name: Restore build cache - uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 + uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11 with: path: | packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app @@ -45,7 +45,7 @@ jobs: key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ matrix.device }}-${{ hashFiles('ios-checksums.txt') }} - name: Restore pods cache - uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 + uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11 with: path: | packages/react-native-editor/ios/Pods @@ -77,13 +77,13 @@ jobs: rm packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/main.jsbundle rm -rf packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/assets - - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 if: always() with: name: ios-screen-recordings path: packages/react-native-editor/ios-screen-recordings - - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 if: always() with: name: appium-logs diff --git a/.github/workflows/stale-issue-add-needs-testing.yml b/.github/workflows/stale-issue-add-needs-testing.yml deleted file mode 100644 index de0442785a3aa5..00000000000000 --- a/.github/workflows/stale-issue-add-needs-testing.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Mark old issues as needs confirmation' -on: - schedule: - - cron: '45 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/gutenberg' }} - - steps: - - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: "Hi,\nThis issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out." - days-before-stale: 180 - days-before-close: -1 - remove-stale-when-updated: false - stale-issue-label: 'Needs Testing' diff --git a/.github/workflows/stale-issue-flaky-test.yml b/.github/workflows/stale-issue-flaky-test.yml deleted file mode 100644 index c17935e2eb144b..00000000000000 --- a/.github/workflows/stale-issue-flaky-test.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Mark old flaky tests issues as stale' -on: - schedule: - - cron: '20 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/gutenberg' }} - - steps: - - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has gone 30 days without any activity.' - days-before-stale: 30 - days-before-close: 1 - only-labels: '[Type] Flaky Test' - stale-issue-label: '[Status] Stale' diff --git a/.github/workflows/stale-issue-gardening.yml b/.github/workflows/stale-issue-gardening.yml new file mode 100644 index 00000000000000..bcf72182262ba1 --- /dev/null +++ b/.github/workflows/stale-issue-gardening.yml @@ -0,0 +1,53 @@ +name: 'Stale Issue Gardening' + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + issue-gardening: + name: ${{ matrix.name }} + runs-on: ubuntu-latest + if: ${{ github.repository == 'WordPress/gutenberg' }} + strategy: + matrix: + include: + - name: 'Issues that require more info' + message: 'Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.' + days-before-stale: 15 + days-before-close: -1 + only-labels: '[Status] Needs More Info' + remove-stale-when-updated: true + stale-issue-label: '[Status] Stale' + - name: 'Issues that have needed testing for a period of time' + message: "Hi,\nThis issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out." + days-before-stale: 30 + days-before-close: -1 + only-labels: 'Needs Testing' + remove-stale-when-updated: true + stale-issue-label: '[Status] Stale' + - name: 'Flaky test issues without activity' + message: 'This issue has gone 30 days without any activity.' + days-before-stale: 30 + days-before-close: 1 + only-labels: '[Type] Flaky Test' + remove-stale-when-updated: true + stale-issue-label: '[Status] Stale' + - name: 'Issues without recent updates that need confirmation' + message: "Hi,\nThis issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out." + days-before-stale: 180 + days-before-close: -1 + remove-stale-when-updated: false + stale-issue-label: 'Needs Testing' + + steps: + - name: Update issues + uses: actions/stale@5ebf00ea0e4c1561e9b43a292ed34424fb1d4578 # v6.0.1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: ${{ matrix.message }} + days-before-stale: ${{ matrix.days-before-stale }} + days-before-close: ${{ matrix.days-before-close }} + only-labels: ${{ matrix.only-labels }} + remove-stale-when-updated: ${{ matrix.remove-stale-when-updated }} + stale-issue-label: ${{ matrix.stale-issue-label }} diff --git a/.github/workflows/stale-issue-mark-stale.yml b/.github/workflows/stale-issue-mark-stale.yml deleted file mode 100644 index 28154b35a0b70f..00000000000000 --- a/.github/workflows/stale-issue-mark-stale.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'Mark issues stale after needs testing for 30 days' -on: - schedule: - - cron: '55 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/gutenberg' }} - - steps: - - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: "Hi,\nThis issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out." - days-before-stale: 30 - days-before-close: -1 - only-labels: 'Needs Testing' - skip-stale-issue-message: true - stale-issue-label: '[Status] Stale' diff --git a/.github/workflows/stale-issue-needs-info.yml b/.github/workflows/stale-issue-needs-info.yml deleted file mode 100644 index f7886f9f46bbde..00000000000000 --- a/.github/workflows/stale-issue-needs-info.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Mark issues stale that require info' -on: - schedule: - - cron: '30 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/gutenberg' }} - - steps: - - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.' - days-before-stale: 15 - days-before-close: -1 - only-labels: '[Status] Needs More Info' - stale-issue-label: '[Status] Stale' diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml index 684c13710fdab7..4abc1f1a354d8e 100644 --- a/.github/workflows/static-checks.yml +++ b/.github/workflows/static-checks.yml @@ -22,10 +22,10 @@ jobs: if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm diff --git a/.github/workflows/storybook-pages.yml b/.github/workflows/storybook-pages.yml index 6efe56a8891f6e..6665a1ef8f7b26 100644 --- a/.github/workflows/storybook-pages.yml +++ b/.github/workflows/storybook-pages.yml @@ -12,12 +12,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: ref: trunk - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -29,7 +29,7 @@ jobs: run: npm run storybook:build - name: Deploy - uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3 + uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # v3.8.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./storybook/build diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 4ed5c3d750feed..c1fd9850191da7 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -29,10 +29,10 @@ jobs: node: ['14'] steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version: ${{ matrix.node }} cache: npm @@ -57,10 +57,10 @@ jobs: if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -91,10 +91,10 @@ jobs: if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml index 59cfed85c1b8f5..a8bdd00892e2ed 100644 --- a/.github/workflows/upload-release-to-plugin-repo.yml +++ b/.github/workflows/upload-release-to-plugin-repo.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: ref: ${{ matrix.branch }} token: ${{ secrets.GUTENBERG_TOKEN }} @@ -89,7 +89,7 @@ jobs: fi - name: Upload Changelog artifact - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 with: name: changelog ${{ matrix.label }} path: ./changelog.txt @@ -134,7 +134,7 @@ jobs: run: sed -i "s/${STABLE_TAG_PLACEHOLDER}/${STABLE_TAG}/g" ./trunk/readme.txt - name: Download Changelog Artifact - uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8 + uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0 with: name: changelog trunk path: trunk diff --git a/.gitignore b/.gitignore index 8121a1132e5b5d..aebfcd623ad2f0 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ yarn.lock /composer.lock .cache +.eslintcache *.tsbuildinfo # Operating system specific files diff --git a/bin/cherry-pick.mjs b/bin/cherry-pick.mjs index 8d1da80b316d53..44bf05d2304029 100644 --- a/bin/cherry-pick.mjs +++ b/bin/cherry-pick.mjs @@ -127,7 +127,7 @@ async function fetchPRs() { const PRsWithMergeCommit = []; for ( const PR of PRs ) { - const { mergeCommitHash } = await GitHubFetch( + const { merge_commit_sha: mergeCommitHash } = await GitHubFetch( '/repos/WordPress/Gutenberg/pulls/' + PR.number ); PRsWithMergeCommit.push( { diff --git a/bin/plugin/commands/performance.js b/bin/plugin/commands/performance.js index 1b0d85a2bb1400..c4a500b105c263 100644 --- a/bin/plugin/commands/performance.js +++ b/bin/plugin/commands/performance.js @@ -161,10 +161,7 @@ async function setUpGitBranch( branch, environmentDirectory ) { await git.checkoutRemoteBranch( environmentDirectory, branch ); log( ' >> Building the ' + formats.success( branch ) + ' branch' ); - await runShellScript( - 'npm install && npm run build', - environmentDirectory - ); + await runShellScript( 'npm ci && npm run build', environmentDirectory ); } /** @@ -235,7 +232,7 @@ async function runPerformanceTests( branches, options ) { } log( ' >> Installing dependencies and building packages' ); await runShellScript( - 'npm install && npm run build:packages', + 'npm ci && npm run build:packages', performanceTestDirectory ); log( ' >> Creating the environment folders' ); diff --git a/changelog.txt b/changelog.txt index 4399018de22861..33f0b72af73e64 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,290 @@ == Changelog == += 14.3.1 = + + + +## Changelog + +### Code Quality + +#### Block Library +- Add: Missing output escaping on some blocks. ([45045](https://github.com/WordPress/gutenberg/pull/45045)) + + +## First time contributors + +The following PRs were merged by first time contributors: + + + +## Contributors + +The following contributors merged PRs in this release: + +@jorgefilipecosta + + += 14.3.0 = + + +## Changelog + +### Enhancements + +#### Post Editor +- Optimize legacy post content layout. ([44506](https://github.com/WordPress/gutenberg/pull/44506)) +- Remove right border when sidebars are closed. ([44613](https://github.com/WordPress/gutenberg/pull/44613)) + +#### Block Library +- Comment Pagination Numbers: Add background color. ([43902](https://github.com/WordPress/gutenberg/pull/43902)) +- Navigation Submenu: Use `get_queried_object_id` when setting `current-menu-item` classes. ([44474](https://github.com/WordPress/gutenberg/pull/44474)) +- Post Author: Include option to link author archive. ([42670](https://github.com/WordPress/gutenberg/pull/42670)) +- Post Terms: Add spacing support. ([43646](https://github.com/WordPress/gutenberg/pull/43646)) +- Query Loop: Hide instructions for FormTokenField. ([44641](https://github.com/WordPress/gutenberg/pull/44641)) +- Tag Cloud: Remove `strtolower` around taxonomy name. ([16112](https://github.com/WordPress/gutenberg/pull/16112)) +- Video: Update placeholder style. ([44215](https://github.com/WordPress/gutenberg/pull/44215)) + +#### Components +- FontSizePicker: Make control take up full width. ([44559](https://github.com/WordPress/gutenberg/pull/44559)) +- Placeholder: Remove unnecessary background color. ([44497](https://github.com/WordPress/gutenberg/pull/44497)) +- Placeholder: Update placeholder style. ([44190](https://github.com/WordPress/gutenberg/pull/44190)) +- ToggleGroupControl: Fix unselected icon color. ([44575](https://github.com/WordPress/gutenberg/pull/44575)) +- ToolsPanel: Add subheadings and reset text to tools panel menu. ([44260](https://github.com/WordPress/gutenberg/pull/44260)) + +#### Block API +- Blocks: Deprecate non-string descriptions. ([44455](https://github.com/WordPress/gutenberg/pull/44455)) +- Tag Processor: Document and test XSS prevention in set_attribute. ([44447](https://github.com/WordPress/gutenberg/pull/44447)) +- Tag Processor: Throw error when supplied with unacceptable attribute names. ([44431](https://github.com/WordPress/gutenberg/pull/44431)) +- Tag Processor: Use (start,length) values for tracking tag name. ([44479](https://github.com/WordPress/gutenberg/pull/44479)) +- Tag processor: Update 'since' version tags to 6.2.0. ([44432](https://github.com/WordPress/gutenberg/pull/44432)) + +#### Global Styles +- Hide the done button of the Global Style palette editor when there aren't colors to edit. ([44372](https://github.com/WordPress/gutenberg/pull/44372)) +- Use ToolsPanel in Global Styles → Typography. ([44180](https://github.com/WordPress/gutenberg/pull/44180)) + +#### Block Editor +- Allow dropping an image on an empty paragraph block to create an image block. ([42722](https://github.com/WordPress/gutenberg/pull/42722)) +- Writing flow: Implement Alt+Arrow. ([44081](https://github.com/WordPress/gutenberg/pull/44081)) + +#### Site Editor +- Allow drag and drop for blocks and patterns in zoom-out mode. ([44402](https://github.com/WordPress/gutenberg/pull/44402)) + +#### Block Directory +- Use 'tertiary' in missing block warning. ([44368](https://github.com/WordPress/gutenberg/pull/44368)) + + +### New APIs + +#### Block Library +- WP_HTML_Tag_Processor: Inject dynamic data to block HTML markup in PHP. ([42485](https://github.com/WordPress/gutenberg/pull/42485)) + + +### Bug Fixes + +- Add a correct TS signature for useEntityRecords. ([44448](https://github.com/WordPress/gutenberg/pull/44448)) +- BlockDraggable: Change prop name passed to children when dragging is disabled. ([44371](https://github.com/WordPress/gutenberg/pull/44371)) +- Fix Lint warning/errors in cherry-pick script. ([44662](https://github.com/WordPress/gutenberg/pull/44662)) +- Fix: Content blocks with nested blocks always appear as top level. ([44098](https://github.com/WordPress/gutenberg/pull/44098)) +- Hide the Classic block in the Site Editor. ([44554](https://github.com/WordPress/gutenberg/pull/44554)) +- PHP 8.2: Remove deprecated callable in Style Engine value functions. ([44561](https://github.com/WordPress/gutenberg/pull/44561)) +- Persisted preferences: Fix context property of user meta configuration. ([44489](https://github.com/WordPress/gutenberg/pull/44489)) +- Resizable editor: Fix height setting bug. ([44637](https://github.com/WordPress/gutenberg/pull/44637)) +- Style engine: Kebab case preset slugs in the editor. ([44406](https://github.com/WordPress/gutenberg/pull/44406)) +- Add submenu block href only if URL is not empty. ([44337](https://github.com/WordPress/gutenberg/pull/44337)) +- Update Theme JSON `$schema` to allow pseudo selectors on `button` property. ([44303](https://github.com/WordPress/gutenberg/pull/44303)) +- Preserve the generic signature of getEntityRecord and getEntityRecords through currying. ([44453](https://github.com/WordPress/gutenberg/pull/44453)) +- Template editor: Fix crashes due to undefined vars. ([44482](https://github.com/WordPress/gutenberg/pull/44482)) +- Add missing value to CSS font-display descriptor in theme.json. ([44622](https://github.com/WordPress/gutenberg/pull/44622)) +- Rich text: Avoid updating partial selection unnecessarily. ([44330](https://github.com/WordPress/gutenberg/pull/44330)) +- useMergeRefs: Don't call/mutate refs passed if unused. ([44629](https://github.com/WordPress/gutenberg/pull/44629)) + +#### Block Library +- Code Block: Add box-sizing to fix inconsistent layout. ([44580](https://github.com/WordPress/gutenberg/pull/44580)) +- Comment Author: Fix empty links created for the author's name. ([44650](https://github.com/WordPress/gutenberg/pull/44650)) +- Comments: Support nested comments settings in the comments blocks. ([44351](https://github.com/WordPress/gutenberg/pull/44351)) +- Group: Legacy Group inner block wrapper should work with a constrained layout. ([44660](https://github.com/WordPress/gutenberg/pull/44660)) +- Image: Fix rotated image crop area aspect ratio. ([44425](https://github.com/WordPress/gutenberg/pull/44425)) +- Image: Upgrade react-easy-crop to bring in fix for site editor iframe. ([44408](https://github.com/WordPress/gutenberg/pull/44408)) +- Navigation: Fix console error. ([44594](https://github.com/WordPress/gutenberg/pull/44594)) +- Navigation: Fix semitransparent burger icon. ([44525](https://github.com/WordPress/gutenberg/pull/44525)) +- Navigation: Try fixing link color in some TT2 contexts. ([44578](https://github.com/WordPress/gutenberg/pull/44578)) +- Paragraph: Disable drop cap control if text is aligned. ([42326](https://github.com/WordPress/gutenberg/pull/42326)) +- Post Featured Image: Fix borders after addition of overlay feature. ([44286](https://github.com/WordPress/gutenberg/pull/44286)) +- Post Featured Image: Fix application of default border style in editor. ([44520](https://github.com/WordPress/gutenberg/pull/44520)) +- Query Loop: Fix condition for displaying 'parents' control. ([44630](https://github.com/WordPress/gutenberg/pull/44630)) +- Query Loop: Rename Query Loop variations `allowControls` to `allowedControls`. ([44523](https://github.com/WordPress/gutenberg/pull/44523)) +- Quote block: Stop slash inserter popup showing in the citation. ([44634](https://github.com/WordPress/gutenberg/pull/44634)) +- Site Title: Fix link color not being applied in editor #37071. ([44333](https://github.com/WordPress/gutenberg/pull/44333)) +- Template part: Prevent adding block in post editor or inside post template or content blocks. ([44480](https://github.com/WordPress/gutenberg/pull/44480)) +- Video: Don't display placeholder SVG when Video block selected. ([44564](https://github.com/WordPress/gutenberg/pull/44564)) + + +#### Global Styles +- Fix empty color indicator with a custom style. ([44364](https://github.com/WordPress/gutenberg/pull/44364)) +- Re-add styles that were removed for classic themes. ([44334](https://github.com/WordPress/gutenberg/pull/44334)) +- Remove border from Global Styles previews. ([44556](https://github.com/WordPress/gutenberg/pull/44556)) +- Spacing presets: Modify the styling of the input controls when in unlinked mode in order to better differentiate sides. ([44141](https://github.com/WordPress/gutenberg/pull/44141)) +- Style cards: Fix focus style. ([44612](https://github.com/WordPress/gutenberg/pull/44612)) +- Theme.json: Fix some shadow properties not working properly in the site editor. ([44569](https://github.com/WordPress/gutenberg/pull/44569)) +- Use color hex + index as key in the Palette component color indicator. ([44344](https://github.com/WordPress/gutenberg/pull/44344)) + +#### Design Tools +- Fix padding/margin visualizer accuracy. ([44485](https://github.com/WordPress/gutenberg/pull/44485)) +- Fix padding/margin visualizer placement. ([44484](https://github.com/WordPress/gutenberg/pull/44484)) +- Fix spacing property generation in flow layout type. ([44446](https://github.com/WordPress/gutenberg/pull/44446)) + +#### Components +- BorderBoxControl: Ensure the most common unit selection is maintained. ([44565](https://github.com/WordPress/gutenberg/pull/44565)) +- Popover: Fix limitShift logic by adding iframe offset correctly (and a custom shift limiter). ([42950](https://github.com/WordPress/gutenberg/pull/42950)) +- Popover: Refine position-to-placement conversion logic, add tests. ([44377](https://github.com/WordPress/gutenberg/pull/44377)) +- Navigator Screen: Fix bug where focus moved erroneously. ([44239](https://github.com/WordPress/gutenberg/pull/44239)) + +#### Block Editor +- Fix block search for non-Latin characters. ([44652](https://github.com/WordPress/gutenberg/pull/44652)) +- Prevent empty block toolbars from showing empty slots. ([44704](https://github.com/WordPress/gutenberg/pull/44704)) + +#### Widgets Editor +- Add extra guarding against legacy widget preview errors. ([44635](https://github.com/WordPress/gutenberg/pull/44635)) + +#### Themes +- Theme export: Fix broken spacingScale export. ([44555](https://github.com/WordPress/gutenberg/pull/44555)) +- Theme export: Stop slugs being cast to integers when a theme is exported. ([44589](https://github.com/WordPress/gutenberg/pull/44589)) + +#### Accessibility +- TokenInput field: Try alternative approach to fix screen reader focus issue. ([44526](https://github.com/WordPress/gutenberg/pull/44526)) + +#### Patterns +- Fix patterns drag and drop in Safari. ([44366](https://github.com/WordPress/gutenberg/pull/44366)) + +#### Post Editor +- Add layout styles from Post Content block to post editor. ([44258](https://github.com/WordPress/gutenberg/pull/44258)) + + +### Performance + +- Compose: Introduce an in-house `throttle()` utility, deprecate Lodash version. ([44225](https://github.com/WordPress/gutenberg/pull/44225)) +- Improve Slot/Fill performance. ([44642](https://github.com/WordPress/gutenberg/pull/44642)) + + +### Documentation + +- Add documentation for extending the Query Loop block via variations. ([44137](https://github.com/WordPress/gutenberg/pull/44137)) +- Add more details about possible values for block assets in `block.json`. ([44199](https://github.com/WordPress/gutenberg/pull/44199)) +- Add missing import statement for useBlockProps. ([44607](https://github.com/WordPress/gutenberg/pull/44607)) +- Instruct people to keep using `wp-scripts` even when extending webpack. ([44348](https://github.com/WordPress/gutenberg/pull/44348)) +- Style engine: Updating and fleshing out documentation. ([44405](https://github.com/WordPress/gutenberg/pull/44405)) +- Style engine: Update readme. ([44308](https://github.com/WordPress/gutenberg/pull/44308)) +- Add callout for experimental packages. ([44056](https://github.com/WordPress/gutenberg/pull/44056)) +- Expand class-level documentation for `WP_HTML_Tag_Processor`. ([44478](https://github.com/WordPress/gutenberg/pull/44478)) +- Experiments: Add README.md and CHANGELOG.md. ([44457](https://github.com/WordPress/gutenberg/pull/44457)) +- Remove the package name from the sub-menu item for clarity. ([44643](https://github.com/WordPress/gutenberg/pull/44643)) + +### Code Quality + +- Avoid calling get_blocks_metadata in WP_Theme_JSON constructor. ([44658](https://github.com/WordPress/gutenberg/pull/44658)) +- Block Popover: Use placement instead of position; move to useBlockToolbarPopoverProps hook. ([44323](https://github.com/WordPress/gutenberg/pull/44323)) +- CS/QA: Various minor fixes. ([44551](https://github.com/WordPress/gutenberg/pull/44551)) +- CS: Always use parentheses when instantiating objects. ([44550](https://github.com/WordPress/gutenberg/pull/44550)) +- CS: Remove redundant parentheses for include/require statements. ([44544](https://github.com/WordPress/gutenberg/pull/44544)) +- CS: Use pre-increment instead of post-increment. ([44549](https://github.com/WordPress/gutenberg/pull/44549)) +- Fix comment typo in document generation tools. ([44583](https://github.com/WordPress/gutenberg/pull/44583)) +- I18n: Use consistent string: 'Link rel'. ([20162](https://github.com/WordPress/gutenberg/pull/20162)) +- PHP 8.2 | Fix deprecated embedded variables in text strings. ([44538](https://github.com/WordPress/gutenberg/pull/44538)) +- PHP 8.2 | Fix for partially supported callback. ([44537](https://github.com/WordPress/gutenberg/pull/44537)) +- PHPCS: Use PHPCompatibilityWP. ([44542](https://github.com/WordPress/gutenberg/pull/44542)) +- QA: No control structures with empty body. ([44548](https://github.com/WordPress/gutenberg/pull/44548)) +- Script loader: Remove 6.1 wp actions. ([44519](https://github.com/WordPress/gutenberg/pull/44519)) + +#### Components +- Components refactor `Mobile` to ignore `exhaustive-deps`. ([44207](https://github.com/WordPress/gutenberg/pull/44207)) +- Convert FontSizePicker to TypeScript. ([44449](https://github.com/WordPress/gutenberg/pull/44449)) +- FontSizePicker: Replace SCSS with Emotion + components. ([44483](https://github.com/WordPress/gutenberg/pull/44483)) +- RangeControl: Remove unused UseDebouncedHoverInteractionArgs type. ([44411](https://github.com/WordPress/gutenberg/pull/44411)) +- Refactor `Notice` to pass `exhaustive-deps`. ([44157](https://github.com/WordPress/gutenberg/pull/44157)) +- Refactor `ResizableBox` to pass `exhaustive-deps`. ([44370](https://github.com/WordPress/gutenberg/pull/44370)) +- Refactor `Sandbox` to pass `exhaustive-deps`. ([44378](https://github.com/WordPress/gutenberg/pull/44378)) +- Refactor `SearchControl` native files to ignore `exhaustive-deps`. ([44381](https://github.com/WordPress/gutenberg/pull/44381)) + +#### Block Library +- Archive Block: Remove unnecessary spaces from class attributes. ([44440](https://github.com/WordPress/gutenberg/pull/44440)) +- Archive: No need to escape class variable. ([44468](https://github.com/WordPress/gutenberg/pull/44468)) +- Gallery: Remove unnecessary caption state. ([44383](https://github.com/WordPress/gutenberg/pull/44383)) +- Remove unnecessary `view.js` file from navigation-submenu block. ([44570](https://github.com/WordPress/gutenberg/pull/44570)) + +#### Plugin +- CS: All methods must declare visibility. ([44543](https://github.com/WordPress/gutenberg/pull/44543)) +- Move `wp_enqueue_block_view_script` to experiments. ([44414](https://github.com/WordPress/gutenberg/pull/44414)) + +#### Layout +- Backport code quality changes from core to Gutenberg. ([44661](https://github.com/WordPress/gutenberg/pull/44661)) + +#### Parsing +- Block Serialization Default Parser: Bring back `no-more-tokens` type. ([44459](https://github.com/WordPress/gutenberg/pull/44459)) + +#### Global Styles +- Add `blocks` to the list of valid origins for `theme.json`. ([44363](https://github.com/WordPress/gutenberg/pull/44363)) + +#### Lodash +- Lodash: Remove completely from `@wordpress/compose` package. ([44568](https://github.com/WordPress/gutenberg/pull/44568)) +- Lodash: Remove completely from `@wordpress/library-export-default-webpack-plugin` package. ([44571](https://github.com/WordPress/gutenberg/pull/44571)) +- Lodash: Remove completely from `@wordpress/list-reusable-blocks` package. ([44567](https://github.com/WordPress/gutenberg/pull/44567)) +- Lodash: Refactor away from `_.flow()`. ([44500](https://github.com/WordPress/gutenberg/pull/44500)) +- Lodash: Remove completely from `@wordpress/block-directory` package. ([44206](https://github.com/WordPress/gutenberg/pull/44206)) +- Lodash: Remove completely from `@wordpress/rich-text` package. ([44204](https://github.com/WordPress/gutenberg/pull/44204)) + +### Tools + +- Scripts: Use default value for process.env.WP_SRC_DIRECTORY. ([44367](https://github.com/WordPress/gutenberg/pull/44367)) +- Limit access to experimental APIs to WordPress codebase. ([43386](https://github.com/WordPress/gutenberg/pull/43386)) +- Cherry Pick Script: Restore retrieval of merge_commit_sha. ([44890](https://github.com/WordPress/gutenberg/pull/44890)) + +#### Testing +- Autocomplete Component: Add end-to-end tests (take two). ([42905](https://github.com/WordPress/gutenberg/pull/42905)) +- Fix failing quote to reusable block conversion end-to-end test. ([44350](https://github.com/WordPress/gutenberg/pull/44350)) +- Add strict meta schema validation test for block.json. ([44423](https://github.com/WordPress/gutenberg/pull/44423)) +- Migrate iframed block test to Playwright. ([44164](https://github.com/WordPress/gutenberg/pull/44164)) +- Add theme.json schema tests. ([44252](https://github.com/WordPress/gutenberg/pull/44252)) +- Remove enzyme completely. ([44494](https://github.com/WordPress/gutenberg/pull/44494)) +- Fix typo from in writing flow spec. ([44358](https://github.com/WordPress/gutenberg/pull/44358)) +- Fix typo in WP_Navigation_Page_Test. ([44685](https://github.com/WordPress/gutenberg/pull/44685)) +- Popover: Convert unit tests to TypeScript and modern RTL assertions. ([44373](https://github.com/WordPress/gutenberg/pull/44373)) +- Refactor `AlignmentMatrixControl` tests to use `@testing-library/react`. ([44670](https://github.com/WordPress/gutenberg/pull/44670)) +- End-to-end Test Utils: Don't use hardcoded login credentials. ([44331](https://github.com/WordPress/gutenberg/pull/44331)) +- Refactor `PluginPostPublishPanel` tests to use RTL render. ([44667](https://github.com/WordPress/gutenberg/pull/44667)) +- Refactor `AutosaveMonitor` tests to `@testing-library/react`. ([44492](https://github.com/WordPress/gutenberg/pull/44492)) +- Refactor `PostPreviewButton` tests to `@testing-library/react`. ([44470](https://github.com/WordPress/gutenberg/pull/44470)) +- Refactor `BlockSwitcher` tests to `@testing-library/react`. ([44493](https://github.com/WordPress/gutenberg/pull/44493)) +- Refactor `ResponsiveBlockControl` tests to use `@testing-library/react`. ([44669](https://github.com/WordPress/gutenberg/pull/44669)) +- Style engine: Add JS unit tests for outline properties. ([44518](https://github.com/WordPress/gutenberg/pull/44518)) + +#### Build Tooling +- Upgrade Lerna to the latest version. ([44456](https://github.com/WordPress/gutenberg/pull/44456)) +- wp-env: Use case insensitive regex when checking WP version string. ([44887](https://github.com/WordPress/gutenberg/pull/44887)) + + +## First time contributors + +The following PRs were merged by first time contributors: + +- @alecgeatches: Add theme.json schema tests. ([44252](https://github.com/WordPress/gutenberg/pull/44252)) +- @BenoitZugmeyer: Use `get_queried_object_id` when setting `current-menu-item` classes. ([44474](https://github.com/WordPress/gutenberg/pull/44474)) +- @blindingstars: Update Theme JSON `$schema` to allow pseudo selectors on `button` property. ([44303](https://github.com/WordPress/gutenberg/pull/44303)) +- @imanish003: Add missing import statement for useBlockProps. ([44607](https://github.com/WordPress/gutenberg/pull/44607)) +- @loxK: Scripts: Use default value for process.env.WP_SRC_DIRECTORY. ([44367](https://github.com/WordPress/gutenberg/pull/44367)) +- @Lucisu: Fix empty links being created for the author's name comment. ([44650](https://github.com/WordPress/gutenberg/pull/44650)) +- @philwp: Post Author block now includes option to link author archive. ([42670](https://github.com/WordPress/gutenberg/pull/42670)) + + +## Contributors + +The following contributors merged PRs in this release: + +@aaronrobertshaw @adamziel @ajlende @alecgeatches @andrewserong @anton-vlasenko @BE-Webdesign @BenoitZugmeyer @blindingstars @carolinan @chad1008 @ciampo @derekblank @dmsnell @ellatrix @getdave @glendaviesnz @gziolo @imanish003 @inc2734 @jameskoster @jasmussen @javierarce @jorgefilipecosta @jrfnl @kevin940726 @loxK @Lucisu @luisherranz @Mamaduka @michalczaplinski @ndiego @noisysocks @ntsekouras @oandregal @pagelab @philwp @ramonjd @Rink9 @ryanwelcher @SantosGuillamot @scruffian @Soean @sunyatasattva @t-hamano @talldan @tellthemachines @tyxla @vcanales @youknowriad + + + + = 14.2.0 = ## Changelog diff --git a/docs/contributors/versions-in-wordpress.md b/docs/contributors/versions-in-wordpress.md index 0deeab1170250e..cb23c072e8e4e8 100644 --- a/docs/contributors/versions-in-wordpress.md +++ b/docs/contributors/versions-in-wordpress.md @@ -6,6 +6,8 @@ If anything looks incorrect here, please bring it up in #core-editor in [WordPre | Gutenberg Versions | WordPress Version | | ------------------ | ----------------- | +| 13.1-14.1 | 6.1 | +| 12.0-13.0 | 6.0.3 | | 12.0-13.0 | 6.0.2 | | 12.0-13.0 | 6.0.1 | | 12.0-13.0 | 6.0 | diff --git a/docs/explanations/architecture/styles.md b/docs/explanations/architecture/styles.md index c9f89cad45f6ea..416eef796bec8f 100644 --- a/docs/explanations/architecture/styles.md +++ b/docs/explanations/architecture/styles.md @@ -2,19 +2,22 @@ This document introduces the main concepts related to styles that affect the user content in the block editor. It points to the relevant reference guides and tutorials for readers to dig deeper into each one of the ideas presented. It's aimed to block authors and people working in the block editor project. -1. HTML and CSS -2. Block styles - -- From UI controls to HTML markup -- Block Supports API -- Current limits of the Block Supports API - -3. Global styles - -- Gather data -- Consolidate data -- From data to styles -- Current limits of the Global styles API +1. [HTML and CSS](#html-and-css) +2. [Block styles](#block-styles) + - [From UI controls to HTML markup](#from-ui-controls-to-html-markup) + - [Block Supports API](#block-supports-api) + - [Current limitations of the Block Supports API](#current-limitations-of-the-block-supports-api) +3. [Global styles](#global-styles) + - [Gather data](#gather-data) + - [Consolidate data](#consolidate-data) + - [From data to styles](#from-data-to-styles) + - [Current limitations of the Global Styles API](#current-limitations-of-the-global-styles-api) +4. [Layout styles](#layout-styles) + - [Base layout styles](#base-layout-styles) + - [Individual layout styles](#individual-layout-styles) + - [Available layout types](#available-layout-types) + - [Targeting layout or container blocks from themes](#targeting-layout-or-container-blocks-from-themes) + - [Opting out of generated layout styles](#opting-out-of-generated-layout-styles) ### HTML and CSS @@ -479,22 +482,87 @@ In addition to the CSS Custom Properties, all presets but duotone generate CSS c #### Current limitations of the Global Styles API -1. **Setting a different CSS selector for blocks requires server-registration** +##### 1. **Setting a different CSS selector for blocks requires server-registration** By default, the selector assigned to a block is `.wp-block-`. However, blocks can change this should they need. They can provide a CSS selector via the `__experimentalSelector` property in its `block.json`. If blocks do this, they need to be registered in the server using the `block.json`, otherwise, the global styles code doesn't have access to that information and will use the default CSS selector for the block. -2. **Can't target different HTML nodes for different styles** +##### 2. **Can't target different HTML nodes for different styles** Every chunk of styles can only use a single selector. This is particularly relevant if the block is using `__experimentalSkipSerialization` to serialize the different style properties to different nodes other than the wrapper. See "Current limitations of blocks supports" for more. -3. **Only a single property per block** +##### 3. **Only a single property per block** Similarly to block supports, there can be only one instance of any style in use by the block. For example, the block can only have a single font size. See related "Current limitations of block supports". -4. **Only blocks using block supports are shown in the Global Styles UI** +##### 4. **Only blocks using block supports are shown in the Global Styles UI** The global styles UI in the site editor has a screen for per-block styles. The list of blocks is generated dynamically using the block supports from the `block.json` of blocks. If a block wants to be listed there, it needs to use the block supports mechanism. + +### Layout styles + +In addition to styles at the individual block level and in global styles, there is the concept of layout styles that are output for both blocks-based and classic themes. + +The layout block support is an experimental approach for outputting common layout styles that are shared between blocks that are used for creating layouts. Layout styles are useful for providing common styling for any block that is a container for other blocks. Examples of blocks that depend on these layout styles include Group, Row, Columns, Buttons, and Social Icons. + +While the feature is part of WordPress core, it is still flagged as experimental in the sense that the features and output are still undergoing active development. It is therefore not yet a stable feature from the perspective of 3rd party blocks, as the API is likely to change. The feature is enabled in core blocks via the `__experimentalLayout` setting under `supports` in a block's `block.json` file. + +There are two primary places where Layout styles are output: + +#### Base layout styles + +Base layout styles are those styles that are common to all blocks that opt in to a particular layout type. Examples of common base layout styling include setting `display: flex` for blocks that use the Flex layout type (such as Buttons and Social Icons), and providing default max-width for constrained layouts. + +Base layout styles are output from within [the main PHP class](https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/class-wp-theme-json.php) that handles global styles, and form part of the global styles stylesheet. In order to provide support for core blocks in classic themes, these styles are always output, irrespective of whether the theme provides its own `theme.json` file. + +Common layout definitions are stored in [the core `theme.json` file](https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/theme.json), but are not intended to be extended or overridden by themes. + +#### Individual layout styles + +When a block that opts in to the experimental layout support is rendered, two things are processed and added to the output via [`layout.php`](https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/block-supports/layout.php): + +- Semantic class names are added to the block markup to indicate which layout settings are in use. For example, `is-layout-flow` is for blocks (such as Group) that use the default/flow layout, and `is-content-justification-right` is added when a user sets a block to use right justification. +- Individual styles are generated for non-default layout values that are set on the individual block being rendered. These styles are attached to the block via a container class name using the form `wp-container-$id` where the `$id` is a [unique number](https://developer.wordpress.org/reference/functions/wp_unique_id/). + +#### Available layout types + +There are currently three layout types in use: + +* Default/Flow: Items are stacked vertically. The parent container block is set to `display: flow` and the spacing between children is handled via vertical margins. +* Constrained: Items are stacked vertically, using the same spacing logic as the Flow layout. Features constrained widths for child content, outputting widths for standard content size and wide size. Defaults to using global `contentSize` and `wideSize` values set in `settings.layout` in the `theme.json`. +* Flex: Items are displayed using a Flexbox layout. Defaults to a horizontal orientation. Spacing between children is handled via the `gap` CSS property. + +For controlling spacing between blocks, and enabling block spacing controls see: [What is blockGap and how can I use it?](https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/#what-is-blockgap-and-how-can-i-use-it). + +#### Targeting layout or container blocks from themes + +The layout block support is designed to enable control over layout features from within the block and site editors. Where possible, try to use the features of the blocks to determine particular layout requirements rather than relying upon additional stylesheets. + +For themes that wish to target container blocks in order to add or adjust particular styles, the block's class name is often the best class name to use. Class names such as `wp-block-group` or `wp-block-columns` are usually reliable class names for targeting a particular block. + +For targeting a block that uses a particular layout type, avoid targeting `wp-container-` as container classes may not always be present in the rendered markup. + +##### Semantic class names + +Work is currently underway to expand stable semantic classnames in Layout block support output. The task is being discussed in [this issue](https://github.com/WordPress/gutenberg/issues/38719). + +The current semantic class names that can be output by the Layout block support are: + +* `is-layout-flow`: Blocks that use the Default/Flow layout type. +* `is-layout-constrained`: Blocks that use the Constrained layout type. +* `is-layout-flex`: Blocks that use the Flex layout type. +* `wp-container-$id`: Where `$id` is a semi-random number. A container class that only exists when the block contains non-default Layout values. This class should not be used directly for any CSS targeting as it may or may not be present. +* `is-horizontal`: When a block explicitly sets `orientation` to `horizontal`. +* `is-vertical`: When a block explicitly sets `orientation` to `vertical`. +* `is-content-justification-left`: When a block explicitly sets `justifyContent` to `left`. +* `is-content-justification-center`: When a block explicitly sets `justifyContent` to `center`. +* `is-content-justification-right`: When a block explicitly sets `justifyContent` to `right`. +* `is-content-justification-space-between`: When a block explicitly sets `justifyContent` to `space-between`. +* `is-nowrap`: When a block explicitly sets `flexWrap` to `nowrap`. + +#### Opting out of generated layout styles + +Layout styles output is switched on by default because the styles are required by core structural blocks. However, themes can opt out of generated block layout styles while retaining semantic class name output by using the `disable-layout-styles` block support. Such themes will be responsible for providing all their own layout styles. See [the entry under Theme Support](https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#disabling-base-layout-styles). diff --git a/docs/how-to-guides/README.md b/docs/how-to-guides/README.md index 0f50bedf05579a..c0a2bd7f1fe6f8 100644 --- a/docs/how-to-guides/README.md +++ b/docs/how-to-guides/README.md @@ -14,6 +14,8 @@ It is also possible to modify the behavior of existing blocks or even remove the Learn more in the [Block Filters](/docs/reference-guides/filters/block-filters.md) section. +Specifically for `Query Loop` block, besides the available filters, there are more ways to extend it and create bespoke versions of it. Learn more in the [Extending the Query Loop block](/docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md) section. + ## Extending the Editor UI Extending the editor UI can be accomplished with the `registerPlugin` API, allowing you to define all your plugin's UI elements in one place. diff --git a/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md b/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md index e0ea419b168a87..800f7dddd57f67 100644 --- a/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md +++ b/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md @@ -102,7 +102,7 @@ registerBlockType( 'gutenberg-examples/example-02-stylesheets', { The inline style works well for a small amount of CSS to apply. If you have much more than the above you will likely find that it is easier to manage with them in a separate stylesheet file. -The `useBlockProps` hooks includes the classsname for the block automatically, it generates a name for each block using the block's name prefixed with `wp-block-`, replacing the `/` namespace separator with a single `-`. +The `useBlockProps` hooks includes the classname for the block automatically, it generates a name for each block using the block's name prefixed with `wp-block-`, replacing the `/` namespace separator with a single `-`. For example the block name: `gutenberg-examples/example-02-stylesheets` would get the classname: `wp-block-gutenberg-examples-example-02-stylesheets`. It might be a bit long but best to avoid conflicts with other blocks. diff --git a/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md b/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md index 7b5f2cb7fe086b..9f5eff3883b6a7 100644 --- a/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md +++ b/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md @@ -221,4 +221,4 @@ registerBlockType( 'gutenberg-examples/example-dynamic', { {% end %} -Note that this code uses the `wp-server-side-render` package but not `wp-data`. Make sure to update the dependencies in the PHP code. You can use wp-scripts to automatically build dependencies (see the [gutenberg-examples repo](https://github.com/WordPress/gutenberg-examples/tree/HEAD/01-basic-esnext) for PHP code setup). +Note that this code uses the `wp-server-side-render` package but not `wp-data`. Make sure to update the dependencies in the PHP code. You can use wp-scripts to automatically build dependencies (see the [gutenberg-examples repo](https://github.com/WordPress/gutenberg-examples/tree/trunk/blocks-jsx/01-basic-esnext) for PHP code setup). diff --git a/docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md b/docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md index dbe21ff35aa339..3956971645f86a 100644 --- a/docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md +++ b/docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md @@ -95,7 +95,7 @@ At this point, your custom variation will be virtually indistinguishable from a Please note that the Query Loop block supports `'block'` as a string in the `scope` property. In theory, that's to allow the variation to be picked up after inserting the block itself. Read more about the Block Variation Picker [here](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-variation-picker/README.md). -However, it is unadvisable to use this currently, this is due to the Query Loop setup with patterns and `scope: [ 'block' ]` variations, all of the selected pattern's attributes will be used except for `postType` and `inherit` query properties, which will likely lead to conflicts and non-functional variations. +However, it is **unadvisable** to use this currently, this is due to the Query Loop setup with patterns and `scope: [ 'block' ]` variations, all of the selected pattern's attributes will be used except for `postType` and `inherit` query properties, which will likely lead to conflicts and non-functional variations. To circumvent this, there two routes, the first one is to add your default `innerBlocks`, like so: @@ -111,7 +111,13 @@ innerBlocks: [ ], ``` -The other would be to register patterns specific to your variation, we can cover that in another guide. +By having `innerBlocks` in your variation you essentially skip the setup phase of Query Loop block with suggested patterns and the block is inserted with these inner blocks as its starting content. + +The other way would be to register patterns specific to your variation, which are going to be suggested in the setup, and replace flows of the block. + +The Query Loop block determines if there is an active variation of itself and if there are specific patterns available for this variation. If there are, these patterns are going to be the only ones suggested to the user, without including the default ones for the original Query Loop block. Otherwise, if there are no such patterns, the default ones are going to be suggested. + +In order for a pattern to be “connected” with a Query Loop variation, you should add the name of your variation prefixed with the Query Loop name (e.g. `core/query/$variation_name`) to the pattern's `blockTypes` property. For more details about registering patterns [see here](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns/). ### Making Gutenberg recognize your variation @@ -131,9 +137,9 @@ We need a way to tell the editor that this block is indeed your specific variati } ``` -You might have been tempted to only compare the `postType`: in this way, Gutenberg will recognize the block as your variation any time the `postType` matches `book`! That's awesome, but the problem is that now Gutenberg will recognize the block as your specific variation any time the `postType` is set to `book`, which is not what we want: other plugins might want to publish variations based on the `book` post type, or we might just not want the variation to be recognized every time the user sets the type to `book` manually through the editor settings. +You might be tempted to only compare the `postType` so that Gutenberg will recognize the block as your variation any time the `postType` matches `book`. This casts a net too wide, however, as other plugins might want to publish variations based on the `book` post type too, or we might just not want the variation to be recognized every time the user sets the type to `book` manually through the editor settings. -That's why the Query Loop block exposes a special attribute called `namespace`: it really doesn't do anything inside the block implementation, and it's used as an easy way for extenders to recognize and scope their own variation. In addition, `isActive` also accepts just an array of strings with the attributes to compare. Often, `namespace` would be sufficient, so you would use it like so: +That's why the Query Loop block exposes a special attribute called `namespace`. It really doesn't do anything inside the block implementation, and it's used as an easy and consistent way for extenders to recognize and scope their own variation. In addition, `isActive` also accepts just an array of strings with the attributes to compare. Often, `namespace` would be sufficient, so you would use it like so: ```js { @@ -154,16 +160,16 @@ Even with all of this, your custom post type might have unique requirements: it ### Disabling irrelevant or unsupported query controls -Let's say you don't use at all the `sticky` attribute in your books, so that would be totally irrelevant to the customization of your block. In order to not confuse the users as to what a setting might do, and only exposing a clear UX to them, we want this control to be unavailable. Furthermore, let's say that you don't use the `author` field at all, which generally indicates the person who has added that post to the database, instead you use a custom `bookAuthor` field. As such, not only keeping the `author` filter would be confusing, it would outright break your query. +Let's say you don't use at all the `sticky` attribute in your books, so that would be totally irrelevant to the customization of your block. In order to not confuse the users as to what a setting might do, and only exposing a clear UX to them, we want this control to be unavailable. Furthermore, let's say that you don't use the `author` field at all, which generally indicates the person who has added that post to the database, instead you use a custom `bookAuthor` field. As such, not only keeping the `author` filter would be confusing, it would outright “break” your query. -For this reason, the Query Loop block supports a property called `allowedControls` which accepts an array of keys of the controls we want to display on the inspector sidebar. By default, we accept all the controls, but as soon as we provide an array to this property, we want to be specific and specify only the controls which are going to be relevant for us! +For this reason, the Query Loop block variations support a property called `allowedControls`, which accepts an array of keys of the controls we want to display on the inspector sidebar. By default, we accept all the controls, but as soon as we provide an array to this property, we want to specify only the controls which are going to be relevant for us! -As of version 13.9, the following controls are available: +As of Gutenberg version 14.2, the following controls are available: - `inherit` - Shows the toggle switch for allowing the query to be inherited directly from the template. - `postType` - Shows a dropdown of available post types. - `order` - Shows a dropdown to select the order of the query. -- `sticky` - Shows a checkbox to only display sticky posts. +- `sticky` - Shows a dropdown to select how to handle sticky posts. - `taxQuery` - Shows available taxonomies filters for the currently selected post type. - `author` - Shows an input field to filter the query by author. - `search` - Shows an input filed to filter the query by keywords. @@ -177,7 +183,9 @@ In our case, the property would look like this: } ``` -Notice that we have also disabled the `postType` control: when the user selects our variation, why show them a confusing dropdown to change the post type? On top of that it might break the block as we can implement custom controls, as we'll see shortly. +If you want to hide all the above available controls, you can set an empty array as a value of `allowedControls`. + +Notice that we have also disabled the `postType` control. When the user selects our variation, why show them a confusing dropdown to change the post type? On top of that it might break the block as we can implement custom controls, as we'll see shortly. ### Adding additional controls diff --git a/docs/how-to-guides/javascript/versions-and-building.md b/docs/how-to-guides/javascript/versions-and-building.md index dd2f63c946906c..257b73c6866f16 100644 --- a/docs/how-to-guides/javascript/versions-and-building.md +++ b/docs/how-to-guides/javascript/versions-and-building.md @@ -5,7 +5,7 @@ The Block Editor Handbook shows JavaScript examples in two syntaxes: JSX and Pla Plain refers to JavaScript code compatible with WordPress's minimum [target for browser support](https://make.wordpress.org/core/handbook/best-practices/browser-support/) without requiring a transpilation step. This step is commonly referred to as a build process. "JSX" doesn't refer to a specific version of JavaScript, but refers to the latest language definition plus -[JSX syntax](https://reactjs.org/docs/introducing-jsx.html), a syntax that blends HTML and JavaScript. JSX makes it easier to read and write markup code, but does require a build step to transpile into code compatible with browers. Webpack and babel are the tools that perform this transpilation step. +[JSX syntax](https://reactjs.org/docs/introducing-jsx.html), a syntax that blends HTML and JavaScript. JSX makes it easier to read and write markup code, but does require a build step to transpile into code compatible with browsers. Webpack and babel are the tools that perform this transpilation step. For simplicity, the JavaScript tutorial uses the Plain definition, without JSX. This code can run straight in your browser and does not require an additional build step. In many cases, it is perfectly fine to follow the same approach for simple plugins or experimenting. As your codebase grows in complexity it might be a good idea to switch to JSX. You will find the majority of code and documentation across the block editor uses JSX. diff --git a/docs/how-to-guides/platform/custom-block-editor/tutorial.md b/docs/how-to-guides/platform/custom-block-editor/tutorial.md index 7c891e6558e308..1e49433da3e654 100644 --- a/docs/how-to-guides/platform/custom-block-editor/tutorial.md +++ b/docs/how-to-guides/platform/custom-block-editor/tutorial.md @@ -122,7 +122,7 @@ function getdave_sbe_render_block_editor() { Here we simply output some basic placeholder HTML. -Note that we've included an `id` attribute `getdave-sbe-block-editor`. Keep a note of that, a we'll be using it shortly. +Note that we've included an `id` attribute `getdave-sbe-block-editor`. Keep a note of that, as we'll be using it shortly. ### Enqueuing JavaScript and CSS diff --git a/docs/how-to-guides/plugin-sidebar-0.md b/docs/how-to-guides/plugin-sidebar-0.md index 7cba7657c20b97..306ef3319a0c18 100644 --- a/docs/how-to-guides/plugin-sidebar-0.md +++ b/docs/how-to-guides/plugin-sidebar-0.md @@ -379,4 +379,4 @@ Functions used in this guide: You now have a custom sidebar that you can use to update `post_meta` content. -A complete example is available, download the [plugin-sidebar example](https://github.com/WordPress/gutenberg-examples/tree/trunk/plugin-sidebar) from the [gutenberg-examples](https://github.com/WordPress/gutenberg-examples) repository. +A complete example is available, download the [plugin-sidebar example](https://github.com/WordPress/gutenberg-examples/tree/trunk/blocks-non-jsx/plugin-sidebar) from the [gutenberg-examples](https://github.com/WordPress/gutenberg-examples) repository. diff --git a/docs/how-to-guides/propagating-updates.md b/docs/how-to-guides/propagating-updates.md index b7d321437634a8..15b3da96be8ff4 100644 --- a/docs/how-to-guides/propagating-updates.md +++ b/docs/how-to-guides/propagating-updates.md @@ -1,12 +1,12 @@ -# Propagating updates for block types +# Propagating updates for block types -This resource seeks to offer direction for those needing to provide updates to content, whether in a template for a theme, pattern, or a block over an entire site. Since each content type allows or disallows certain kind of synchronization, it's important to know what's possible before creating to make maintenance easier in the future. +This resource seeks to offer direction for those needing to provide updates to content, whether in a template for a theme, pattern, or a block over an entire site. Since each content type allows or disallows certain kind of synchronization, it's important to know what's possible before creating to make maintenance easier in the future. ## Recommendations on managing updates ### Establish early what content you expect to require updates -At a high level, it’s important to recognize that not every piece of content can be updated across the entire site and that the method of creation greatly impacts what’s possible. As a result, it’s critical to spend time ahead of creation determining what you expect to need updates and to put that content in the appropriate format. This will make a huge difference in terms of future maintenance. +At a high level, it’s important to recognize that not every piece of content can be updated across the entire site and that the method of creation greatly impacts what’s possible. As a result, it’s critical to spend time ahead of creation determining what you expect to need updates and to put that content in the appropriate format. This will make a huge difference in terms of future maintenance. ### Embrace theme design at the block level @@ -22,7 +22,7 @@ How to manage block updates depends on the nature of the block itself. If the bl ### Patterns -**For content that you want updated later on, do not use patterns and instead rely on reusable blocks or template parts.** Patterns cannot be updated after you insert one into your site. For context, you can think of Patterns as more like sample/example/starter content. While Patterns exposed in the Inserter might evolve over time, those changes won't be automatically applied to any current useage of the pattern. Once insertered, patterns become completely detached from the original pattern unlike Reusable block or Template Part block. +**For content that you want updated later on, do not use patterns and instead rely on reusable blocks or template parts.** Patterns cannot be updated after you insert one into your site. For context, you can think of Patterns as more like sample/example/starter content. While Patterns exposed in the Inserter might evolve over time, those changes won't be automatically applied to any current useage of the pattern. Once inserted, patterns become completely detached from the original pattern unlike Reusable block or Template Part block. If needed, one potential workaround for patterns with custom styles is to add a class name to the wrapping block for a pattern. For example, the following adds a themeslug-special class to a Group block: @@ -34,7 +34,7 @@ If needed, one potential workaround for patterns with custom styles is to add a ``` -It is not fool-proof because users can modify the class via the editor UI. However, because this setting is under the "Advanced" panel it is likely to stay intact in most instances. This gives theme authors some CSS control for some pattern types, allowing them to update existing uses. However, it does not prevent users from making massive alterations that cannot be updated. +It is not fool-proof because users can modify the class via the editor UI. However, because this setting is under the "Advanced" panel it is likely to stay intact in most instances. This gives theme authors some CSS control for some pattern types, allowing them to update existing uses. However, it does not prevent users from making massive alterations that cannot be updated. ### Reusable blocks @@ -47,7 +47,7 @@ Because block themes allow users to directly edit templates and template parts, - Revert all their changes - Update the templates and template parts in the database -Generally speaking, if a user has made changes to templates then it’s recommended to leave the templates as is, unless agreed upon with the user (ie in an agency setting). +Generally speaking, if a user has made changes to templates then it’s recommended to leave the templates as is, unless agreed upon with the user (ie in an agency setting). One thing to be mindful of when updating templates is inserting references to new or different template parts. For example, the templates/page.html template could insert a parts/header.html part in version 1.0 but change that reference to parts/header-alt.html in version 2.0. Some developers may see this as a "workaround" in instances where users modified the original header.html. However, this is likely to break a user's customized design since the page.html template would no longer reference the correct part unless they also modified and saved the page template. diff --git a/docs/manifest.json b/docs/manifest.json index fa66c97044e1c4..3db21b179331ef 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -155,6 +155,12 @@ "markdown_source": "../docs/how-to-guides/block-tutorial/nested-blocks-inner-blocks.md", "parent": "block-tutorial" }, + { + "title": "Extending the Query Loop block", + "slug": "extending-the-query-loop-block", + "markdown_source": "../docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md", + "parent": "block-tutorial" + }, { "title": "Development Platform", "slug": "platform", @@ -306,7 +312,7 @@ "parent": "how-to-guides" }, { - "title": "Propagating updates for block types ", + "title": "Propagating updates for block types", "slug": "propagating-updates", "markdown_source": "../docs/how-to-guides/propagating-updates.md", "parent": "how-to-guides" @@ -1223,6 +1229,12 @@ "markdown_source": "../packages/components/src/textarea-control/README.md", "parent": "components" }, + { + "title": "Theme", + "slug": "theme", + "markdown_source": "../packages/components/src/theme/README.md", + "parent": "components" + }, { "title": "ToggleControl", "slug": "toggle-control", diff --git a/docs/reference-guides/block-api/block-supports.md b/docs/reference-guides/block-api/block-supports.md index 53d7088576b182..f3d15f118ae8fa 100644 --- a/docs/reference-guides/block-api/block-supports.md +++ b/docs/reference-guides/block-api/block-supports.md @@ -105,6 +105,20 @@ supports: { } ``` +## ariaLabel + +- Type: `boolean` +- Default value: `false` + +ARIA-labels let you define an accessible label for elements. This property allows enabling the definition of an aria-label for the block, without exposing a UI field. + +```js +supports: { + // Add the support for aria label. + ariaLabel: true +} +``` + ## className - Type: `boolean` diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 148988bbfcc3e8..6d864b69d8befe 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -176,7 +176,7 @@ An advanced block that allows displaying post comments using different visual co - **Name:** core/comments - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** legacy, tagName ## Comments Pagination @@ -347,7 +347,7 @@ Create a list item. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/ - **Name:** core/list-item - **Category:** text -- **Supports:** ~~className~~ +- **Supports:** typography (fontSize, lineHeight), ~~className~~ - **Attributes:** content, placeholder ## Login/out @@ -392,8 +392,8 @@ A collection of blocks that allow visitors to get around your site. ([Source](ht - **Name:** core/navigation - **Category:** theme -- **Supports:** align (full, wide), anchor, inserter, spacing (blockGap, units), typography (fontSize, lineHeight), ~~html~~ -- **Attributes:** __unstableLocation, backgroundColor, customBackgroundColor, customOverlayBackgroundColor, customOverlayTextColor, customTextColor, hasIcon, icon, maxNestingLevel, openSubmenusOnClick, overlayBackgroundColor, overlayMenu, overlayTextColor, ref, rgbBackgroundColor, rgbTextColor, showSubmenuIcon, textColor +- **Supports:** align (full, wide), inserter, spacing (blockGap, units), typography (fontSize, lineHeight), ~~html~~ +- **Attributes:** __unstableLocation, backgroundColor, customBackgroundColor, customOverlayBackgroundColor, customOverlayTextColor, customTextColor, hasIcon, icon, maxNestingLevel, openSubmenusOnClick, overlayBackgroundColor, overlayMenu, overlayTextColor, ref, rgbBackgroundColor, rgbTextColor, showSubmenuIcon, templateLock, textColor ## Custom Link @@ -429,7 +429,7 @@ Display a list of all pages. ([Source](https://github.com/WordPress/gutenberg/tr - **Name:** core/page-list - **Category:** widgets - **Supports:** ~~html~~, ~~reusable~~ -- **Attributes:** __unstableMaxPages +- **Attributes:** ## Paragraph @@ -797,7 +797,7 @@ A cloud of your most used tags. ([Source](https://github.com/WordPress/gutenberg - **Name:** core/tag-cloud - **Category:** widgets -- **Supports:** align, spacing (margin, padding), ~~html~~ +- **Supports:** align, spacing (margin, padding), typography (lineHeight), ~~html~~ - **Attributes:** largestFontSize, numberOfTags, showTagCounts, smallestFontSize, taxonomy ## Template Part diff --git a/docs/reference-guides/data/data-core-block-editor.md b/docs/reference-guides/data/data-core-block-editor.md index c0a180f72adf4a..8d7bceb5b44317 100644 --- a/docs/reference-guides/data/data-core-block-editor.md +++ b/docs/reference-guides/data/data-core-block-editor.md @@ -1191,10 +1191,6 @@ _Parameters_ Action that hides the insertion point. -_Returns_ - -- `Object`: Action object. - ### insertAfterBlock Action that inserts an empty block after a given block. @@ -1514,12 +1510,17 @@ _Parameters_ - _rootClientId_ `?string`: Optional root client ID of block list on which to insert. - _index_ `?number`: Index at which block should be inserted. -- _\_\_unstableOptions_ `Object`: Whether or not to show an inserter button. +- _\_\_unstableOptions_ `?Object`: Additional options. _Returns_ - `Object`: Action object. +_Properties_ + +- _\_\_unstableWithInserter_ `boolean`: Whether or not to show an inserter button. +- _operation_ `WPDropOperation`: The operation to perform when applied, either 'insert' or 'replace' for now. + ### startDraggingBlocks Returns an action object used in signalling that the user has begun to drag blocks. diff --git a/docs/reference-guides/filters/editor-filters.md b/docs/reference-guides/filters/editor-filters.md index fd5cccb5fe45a0..c65612f2083b97 100644 --- a/docs/reference-guides/filters/editor-filters.md +++ b/docs/reference-guides/filters/editor-filters.md @@ -44,7 +44,7 @@ wp.hooks.addFilter( ### `media.crossOrigin` -Used to set or modify the `crossOrigin` attribute for foreign-origin media elements (i.e ``, `