@wordpress/block-editor 10.4.0 → 11.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 +17 -0
- package/README.md +0 -1
- package/build/autocompleters/block.js +2 -6
- package/build/autocompleters/block.js.map +1 -1
- package/build/autocompleters/link.js +2 -0
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/block-card/index.js +51 -3
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +46 -39
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-edit/edit.js +4 -3
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-edit/edit.native.js +4 -7
- package/build/components/block-edit/edit.native.js.map +1 -1
- package/build/components/block-inspector/index.js +35 -33
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-list-context.native.js +5 -8
- package/build/components/block-list/block-list-context.native.js.map +1 -1
- package/build/components/block-list/block.js +55 -24
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +61 -28
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-lock/menu-item.js +1 -1
- package/build/components/block-lock/menu-item.js.map +1 -1
- package/build/components/block-lock/modal.js +16 -9
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +12 -4
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +3 -2
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +33 -11
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-preview/auto.js +9 -3
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +5 -9
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +5 -2
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/utils.js +3 -3
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-switcher/index.js +19 -4
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +5 -1
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +8 -49
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +27 -4
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-variation-picker/index.js +1 -2
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/colors/with-colors.js +4 -3
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +24 -40
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +7 -5
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/height-control/index.js +115 -0
- package/build/components/height-control/index.js.map +1 -0
- package/build/components/iframe/index.js +11 -8
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +2 -0
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/image-editor/zoom-dropdown.js +1 -0
- package/build/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build/components/index.js +18 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +25 -9
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +25 -10
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/sidebar.js +1 -0
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +25 -46
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +3 -1
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/hooks/use-debounced-input.js +27 -0
- package/build/components/inserter/hooks/use-debounced-input.js.map +1 -0
- package/build/components/inserter/index.js +8 -3
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +3 -4
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +103 -0
- package/build/components/inserter/media-tab/hooks.js.map +1 -0
- package/build/components/inserter/media-tab/index.js +32 -0
- package/build/components/inserter/media-tab/index.js.map +1 -0
- package/build/components/inserter/media-tab/media-list.js +100 -0
- package/build/components/inserter/media-tab/media-list.js.map +1 -0
- package/build/components/inserter/media-tab/media-panel.js +96 -0
- package/build/components/inserter/media-tab/media-panel.js.map +1 -0
- package/build/components/inserter/media-tab/media-tab.js +120 -0
- package/build/components/inserter/media-tab/media-tab.js.map +1 -0
- package/build/components/inserter/media-tab/utils.js +54 -0
- package/build/components/inserter/media-tab/utils.js.map +1 -0
- package/build/components/inserter/menu.js +35 -12
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +70 -0
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -0
- package/build/components/inserter/quick-inserter.js +1 -0
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.js +4 -1
- package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build/components/inserter/search-results.js +3 -1
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/tabs.js +16 -2
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter-list-item/index.js +4 -1
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inspector-controls/groups.js +2 -0
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js +46 -0
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -0
- package/build/components/inspector-controls-tabs/index.js +71 -0
- package/build/components/inspector-controls-tabs/index.js.map +1 -0
- package/build/components/inspector-controls-tabs/settings-tab.js +28 -0
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -0
- package/build/components/inspector-controls-tabs/styles-tab.js +61 -0
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -0
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +97 -0
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -0
- package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +18 -0
- package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -0
- package/build/components/inspector-controls-tabs/utils.js +37 -0
- package/build/components/inspector-controls-tabs/utils.js.map +1 -0
- package/build/components/link-control/index.js +19 -34
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -2
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/use-internal-input-value.js +26 -0
- package/build/components/link-control/use-internal-input-value.js.map +1 -0
- package/build/components/list-view/block.js +10 -5
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +22 -15
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/media-upload/index.native.js +2 -3
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/off-canvas-editor/appender.js +104 -0
- package/build/components/off-canvas-editor/appender.js.map +1 -0
- package/build/components/off-canvas-editor/block-contents.js +100 -0
- package/build/components/off-canvas-editor/block-contents.js.map +1 -0
- package/build/components/off-canvas-editor/block-edit-button.js +50 -0
- package/build/components/off-canvas-editor/block-edit-button.js.map +1 -0
- package/build/components/off-canvas-editor/block-select-button.js +119 -0
- package/build/components/off-canvas-editor/block-select-button.js.map +1 -0
- package/build/components/off-canvas-editor/block.js +324 -0
- package/build/components/off-canvas-editor/block.js.map +1 -0
- package/build/components/off-canvas-editor/branch.js +179 -0
- package/build/components/off-canvas-editor/branch.js.map +1 -0
- package/build/components/off-canvas-editor/context.js +19 -0
- package/build/components/off-canvas-editor/context.js.map +1 -0
- package/build/components/off-canvas-editor/drop-indicator.js +118 -0
- package/build/components/off-canvas-editor/drop-indicator.js.map +1 -0
- package/build/components/off-canvas-editor/expander.js +41 -0
- package/build/components/off-canvas-editor/expander.js.map +1 -0
- package/build/components/off-canvas-editor/index.js +213 -0
- package/build/components/off-canvas-editor/index.js.map +1 -0
- package/build/components/off-canvas-editor/leaf.js +60 -0
- package/build/components/off-canvas-editor/leaf.js.map +1 -0
- package/build/components/off-canvas-editor/link-ui.js +185 -0
- package/build/components/off-canvas-editor/link-ui.js.map +1 -0
- package/build/components/off-canvas-editor/update-attributes.js +108 -0
- package/build/components/off-canvas-editor/update-attributes.js.map +1 -0
- package/build/components/off-canvas-editor/use-block-selection.js +139 -0
- package/build/components/off-canvas-editor/use-block-selection.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-client-ids.js +33 -0
- package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js +235 -0
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +60 -0
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
- package/build/components/off-canvas-editor/utils.js +60 -0
- package/build/components/off-canvas-editor/utils.js.map +1 -0
- package/build/components/rich-text/format-toolbar/index.js +8 -4
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/index.js +3 -3
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +0 -2
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/use-insert-replacement-text.js +43 -0
- package/build/components/rich-text/use-insert-replacement-text.js.map +1 -0
- package/build/components/rich-text/use-undo-automatic-change.js +9 -1
- package/build/components/rich-text/use-undo-automatic-change.js.map +1 -1
- package/build/components/rich-text/utils.js +1 -19
- package/build/components/rich-text/utils.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +12 -3
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/components/ungroup-button/index.native.js +4 -2
- package/build/components/ungroup-button/index.native.js.map +1 -1
- package/build/components/url-input/index.js +46 -43
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/index.js +31 -2
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/use-block-display-information/index.js +8 -4
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-setting/index.js +10 -2
- package/build/components/use-setting/index.js.map +1 -1
- package/build/hooks/child-layout.js +209 -0
- package/build/hooks/child-layout.js.map +1 -0
- package/build/hooks/color-panel.js +17 -1
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +14 -7
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/dimensions.js +65 -16
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/layout.js +59 -3
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/margin.js +4 -2
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/min-height.js +139 -0
- package/build/hooks/min-height.js.map +1 -0
- package/build/hooks/padding.js +4 -2
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +3 -2
- package/build/hooks/style.js.map +1 -1
- package/build/layouts/flex.js +22 -21
- package/build/layouts/flex.js.map +1 -1
- package/build/store/actions.js +26 -0
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +420 -265
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +73 -49
- package/build/store/selectors.js.map +1 -1
- package/build/utils/sorting.js +63 -0
- package/build/utils/sorting.js.map +1 -0
- package/build-module/autocompleters/block.js +2 -6
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/autocompleters/link.js +2 -0
- package/build-module/autocompleters/link.js.map +1 -1
- package/build-module/components/block-card/index.js +45 -3
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +40 -31
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-edit/edit.js +4 -2
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-edit/edit.native.js +4 -6
- package/build-module/components/block-edit/edit.native.js.map +1 -1
- package/build-module/components/block-inspector/index.js +32 -30
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-list-context.native.js +5 -8
- package/build-module/components/block-list/block-list-context.native.js.map +1 -1
- package/build-module/components/block-list/block.js +55 -25
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +61 -28
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-lock/menu-item.js +2 -2
- package/build-module/components/block-lock/menu-item.js.map +1 -1
- package/build-module/components/block-lock/modal.js +17 -10
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +13 -6
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +3 -2
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +35 -13
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +9 -3
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +5 -8
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/utils.js +3 -3
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-switcher/index.js +19 -4
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +6 -2
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +8 -49
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +27 -5
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +1 -2
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/colors/with-colors.js +5 -4
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +24 -40
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +8 -6
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/height-control/index.js +103 -0
- package/build-module/components/height-control/index.js.map +1 -0
- package/build-module/components/iframe/index.js +11 -8
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +2 -0
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/image-editor/zoom-dropdown.js +1 -0
- package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build-module/components/index.js +2 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +27 -11
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +23 -10
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js +1 -0
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +27 -49
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +3 -2
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +18 -0
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -0
- package/build-module/components/inserter/index.js +8 -3
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +3 -5
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +89 -0
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -0
- package/build-module/components/inserter/media-tab/index.js +4 -0
- package/build-module/components/inserter/media-tab/index.js.map +1 -0
- package/build-module/components/inserter/media-tab/media-list.js +86 -0
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -0
- package/build-module/components/inserter/media-tab/media-panel.js +77 -0
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -0
- package/build-module/components/inserter/media-tab/media-tab.js +100 -0
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -0
- package/build-module/components/inserter/media-tab/utils.js +45 -0
- package/build-module/components/inserter/media-tab/utils.js.map +1 -0
- package/build-module/components/inserter/menu.js +33 -12
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +61 -0
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -0
- package/build-module/components/inserter/quick-inserter.js +1 -0
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.js +3 -1
- package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build-module/components/inserter/search-results.js +3 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/tabs.js +15 -2
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +5 -2
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +2 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +32 -0
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/index.js +56 -0
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/settings-tab.js +17 -0
- package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js +46 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +81 -0
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +8 -0
- package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/utils.js +26 -0
- package/build-module/components/inspector-controls-tabs/utils.js.map +1 -0
- package/build-module/components/link-control/index.js +18 -34
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +1 -2
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/use-internal-input-value.js +18 -0
- package/build-module/components/link-control/use-internal-input-value.js.map +1 -0
- package/build-module/components/list-view/block.js +10 -5
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +21 -14
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +2 -4
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/off-canvas-editor/appender.js +89 -0
- package/build-module/components/off-canvas-editor/appender.js.map +1 -0
- package/build-module/components/off-canvas-editor/block-contents.js +85 -0
- package/build-module/components/off-canvas-editor/block-contents.js.map +1 -0
- package/build-module/components/off-canvas-editor/block-edit-button.js +35 -0
- package/build-module/components/off-canvas-editor/block-edit-button.js.map +1 -0
- package/build-module/components/off-canvas-editor/block-select-button.js +101 -0
- package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -0
- package/build-module/components/off-canvas-editor/block.js +298 -0
- package/build-module/components/off-canvas-editor/block.js.map +1 -0
- package/build-module/components/off-canvas-editor/branch.js +164 -0
- package/build-module/components/off-canvas-editor/branch.js.map +1 -0
- package/build-module/components/off-canvas-editor/context.js +7 -0
- package/build-module/components/off-canvas-editor/context.js.map +1 -0
- package/build-module/components/off-canvas-editor/drop-indicator.js +111 -0
- package/build-module/components/off-canvas-editor/drop-indicator.js.map +1 -0
- package/build-module/components/off-canvas-editor/expander.js +32 -0
- package/build-module/components/off-canvas-editor/expander.js.map +1 -0
- package/build-module/components/off-canvas-editor/index.js +189 -0
- package/build-module/components/off-canvas-editor/index.js.map +1 -0
- package/build-module/components/off-canvas-editor/leaf.js +45 -0
- package/build-module/components/off-canvas-editor/leaf.js.map +1 -0
- package/build-module/components/off-canvas-editor/link-ui.js +165 -0
- package/build-module/components/off-canvas-editor/link-ui.js.map +1 -0
- package/build-module/components/off-canvas-editor/update-attributes.js +97 -0
- package/build-module/components/off-canvas-editor/update-attributes.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-block-selection.js +124 -0
- package/build-module/components/off-canvas-editor/use-block-selection.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +24 -0
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +220 -0
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +50 -0
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
- package/build-module/components/off-canvas-editor/utils.js +44 -0
- package/build-module/components/off-canvas-editor/utils.js.map +1 -0
- package/build-module/components/rich-text/format-toolbar/index.js +6 -2
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +2 -3
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +0 -2
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-insert-replacement-text.js +33 -0
- package/build-module/components/rich-text/use-insert-replacement-text.js.map +1 -0
- package/build-module/components/rich-text/use-undo-automatic-change.js +9 -1
- package/build-module/components/rich-text/use-undo-automatic-change.js.map +1 -1
- package/build-module/components/rich-text/utils.js +1 -16
- package/build-module/components/rich-text/utils.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +12 -3
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/components/ungroup-button/index.native.js +3 -2
- package/build-module/components/ungroup-button/index.native.js.map +1 -1
- package/build-module/components/url-input/index.js +46 -43
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/index.js +30 -3
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +9 -5
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-setting/index.js +9 -2
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/hooks/child-layout.js +189 -0
- package/build-module/hooks/child-layout.js.map +1 -0
- package/build-module/hooks/color-panel.js +17 -1
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +16 -9
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/dimensions.js +60 -16
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/layout.js +57 -2
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/margin.js +4 -2
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/min-height.js +116 -0
- package/build-module/hooks/min-height.js.map +1 -0
- package/build-module/hooks/padding.js +4 -2
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +4 -3
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/layouts/flex.js +23 -22
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/store/actions.js +22 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +415 -265
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +66 -48
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/sorting.js +56 -0
- package/build-module/utils/sorting.js.map +1 -0
- package/build-style/content-rtl.css +701 -0
- package/build-style/content.css +701 -0
- package/build-style/default-editor-styles-rtl.css +14 -0
- package/build-style/default-editor-styles.css +14 -0
- package/build-style/style-rtl.css +305 -668
- package/build-style/style.css +305 -668
- package/package.json +32 -30
- package/src/autocompleters/block.js +2 -6
- package/src/autocompleters/link.js +2 -0
- package/src/components/alignment-control/README.md +1 -1
- package/src/components/alignment-control/test/index.js +4 -1
- package/src/components/block-alignment-control/test/index.js +4 -1
- package/src/components/block-alignment-control/test/index.native.js +4 -4
- package/src/components/block-card/index.js +46 -2
- package/src/components/block-card/style.scss +4 -0
- package/src/components/block-content-overlay/{style.scss → content.scss} +7 -1
- package/src/components/block-draggable/content.scss +20 -0
- package/src/components/block-draggable/index.native.js +54 -40
- package/src/components/block-draggable/style.scss +0 -21
- package/src/components/block-draggable/test/helpers.native.js +7 -9
- package/src/components/block-draggable/test/index.native.js +35 -45
- package/src/components/block-edit/edit.js +5 -2
- package/src/components/block-edit/edit.native.js +5 -6
- package/src/components/block-inspector/index.js +96 -81
- package/src/components/block-inspector/style.scss +9 -1
- package/src/components/block-list/block-list-context.native.js +5 -8
- package/src/components/block-list/block.js +74 -23
- package/src/components/block-list/block.native.js +78 -23
- package/src/components/block-list/{style.scss → content.scss} +11 -20
- package/src/components/block-list-appender/{style.scss → content.scss} +0 -0
- package/src/components/block-lock/menu-item.js +5 -2
- package/src/components/block-lock/modal.js +19 -36
- package/src/components/block-lock/style.scss +8 -17
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +24 -6
- package/src/components/block-mover/style.scss +0 -1
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -2
- package/src/components/block-pattern-setup/index.js +2 -1
- package/src/components/block-patterns-list/index.js +47 -24
- package/src/components/block-popover/style.scss +1 -1
- package/src/components/block-preview/README.md +15 -10
- package/src/components/block-preview/auto.js +7 -1
- package/src/components/block-preview/content.scss +4 -0
- package/src/components/block-preview/index.js +7 -12
- package/src/components/block-preview/style.scss +0 -7
- package/src/components/block-preview/test/index.js +18 -35
- package/src/components/block-selection-clearer/test/index.js +12 -12
- package/src/components/block-settings-menu/block-settings-dropdown.js +32 -20
- package/src/components/block-styles/utils.js +3 -3
- package/src/components/block-switcher/index.js +19 -4
- package/src/components/block-switcher/test/index.js +4 -0
- package/src/components/block-toolbar/index.js +12 -5
- package/src/components/block-toolbar/style.scss +10 -0
- package/src/components/block-tools/insertion-point.js +3 -47
- package/src/components/block-tools/selected-block-popover.js +80 -34
- package/src/components/block-tools/style.scss +27 -5
- package/src/components/block-variation-picker/index.js +1 -4
- package/src/components/block-vertical-alignment-control/test/index.js +4 -1
- package/src/components/colors/with-colors.js +13 -23
- package/src/components/default-block-appender/{style.scss → content.scss} +1 -0
- package/src/components/font-sizes/fluid-utils.js +37 -64
- package/src/components/font-sizes/test/fluid-utils.js +5 -5
- package/src/components/font-sizes/with-font-sizes.js +14 -11
- package/src/components/height-control/index.js +123 -0
- package/src/components/height-control/stories/index.js +21 -0
- package/src/components/height-control/style.scss +5 -0
- package/src/components/iframe/index.js +25 -18
- package/src/components/image-editor/use-save-image.js +2 -0
- package/src/components/image-editor/zoom-dropdown.js +1 -0
- package/src/components/index.js +2 -0
- package/src/components/inner-blocks/{style.scss → content.scss} +0 -0
- package/src/components/inner-blocks/index.js +30 -10
- package/src/components/inner-blocks/use-inner-block-template-sync.js +28 -10
- package/src/components/inserter/block-patterns-explorer/sidebar.js +1 -0
- package/src/components/inserter/block-patterns-tab.js +28 -71
- package/src/components/inserter/block-types-tab.js +3 -2
- package/src/components/inserter/hooks/use-debounced-input.js +17 -0
- package/src/components/inserter/index.js +10 -2
- package/src/components/inserter/index.native.js +1 -1
- package/src/components/inserter/media-tab/hooks.js +88 -0
- package/src/components/inserter/media-tab/index.js +3 -0
- package/src/components/inserter/media-tab/media-list.js +93 -0
- package/src/components/inserter/media-tab/media-panel.js +83 -0
- package/src/components/inserter/media-tab/media-tab.js +135 -0
- package/src/components/inserter/media-tab/utils.js +37 -0
- package/src/components/inserter/menu.js +55 -13
- package/src/components/inserter/mobile-tab-navigation.js +85 -0
- package/src/components/inserter/quick-inserter.js +1 -0
- package/src/components/inserter/reusable-blocks-tab.js +4 -2
- package/src/components/inserter/search-results.js +3 -2
- package/src/components/inserter/stories/index.js +1 -1
- package/src/components/inserter/stories/{fixtures.js → utils/fixtures.js} +0 -0
- package/src/components/inserter/style.scss +184 -18
- package/src/components/inserter/tabs.js +12 -1
- package/src/components/inserter/test/reusable-blocks-tab.js +14 -57
- package/src/components/inserter-list-item/index.js +11 -1
- package/src/components/inserter-list-item/style.scss +26 -0
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/advanced-controls-panel.js +37 -0
- package/src/components/inspector-controls-tabs/index.js +62 -0
- package/src/components/inspector-controls-tabs/settings-tab.js +18 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +51 -0
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +89 -0
- package/src/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +9 -0
- package/src/components/inspector-controls-tabs/utils.js +28 -0
- package/src/components/line-height-control/test/index.js +5 -5
- package/src/components/link-control/README.md +1 -1
- package/src/components/link-control/index.js +24 -39
- package/src/components/link-control/search-input.js +1 -2
- package/src/components/link-control/test/index.js +400 -582
- package/src/components/link-control/use-internal-input-value.js +22 -0
- package/src/components/list-view/block.js +7 -3
- package/src/components/list-view/branch.js +21 -14
- package/src/components/list-view/style.scss +20 -9
- package/src/components/media-placeholder/{style.scss → content.scss} +0 -0
- package/src/components/media-replace-flow/test/index.js +37 -9
- package/src/components/media-upload/test/index.native.js +2 -0
- package/src/components/off-canvas-editor/README.md +5 -0
- package/src/components/off-canvas-editor/appender.js +93 -0
- package/src/components/off-canvas-editor/block-contents.js +89 -0
- package/src/components/off-canvas-editor/block-edit-button.js +27 -0
- package/src/components/off-canvas-editor/block-select-button.js +113 -0
- package/src/components/off-canvas-editor/block.js +401 -0
- package/src/components/off-canvas-editor/branch.js +208 -0
- package/src/components/off-canvas-editor/context.js +8 -0
- package/src/components/off-canvas-editor/drop-indicator.js +126 -0
- package/src/components/off-canvas-editor/expander.js +26 -0
- package/src/components/off-canvas-editor/index.js +242 -0
- package/src/components/off-canvas-editor/leaf.js +52 -0
- package/src/components/off-canvas-editor/link-ui.js +166 -0
- package/src/components/off-canvas-editor/style.scss +26 -0
- package/src/components/off-canvas-editor/test/utils.js +50 -0
- package/src/components/off-canvas-editor/update-attributes.js +99 -0
- package/src/components/off-canvas-editor/use-block-selection.js +169 -0
- package/src/components/off-canvas-editor/use-list-view-client-ids.js +29 -0
- package/src/components/off-canvas-editor/use-list-view-drop-zone.js +260 -0
- package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +58 -0
- package/src/components/off-canvas-editor/utils.js +58 -0
- package/src/components/plain-text/{style.scss → content.scss} +0 -0
- package/src/components/recursion-provider/test/index.js +27 -29
- package/src/components/responsive-block-control/test/index.js +69 -92
- package/src/components/rich-text/content.scss +42 -0
- package/src/components/rich-text/format-toolbar/index.js +6 -4
- package/src/components/rich-text/index.js +2 -2
- package/src/components/rich-text/index.native.js +0 -2
- package/src/components/rich-text/style.scss +0 -43
- package/src/components/rich-text/use-insert-replacement-text.js +31 -0
- package/src/components/rich-text/use-undo-automatic-change.js +7 -1
- package/src/components/rich-text/utils.js +2 -21
- package/src/components/spacing-sizes-control/spacing-input-control.js +9 -0
- package/src/components/ungroup-button/index.native.js +6 -2
- package/src/components/url-input/index.js +57 -73
- package/src/components/url-popover/README.md +12 -3
- package/src/components/url-popover/index.js +33 -3
- package/src/components/url-popover/test/__snapshots__/index.js.snap +8 -6
- package/src/components/url-popover/test/index.js +21 -9
- package/src/components/use-block-display-information/index.js +14 -5
- package/src/components/use-setting/index.js +20 -2
- package/src/components/use-setting/test/index.js +99 -0
- package/src/content.scss +10 -0
- package/src/hooks/child-layout.js +190 -0
- package/src/hooks/color-panel.js +13 -1
- package/src/hooks/color.js +2 -0
- package/src/hooks/content-lock-ui.js +47 -35
- package/src/hooks/dimensions.js +119 -21
- package/src/hooks/layout.js +62 -3
- package/src/hooks/margin.js +4 -3
- package/src/hooks/min-height.js +104 -0
- package/src/hooks/padding.js +4 -3
- package/src/hooks/style.js +10 -2
- package/src/hooks/test/style.js +4 -0
- package/src/hooks/test/use-typography-props.js +1 -1
- package/src/layouts/flex.js +43 -38
- package/src/store/actions.js +22 -0
- package/src/store/reducer.js +480 -434
- package/src/store/selectors.js +70 -64
- package/src/store/test/actions.js +18 -0
- package/src/store/test/performance.js +71 -0
- package/src/store/test/reducer.js +662 -490
- package/src/store/test/selectors.js +1839 -1306
- package/src/style.scss +4 -7
- package/src/utils/sorting.js +54 -0
- package/src/utils/test/sorting.js +49 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-preview/live.js +0 -30
- package/build/components/block-preview/live.js.map +0 -1
- package/build-module/components/block-preview/live.js +0 -20
- package/build-module/components/block-preview/live.js.map +0 -1
- package/src/components/block-preview/live.js +0 -19
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
serializeRawBlock,
|
|
20
20
|
switchToBlockType,
|
|
21
21
|
store as blocksStore,
|
|
22
|
+
getDefaultBlockName,
|
|
23
|
+
isUnmodifiedBlock,
|
|
22
24
|
} from '@wordpress/blocks';
|
|
23
25
|
import { withFilters } from '@wordpress/components';
|
|
24
26
|
import {
|
|
@@ -40,7 +42,7 @@ import BlockCrashBoundary from './block-crash-boundary';
|
|
|
40
42
|
import BlockHtml from './block-html';
|
|
41
43
|
import { useBlockProps } from './use-block-props';
|
|
42
44
|
import { store as blockEditorStore } from '../../store';
|
|
43
|
-
|
|
45
|
+
import { useLayout } from './layout';
|
|
44
46
|
export const BlockListBlockContext = createContext();
|
|
45
47
|
|
|
46
48
|
/**
|
|
@@ -130,6 +132,8 @@ function BlockListBlock( {
|
|
|
130
132
|
const { removeBlock } = useDispatch( blockEditorStore );
|
|
131
133
|
const onRemove = useCallback( () => removeBlock( clientId ), [ clientId ] );
|
|
132
134
|
|
|
135
|
+
const parentLayout = useLayout() || {};
|
|
136
|
+
|
|
133
137
|
// We wrap the BlockEdit component in a div that hides it when editing in
|
|
134
138
|
// HTML mode. This allows us to render all of the ancillary pieces
|
|
135
139
|
// (InspectorControls, etc.) which are inside `BlockEdit` but not
|
|
@@ -148,6 +152,9 @@ function BlockListBlock( {
|
|
|
148
152
|
isSelectionEnabled={ isSelectionEnabled }
|
|
149
153
|
toggleSelection={ toggleSelection }
|
|
150
154
|
__unstableLayoutClassNames={ layoutClassNames }
|
|
155
|
+
__unstableParentLayout={
|
|
156
|
+
Object.keys( parentLayout ).length ? parentLayout : undefined
|
|
157
|
+
}
|
|
151
158
|
/>
|
|
152
159
|
);
|
|
153
160
|
|
|
@@ -308,7 +315,6 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
308
315
|
__unstableMarkLastChangeAsPersistent,
|
|
309
316
|
moveBlocksToPosition,
|
|
310
317
|
removeBlock,
|
|
311
|
-
selectBlock,
|
|
312
318
|
} = dispatch( blockEditorStore );
|
|
313
319
|
|
|
314
320
|
// Do not add new properties here, use `useDispatch` instead to avoid
|
|
@@ -345,8 +351,71 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
345
351
|
getBlockAttributes,
|
|
346
352
|
getBlockName,
|
|
347
353
|
getBlockOrder,
|
|
354
|
+
getBlockIndex,
|
|
355
|
+
getBlockRootClientId,
|
|
356
|
+
canInsertBlockType,
|
|
348
357
|
} = registry.select( blockEditorStore );
|
|
349
358
|
|
|
359
|
+
/**
|
|
360
|
+
* Moves the block with clientId up one level. If the block type
|
|
361
|
+
* cannot be inserted at the new location, it will be attempted to
|
|
362
|
+
* convert to the default block type.
|
|
363
|
+
*
|
|
364
|
+
* @param {string} _clientId The block to move.
|
|
365
|
+
* @param {boolean} changeSelection Whether to change the selection
|
|
366
|
+
* to the moved block.
|
|
367
|
+
*/
|
|
368
|
+
function moveFirstItemUp( _clientId, changeSelection = true ) {
|
|
369
|
+
const targetRootClientId = getBlockRootClientId( _clientId );
|
|
370
|
+
const blockOrder = getBlockOrder( _clientId );
|
|
371
|
+
const [ firstClientId ] = blockOrder;
|
|
372
|
+
|
|
373
|
+
if (
|
|
374
|
+
blockOrder.length === 1 &&
|
|
375
|
+
isUnmodifiedBlock( getBlock( firstClientId ) )
|
|
376
|
+
) {
|
|
377
|
+
removeBlock( _clientId );
|
|
378
|
+
} else {
|
|
379
|
+
if (
|
|
380
|
+
canInsertBlockType(
|
|
381
|
+
getBlockName( firstClientId ),
|
|
382
|
+
targetRootClientId
|
|
383
|
+
)
|
|
384
|
+
) {
|
|
385
|
+
moveBlocksToPosition(
|
|
386
|
+
[ firstClientId ],
|
|
387
|
+
_clientId,
|
|
388
|
+
targetRootClientId,
|
|
389
|
+
getBlockIndex( _clientId )
|
|
390
|
+
);
|
|
391
|
+
} else {
|
|
392
|
+
const replacement = switchToBlockType(
|
|
393
|
+
getBlock( firstClientId ),
|
|
394
|
+
getDefaultBlockName()
|
|
395
|
+
);
|
|
396
|
+
|
|
397
|
+
if ( replacement && replacement.length ) {
|
|
398
|
+
registry.batch( () => {
|
|
399
|
+
insertBlocks(
|
|
400
|
+
replacement,
|
|
401
|
+
getBlockIndex( _clientId ),
|
|
402
|
+
targetRootClientId,
|
|
403
|
+
changeSelection
|
|
404
|
+
);
|
|
405
|
+
removeBlock( firstClientId, false );
|
|
406
|
+
} );
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (
|
|
411
|
+
! getBlockOrder( _clientId ).length &&
|
|
412
|
+
isUnmodifiedBlock( getBlock( _clientId ) )
|
|
413
|
+
) {
|
|
414
|
+
removeBlock( _clientId, false );
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
350
419
|
// For `Delete` or forward merge, we should do the exact same thing
|
|
351
420
|
// as `Backspace`, but from the other block.
|
|
352
421
|
if ( forward ) {
|
|
@@ -397,15 +466,8 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
397
466
|
return;
|
|
398
467
|
}
|
|
399
468
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
const replacement = switchToBlockType(
|
|
403
|
-
getBlock( nextBlockClientId ),
|
|
404
|
-
'*'
|
|
405
|
-
);
|
|
406
|
-
|
|
407
|
-
if ( replacement && replacement.length ) {
|
|
408
|
-
replaceBlocks( nextBlockClientId, replacement );
|
|
469
|
+
if ( getBlockOrder( nextBlockClientId ).length ) {
|
|
470
|
+
moveFirstItemUp( nextBlockClientId, false );
|
|
409
471
|
} else {
|
|
410
472
|
mergeBlocks( clientId, nextBlockClientId );
|
|
411
473
|
}
|
|
@@ -450,18 +512,7 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
450
512
|
}
|
|
451
513
|
}
|
|
452
514
|
|
|
453
|
-
|
|
454
|
-
// preceding block to merge with.
|
|
455
|
-
const replacement = switchToBlockType(
|
|
456
|
-
getBlock( rootClientId ),
|
|
457
|
-
'*'
|
|
458
|
-
);
|
|
459
|
-
if ( replacement && replacement.length ) {
|
|
460
|
-
registry.batch( () => {
|
|
461
|
-
replaceBlocks( rootClientId, replacement );
|
|
462
|
-
selectBlock( replacement[ 0 ].clientId, 0 );
|
|
463
|
-
} );
|
|
464
|
-
}
|
|
515
|
+
moveFirstItemUp( rootClientId );
|
|
465
516
|
}
|
|
466
517
|
}
|
|
467
518
|
},
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { View, Text, TouchableWithoutFeedback, Dimensions } from 'react-native';
|
|
5
|
-
import { pick } from 'lodash';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -21,6 +20,8 @@ import {
|
|
|
21
20
|
getBlockType,
|
|
22
21
|
__experimentalGetAccessibleBlockLabel as getAccessibleBlockLabel,
|
|
23
22
|
switchToBlockType,
|
|
23
|
+
getDefaultBlockName,
|
|
24
|
+
isUnmodifiedBlock,
|
|
24
25
|
} from '@wordpress/blocks';
|
|
25
26
|
import { useSetting } from '@wordpress/block-editor';
|
|
26
27
|
|
|
@@ -33,6 +34,7 @@ import BlockInvalidWarning from './block-invalid-warning';
|
|
|
33
34
|
import BlockMobileToolbar from '../block-mobile-toolbar';
|
|
34
35
|
import { store as blockEditorStore } from '../../store';
|
|
35
36
|
import BlockDraggable from '../block-draggable';
|
|
37
|
+
import { useLayout } from './layout';
|
|
36
38
|
|
|
37
39
|
const emptyArray = [];
|
|
38
40
|
function BlockForType( {
|
|
@@ -74,10 +76,16 @@ function BlockForType( {
|
|
|
74
76
|
// Thanks to the JSON.stringify we check if the value is the same instead of reference.
|
|
75
77
|
JSON.stringify( wrapperProps.style ),
|
|
76
78
|
JSON.stringify(
|
|
77
|
-
|
|
79
|
+
Object.fromEntries(
|
|
80
|
+
Object.entries( attributes ?? {} ).filter( ( [ key ] ) =>
|
|
81
|
+
GlobalStylesContext.BLOCK_STYLE_ATTRIBUTES.includes( key )
|
|
82
|
+
)
|
|
83
|
+
)
|
|
78
84
|
),
|
|
79
85
|
] );
|
|
80
86
|
|
|
87
|
+
const parentLayout = useLayout();
|
|
88
|
+
|
|
81
89
|
return (
|
|
82
90
|
<GlobalStylesContext.Provider value={ mergedStyle }>
|
|
83
91
|
<BlockEdit
|
|
@@ -99,6 +107,7 @@ function BlockForType( {
|
|
|
99
107
|
onDeleteBlock={ onDeleteBlock }
|
|
100
108
|
blockWidth={ blockWidth }
|
|
101
109
|
parentBlockAlignment={ parentBlockAlignment }
|
|
110
|
+
__unstableParentLayout={ parentLayout }
|
|
102
111
|
/>
|
|
103
112
|
<View onLayout={ getBlockWidth } />
|
|
104
113
|
</GlobalStylesContext.Provider>
|
|
@@ -429,8 +438,72 @@ export default compose( [
|
|
|
429
438
|
getBlockAttributes,
|
|
430
439
|
getBlockName,
|
|
431
440
|
getBlockOrder,
|
|
441
|
+
getBlockIndex,
|
|
442
|
+
getBlockRootClientId,
|
|
443
|
+
canInsertBlockType,
|
|
432
444
|
} = registry.select( blockEditorStore );
|
|
433
445
|
|
|
446
|
+
/**
|
|
447
|
+
* Moves the block with clientId up one level. If the block type
|
|
448
|
+
* cannot be inserted at the new location, it will be attempted to
|
|
449
|
+
* convert to the default block type.
|
|
450
|
+
*
|
|
451
|
+
* @param {string} _clientId The block to move.
|
|
452
|
+
* @param {boolean} changeSelection Whether to change the selection
|
|
453
|
+
* to the moved block.
|
|
454
|
+
*/
|
|
455
|
+
function moveFirstItemUp( _clientId, changeSelection = true ) {
|
|
456
|
+
const targetRootClientId =
|
|
457
|
+
getBlockRootClientId( _clientId );
|
|
458
|
+
const blockOrder = getBlockOrder( _clientId );
|
|
459
|
+
const [ firstClientId ] = blockOrder;
|
|
460
|
+
|
|
461
|
+
if (
|
|
462
|
+
blockOrder.length === 1 &&
|
|
463
|
+
isUnmodifiedBlock( getBlock( firstClientId ) )
|
|
464
|
+
) {
|
|
465
|
+
removeBlock( _clientId );
|
|
466
|
+
} else {
|
|
467
|
+
if (
|
|
468
|
+
canInsertBlockType(
|
|
469
|
+
getBlockName( firstClientId ),
|
|
470
|
+
targetRootClientId
|
|
471
|
+
)
|
|
472
|
+
) {
|
|
473
|
+
moveBlocksToPosition(
|
|
474
|
+
[ firstClientId ],
|
|
475
|
+
_clientId,
|
|
476
|
+
targetRootClientId,
|
|
477
|
+
getBlockIndex( _clientId )
|
|
478
|
+
);
|
|
479
|
+
} else {
|
|
480
|
+
const replacement = switchToBlockType(
|
|
481
|
+
getBlock( firstClientId ),
|
|
482
|
+
getDefaultBlockName()
|
|
483
|
+
);
|
|
484
|
+
|
|
485
|
+
if ( replacement && replacement.length ) {
|
|
486
|
+
registry.batch( () => {
|
|
487
|
+
insertBlocks(
|
|
488
|
+
replacement,
|
|
489
|
+
getBlockIndex( _clientId ),
|
|
490
|
+
targetRootClientId,
|
|
491
|
+
changeSelection
|
|
492
|
+
);
|
|
493
|
+
removeBlock( firstClientId, false );
|
|
494
|
+
} );
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
if (
|
|
499
|
+
! getBlockOrder( _clientId ).length &&
|
|
500
|
+
isUnmodifiedBlock( getBlock( _clientId ) )
|
|
501
|
+
) {
|
|
502
|
+
removeBlock( _clientId, false );
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
434
507
|
// For `Delete` or forward merge, we should do the exact same thing
|
|
435
508
|
// as `Backspace`, but from the other block.
|
|
436
509
|
if ( forward ) {
|
|
@@ -481,15 +554,8 @@ export default compose( [
|
|
|
481
554
|
return;
|
|
482
555
|
}
|
|
483
556
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
const replacement = switchToBlockType(
|
|
487
|
-
getBlock( nextBlockClientId ),
|
|
488
|
-
'*'
|
|
489
|
-
);
|
|
490
|
-
|
|
491
|
-
if ( replacement && replacement.length ) {
|
|
492
|
-
replaceBlocks( nextBlockClientId, replacement );
|
|
557
|
+
if ( getBlockOrder( nextBlockClientId ).length ) {
|
|
558
|
+
moveFirstItemUp( nextBlockClientId, false );
|
|
493
559
|
} else {
|
|
494
560
|
mergeBlocks( clientId, nextBlockClientId );
|
|
495
561
|
}
|
|
@@ -534,18 +600,7 @@ export default compose( [
|
|
|
534
600
|
}
|
|
535
601
|
}
|
|
536
602
|
|
|
537
|
-
|
|
538
|
-
// preceding block to merge with.
|
|
539
|
-
const replacement = switchToBlockType(
|
|
540
|
-
getBlock( rootClientId ),
|
|
541
|
-
'*'
|
|
542
|
-
);
|
|
543
|
-
if ( replacement && replacement.length ) {
|
|
544
|
-
registry.batch( () => {
|
|
545
|
-
replaceBlocks( rootClientId, replacement );
|
|
546
|
-
selectBlock( replacement[ 0 ].clientId, 0 );
|
|
547
|
-
} );
|
|
548
|
-
}
|
|
603
|
+
moveFirstItemUp( rootClientId );
|
|
549
604
|
}
|
|
550
605
|
}
|
|
551
606
|
},
|
|
@@ -290,11 +290,16 @@
|
|
|
290
290
|
cursor: unset;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
293
|
+
&::after {
|
|
294
|
+
content: "";
|
|
295
|
+
position: absolute;
|
|
296
|
+
pointer-events: none;
|
|
297
|
+
top: $border-width;
|
|
298
|
+
left: $border-width;
|
|
299
|
+
right: $border-width;
|
|
300
|
+
bottom: $border-width;
|
|
301
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
302
|
+
border-radius: $radius-block-ui;
|
|
298
303
|
}
|
|
299
304
|
}
|
|
300
305
|
}
|
|
@@ -425,22 +430,8 @@
|
|
|
425
430
|
}
|
|
426
431
|
}
|
|
427
432
|
|
|
428
|
-
/** Zoom Out mode styles **/
|
|
429
433
|
.block-editor-iframe__body {
|
|
434
|
+
background-color: $white;
|
|
430
435
|
transition: all 0.3s;
|
|
431
436
|
transform-origin: top center;
|
|
432
|
-
|
|
433
|
-
&.is-zoomed-out {
|
|
434
|
-
margin: 100px 0;
|
|
435
|
-
transform: scale(0.45);
|
|
436
|
-
|
|
437
|
-
// Add a bit more space between the top level blocks.
|
|
438
|
-
.wp-site-blocks > * + * {
|
|
439
|
-
margin-block-start: 2.5rem;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
> .block-list-appender {
|
|
443
|
-
display: none;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
437
|
}
|
|
File without changes
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { useReducer } from '@wordpress/element';
|
|
6
6
|
import { MenuItem } from '@wordpress/components';
|
|
7
|
-
import {
|
|
7
|
+
import { lockOutline, unlock } from '@wordpress/icons';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
@@ -28,7 +28,10 @@ export default function BlockLockMenuItem( { clientId } ) {
|
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<>
|
|
31
|
-
<MenuItem
|
|
31
|
+
<MenuItem
|
|
32
|
+
icon={ isLocked ? unlock : lockOutline }
|
|
33
|
+
onClick={ toggleModal }
|
|
34
|
+
>
|
|
32
35
|
{ label }
|
|
33
36
|
</MenuItem>
|
|
34
37
|
{ isModalOpen && (
|
|
@@ -114,6 +114,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
114
114
|
className="block-editor-block-lock-modal__options"
|
|
115
115
|
>
|
|
116
116
|
<CheckboxControl
|
|
117
|
+
__nextHasNoMarginBottom
|
|
117
118
|
className="block-editor-block-lock-modal__options-title"
|
|
118
119
|
label={
|
|
119
120
|
<span id={ instanceId }>{ __( 'Lock all' ) }</span>
|
|
@@ -134,18 +135,8 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
134
135
|
{ allowsEditLocking && (
|
|
135
136
|
<li className="block-editor-block-lock-modal__checklist-item">
|
|
136
137
|
<CheckboxControl
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
{ __( 'Restrict editing' ) }
|
|
140
|
-
<Icon
|
|
141
|
-
icon={
|
|
142
|
-
lock.edit
|
|
143
|
-
? lockIcon
|
|
144
|
-
: unlockIcon
|
|
145
|
-
}
|
|
146
|
-
/>
|
|
147
|
-
</>
|
|
148
|
-
}
|
|
138
|
+
__nextHasNoMarginBottom
|
|
139
|
+
label={ __( 'Restrict editing' ) }
|
|
149
140
|
checked={ !! lock.edit }
|
|
150
141
|
onChange={ ( edit ) =>
|
|
151
142
|
setLock( ( prevLock ) => ( {
|
|
@@ -154,22 +145,16 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
154
145
|
} ) )
|
|
155
146
|
}
|
|
156
147
|
/>
|
|
148
|
+
<Icon
|
|
149
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
150
|
+
icon={ lock.edit ? lockIcon : unlockIcon }
|
|
151
|
+
/>
|
|
157
152
|
</li>
|
|
158
153
|
) }
|
|
159
154
|
<li className="block-editor-block-lock-modal__checklist-item">
|
|
160
155
|
<CheckboxControl
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
{ __( 'Disable movement' ) }
|
|
164
|
-
<Icon
|
|
165
|
-
icon={
|
|
166
|
-
lock.move
|
|
167
|
-
? lockIcon
|
|
168
|
-
: unlockIcon
|
|
169
|
-
}
|
|
170
|
-
/>
|
|
171
|
-
</>
|
|
172
|
-
}
|
|
156
|
+
__nextHasNoMarginBottom
|
|
157
|
+
label={ __( 'Disable movement' ) }
|
|
173
158
|
checked={ lock.move }
|
|
174
159
|
onChange={ ( move ) =>
|
|
175
160
|
setLock( ( prevLock ) => ( {
|
|
@@ -178,21 +163,15 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
178
163
|
} ) )
|
|
179
164
|
}
|
|
180
165
|
/>
|
|
166
|
+
<Icon
|
|
167
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
168
|
+
icon={ lock.move ? lockIcon : unlockIcon }
|
|
169
|
+
/>
|
|
181
170
|
</li>
|
|
182
171
|
<li className="block-editor-block-lock-modal__checklist-item">
|
|
183
172
|
<CheckboxControl
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
{ __( 'Prevent removal' ) }
|
|
187
|
-
<Icon
|
|
188
|
-
icon={
|
|
189
|
-
lock.remove
|
|
190
|
-
? lockIcon
|
|
191
|
-
: unlockIcon
|
|
192
|
-
}
|
|
193
|
-
/>
|
|
194
|
-
</>
|
|
195
|
-
}
|
|
173
|
+
__nextHasNoMarginBottom
|
|
174
|
+
label={ __( 'Prevent removal' ) }
|
|
196
175
|
checked={ lock.remove }
|
|
197
176
|
onChange={ ( remove ) =>
|
|
198
177
|
setLock( ( prevLock ) => ( {
|
|
@@ -201,6 +180,10 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
201
180
|
} ) )
|
|
202
181
|
}
|
|
203
182
|
/>
|
|
183
|
+
<Icon
|
|
184
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
185
|
+
icon={ lock.remove ? lockIcon : unlockIcon }
|
|
186
|
+
/>
|
|
204
187
|
</li>
|
|
205
188
|
</ul>
|
|
206
189
|
{ hasTemplateLock && (
|
|
@@ -22,29 +22,20 @@
|
|
|
22
22
|
.components-base-control__field {
|
|
23
23
|
align-items: center;
|
|
24
24
|
display: flex;
|
|
25
|
-
margin: 0;
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
.block-editor-block-lock-modal__checklist-item {
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: $grid-unit-15;
|
|
29
32
|
margin-bottom: 0;
|
|
30
33
|
padding: $grid-unit-15 0 $grid-unit-15 $grid-unit-40;
|
|
31
34
|
|
|
32
|
-
.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.components-checkbox-control__label {
|
|
39
|
-
display: flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
justify-content: space-between;
|
|
42
|
-
flex-grow: 1;
|
|
43
|
-
|
|
44
|
-
svg {
|
|
45
|
-
margin-right: $grid-unit-15;
|
|
46
|
-
fill: $gray-900;
|
|
47
|
-
}
|
|
35
|
+
.block-editor-block-lock-modal__lock-icon {
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
margin-right: $grid-unit-15;
|
|
38
|
+
fill: $gray-900;
|
|
48
39
|
}
|
|
49
40
|
|
|
50
41
|
&:hover {
|
|
@@ -23,12 +23,14 @@ import {
|
|
|
23
23
|
isReusableBlock,
|
|
24
24
|
} from '@wordpress/blocks';
|
|
25
25
|
import { __, sprintf } from '@wordpress/i18n';
|
|
26
|
-
import { withDispatch, withSelect } from '@wordpress/data';
|
|
26
|
+
import { withDispatch, withSelect, useSelect } from '@wordpress/data';
|
|
27
27
|
import { withInstanceId, compose } from '@wordpress/compose';
|
|
28
28
|
import { moreHorizontalMobile } from '@wordpress/icons';
|
|
29
29
|
import { useRef, useState } from '@wordpress/element';
|
|
30
30
|
import { store as noticesStore } from '@wordpress/notices';
|
|
31
31
|
import { store as reusableBlocksStore } from '@wordpress/reusable-blocks';
|
|
32
|
+
// Disable Reason: Needs to be refactored.
|
|
33
|
+
// eslint-disable-next-line no-restricted-imports
|
|
32
34
|
import { store as coreStore } from '@wordpress/core-data';
|
|
33
35
|
|
|
34
36
|
/**
|
|
@@ -78,6 +80,12 @@ const BlockActionsMenu = ( {
|
|
|
78
80
|
clipboardBlock &&
|
|
79
81
|
canInsertBlockType( clipboardBlock.name, rootClientId );
|
|
80
82
|
|
|
83
|
+
const innerBlockCount = useSelect(
|
|
84
|
+
( select ) =>
|
|
85
|
+
select( blockEditorStore ).getBlockCount( selectedBlockClientId ),
|
|
86
|
+
[ selectedBlockClientId ]
|
|
87
|
+
);
|
|
88
|
+
|
|
81
89
|
const {
|
|
82
90
|
actionTitle: {
|
|
83
91
|
backward: backwardButtonTitle,
|
|
@@ -187,13 +195,21 @@ const BlockActionsMenu = ( {
|
|
|
187
195
|
},
|
|
188
196
|
convertToRegularBlocks: {
|
|
189
197
|
id: 'convertToRegularBlocksOption',
|
|
190
|
-
label:
|
|
198
|
+
label:
|
|
199
|
+
innerBlockCount > 1
|
|
200
|
+
? __( 'Convert to regular blocks' )
|
|
201
|
+
: __( 'Convert to regular block' ),
|
|
191
202
|
value: 'convertToRegularBlocksOption',
|
|
192
203
|
onSelect: () => {
|
|
204
|
+
const successNotice =
|
|
205
|
+
innerBlockCount > 1
|
|
206
|
+
? /* translators: %s: name of the reusable block */
|
|
207
|
+
__( '%s converted to regular blocks' )
|
|
208
|
+
: /* translators: %s: name of the reusable block */
|
|
209
|
+
__( '%s converted to regular block' );
|
|
193
210
|
createSuccessNotice(
|
|
194
211
|
sprintf(
|
|
195
|
-
|
|
196
|
-
__( '%s converted to regular blocks' ),
|
|
212
|
+
successNotice,
|
|
197
213
|
reusableBlock?.title?.raw || blockTitle
|
|
198
214
|
)
|
|
199
215
|
);
|
|
@@ -293,6 +309,8 @@ const BlockActionsMenu = ( {
|
|
|
293
309
|
);
|
|
294
310
|
};
|
|
295
311
|
|
|
312
|
+
const EMPTY_BLOCK_LIST = [];
|
|
313
|
+
|
|
296
314
|
export default compose(
|
|
297
315
|
withSelect( ( select, { clientIds } ) => {
|
|
298
316
|
const {
|
|
@@ -345,8 +363,8 @@ export default compose(
|
|
|
345
363
|
? getBlocksByClientId( selectedBlockClientId )[ 0 ]
|
|
346
364
|
: undefined;
|
|
347
365
|
const selectedBlockPossibleTransformations = selectedBlock
|
|
348
|
-
? getBlockTransformItems(
|
|
349
|
-
:
|
|
366
|
+
? getBlockTransformItems( selectedBlock, rootClientId )
|
|
367
|
+
: EMPTY_BLOCK_LIST;
|
|
350
368
|
|
|
351
369
|
const isReusableBlockType = block ? isReusableBlock( block ) : false;
|
|
352
370
|
const reusableBlock = isReusableBlockType
|
|
@@ -15,7 +15,6 @@ Array [
|
|
|
15
15
|
accessible={true}
|
|
16
16
|
collapsable={false}
|
|
17
17
|
focusable={true}
|
|
18
|
-
nativeID="animatedComponent"
|
|
19
18
|
onClick={[Function]}
|
|
20
19
|
onResponderGrant={[Function]}
|
|
21
20
|
onResponderMove={[Function]}
|
|
@@ -75,7 +74,6 @@ Array [
|
|
|
75
74
|
accessible={true}
|
|
76
75
|
collapsable={false}
|
|
77
76
|
focusable={true}
|
|
78
|
-
nativeID="animatedComponent"
|
|
79
77
|
onClick={[Function]}
|
|
80
78
|
onResponderGrant={[Function]}
|
|
81
79
|
onResponderMove={[Function]}
|
|
@@ -138,8 +138,9 @@ const BlockPatternSetup = ( {
|
|
|
138
138
|
blockName,
|
|
139
139
|
filterPatternsFn,
|
|
140
140
|
onBlockPatternSelect,
|
|
141
|
+
initialViewMode = VIEWMODES.carousel,
|
|
141
142
|
} ) => {
|
|
142
|
-
const [ viewMode, setViewMode ] = useState(
|
|
143
|
+
const [ viewMode, setViewMode ] = useState( initialViewMode );
|
|
143
144
|
const [ activeSlide, setActiveSlide ] = useState( 0 );
|
|
144
145
|
const { replaceBlock } = useDispatch( blockEditorStore );
|
|
145
146
|
const patterns = usePatternsSetup( clientId, blockName, filterPatternsFn );
|