@wordpress/block-editor 14.21.1-next.719a03cbe.0 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/components/block-list/use-block-props/index.js +1 -3
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +8 -25
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +7 -4
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/child-layout-control/index.js +53 -34
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +4 -2
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block.js +5 -4
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/use-list-view-images.js +62 -30
- package/build/components/list-view/use-list-view-images.js.map +1 -1
- package/build/layouts/grid.js +2 -0
- package/build/layouts/grid.js.map +1 -1
- package/build/store/actions.js +7 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +0 -18
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +13 -9
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +1 -3
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +8 -26
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -4
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +54 -35
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +4 -2
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block.js +6 -5
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/use-list-view-images.js +62 -30
- package/build-module/components/list-view/use-list-view-images.js.map +1 -1
- package/build-module/layouts/grid.js +2 -0
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/store/actions.js +7 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -17
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +12 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +46 -8
- package/build-style/style.css +46 -8
- package/package.json +34 -34
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-list/use-block-props/use-is-hovered.js +12 -26
- package/src/components/block-lock/style.scss +10 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -1
- package/src/components/block-variation-transforms/style.scss +7 -0
- package/src/components/border-radius-control/style.scss +5 -0
- package/src/components/child-layout-control/index.js +66 -42
- package/src/components/colors-gradients/style.scss +5 -0
- package/src/components/inserter-list-item/style.scss +9 -6
- package/src/components/link-control/search-input.js +9 -2
- package/src/components/link-control/style.scss +7 -0
- package/src/components/link-control/test/index.js +44 -44
- package/src/components/list-view/block.js +9 -5
- package/src/components/list-view/use-list-view-images.js +57 -36
- package/src/components/media-replace-flow/test/index.js +1 -1
- package/src/components/spacing-sizes-control/style.scss +5 -0
- package/src/hooks/layout.scss +8 -0
- package/src/layouts/grid.js +2 -2
- package/src/store/actions.js +7 -6
- package/src/store/reducer.js +0 -18
- package/src/store/selectors.js +29 -31
package/src/store/reducer.js
CHANGED
|
@@ -2055,23 +2055,6 @@ export function lastFocus( state = false, action ) {
|
|
|
2055
2055
|
return state;
|
|
2056
2056
|
}
|
|
2057
2057
|
|
|
2058
|
-
/**
|
|
2059
|
-
* Reducer setting currently hovered block.
|
|
2060
|
-
*
|
|
2061
|
-
* @param {boolean} state Current state.
|
|
2062
|
-
* @param {Object} action Dispatched action.
|
|
2063
|
-
*
|
|
2064
|
-
* @return {boolean} Updated state.
|
|
2065
|
-
*/
|
|
2066
|
-
export function hoveredBlockClientId( state = false, action ) {
|
|
2067
|
-
switch ( action.type ) {
|
|
2068
|
-
case 'HOVER_BLOCK':
|
|
2069
|
-
return action.clientId;
|
|
2070
|
-
}
|
|
2071
|
-
|
|
2072
|
-
return state;
|
|
2073
|
-
}
|
|
2074
|
-
|
|
2075
2058
|
/**
|
|
2076
2059
|
* Reducer setting zoom out state.
|
|
2077
2060
|
*
|
|
@@ -2141,7 +2124,6 @@ const combinedReducers = combineReducers( {
|
|
|
2141
2124
|
blockRemovalRules,
|
|
2142
2125
|
openedBlockSettingsMenu,
|
|
2143
2126
|
registeredInserterMediaCategories,
|
|
2144
|
-
hoveredBlockClientId,
|
|
2145
2127
|
zoomLevel,
|
|
2146
2128
|
} );
|
|
2147
2129
|
|
package/src/store/selectors.js
CHANGED
|
@@ -2318,26 +2318,21 @@ export const getBlockTransformItems = createRegistrySelector( ( select ) =>
|
|
|
2318
2318
|
*
|
|
2319
2319
|
* @return {boolean} Items that appear in inserter.
|
|
2320
2320
|
*/
|
|
2321
|
-
export const hasInserterItems =
|
|
2322
|
-
(
|
|
2323
|
-
( state, rootClientId
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
'core/block',
|
|
2334
|
-
rootClientId
|
|
2335
|
-
) &&
|
|
2336
|
-
unlock( select( STORE_NAME ) ).getReusableBlocks().length > 0;
|
|
2321
|
+
export const hasInserterItems = ( state, rootClientId = null ) => {
|
|
2322
|
+
const hasBlockType = getBlockTypes().some( ( blockType ) =>
|
|
2323
|
+
canIncludeBlockTypeInInserter( state, blockType, rootClientId )
|
|
2324
|
+
);
|
|
2325
|
+
if ( hasBlockType ) {
|
|
2326
|
+
return true;
|
|
2327
|
+
}
|
|
2328
|
+
const hasReusableBlock = canInsertBlockTypeUnmemoized(
|
|
2329
|
+
state,
|
|
2330
|
+
'core/block',
|
|
2331
|
+
rootClientId
|
|
2332
|
+
);
|
|
2337
2333
|
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
);
|
|
2334
|
+
return hasReusableBlock;
|
|
2335
|
+
};
|
|
2341
2336
|
|
|
2342
2337
|
/**
|
|
2343
2338
|
* Returns the list of allowed inserter blocks for inner blocks children.
|
|
@@ -2358,13 +2353,11 @@ export const getAllowedBlocks = createRegistrySelector( ( select ) =>
|
|
|
2358
2353
|
canIncludeBlockTypeInInserter( state, blockType, rootClientId )
|
|
2359
2354
|
);
|
|
2360
2355
|
|
|
2361
|
-
const hasReusableBlock =
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
) &&
|
|
2367
|
-
unlock( select( STORE_NAME ) ).getReusableBlocks().length > 0;
|
|
2356
|
+
const hasReusableBlock = canInsertBlockTypeUnmemoized(
|
|
2357
|
+
state,
|
|
2358
|
+
'core/block',
|
|
2359
|
+
rootClientId
|
|
2360
|
+
);
|
|
2368
2361
|
|
|
2369
2362
|
if ( hasReusableBlock ) {
|
|
2370
2363
|
blockTypes.push( 'core/block' );
|
|
@@ -2374,7 +2367,6 @@ export const getAllowedBlocks = createRegistrySelector( ( select ) =>
|
|
|
2374
2367
|
},
|
|
2375
2368
|
( state, rootClientId ) => [
|
|
2376
2369
|
getBlockTypes(),
|
|
2377
|
-
unlock( select( STORE_NAME ) ).getReusableBlocks(),
|
|
2378
2370
|
...getInsertBlockTypeDependants( select )( state, rootClientId ),
|
|
2379
2371
|
]
|
|
2380
2372
|
)
|
|
@@ -2920,11 +2912,17 @@ export function isBlockVisible( state, clientId ) {
|
|
|
2920
2912
|
/**
|
|
2921
2913
|
* Returns the currently hovered block.
|
|
2922
2914
|
*
|
|
2923
|
-
* @
|
|
2924
|
-
* @return {Object} Client Id of the hovered block.
|
|
2915
|
+
* @deprecated
|
|
2925
2916
|
*/
|
|
2926
|
-
export function getHoveredBlockClientId(
|
|
2927
|
-
|
|
2917
|
+
export function getHoveredBlockClientId() {
|
|
2918
|
+
deprecated(
|
|
2919
|
+
"wp.data.select( 'core/block-editor' ).getHoveredBlockClientId",
|
|
2920
|
+
{
|
|
2921
|
+
since: '6.9',
|
|
2922
|
+
version: '7.1',
|
|
2923
|
+
}
|
|
2924
|
+
);
|
|
2925
|
+
return undefined;
|
|
2928
2926
|
}
|
|
2929
2927
|
|
|
2930
2928
|
/**
|