@wordpress/block-editor 15.10.1-next.v.0 → 15.11.1-next.v.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 +2 -0
- package/build/components/block-controls/index.cjs +1 -1
- package/build/components/block-controls/index.cjs.map +2 -2
- package/build/components/block-edit/context.cjs +5 -0
- package/build/components/block-edit/context.cjs.map +2 -2
- package/build/components/block-edit/index.cjs +3 -0
- package/build/components/block-edit/index.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +7 -27
- package/build/components/block-inspector/index.cjs.map +3 -3
- package/build/components/block-list/block.cjs +3 -0
- package/build/components/block-list/block.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs +37 -13
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs.map +2 -2
- package/build/components/block-settings-menu-controls/index.cjs +1 -1
- package/build/components/block-settings-menu-controls/index.cjs.map +2 -2
- package/build/components/block-toolbar/index.cjs +1 -1
- package/build/components/block-toolbar/index.cjs.map +2 -2
- package/build/components/block-tools/index.cjs +2 -26
- package/build/components/block-tools/index.cjs.map +2 -2
- package/build/components/block-visibility/index.cjs +7 -9
- package/build/components/block-visibility/index.cjs.map +3 -3
- package/build/components/block-visibility/modal.cjs +13 -11
- package/build/components/block-visibility/modal.cjs.map +2 -2
- package/build/components/block-visibility/use-block-visibility.cjs +1 -1
- package/build/components/block-visibility/use-block-visibility.cjs.map +2 -2
- package/build/components/block-visibility/utils.cjs +5 -1
- package/build/components/block-visibility/utils.cjs.map +2 -2
- package/build/components/block-visibility/viewport-menu-item.cjs +11 -4
- package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
- package/build/components/block-visibility/viewport-toolbar.cjs +4 -6
- package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs +121 -0
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +7 -0
- package/build/components/button-block-appender/index.cjs +23 -19
- package/build/components/button-block-appender/index.cjs.map +2 -2
- package/build/components/color-palette/with-color-context.cjs +1 -1
- package/build/components/color-palette/with-color-context.cjs.map +2 -2
- package/build/components/color-style-selector/index.cjs +1 -1
- package/build/components/color-style-selector/index.cjs.map +2 -2
- package/build/components/colors/with-colors.cjs +5 -3
- package/build/components/colors/with-colors.cjs.map +2 -2
- package/build/components/colors-gradients/dropdown.cjs +1 -1
- package/build/components/colors-gradients/dropdown.cjs.map +2 -2
- package/build/components/editable-text/index.cjs +5 -1
- package/build/components/editable-text/index.cjs.map +2 -2
- package/build/components/font-sizes/font-size-picker.cjs +2 -1
- package/build/components/font-sizes/font-size-picker.cjs.map +2 -2
- package/build/components/font-sizes/with-font-sizes.cjs +5 -3
- package/build/components/font-sizes/with-font-sizes.cjs.map +2 -2
- package/build/components/global-styles/advanced-panel.cjs +26 -13
- package/build/components/global-styles/advanced-panel.cjs.map +2 -2
- package/build/components/global-styles/filters-panel.cjs +1 -1
- package/build/components/global-styles/filters-panel.cjs.map +2 -2
- package/build/components/global-styles/shadow-panel-components.cjs +1 -1
- package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
- package/build/components/gradients/with-gradient.cjs +1 -1
- package/build/components/gradients/with-gradient.cjs.map +2 -2
- package/build/components/inspector-controls/fill.cjs +14 -25
- package/build/components/inspector-controls/fill.cjs.map +2 -2
- package/build/components/inspector-controls/index.cjs +1 -1
- package/build/components/inspector-controls/index.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/index.cjs +1 -1
- package/build/components/inspector-controls-tabs/index.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs +7 -7
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs.map +2 -2
- package/build/components/list-view/block-select-button.cjs +8 -16
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/block.cjs +29 -34
- package/build/components/list-view/block.cjs.map +3 -3
- package/build/components/list-view/utils.cjs +3 -1
- package/build/components/list-view/utils.cjs.map +2 -2
- package/build/components/provider/index.cjs +7 -8
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/provider/with-registry-provider.cjs +1 -1
- package/build/components/provider/with-registry-provider.cjs.map +2 -2
- package/build/components/use-block-commands/index.cjs +2 -34
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/hooks/block-fields/index.cjs +52 -86
- package/build/hooks/block-fields/index.cjs.map +3 -3
- package/build/hooks/block-fields/link/index.cjs +2 -11
- package/build/hooks/block-fields/link/index.cjs.map +2 -2
- package/build/hooks/block-fields/media/index.cjs +9 -14
- package/build/hooks/block-fields/media/index.cjs.map +2 -2
- package/build/hooks/cross-origin-isolation.cjs +1 -1
- package/build/hooks/cross-origin-isolation.cjs.map +2 -2
- package/build/hooks/custom-css.cjs +141 -0
- package/build/hooks/custom-css.cjs.map +7 -0
- package/build/hooks/fit-text.cjs +14 -7
- package/build/hooks/fit-text.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +1 -1
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/index.cjs +6 -1
- package/build/hooks/index.cjs.map +3 -3
- package/build/hooks/layout.cjs +10 -4
- package/build/hooks/layout.cjs.map +2 -2
- package/build/hooks/list-view.cjs +32 -11
- package/build/hooks/list-view.cjs.map +3 -3
- package/build/hooks/utils.cjs +5 -4
- package/build/hooks/utils.cjs.map +2 -2
- package/build/layouts/grid.cjs +12 -1
- package/build/layouts/grid.cjs.map +2 -2
- package/build/store/defaults.cjs +3 -0
- package/build/store/defaults.cjs.map +2 -2
- package/build/store/private-selectors.cjs +45 -37
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/selectors.cjs +7 -1
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/fit-text-utils.cjs +5 -1
- package/build/utils/fit-text-utils.cjs.map +2 -2
- package/build-module/components/block-controls/index.mjs +1 -1
- package/build-module/components/block-controls/index.mjs.map +2 -2
- package/build-module/components/block-edit/context.mjs +4 -0
- package/build-module/components/block-edit/context.mjs.map +2 -2
- package/build-module/components/block-edit/index.mjs +4 -0
- package/build-module/components/block-edit/index.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +7 -27
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-list/block.mjs +3 -0
- package/build-module/components/block-list/block.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs +37 -13
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs.map +2 -2
- package/build-module/components/block-settings-menu-controls/index.mjs +2 -2
- package/build-module/components/block-settings-menu-controls/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/index.mjs +2 -2
- package/build-module/components/block-toolbar/index.mjs.map +2 -2
- package/build-module/components/block-tools/index.mjs +2 -26
- package/build-module/components/block-tools/index.mjs.map +2 -2
- package/build-module/components/block-visibility/index.mjs +6 -9
- package/build-module/components/block-visibility/index.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs +13 -11
- package/build-module/components/block-visibility/modal.mjs.map +2 -2
- package/build-module/components/block-visibility/use-block-visibility.mjs +1 -1
- package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
- package/build-module/components/block-visibility/utils.mjs +5 -1
- package/build-module/components/block-visibility/utils.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-menu-item.mjs +11 -4
- package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-toolbar.mjs +4 -6
- package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +95 -0
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +7 -0
- package/build-module/components/button-block-appender/index.mjs +23 -19
- package/build-module/components/button-block-appender/index.mjs.map +2 -2
- package/build-module/components/color-palette/with-color-context.mjs +1 -1
- package/build-module/components/color-palette/with-color-context.mjs.map +2 -2
- package/build-module/components/color-style-selector/index.mjs +1 -1
- package/build-module/components/color-style-selector/index.mjs.map +2 -2
- package/build-module/components/colors/with-colors.mjs +5 -3
- package/build-module/components/colors/with-colors.mjs.map +2 -2
- package/build-module/components/colors-gradients/dropdown.mjs +1 -1
- package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
- package/build-module/components/editable-text/index.mjs +5 -1
- package/build-module/components/editable-text/index.mjs.map +2 -2
- package/build-module/components/font-sizes/font-size-picker.mjs +2 -1
- package/build-module/components/font-sizes/font-size-picker.mjs.map +2 -2
- package/build-module/components/font-sizes/with-font-sizes.mjs +5 -3
- package/build-module/components/font-sizes/with-font-sizes.mjs.map +2 -2
- package/build-module/components/global-styles/advanced-panel.mjs +22 -13
- package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
- package/build-module/components/global-styles/filters-panel.mjs +1 -1
- package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
- package/build-module/components/global-styles/shadow-panel-components.mjs +1 -1
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
- package/build-module/components/gradients/with-gradient.mjs +1 -1
- package/build-module/components/gradients/with-gradient.mjs.map +2 -2
- package/build-module/components/inspector-controls/fill.mjs +16 -22
- package/build-module/components/inspector-controls/fill.mjs.map +2 -2
- package/build-module/components/inspector-controls/index.mjs +1 -1
- package/build-module/components/inspector-controls/index.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/index.mjs +1 -1
- package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs +7 -7
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +8 -16
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/block.mjs +31 -36
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/list-view/utils.mjs +3 -1
- package/build-module/components/list-view/utils.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +7 -8
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/with-registry-provider.mjs +1 -1
- package/build-module/components/provider/with-registry-provider.mjs.map +2 -2
- package/build-module/components/use-block-commands/index.mjs +3 -37
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/hooks/block-fields/index.mjs +45 -87
- package/build-module/hooks/block-fields/index.mjs.map +2 -2
- package/build-module/hooks/block-fields/link/index.mjs +2 -11
- package/build-module/hooks/block-fields/link/index.mjs.map +2 -2
- package/build-module/hooks/block-fields/media/index.mjs +9 -14
- package/build-module/hooks/block-fields/media/index.mjs.map +2 -2
- package/build-module/hooks/cross-origin-isolation.mjs +1 -1
- package/build-module/hooks/cross-origin-isolation.mjs.map +2 -2
- package/build-module/hooks/custom-css.mjs +112 -0
- package/build-module/hooks/custom-css.mjs.map +7 -0
- package/build-module/hooks/fit-text.mjs +14 -7
- package/build-module/hooks/fit-text.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +1 -1
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/index.mjs +6 -1
- package/build-module/hooks/index.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +10 -4
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/list-view.mjs +33 -12
- package/build-module/hooks/list-view.mjs.map +2 -2
- package/build-module/hooks/utils.mjs +7 -5
- package/build-module/hooks/utils.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +12 -1
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/store/defaults.mjs +3 -0
- package/build-module/store/defaults.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +42 -40
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/selectors.mjs +7 -1
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/fit-text-utils.mjs +5 -1
- package/build-module/utils/fit-text-utils.mjs.map +2 -2
- package/build-style/style-rtl.css +3 -0
- package/build-style/style.css +3 -0
- package/package.json +39 -39
- package/src/components/block-controls/index.js +1 -1
- package/src/components/block-controls/test/index.js +1 -0
- package/src/components/block-edit/context.js +3 -0
- package/src/components/block-edit/index.js +6 -0
- package/src/components/block-edit/test/edit.js +10 -0
- package/src/components/block-inspector/index.js +16 -38
- package/src/components/block-list/block.js +3 -0
- package/src/components/block-list/block.native.js +5 -0
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +49 -29
- package/src/components/block-patterns-list/stories/index.story.jsx +1 -1
- package/src/components/block-preview/test/index.js +11 -7
- package/src/components/block-settings-menu-controls/index.js +2 -2
- package/src/components/block-switcher/test/index.js +2 -0
- package/src/components/block-switcher/test/use-transformed.patterns.js +2 -0
- package/src/components/block-switcher/test/utils.js +2 -0
- package/src/components/block-toolbar/index.js +2 -2
- package/src/components/block-tools/index.js +2 -29
- package/src/components/block-visibility/index.js +3 -19
- package/src/components/block-visibility/modal.js +16 -14
- package/src/components/block-visibility/test/use-block-visibility.js +27 -25
- package/src/components/block-visibility/test/utils.js +24 -8
- package/src/components/block-visibility/use-block-visibility.js +1 -4
- package/src/components/block-visibility/utils.js +9 -1
- package/src/components/block-visibility/viewport-menu-item.js +11 -5
- package/src/components/block-visibility/viewport-toolbar.js +5 -6
- package/src/components/block-visibility/viewport-visibility-info.js +131 -0
- package/src/components/button-block-appender/index.js +2 -2
- package/src/components/color-palette/with-color-context.js +1 -1
- package/src/components/color-style-selector/index.js +2 -3
- package/src/components/colors/with-colors.js +23 -20
- package/src/components/colors-gradients/dropdown.js +2 -3
- package/src/components/editable-text/index.js +5 -1
- package/src/components/font-sizes/font-size-picker.js +1 -0
- package/src/components/font-sizes/with-font-sizes.js +13 -10
- package/src/components/global-styles/advanced-panel.js +35 -16
- package/src/components/global-styles/filters-panel.js +2 -3
- package/src/components/global-styles/shadow-panel-components.js +1 -1
- package/src/components/global-styles/style.scss +9 -5
- package/src/components/gradients/with-gradient.js +7 -4
- package/src/components/inner-blocks/test/index.js +2 -0
- package/src/components/inspector-controls/fill.js +30 -20
- package/src/components/inspector-controls/index.js +1 -1
- package/src/components/inspector-controls-tabs/index.js +5 -1
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +13 -11
- package/src/components/link-control/test/index.js +6 -1
- package/src/components/list-view/block-select-button.js +16 -25
- package/src/components/list-view/block.js +38 -43
- package/src/components/list-view/utils.js +4 -2
- package/src/components/media-replace-flow/test/index.js +13 -11
- package/src/components/provider/index.js +11 -10
- package/src/components/provider/test/use-block-sync.js +1 -0
- package/src/components/provider/with-registry-provider.js +1 -1
- package/src/components/use-block-commands/index.js +0 -41
- package/src/hooks/block-fields/index.js +66 -111
- package/src/hooks/block-fields/link/index.js +2 -14
- package/src/hooks/block-fields/media/index.js +9 -21
- package/src/hooks/cross-origin-isolation.js +19 -18
- package/src/hooks/custom-css.js +176 -0
- package/src/hooks/fit-text.js +20 -5
- package/src/hooks/grid-visualizer.js +15 -14
- package/src/hooks/index.js +6 -1
- package/src/hooks/layout.js +55 -43
- package/src/hooks/list-view.js +46 -12
- package/src/hooks/test/align.js +1 -0
- package/src/hooks/test/allowed-blocks.js +8 -0
- package/src/hooks/test/auto-inspector-controls.js +4 -0
- package/src/hooks/test/font-size.js +1 -0
- package/src/hooks/test/metadata.js +4 -0
- package/src/hooks/test/text-align.js +1 -0
- package/src/hooks/utils.js +124 -116
- package/src/layouts/grid.js +19 -3
- package/src/layouts/test/grid.js +1 -1
- package/src/store/defaults.js +4 -0
- package/src/store/private-selectors.js +94 -63
- package/src/store/selectors.js +14 -6
- package/src/store/test/actions.js +7 -0
- package/src/store/test/private-selectors.js +116 -119
- package/src/store/test/reducer.js +4 -0
- package/src/store/test/registry-selectors.js +2 -0
- package/src/store/test/selectors.js +19 -0
- package/src/utils/fit-text-utils.js +12 -2
- package/build/components/block-visibility/block-visibility-info.cjs +0 -63
- package/build/components/block-visibility/block-visibility-info.cjs.map +0 -7
- package/build/components/block-visibility/menu-item.cjs +0 -109
- package/build/components/block-visibility/menu-item.cjs.map +0 -7
- package/build/components/block-visibility/toolbar.cjs +0 -92
- package/build/components/block-visibility/toolbar.cjs.map +0 -7
- package/build-module/components/block-visibility/block-visibility-info.mjs +0 -47
- package/build-module/components/block-visibility/block-visibility-info.mjs.map +0 -7
- package/build-module/components/block-visibility/menu-item.mjs +0 -88
- package/build-module/components/block-visibility/menu-item.mjs.map +0 -7
- package/build-module/components/block-visibility/toolbar.mjs +0 -71
- package/build-module/components/block-visibility/toolbar.mjs.map +0 -7
- package/src/components/block-visibility/block-visibility-info.js +0 -62
- package/src/components/block-visibility/menu-item.js +0 -96
- package/src/components/block-visibility/toolbar.js +0 -88
- /package/src/components/block-icon/stories/{index.story.js → index.story.ts} +0 -0
- /package/src/components/contrast-checker/stories/{index.story.js → index.story.ts} +0 -0
|
@@ -174,6 +174,7 @@ describe( 'metadata', () => {
|
|
|
174
174
|
|
|
175
175
|
it( 'should preserve custom name metadata', () => {
|
|
176
176
|
registerBlockType( 'core/bar', {
|
|
177
|
+
apiVersion: 3,
|
|
177
178
|
title: 'Bar',
|
|
178
179
|
} );
|
|
179
180
|
const source = [
|
|
@@ -199,6 +200,7 @@ describe( 'metadata', () => {
|
|
|
199
200
|
|
|
200
201
|
it( 'should not preserve custom name metadata when target block does not support renaming', () => {
|
|
201
202
|
registerBlockType( 'core/bar', {
|
|
203
|
+
apiVersion: 3,
|
|
202
204
|
title: 'Bar',
|
|
203
205
|
supports: {
|
|
204
206
|
renaming: false,
|
|
@@ -226,6 +228,7 @@ describe( 'metadata', () => {
|
|
|
226
228
|
|
|
227
229
|
it( 'should preserve block visibility metadata', () => {
|
|
228
230
|
registerBlockType( 'core/bar', {
|
|
231
|
+
apiVersion: 3,
|
|
229
232
|
title: 'Bar',
|
|
230
233
|
} );
|
|
231
234
|
|
|
@@ -252,6 +255,7 @@ describe( 'metadata', () => {
|
|
|
252
255
|
|
|
253
256
|
it( 'should not preserve block visibility metadata when target block does not support it', () => {
|
|
254
257
|
registerBlockType( 'core/bar', {
|
|
258
|
+
apiVersion: 3,
|
|
255
259
|
title: 'Bar',
|
|
256
260
|
supports: {
|
|
257
261
|
visibility: false,
|
package/src/hooks/utils.js
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
useBlockEditContext,
|
|
20
20
|
mayDisplayControlsKey,
|
|
21
21
|
mayDisplayParentControlsKey,
|
|
22
|
+
mayDisplayPatternEditingControlsKey,
|
|
22
23
|
} from '../components/block-edit/context';
|
|
23
24
|
import { useSettings } from '../components';
|
|
24
25
|
import { useSettingsForBlockElement } from '../components/global-styles/hooks';
|
|
@@ -521,60 +522,66 @@ export function createBlockEditFilter( features ) {
|
|
|
521
522
|
return { ...settings, Edit: memo( settings.edit ) };
|
|
522
523
|
} );
|
|
523
524
|
const withBlockEditHooks = createHigherOrderComponent(
|
|
524
|
-
( OriginalBlockEdit ) =>
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
525
|
+
( OriginalBlockEdit ) =>
|
|
526
|
+
function WithBlockEditHooks( props ) {
|
|
527
|
+
const context = useBlockEditContext();
|
|
528
|
+
// CAUTION: code added before this line will be executed for all
|
|
529
|
+
// blocks, not just those that support the feature! Code added
|
|
530
|
+
// above this line should be carefully evaluated for its impact on
|
|
531
|
+
// performance.
|
|
532
|
+
return [
|
|
533
|
+
...features.map( ( feature, i ) => {
|
|
534
|
+
const {
|
|
535
|
+
Edit,
|
|
536
|
+
hasSupport,
|
|
537
|
+
attributeKeys = [],
|
|
538
|
+
shareWithChildBlocks,
|
|
539
|
+
supportsPatternEditing,
|
|
540
|
+
} = feature;
|
|
541
|
+
const shouldDisplayControls =
|
|
542
|
+
( supportsPatternEditing &&
|
|
543
|
+
context[
|
|
544
|
+
mayDisplayPatternEditingControlsKey
|
|
545
|
+
] ) ||
|
|
546
|
+
context[ mayDisplayControlsKey ] ||
|
|
547
|
+
( context[ mayDisplayParentControlsKey ] &&
|
|
548
|
+
shareWithChildBlocks );
|
|
542
549
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
const neededProps = {};
|
|
551
|
-
for ( const key of attributeKeys ) {
|
|
552
|
-
if ( props.attributes[ key ] ) {
|
|
553
|
-
neededProps[ key ] = props.attributes[ key ];
|
|
550
|
+
if (
|
|
551
|
+
! shouldDisplayControls ||
|
|
552
|
+
! hasSupport( props.name )
|
|
553
|
+
) {
|
|
554
|
+
return null;
|
|
554
555
|
}
|
|
555
|
-
}
|
|
556
556
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
key={ i }
|
|
562
|
-
name={ props.name }
|
|
563
|
-
isSelected={ props.isSelected }
|
|
564
|
-
clientId={ props.clientId }
|
|
565
|
-
setAttributes={ props.setAttributes }
|
|
566
|
-
__unstableParentLayout={
|
|
567
|
-
props.__unstableParentLayout
|
|
557
|
+
const neededProps = {};
|
|
558
|
+
for ( const key of attributeKeys ) {
|
|
559
|
+
if ( props.attributes[ key ] ) {
|
|
560
|
+
neededProps[ key ] = props.attributes[ key ];
|
|
568
561
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
return (
|
|
565
|
+
<Edit
|
|
566
|
+
// We can use the index because the array length
|
|
567
|
+
// is fixed per page load right now.
|
|
568
|
+
key={ i }
|
|
569
|
+
name={ props.name }
|
|
570
|
+
isSelected={ props.isSelected }
|
|
571
|
+
clientId={ props.clientId }
|
|
572
|
+
setAttributes={ props.setAttributes }
|
|
573
|
+
__unstableParentLayout={
|
|
574
|
+
props.__unstableParentLayout
|
|
575
|
+
}
|
|
576
|
+
// This component is pure, so only pass needed
|
|
577
|
+
// props!!!
|
|
578
|
+
{ ...neededProps }
|
|
579
|
+
/>
|
|
580
|
+
);
|
|
581
|
+
} ),
|
|
582
|
+
<OriginalBlockEdit key="edit" { ...props } />,
|
|
583
|
+
];
|
|
584
|
+
},
|
|
578
585
|
'withBlockEditHooks'
|
|
579
586
|
);
|
|
580
587
|
addFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );
|
|
@@ -610,76 +617,77 @@ const BlockPropsPure = memo( BlockProps );
|
|
|
610
617
|
|
|
611
618
|
export function createBlockListBlockFilter( features ) {
|
|
612
619
|
const withBlockListBlockHooks = createHigherOrderComponent(
|
|
613
|
-
( BlockListBlock ) =>
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
620
|
+
( BlockListBlock ) =>
|
|
621
|
+
function WithBlockListBlockHooks( props ) {
|
|
622
|
+
const [ allWrapperProps, setAllWrapperProps ] = useState(
|
|
623
|
+
Array( features.length ).fill( undefined )
|
|
624
|
+
);
|
|
625
|
+
return [
|
|
626
|
+
...features.map( ( feature, i ) => {
|
|
627
|
+
const {
|
|
628
|
+
hasSupport,
|
|
629
|
+
attributeKeys = [],
|
|
630
|
+
useBlockProps,
|
|
631
|
+
isMatch,
|
|
632
|
+
} = feature;
|
|
625
633
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
634
|
+
const neededProps = {};
|
|
635
|
+
for ( const key of attributeKeys ) {
|
|
636
|
+
if ( props.attributes[ key ] ) {
|
|
637
|
+
neededProps[ key ] = props.attributes[ key ];
|
|
638
|
+
}
|
|
630
639
|
}
|
|
631
|
-
}
|
|
632
640
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
641
|
+
if (
|
|
642
|
+
// Skip rendering if none of the needed attributes are
|
|
643
|
+
// set.
|
|
644
|
+
! Object.keys( neededProps ).length ||
|
|
645
|
+
! hasSupport( props.name ) ||
|
|
646
|
+
( isMatch && ! isMatch( neededProps ) )
|
|
647
|
+
) {
|
|
648
|
+
return null;
|
|
649
|
+
}
|
|
642
650
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
651
|
+
return (
|
|
652
|
+
<BlockPropsPure
|
|
653
|
+
// We can use the index because the array length
|
|
654
|
+
// is fixed per page load right now.
|
|
655
|
+
key={ i }
|
|
656
|
+
index={ i }
|
|
657
|
+
useBlockProps={ useBlockProps }
|
|
658
|
+
// This component is pure, so we must pass a stable
|
|
659
|
+
// function reference.
|
|
660
|
+
setAllWrapperProps={ setAllWrapperProps }
|
|
661
|
+
name={ props.name }
|
|
662
|
+
clientId={ props.clientId }
|
|
663
|
+
// This component is pure, so only pass needed
|
|
664
|
+
// props!!!
|
|
665
|
+
{ ...neededProps }
|
|
666
|
+
/>
|
|
667
|
+
);
|
|
668
|
+
} ),
|
|
669
|
+
<BlockListBlock
|
|
670
|
+
key="edit"
|
|
671
|
+
{ ...props }
|
|
672
|
+
wrapperProps={ allWrapperProps
|
|
673
|
+
.filter( Boolean )
|
|
674
|
+
.reduce( ( acc, wrapperProps ) => {
|
|
675
|
+
return {
|
|
676
|
+
...acc,
|
|
677
|
+
...wrapperProps,
|
|
678
|
+
className: clsx(
|
|
679
|
+
acc.className,
|
|
680
|
+
wrapperProps.className
|
|
681
|
+
),
|
|
682
|
+
style: {
|
|
683
|
+
...acc.style,
|
|
684
|
+
...wrapperProps.style,
|
|
685
|
+
},
|
|
686
|
+
};
|
|
687
|
+
}, props.wrapperProps || {} ) }
|
|
688
|
+
/>,
|
|
689
|
+
];
|
|
690
|
+
},
|
|
683
691
|
'withBlockListBlockHooks'
|
|
684
692
|
);
|
|
685
693
|
addFilter(
|
package/src/layouts/grid.js
CHANGED
|
@@ -113,6 +113,7 @@ export default {
|
|
|
113
113
|
style,
|
|
114
114
|
blockName,
|
|
115
115
|
hasBlockGapSupport,
|
|
116
|
+
globalBlockGapValue,
|
|
116
117
|
layoutDefinitions = LAYOUT_DEFINITIONS,
|
|
117
118
|
} ) {
|
|
118
119
|
const {
|
|
@@ -146,13 +147,28 @@ export default {
|
|
|
146
147
|
? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )
|
|
147
148
|
: undefined;
|
|
148
149
|
|
|
150
|
+
// Use the global blockGap value for grid column calculations when available
|
|
151
|
+
// If the gap value has both top and left (separated by space), use the left value for horizontal calculations
|
|
152
|
+
let fallbackGapValue = '1.2rem';
|
|
153
|
+
if ( globalBlockGapValue ) {
|
|
154
|
+
const processedGap = getGapCSSValue( globalBlockGapValue, '0.5em' );
|
|
155
|
+
const gapParts = processedGap.split( ' ' );
|
|
156
|
+
fallbackGapValue =
|
|
157
|
+
gapParts.length > 1 ? gapParts[ 1 ] : gapParts[ 0 ];
|
|
158
|
+
}
|
|
159
|
+
|
|
149
160
|
let output = '';
|
|
150
161
|
const rules = [];
|
|
151
162
|
|
|
152
163
|
if ( minimumColumnWidth && columnCount > 0 ) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
164
|
+
let blockGapToUse = blockGapValue || fallbackGapValue;
|
|
165
|
+
// Ensure 0 values have a unit so they work in calc().
|
|
166
|
+
if ( blockGapToUse === '0' || blockGapToUse === 0 ) {
|
|
167
|
+
blockGapToUse = '0px';
|
|
168
|
+
}
|
|
169
|
+
const maxValue = `max(min( ${ minimumColumnWidth }, 100%), ( 100% - (${ blockGapToUse }*${
|
|
170
|
+
columnCount - 1
|
|
171
|
+
}) ) / ${ columnCount })`;
|
|
156
172
|
rules.push(
|
|
157
173
|
`grid-template-columns: repeat(auto-fill, minmax(${ maxValue }, 1fr))`,
|
|
158
174
|
`container-type: inline-size`
|
package/src/layouts/test/grid.js
CHANGED
|
@@ -33,7 +33,7 @@ describe( 'getLayoutStyle', () => {
|
|
|
33
33
|
expect( result ).toBe( expected );
|
|
34
34
|
} );
|
|
35
35
|
it( 'should return `grid-template-columns` with max() function if both minimumColumnWidth and columnCount are provided', () => {
|
|
36
|
-
const expected = `.my-container { grid-template-columns: repeat(auto-fill, minmax(max(12rem, ( 100% - (1.2rem*2) ) / 3), 1fr)); container-type: inline-size; }`;
|
|
36
|
+
const expected = `.my-container { grid-template-columns: repeat(auto-fill, minmax(max(min( 12rem, 100%), ( 100% - (1.2rem*2) ) / 3), 1fr)); container-type: inline-size; }`;
|
|
37
37
|
|
|
38
38
|
const result = grid.getLayoutStyle( {
|
|
39
39
|
selector: '.my-container',
|
package/src/store/defaults.js
CHANGED
|
@@ -157,6 +157,10 @@ export const SETTINGS_DEFAULTS = {
|
|
|
157
157
|
// Allows to disable block locking interface.
|
|
158
158
|
canLockBlocks: true,
|
|
159
159
|
|
|
160
|
+
// Whether the user can edit custom CSS (requires edit_css capability).
|
|
161
|
+
// Defaults to false for safety - PHP passes true when user has capability.
|
|
162
|
+
canEditCSS: false,
|
|
163
|
+
|
|
160
164
|
// Allows to disable Openverse media category in the inserter.
|
|
161
165
|
enableOpenverseMediaCategory: true,
|
|
162
166
|
|
|
@@ -36,12 +36,8 @@ import {
|
|
|
36
36
|
reusableBlocksSelectKey,
|
|
37
37
|
sectionRootClientIdKey,
|
|
38
38
|
isIsolatedEditorKey,
|
|
39
|
-
deviceTypeKey,
|
|
40
39
|
} from './private-keys';
|
|
41
|
-
import {
|
|
42
|
-
BLOCK_VISIBILITY_VIEWPORT_ENTRIES,
|
|
43
|
-
BLOCK_VISIBILITY_VIEWPORTS,
|
|
44
|
-
} from '../components/block-visibility/constants';
|
|
40
|
+
import { BLOCK_VISIBILITY_VIEWPORTS } from '../components/block-visibility/constants';
|
|
45
41
|
|
|
46
42
|
const { isContentBlock } = unlock( blocksPrivateApis );
|
|
47
43
|
|
|
@@ -703,18 +699,22 @@ export function getInsertionPoint( state ) {
|
|
|
703
699
|
}
|
|
704
700
|
|
|
705
701
|
/**
|
|
706
|
-
* Returns true if the block is hidden, or false otherwise.
|
|
702
|
+
* Returns true if the block is hidden anywhere, or false otherwise.
|
|
703
|
+
*
|
|
704
|
+
* This selector checks whether a block has visibility metadata set that would
|
|
705
|
+
* hide it at any viewport or everywhere. It's useful for flagging blocks that
|
|
706
|
+
* have visibility restrictions.
|
|
707
707
|
*
|
|
708
|
-
* A block is considered hidden if:
|
|
708
|
+
* A block is considered hidden anywhere if:
|
|
709
709
|
* - blockVisibility is false (hidden everywhere)
|
|
710
|
-
* - blockVisibility
|
|
710
|
+
* - blockVisibility.viewport has any viewport set to false (hidden at specific screen sizes)
|
|
711
711
|
*
|
|
712
712
|
* @param {Object} state Global application state.
|
|
713
713
|
* @param {string} clientId Client ID of the block.
|
|
714
714
|
*
|
|
715
|
-
* @return {boolean} Whether the block is hidden.
|
|
715
|
+
* @return {boolean} Whether the block is hidden anywhere.
|
|
716
716
|
*/
|
|
717
|
-
export const
|
|
717
|
+
export const isBlockHiddenAnywhere = ( state, clientId ) => {
|
|
718
718
|
const blockName = getBlockName( state, clientId );
|
|
719
719
|
if ( ! hasBlockSupport( blockName, 'visibility', true ) ) {
|
|
720
720
|
return false;
|
|
@@ -726,79 +726,110 @@ export const isBlockHidden = ( state, clientId ) => {
|
|
|
726
726
|
return true;
|
|
727
727
|
}
|
|
728
728
|
|
|
729
|
-
if (
|
|
730
|
-
|
|
729
|
+
if (
|
|
730
|
+
typeof blockVisibility?.viewport === 'object' &&
|
|
731
|
+
blockVisibility?.viewport !== null
|
|
732
|
+
) {
|
|
733
|
+
// Check if the block is hidden at any viewport.
|
|
734
|
+
return Object.values( BLOCK_VISIBILITY_VIEWPORTS ).some(
|
|
735
|
+
( viewport ) =>
|
|
736
|
+
blockVisibility?.viewport?.[ viewport.key ] === false
|
|
737
|
+
);
|
|
731
738
|
}
|
|
739
|
+
return false;
|
|
740
|
+
};
|
|
732
741
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
742
|
+
/**
|
|
743
|
+
* Returns true if the block is hidden everywhere (blockVisibility is false).
|
|
744
|
+
*
|
|
745
|
+
* A block is considered hidden everywhere when blockVisibility is explicitly
|
|
746
|
+
* set to false, which means it's hidden on all viewports.
|
|
747
|
+
*
|
|
748
|
+
* @param {Object} state Global application state.
|
|
749
|
+
* @param {string} clientId Client ID of the block.
|
|
750
|
+
*
|
|
751
|
+
* @return {boolean} Whether the block is hidden everywhere.
|
|
752
|
+
*/
|
|
753
|
+
export const isBlockHiddenEverywhere = ( state, clientId ) => {
|
|
754
|
+
const blockName = getBlockName( state, clientId );
|
|
755
|
+
if ( ! hasBlockSupport( blockName, 'visibility', true ) ) {
|
|
756
|
+
return false;
|
|
741
757
|
}
|
|
758
|
+
const attributes = state.blocks.attributes.get( clientId );
|
|
759
|
+
const blockVisibility = attributes?.metadata?.blockVisibility;
|
|
742
760
|
|
|
761
|
+
if ( blockVisibility === false ) {
|
|
762
|
+
return true;
|
|
763
|
+
}
|
|
743
764
|
return false;
|
|
744
765
|
};
|
|
745
766
|
|
|
746
767
|
/**
|
|
747
|
-
* Returns true if any
|
|
768
|
+
* Returns true if any parent block (immediate or further up the chain) is hidden everywhere.
|
|
748
769
|
*
|
|
749
|
-
*
|
|
750
|
-
*
|
|
751
|
-
*
|
|
770
|
+
* Checks all parent blocks in the hierarchy and returns true if any of them
|
|
771
|
+
* is hidden everywhere.
|
|
772
|
+
*
|
|
773
|
+
* @param {Object} state Global application state.
|
|
774
|
+
* @param {string} clientId Client ID of the block.
|
|
775
|
+
*
|
|
776
|
+
* @return {boolean} Whether any parent block is hidden everywhere.
|
|
752
777
|
*/
|
|
753
|
-
export const
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
778
|
+
export const isBlockParentHiddenEverywhere = ( state, clientId ) => {
|
|
779
|
+
const parents = getBlockParents( state, clientId );
|
|
780
|
+
return parents.some( ( parentId ) =>
|
|
781
|
+
isBlockHiddenEverywhere( state, parentId )
|
|
782
|
+
);
|
|
758
783
|
};
|
|
759
784
|
|
|
760
785
|
/**
|
|
761
|
-
*
|
|
786
|
+
* Returns true if the block is hidden at the given viewport.
|
|
762
787
|
*
|
|
763
|
-
*
|
|
764
|
-
*
|
|
765
|
-
*
|
|
788
|
+
* A block is considered hidden at a viewport if:
|
|
789
|
+
* - blockVisibility is false (hidden everywhere)
|
|
790
|
+
* - blockVisibility is an object with the specified viewport set to false
|
|
766
791
|
*
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
*
|
|
792
|
+
* @param {Object} state Global application state.
|
|
793
|
+
* @param {string} clientId Client ID of the block.
|
|
794
|
+
* @param {string} viewport Viewport to check ('desktop', 'tablet', 'mobile').
|
|
770
795
|
*
|
|
771
|
-
* @
|
|
772
|
-
* @param {Array} clientIds Array of block client IDs to check.
|
|
773
|
-
* @return {boolean} `true` if at least one block meets the visibility criteria, `false` otherwise.
|
|
796
|
+
* @return {boolean} Whether the block is hidden at the viewport.
|
|
774
797
|
*/
|
|
775
|
-
export const
|
|
776
|
-
if (
|
|
777
|
-
return
|
|
798
|
+
export const isBlockHiddenAtViewport = ( state, clientId, viewport ) => {
|
|
799
|
+
if ( isBlockHiddenEverywhere( state, clientId ) ) {
|
|
800
|
+
return true;
|
|
778
801
|
}
|
|
779
|
-
return clientIds.some( ( clientId ) => {
|
|
780
|
-
if ( ! clientId ) {
|
|
781
|
-
return false;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
const attributes = state.blocks.attributes.get( clientId );
|
|
785
|
-
const blockVisibility = attributes?.metadata?.blockVisibility;
|
|
786
|
-
|
|
787
|
-
// If explicitly hidden everywhere (false), return true.
|
|
788
|
-
if ( typeof blockVisibility === 'boolean' ) {
|
|
789
|
-
return blockVisibility === false;
|
|
790
|
-
}
|
|
791
802
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
803
|
+
const attributes = state.blocks.attributes.get( clientId );
|
|
804
|
+
const blockVisibilityViewport =
|
|
805
|
+
attributes?.metadata?.blockVisibility?.viewport;
|
|
806
|
+
if (
|
|
807
|
+
typeof blockVisibilityViewport === 'object' &&
|
|
808
|
+
blockVisibilityViewport !== null &&
|
|
809
|
+
typeof viewport === 'string'
|
|
810
|
+
) {
|
|
811
|
+
return blockVisibilityViewport?.[ viewport.toLowerCase() ] === false;
|
|
812
|
+
}
|
|
813
|
+
return false;
|
|
814
|
+
};
|
|
796
815
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
816
|
+
/**
|
|
817
|
+
* Returns true if any parent block (immediate or further up the chain) is hidden at the given viewport.
|
|
818
|
+
*
|
|
819
|
+
* Checks all parent blocks in the hierarchy and returns true if any of them
|
|
820
|
+
* is hidden at the specified viewport.
|
|
821
|
+
*
|
|
822
|
+
* @param {Object} state Global application state.
|
|
823
|
+
* @param {string} clientId Client ID of the block.
|
|
824
|
+
* @param {string} viewport Viewport to check ('desktop', 'tablet', 'mobile').
|
|
825
|
+
*
|
|
826
|
+
* @return {boolean} Whether any parent block is hidden at the viewport.
|
|
827
|
+
*/
|
|
828
|
+
export const isBlockParentHiddenAtViewport = ( state, clientId, viewport ) => {
|
|
829
|
+
const parents = getBlockParents( state, clientId );
|
|
830
|
+
return parents.some( ( parentId ) =>
|
|
831
|
+
isBlockHiddenAtViewport( state, parentId, viewport )
|
|
832
|
+
);
|
|
802
833
|
};
|
|
803
834
|
|
|
804
835
|
/**
|
package/src/store/selectors.js
CHANGED
|
@@ -2279,13 +2279,21 @@ export const getInserterItems = createRegistrySelector( ( select ) =>
|
|
|
2279
2279
|
)
|
|
2280
2280
|
);
|
|
2281
2281
|
} else {
|
|
2282
|
+
const { getClosestAllowedInsertionPoint } = unlock(
|
|
2283
|
+
select( STORE_NAME )
|
|
2284
|
+
);
|
|
2282
2285
|
blockTypeInserterItems = blockTypeInserterItems
|
|
2283
|
-
.filter(
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2286
|
+
.filter(
|
|
2287
|
+
( blockType ) =>
|
|
2288
|
+
isBlockVisibleInTheInserter(
|
|
2289
|
+
state,
|
|
2290
|
+
blockType,
|
|
2291
|
+
rootClientId
|
|
2292
|
+
) &&
|
|
2293
|
+
getClosestAllowedInsertionPoint(
|
|
2294
|
+
blockType.name,
|
|
2295
|
+
rootClientId
|
|
2296
|
+
) !== null
|
|
2289
2297
|
)
|
|
2290
2298
|
.map( ( blockType ) => ( {
|
|
2291
2299
|
...blockType,
|
|
@@ -60,6 +60,7 @@ const {
|
|
|
60
60
|
|
|
61
61
|
describe( 'actions', () => {
|
|
62
62
|
const defaultBlockSettings = {
|
|
63
|
+
apiVersion: 3,
|
|
63
64
|
attributes: {
|
|
64
65
|
content: {},
|
|
65
66
|
},
|
|
@@ -863,6 +864,7 @@ describe( 'actions', () => {
|
|
|
863
864
|
|
|
864
865
|
it( 'should merge the blocks if blocks of the same type', () => {
|
|
865
866
|
registerBlockType( 'core/test-block', {
|
|
867
|
+
apiVersion: 3,
|
|
866
868
|
attributes: {
|
|
867
869
|
content: {},
|
|
868
870
|
},
|
|
@@ -933,6 +935,7 @@ describe( 'actions', () => {
|
|
|
933
935
|
|
|
934
936
|
it( 'should not merge the blocks have different types without transformation', () => {
|
|
935
937
|
registerBlockType( 'core/test-block', {
|
|
938
|
+
apiVersion: 3,
|
|
936
939
|
attributes: {
|
|
937
940
|
content: {},
|
|
938
941
|
},
|
|
@@ -986,6 +989,7 @@ describe( 'actions', () => {
|
|
|
986
989
|
|
|
987
990
|
it( 'should transform and merge the blocks', () => {
|
|
988
991
|
registerBlockType( 'core/test-block', {
|
|
992
|
+
apiVersion: 3,
|
|
989
993
|
attributes: {
|
|
990
994
|
content: {
|
|
991
995
|
type: 'string',
|
|
@@ -1004,6 +1008,7 @@ describe( 'actions', () => {
|
|
|
1004
1008
|
title: 'test block',
|
|
1005
1009
|
} );
|
|
1006
1010
|
registerBlockType( 'core/test-block-2', {
|
|
1011
|
+
apiVersion: 3,
|
|
1007
1012
|
attributes: {
|
|
1008
1013
|
content2: {
|
|
1009
1014
|
type: 'string',
|
|
@@ -1081,6 +1086,7 @@ describe( 'actions', () => {
|
|
|
1081
1086
|
|
|
1082
1087
|
it( 'should not merge the blocks if blockB editing mode is `disabled`', () => {
|
|
1083
1088
|
registerBlockType( 'core/test-block', {
|
|
1089
|
+
apiVersion: 3,
|
|
1084
1090
|
attributes: {
|
|
1085
1091
|
content: {},
|
|
1086
1092
|
},
|
|
@@ -1140,6 +1146,7 @@ describe( 'actions', () => {
|
|
|
1140
1146
|
|
|
1141
1147
|
it( 'should not merge the blocks if blockA editing mode is `disabled`', () => {
|
|
1142
1148
|
registerBlockType( 'core/test-block', {
|
|
1149
|
+
apiVersion: 3,
|
|
1143
1150
|
attributes: {
|
|
1144
1151
|
content: {},
|
|
1145
1152
|
},
|