diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 93ab0a031800f0..77e466db8e1f9e 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -902,7 +902,7 @@ Summarize your post with a list of headings. Add HTML anchors to Heading blocks - **Name:** core/table-of-contents - **Experimental:** true -- **Category:** layout +- **Category:** design - **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** headings, onlyIncludeCurrentPage diff --git a/package-lock.json b/package-lock.json index 6573b0779c034c..4f97a42a8d4f58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -218,6 +218,7 @@ "patch-package": "8.0.0", "postcss": "8.4.16", "postcss-loader": "6.2.1", + "postcss-local-keyframes": "^0.0.2", "prettier": "npm:wp-prettier@3.0.3", "progress": "2.0.3", "react": "18.3.1", @@ -42428,6 +42429,7 @@ "version": "0.0.2", "resolved": "https://registry.npmjs.org/postcss-local-keyframes/-/postcss-local-keyframes-0.0.2.tgz", "integrity": "sha512-nRN01llvxnqLw1TZu4kBknHwpxPPK3DLLJClQ3eTGhS+jBNyoIAMx0hw+fdiDOy7TXjfnojamPwUm/UxBEZDTw==", + "dev": true, "engines": { "node": ">=10.0.0" }, @@ -55139,7 +55141,7 @@ }, "packages/react-native-aztec": { "name": "@wordpress/react-native-aztec", - "version": "1.120.0", + "version": "1.120.1", "license": "GPL-2.0-or-later", "dependencies": { "@wordpress/element": "file:../element", @@ -55156,7 +55158,7 @@ }, "packages/react-native-bridge": { "name": "@wordpress/react-native-bridge", - "version": "1.120.0", + "version": "1.120.1", "license": "GPL-2.0-or-later", "dependencies": { "@wordpress/react-native-aztec": "file:../react-native-aztec" @@ -55171,7 +55173,7 @@ }, "packages/react-native-editor": { "name": "@wordpress/react-native-editor", - "version": "1.120.0", + "version": "1.120.1", "hasInstallScript": true, "license": "GPL-2.0-or-later", "dependencies": { @@ -88809,7 +88811,8 @@ "postcss-local-keyframes": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/postcss-local-keyframes/-/postcss-local-keyframes-0.0.2.tgz", - "integrity": "sha512-nRN01llvxnqLw1TZu4kBknHwpxPPK3DLLJClQ3eTGhS+jBNyoIAMx0hw+fdiDOy7TXjfnojamPwUm/UxBEZDTw==" + "integrity": "sha512-nRN01llvxnqLw1TZu4kBknHwpxPPK3DLLJClQ3eTGhS+jBNyoIAMx0hw+fdiDOy7TXjfnojamPwUm/UxBEZDTw==", + "dev": true }, "postcss-media-query-parser": { "version": "0.2.3", diff --git a/package.json b/package.json index 42f796f442a262..848ba6dc6b960d 100644 --- a/package.json +++ b/package.json @@ -230,6 +230,7 @@ "patch-package": "8.0.0", "postcss": "8.4.16", "postcss-loader": "6.2.1", + "postcss-local-keyframes": "^0.0.2", "prettier": "npm:wp-prettier@3.0.3", "progress": "2.0.3", "react": "18.3.1", diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index 7c70473430b31e..322f0873c83049 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -45,7 +45,7 @@ In this example, we're instantiating a block editor. A block editor is composed Inside `BlockEditorProvider`, you can nest any of the available `@wordpress/block-editor` UI components to build the UI of your editor. -In the example above we're rendering the `BlockList` to show and edit the block list. For instance we could add a custom sidebar and use the `BlockInspector` component to be able to edit the advanced settings for the currently selected block. (See the [API](#API) for the list of all the available components). +In the example above we're rendering the `BlockList` to show and edit the block list. For instance we could add a custom sidebar and use the `BlockInspector` component to be able to edit the advanced settings for the currently selected block. (See the [API](#api) for the list of all the available components). The `BlockTools` component is used to render the toolbar for a selected block. diff --git a/packages/block-editor/src/components/block-toolbar/shuffle.js b/packages/block-editor/src/components/block-toolbar/shuffle.js index 8f8bc0c58e65c2..e7e40619f6a499 100644 --- a/packages/block-editor/src/components/block-toolbar/shuffle.js +++ b/packages/block-editor/src/components/block-toolbar/shuffle.js @@ -60,7 +60,9 @@ export default function Shuffle( { clientId, as = Container } ) { pattern.blocks.length === 1 && pattern.categories?.some( ( category ) => { return categories.includes( category ); - } ) + } ) && + // Check if the pattern is not a synced pattern. + ( pattern.syncStatus === 'unsynced' || ! pattern.id ) ); } ); }, [ categories, patterns ] ); diff --git a/packages/block-library/src/table-of-contents/block.json b/packages/block-library/src/table-of-contents/block.json index 7857744d91c4eb..0c9c4bb4a2868d 100644 --- a/packages/block-library/src/table-of-contents/block.json +++ b/packages/block-library/src/table-of-contents/block.json @@ -4,7 +4,7 @@ "__experimental": true, "name": "core/table-of-contents", "title": "Table of Contents", - "category": "layout", + "category": "design", "description": "Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.", "keywords": [ "document outline", "summary" ], "textdomain": "default", diff --git a/packages/dataviews/src/dataviews.tsx b/packages/dataviews/src/dataviews.tsx index 875746ceb52c38..601ee23304633c 100644 --- a/packages/dataviews/src/dataviews.tsx +++ b/packages/dataviews/src/dataviews.tsx @@ -38,6 +38,8 @@ interface DataViewsProps< Item extends AnyItem > { totalPages: number; }; supportedLayouts: string[]; + selection?: string[]; + setSelection?: ( selection: string[] ) => void; onSelectionChange?: ( items: Item[] ) => void; } @@ -72,9 +74,22 @@ export default function DataViews< Item extends AnyItem >( { isLoading = false, paginationInfo, supportedLayouts, + selection: selectionProperty, + setSelection: setSelectionProperty, onSelectionChange = defaultOnSelectionChange, }: DataViewsProps< Item > ) { - const [ selection, setSelection ] = useState< string[] >( [] ); + const [ selectionState, setSelectionState ] = useState< string[] >( [] ); + let selection, setSelection; + if ( + selectionProperty !== undefined && + setSelectionProperty !== undefined + ) { + selection = selectionProperty; + setSelection = setSelectionProperty; + } else { + selection = selectionState; + setSelection = setSelectionState; + } const [ openedFilter, setOpenedFilter ] = useState< string | null >( null ); useEffect( () => { diff --git a/packages/dataviews/src/view-list.tsx b/packages/dataviews/src/view-list.tsx index 81dc9127c922aa..51df552564d748 100644 --- a/packages/dataviews/src/view-list.tsx +++ b/packages/dataviews/src/view-list.tsx @@ -318,7 +318,7 @@ export default function ViewList< Item extends AnyItem >( } = props; const baseId = useInstanceId( ViewList, 'view-list' ); const selectedItem = data?.findLast( ( item ) => - selection.includes( item.id ) + selection.includes( getItemId( item ) ) ); const mediaField = fields.find( diff --git a/packages/edit-site/lib/inflate.js b/packages/edit-site/lib/inflate.js index 084f03678549bc..596d1cb5b8013c 100644 --- a/packages/edit-site/lib/inflate.js +++ b/packages/edit-site/lib/inflate.js @@ -1,3 +1,33 @@ +/** + * Credits: + * + * lib-font + * https://github.com/Pomax/lib-font + * https://github.com/Pomax/lib-font/blob/master/lib/inflate.js + * + * The MIT License (MIT) + * + * Copyright (c) 2020 pomax@nihongoresources.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + /* eslint eslint-comments/no-unlimited-disable: 0 */ /* eslint-disable */ /* pako 1.0.10 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i { + if ( postId ) { + setPostIdToSelect( postId ); + } + }, [ postId ] ); + + useEffect( () => { + if ( ! postIdToSelect ) { + return; + } + // Only try to select an item if the loading is complete and we have items. + if ( ! isLoadingItems && items && items.length ) { + // If the item is not in the current selection, select it. + if ( selection.length !== 1 || selection[ 0 ] !== postIdToSelect ) { + setSelection( [ postIdToSelect ] ); + } + setPostIdToSelect( undefined ); + } + }, [ postIdToSelect, selection, setSelection, isLoadingItems, items ] ); +} + export default function PagePages() { const postType = 'page'; const [ view, setView ] = useView( postType ); const history = useHistory(); + const [ selection, setSelection ] = useState( [] ); + const onSelectionChange = useCallback( ( items ) => { const { params } = history.getLocationWithParams(); @@ -266,6 +299,8 @@ export default function PagePages() { totalPages, } = useEntityRecords( 'postType', postType, queryArgs ); + usePostIdLinkInSelection( selection, setSelection, isLoadingPages, pages ); + const { records: authors, isResolving: isLoadingAuthors } = useEntityRecords( 'root', 'user', { per_page: -1 } ); @@ -531,7 +566,10 @@ export default function PagePages() { isLoading={ isLoadingPages || isLoadingAuthors } view={ view } onChangeView={ onChangeView } + selection={ selection } + setSelection={ setSelection } onSelectionChange={ onSelectionChange } + getItemId={ ( item ) => item.id.toString() } /> ); diff --git a/packages/react-native-aztec/package.json b/packages/react-native-aztec/package.json index 0c870edf7e5ea0..9681423ec4506e 100644 --- a/packages/react-native-aztec/package.json +++ b/packages/react-native-aztec/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/react-native-aztec", - "version": "1.120.0", + "version": "1.120.1", "description": "Aztec view for react-native.", "private": true, "author": "The WordPress Contributors", diff --git a/packages/react-native-bridge/package.json b/packages/react-native-bridge/package.json index c66c65cb8866a0..e016e11a4682b5 100644 --- a/packages/react-native-bridge/package.json +++ b/packages/react-native-bridge/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/react-native-bridge", - "version": "1.120.0", + "version": "1.120.1", "description": "Native bridge library used to integrate the block editor into a native App.", "private": true, "author": "The WordPress Contributors", diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index 66c145cd46a877..02eb3154d01e06 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -12,9 +12,11 @@ For each user feature we should also add a importance categorization label to i ## Unreleased - [internal] Fix Inserter items list filtering [#62334] - [*] Prevent hiding the keyboard when creating new list items [#62446] -- [*] RichText - Fix undefined onDelete callback [#62486] - [*] Fix issue when pasting HTML content [#62588] +## 1.120.1 +- [*] RichText - Fix undefined onDelete callback [#62486] + ## 1.120.0 - [*] Prevent deleting content when backspacing in the first Paragraph block [#62069] - [internal] Adds new bridge functionality for updating content [#61796] diff --git a/packages/react-native-editor/ios/Podfile.lock b/packages/react-native-editor/ios/Podfile.lock index 9407c238841aa1..7e9fba1fa2b89a 100644 --- a/packages/react-native-editor/ios/Podfile.lock +++ b/packages/react-native-editor/ios/Podfile.lock @@ -13,7 +13,7 @@ PODS: - ReactCommon/turbomodule/core (= 0.73.3) - fmt (6.2.1) - glog (0.3.5) - - Gutenberg (1.120.0): + - Gutenberg (1.120.1): - React-Core (= 0.73.3) - React-CoreModules (= 0.73.3) - React-RCTImage (= 0.73.3) @@ -1109,7 +1109,7 @@ PODS: - React-Core - RNSVG (14.0.0): - React-Core - - RNTAztecView (1.120.0): + - RNTAztecView (1.120.1): - React-Core - WordPress-Aztec-iOS (= 1.19.11) - SDWebImage (5.11.1): @@ -1343,7 +1343,7 @@ SPEC CHECKSUMS: FBReactNativeSpec: 73b3972e2bd20b3235ff2014f06a3d3af675ed29 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 - Gutenberg: 0d15c3a0b8aace231a954709a536580d7905c867 + Gutenberg: 1f3141594d15fc34e121ae5921676a49332e9009 hermes-engine: 5420539d016f368cd27e008f65f777abd6098c56 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 libwebp: 60305b2e989864154bd9be3d772730f08fc6a59c @@ -1402,7 +1402,7 @@ SPEC CHECKSUMS: RNReanimated: 6936b41d8afb97175e7c0ab40425b53103f71046 RNScreens: 2b73f5eb2ac5d94fbd61fa4be0bfebd345716825 RNSVG: 255767813dac22db1ec2062c8b7e7b856d4e5ae6 - RNTAztecView: 3a1df2dd827082d22a4dd06b6031e2fefd2885c6 + RNTAztecView: e7495baad7608c5e7e9e9a43ee537282dae7ccdc SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 diff --git a/packages/react-native-editor/package.json b/packages/react-native-editor/package.json index 6e6a52a0817e53..788cdedde9677c 100644 --- a/packages/react-native-editor/package.json +++ b/packages/react-native-editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/react-native-editor", - "version": "1.120.0", + "version": "1.120.1", "description": "Mobile WordPress gutenberg editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later",