@wordpress/block-editor 14.10.0 → 14.11.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 +3 -1
- package/build/components/background-image-control/index.js +0 -1
- package/build/components/background-image-control/index.js.map +1 -1
- package/build/components/block-actions/index.js +0 -3
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-inspector/index.js +6 -11
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-handler.js +1 -1
- package/build/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
- package/build/components/block-rename/modal.js +36 -11
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-rename/rename-control.js +2 -43
- package/build/components/block-rename/rename-control.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +12 -3
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/preview.native.js +1 -1
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +7 -7
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +2 -2
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build/components/block-switcher/index.js +1 -1
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build/components/block-toolbar/index.native.js +2 -2
- package/build/components/block-toolbar/index.native.js.map +1 -1
- package/build/components/date-format-picker/index.js +1 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +2 -2
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +2 -2
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +3 -3
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +1 -1
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/iframe/index.js +1 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-size-control/index.js +2 -1
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/line-height-control/index.native.js +1 -1
- package/build/components/line-height-control/index.native.js.map +1 -1
- package/build/components/link-control/index.js +1 -1
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +1 -1
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/block-select-button.js +5 -2
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/media-placeholder/index.js +1 -0
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/observe-typing/index.js +1 -1
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/provider/index.js +0 -2
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +2 -2
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/event-listeners/input-rules.js +3 -3
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build/components/rich-text/native/use-format-types.js +1 -1
- package/build/components/rich-text/native/use-format-types.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +1 -1
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +39 -0
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/typewriter/index.js +1 -1
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +3 -3
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/use-block-commands/index.js +1 -1
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +1 -1
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/store/actions.js +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +5 -5
- package/build/store/selectors.js.map +1 -1
- package/build/utils/transform-styles/index.js +1 -1
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build/utils/use-notify-copy.js +19 -11
- package/build/utils/use-notify-copy.js.map +1 -1
- package/build-module/components/background-image-control/index.js +0 -1
- package/build-module/components/background-image-control/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +0 -3
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +6 -11
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-handler.js +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
- package/build-module/components/block-rename/modal.js +36 -11
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-rename/rename-control.js +2 -43
- package/build-module/components/block-rename/rename-control.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -3
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +1 -1
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +7 -7
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +2 -2
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build-module/components/block-switcher/index.js +1 -1
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build-module/components/block-toolbar/index.native.js +2 -2
- package/build-module/components/block-toolbar/index.native.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +1 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +2 -2
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +2 -2
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +3 -3
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/iframe/index.js +1 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-size-control/index.js +3 -2
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/line-height-control/index.native.js +1 -1
- package/build-module/components/line-height-control/index.native.js.map +1 -1
- package/build-module/components/link-control/index.js +1 -1
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +1 -1
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +6 -3
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +1 -0
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/observe-typing/index.js +1 -1
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/provider/index.js +0 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +2 -2
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +3 -3
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/native/use-format-types.js +1 -1
- package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +1 -1
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +39 -0
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/typewriter/index.js +1 -1
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +3 -3
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +1 -1
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +1 -1
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/store/actions.js +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +5 -5
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +1 -1
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-module/utils/use-notify-copy.js +19 -11
- package/build-module/utils/use-notify-copy.js.map +1 -1
- package/build-style/content-rtl.css +0 -9
- package/build-style/content.css +0 -9
- package/build-style/style-rtl.css +18 -21
- package/build-style/style.css +18 -21
- package/package.json +34 -33
- package/src/components/background-image-control/index.js +0 -1
- package/src/components/block-actions/index.js +0 -3
- package/src/components/block-icon/content.scss +1 -1
- package/src/components/{block-card → block-icon}/stories/index.story.js +16 -26
- package/src/components/block-icon/style.scss +1 -1
- package/src/components/block-inspector/index.js +7 -10
- package/src/components/block-list/use-block-props/use-focus-handler.js +1 -1
- package/src/components/block-preview/style.scss +1 -1
- package/src/components/block-rename/modal.js +40 -12
- package/src/components/block-rename/rename-control.js +1 -53
- package/src/components/block-settings-menu/block-settings-dropdown.js +16 -2
- package/src/components/block-styles/preview.native.js +1 -1
- package/src/components/block-switcher/block-transformations-menu.js +9 -9
- package/src/components/block-switcher/block-variation-transformations.js +2 -2
- package/src/components/block-switcher/index.js +1 -1
- package/src/components/block-switcher/use-transformed-patterns.js +1 -1
- package/src/components/block-toolbar/index.native.js +2 -2
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/colors-gradients/style.scss +1 -0
- package/src/components/colors-gradients/test/control.js +2 -2
- package/src/components/date-format-picker/index.js +1 -1
- package/src/components/duotone-control/style.scss +2 -2
- package/src/components/global-styles/filters-panel.js +4 -2
- package/src/components/global-styles/image-settings-panel.js +2 -2
- package/src/components/global-styles/test/typography-utils.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +3 -3
- package/src/components/iframe/get-compatibility-styles.js +1 -1
- package/src/components/iframe/index.js +1 -1
- package/src/components/image-size-control/index.js +6 -2
- package/src/components/inner-blocks/README.md +1 -1
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/src/components/inserter/reusable-blocks-tab.native.js +1 -1
- package/src/components/line-height-control/index.native.js +1 -1
- package/src/components/link-control/README.md +2 -2
- package/src/components/link-control/index.js +1 -1
- package/src/components/link-control/test/index.js +3 -3
- package/src/components/link-control/use-search-handler.js +1 -1
- package/src/components/list-view/README.md +1 -1
- package/src/components/list-view/block-select-button.js +5 -5
- package/src/components/list-view/style.scss +3 -7
- package/src/components/media-placeholder/content.scss +0 -8
- package/src/components/media-placeholder/index.js +1 -0
- package/src/components/media-placeholder/style.scss +7 -0
- package/src/components/observe-typing/index.js +1 -1
- package/src/components/provider/index.js +0 -1
- package/src/components/provider/use-block-sync.js +2 -2
- package/src/components/resolution-tool/stories/index.story.js +52 -2
- package/src/components/rich-text/README.md +1 -1
- package/src/components/rich-text/event-listeners/input-rules.js +3 -3
- package/src/components/rich-text/native/use-format-types.js +1 -1
- package/src/components/rich-text/use-format-types.js +1 -1
- package/src/components/tabbed-sidebar/README.md +24 -13
- package/src/components/tabbed-sidebar/index.js +38 -0
- package/src/components/tabbed-sidebar/stories/index.story.js +104 -0
- package/src/components/typewriter/index.js +1 -1
- package/src/components/unit-control/README.md +1 -1
- package/src/components/unit-control/stories/index.story.js +124 -0
- package/src/components/url-popover/image-url-input-ui.js +3 -3
- package/src/components/use-block-commands/index.js +1 -1
- package/src/components/use-moving-animation/index.js +1 -1
- package/src/components/use-settings/README.md +1 -1
- package/src/components/warning/content.scss +1 -1
- package/src/components/writing-flow/test/index.js +1 -1
- package/src/hooks/color.scss +0 -7
- package/src/store/actions.js +1 -1
- package/src/store/selectors.js +5 -5
- package/src/store/test/private-selectors.js +1 -1
- package/src/store/test/selectors.js +3 -3
- package/src/style.scss +1 -0
- package/src/utils/test/sorting.js +1 -1
- package/src/utils/transform-styles/index.js +1 -1
- package/src/utils/use-notify-copy.js +51 -43
- package/tsconfig.json +1 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
It does the lookup of the settings in the following order:
|
|
6
6
|
|
|
7
7
|
1. Third parties can provide the settings for the block using the filter `blockEditor.useSetting.before`.
|
|
8
|
-
2. If no third parties have provided this setting, then it looks up in the block instance
|
|
8
|
+
2. If no third parties have provided this setting, then it looks up in the block instance hierarchy starting from the current block and working its way upwards to its ancestors.
|
|
9
9
|
3. If that doesn't prove to be successful in getting a value, then it falls back to the settings from the block editor store.
|
|
10
10
|
4. If none of the above steps prove to be successful, then it's likely to be a deprecated setting and the deprecated setting is used instead.
|
|
11
11
|
|
|
@@ -50,7 +50,7 @@ describe( 'isNavigationCandidate', () => {
|
|
|
50
50
|
} );
|
|
51
51
|
} );
|
|
52
52
|
|
|
53
|
-
it( 'should return false if vertically navigating inputs with
|
|
53
|
+
it( 'should return false if vertically navigating inputs with vertical support like number', () => {
|
|
54
54
|
[ UP, DOWN ].forEach( ( keyCode ) => {
|
|
55
55
|
const result = isNavigationCandidate(
|
|
56
56
|
elements.inputNumber,
|
package/src/hooks/color.scss
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
.color-block-support-panel {
|
|
2
2
|
.block-editor-contrast-checker {
|
|
3
|
-
/**
|
|
4
|
-
* Contrast checkers are forced to the bottom of the panel so all
|
|
5
|
-
* injected color controls can appear as a single item group without
|
|
6
|
-
* the contrast checkers suddenly appearing between items.
|
|
7
|
-
*/
|
|
8
|
-
/* stylelint-disable-next-line property-disallowed-list -- This should be removed when https://github.com/WordPress/gutenberg/issues/58936 is fixed. */
|
|
9
|
-
order: 9999;
|
|
10
3
|
grid-column: span 2;
|
|
11
4
|
margin-top: $grid-unit-20;
|
|
12
5
|
|
package/src/store/actions.js
CHANGED
|
@@ -1266,7 +1266,7 @@ export const mergeBlocks =
|
|
|
1266
1266
|
offset !== undefined &&
|
|
1267
1267
|
// We cannot restore text selection if the RichText identifier
|
|
1268
1268
|
// is not a defined block attribute key. This can be the case if the
|
|
1269
|
-
// fallback
|
|
1269
|
+
// fallback instance ID is used to store selection (and no RichText
|
|
1270
1270
|
// identifier is set), or when the identifier is wrong.
|
|
1271
1271
|
!! attributeDefinition;
|
|
1272
1272
|
|
package/src/store/selectors.js
CHANGED
|
@@ -1958,7 +1958,7 @@ const canIncludeBlockTypeInInserter = ( state, blockType, rootClientId ) => {
|
|
|
1958
1958
|
};
|
|
1959
1959
|
|
|
1960
1960
|
/**
|
|
1961
|
-
* Return a function to be used to
|
|
1961
|
+
* Return a function to be used to transform a block variation to an inserter item
|
|
1962
1962
|
*
|
|
1963
1963
|
* @param {Object} state Global State
|
|
1964
1964
|
* @param {Object} item Denormalized inserter item
|
|
@@ -2021,7 +2021,7 @@ const calculateFrecency = ( time, count ) => {
|
|
|
2021
2021
|
/**
|
|
2022
2022
|
* Returns a function that accepts a block type and builds an item to be shown
|
|
2023
2023
|
* in a specific context. It's used for building items for Inserter and available
|
|
2024
|
-
* block
|
|
2024
|
+
* block Transforms list.
|
|
2025
2025
|
*
|
|
2026
2026
|
* @param {Object} state Editor state.
|
|
2027
2027
|
* @param {Object} options Options object for handling the building of a block type.
|
|
@@ -2522,7 +2522,7 @@ export const __experimentalGetAllowedPatterns = createRegistrySelector(
|
|
|
2522
2522
|
* or blocks transformations.
|
|
2523
2523
|
*
|
|
2524
2524
|
* @param {Object} state Editor state.
|
|
2525
|
-
* @param {string|string[]} blockNames Block's name or array of block names to find matching
|
|
2525
|
+
* @param {string|string[]} blockNames Block's name or array of block names to find matching patterns.
|
|
2526
2526
|
* @param {?string} rootClientId Optional target root client ID.
|
|
2527
2527
|
*
|
|
2528
2528
|
* @return {Array} The list of matched block patterns based on declared `blockTypes` and block name.
|
|
@@ -2941,7 +2941,7 @@ export const __unstableGetVisibleBlocks = createSelector(
|
|
|
2941
2941
|
);
|
|
2942
2942
|
|
|
2943
2943
|
export function __unstableHasActiveBlockOverlayActive( state, clientId ) {
|
|
2944
|
-
// Prevent overlay on blocks with a non-default editing mode. If the
|
|
2944
|
+
// Prevent overlay on blocks with a non-default editing mode. If the mode is
|
|
2945
2945
|
// 'disabled' then the overlay is redundant since the block can't be
|
|
2946
2946
|
// selected. If the mode is 'contentOnly' then the overlay is redundant
|
|
2947
2947
|
// since there will be no controls to interact with once selected.
|
|
@@ -3065,7 +3065,7 @@ export const getBlockEditingMode = createRegistrySelector(
|
|
|
3065
3065
|
return state.derivedNavModeBlockEditingModes.get( clientId );
|
|
3066
3066
|
}
|
|
3067
3067
|
|
|
3068
|
-
// In normal mode, consider that an
|
|
3068
|
+
// In normal mode, consider that an explicitly set editing mode takes over.
|
|
3069
3069
|
const blockEditingMode = state.blockEditingModes.get( clientId );
|
|
3070
3070
|
if ( blockEditingMode ) {
|
|
3071
3071
|
return blockEditingMode;
|
|
@@ -237,7 +237,7 @@ describe( 'private selectors', () => {
|
|
|
237
237
|
).toBe( false );
|
|
238
238
|
} );
|
|
239
239
|
|
|
240
|
-
it( 'should return false when top level block is disabled via
|
|
240
|
+
it( 'should return false when top level block is disabled via inheritance and there are non-disabled editing modes within it', () => {
|
|
241
241
|
const state = {
|
|
242
242
|
...baseState,
|
|
243
243
|
blockEditingModes: new Map( [
|
|
@@ -3534,7 +3534,7 @@ describe( 'selectors', () => {
|
|
|
3534
3534
|
beforeAll( () => {
|
|
3535
3535
|
registerBlockType( 'core/with-tranforms-a', {
|
|
3536
3536
|
category: 'text',
|
|
3537
|
-
title: '
|
|
3537
|
+
title: 'Transforms a',
|
|
3538
3538
|
edit: () => {},
|
|
3539
3539
|
save: () => {},
|
|
3540
3540
|
transforms: {
|
|
@@ -3563,7 +3563,7 @@ describe( 'selectors', () => {
|
|
|
3563
3563
|
} );
|
|
3564
3564
|
registerBlockType( 'core/with-tranforms-b', {
|
|
3565
3565
|
category: 'text',
|
|
3566
|
-
title: '
|
|
3566
|
+
title: 'Transforms b',
|
|
3567
3567
|
edit: () => {},
|
|
3568
3568
|
save: () => {},
|
|
3569
3569
|
transforms: {
|
|
@@ -3578,7 +3578,7 @@ describe( 'selectors', () => {
|
|
|
3578
3578
|
} );
|
|
3579
3579
|
registerBlockType( 'core/with-tranforms-c', {
|
|
3580
3580
|
category: 'text',
|
|
3581
|
-
title: '
|
|
3581
|
+
title: 'Transforms c',
|
|
3582
3582
|
edit: () => {},
|
|
3583
3583
|
save: () => {},
|
|
3584
3584
|
transforms: {
|
package/src/style.scss
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
@import "./components/justify-content-control/style.scss";
|
|
41
41
|
@import "./components/link-control/style.scss";
|
|
42
42
|
@import "./components/list-view/style.scss";
|
|
43
|
+
@import "./components/media-placeholder/style.scss";
|
|
43
44
|
@import "./components/media-replace-flow/style.scss";
|
|
44
45
|
@import "./components/multi-selection-inspector/style.scss";
|
|
45
46
|
@import "./components/responsive-block-control/style.scss";
|
|
@@ -37,7 +37,7 @@ describe( 'orderBy', () => {
|
|
|
37
37
|
expect( orderBy( input, 'x' ) ).toEqual( expected );
|
|
38
38
|
} );
|
|
39
39
|
|
|
40
|
-
it( 'should maintain original order of equal items in
|
|
40
|
+
it( 'should maintain original order of equal items in descending order', () => {
|
|
41
41
|
const a = { x: 1, a: 1 };
|
|
42
42
|
const b = { x: 1, b: 2 };
|
|
43
43
|
const c = { x: 0 };
|
|
@@ -160,7 +160,7 @@ function transformStyle(
|
|
|
160
160
|
/**
|
|
161
161
|
* @typedef {Object} EditorStyle
|
|
162
162
|
* @property {string} css the CSS block(s), as a single string.
|
|
163
|
-
* @property {?string} baseURL the base URL to be used as the reference when
|
|
163
|
+
* @property {?string} baseURL the base URL to be used as the reference when rewriting urls.
|
|
164
164
|
* @property {?string[]} ignoredSelectors the selectors not to wrap.
|
|
165
165
|
*/
|
|
166
166
|
|
|
@@ -17,47 +17,55 @@ export function useNotifyCopy() {
|
|
|
17
17
|
const { getBlockType } = useSelect( blocksStore );
|
|
18
18
|
const { createSuccessNotice } = useDispatch( noticesStore );
|
|
19
19
|
|
|
20
|
-
return useCallback(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
20
|
+
return useCallback(
|
|
21
|
+
( eventType, selectedBlockClientIds ) => {
|
|
22
|
+
let notice = '';
|
|
23
|
+
|
|
24
|
+
if ( eventType === 'copyStyles' ) {
|
|
25
|
+
notice = __( 'Styles copied to clipboard.' );
|
|
26
|
+
} else if ( selectedBlockClientIds.length === 1 ) {
|
|
27
|
+
const clientId = selectedBlockClientIds[ 0 ];
|
|
28
|
+
const title = getBlockType( getBlockName( clientId ) )?.title;
|
|
29
|
+
|
|
30
|
+
if ( eventType === 'copy' ) {
|
|
31
|
+
notice = sprintf(
|
|
32
|
+
// Translators: Name of the block being copied, e.g. "Paragraph".
|
|
33
|
+
__( 'Copied "%s" to clipboard.' ),
|
|
34
|
+
title
|
|
35
|
+
);
|
|
36
|
+
} else {
|
|
37
|
+
notice = sprintf(
|
|
38
|
+
// Translators: Name of the block being cut, e.g. "Paragraph".
|
|
39
|
+
__( 'Moved "%s" to clipboard.' ),
|
|
40
|
+
title
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
} else if ( eventType === 'copy' ) {
|
|
44
|
+
notice = sprintf(
|
|
45
|
+
// Translators: %d: Number of blocks being copied.
|
|
46
|
+
_n(
|
|
47
|
+
'Copied %d block to clipboard.',
|
|
48
|
+
'Copied %d blocks to clipboard.',
|
|
49
|
+
selectedBlockClientIds.length
|
|
50
|
+
),
|
|
51
|
+
selectedBlockClientIds.length
|
|
52
|
+
);
|
|
53
|
+
} else {
|
|
54
|
+
notice = sprintf(
|
|
55
|
+
// Translators: %d: Number of blocks being moved.
|
|
56
|
+
_n(
|
|
57
|
+
'Moved %d block to clipboard.',
|
|
58
|
+
'Moved %d blocks to clipboard.',
|
|
59
|
+
selectedBlockClientIds.length
|
|
60
|
+
),
|
|
61
|
+
selectedBlockClientIds.length
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
createSuccessNotice( notice, {
|
|
66
|
+
type: 'snackbar',
|
|
67
|
+
} );
|
|
68
|
+
},
|
|
69
|
+
[ createSuccessNotice, getBlockName, getBlockType ]
|
|
70
|
+
);
|
|
63
71
|
}
|