@wordpress/block-editor 14.6.0 → 14.7.1-next.082ed6819.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/slot.js +6 -3
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +14 -28
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-lock/modal.js +1 -1
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-manager/category.js +79 -0
- package/build/components/block-manager/category.js.map +1 -0
- package/build/components/block-manager/checklist.js +40 -0
- package/build/components/block-manager/checklist.js.map +1 -0
- package/build/components/block-manager/index.js +108 -0
- package/build/components/block-manager/index.js.map +1 -0
- package/build/components/block-patterns-list/index.js +23 -26
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/index.js +1 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/async.js +51 -0
- package/build/components/block-preview/async.js.map +1 -0
- package/build/components/block-preview/index.js +4 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-toolbar/change-design.js +1 -4
- package/build/components/block-toolbar/change-design.js.map +1 -1
- package/build/components/block-toolbar/index.js +7 -2
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/switch-section-style.js +105 -0
- package/build/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build/components/block-tools/index.js +12 -9
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +4 -1
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/collab/block-comment-icon-slot.js +2 -6
- package/build/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +4 -2
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/font-family/index.js +14 -13
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +26 -14
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +4 -4
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/iframe/index.js +156 -23
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +1 -2
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -6
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +5 -1
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +7 -8
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
- package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build/components/inserter/search-results.js +0 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +2 -1
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +7 -4
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/media-placeholder/index.js +33 -25
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +1 -1
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/url-input/index.js +3 -1
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +5 -6
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/hooks/border.js +3 -3
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-family.js +1 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/style.js +6 -6
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +7 -7
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +6 -6
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +3 -3
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/flex.js +11 -9
- package/build/layouts/flex.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +4 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/private-selectors.js +3 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +12 -8
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +5 -4
- package/build/store/utils.js.map +1 -1
- package/build/utils/dom.js +27 -22
- package/build/utils/dom.js.map +1 -1
- package/build-module/components/block-controls/slot.js +6 -3
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +15 -27
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-lock/modal.js +1 -1
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-manager/category.js +71 -0
- package/build-module/components/block-manager/category.js.map +1 -0
- package/build-module/components/block-manager/checklist.js +32 -0
- package/build-module/components/block-manager/checklist.js.map +1 -0
- package/build-module/components/block-manager/index.js +102 -0
- package/build-module/components/block-manager/index.js.map +1 -0
- package/build-module/components/block-patterns-list/index.js +23 -26
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/index.js +2 -2
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/async.js +44 -0
- package/build-module/components/block-preview/async.js.map +1 -0
- package/build-module/components/block-preview/index.js +4 -1
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +2 -2
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-toolbar/change-design.js +1 -4
- package/build-module/components/block-toolbar/change-design.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +7 -2
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/switch-section-style.js +97 -0
- package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build-module/components/block-tools/index.js +13 -10
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +4 -1
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +4 -2
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/font-family/index.js +15 -14
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +26 -14
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +4 -4
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/iframe/index.js +157 -24
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -7
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +8 -9
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build-module/components/inserter/search-results.js +0 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +2 -1
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +7 -4
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +33 -25
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +1 -1
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/url-input/index.js +3 -1
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +4 -4
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/hooks/border.js +3 -3
- package/build-module/hooks/border.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/dimensions.js +2 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-family.js +1 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/style.js +6 -6
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +7 -7
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +6 -6
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +3 -3
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/flex.js +11 -9
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +6 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-selectors.js +3 -3
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/selectors.js +12 -8
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -3
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/dom.js +25 -21
- package/build-module/utils/dom.js.map +1 -1
- package/build-style/content-rtl.css +30 -15
- package/build-style/content.css +30 -15
- package/build-style/style-rtl.css +92 -3
- package/build-style/style.css +92 -3
- package/build-types/utils/dom.d.ts +7 -9
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +32 -31
- package/src/components/block-canvas/style.scss +1 -1
- package/src/components/block-controls/slot.js +5 -3
- package/src/components/block-inspector/index.js +0 -2
- package/src/components/block-inspector/style.scss +2 -1
- package/src/components/block-list/block.js +28 -48
- package/src/components/block-lock/modal.js +1 -1
- package/src/components/block-manager/category.js +102 -0
- package/src/components/block-manager/checklist.js +34 -0
- package/src/components/block-manager/index.js +127 -0
- package/src/components/block-manager/style.scss +82 -0
- package/src/components/block-mover/README.md +15 -8
- package/src/components/block-mover/stories/index.story.js +73 -71
- package/src/components/block-mover/style.scss +3 -0
- package/src/components/block-patterns-list/README.md +8 -8
- package/src/components/block-patterns-list/index.js +35 -51
- package/src/components/block-patterns-list/stories/index.story.js +2 -19
- package/src/components/block-popover/index.js +4 -4
- package/src/components/block-preview/async.js +43 -0
- package/src/components/block-preview/index.js +6 -1
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/src/components/block-settings-menu/index.js +2 -2
- package/src/components/block-toolbar/change-design.js +1 -7
- package/src/components/block-toolbar/index.js +6 -0
- package/src/components/block-toolbar/switch-section-style.js +115 -0
- package/src/components/block-tools/index.js +26 -10
- package/src/components/block-tools/style.scss +12 -0
- package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/src/components/block-tools/use-show-block-tools.js +3 -1
- package/src/components/collab/block-comment-icon-slot.js +2 -6
- package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
- package/src/components/color-palette/with-color-context.js +25 -7
- package/src/components/default-block-appender/content.scss +13 -19
- package/src/components/font-family/index.js +13 -13
- package/src/components/global-styles/dimensions-panel.js +22 -16
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +1 -1
- package/src/components/iframe/content.scss +16 -3
- package/src/components/iframe/get-compatibility-styles.js +4 -9
- package/src/components/iframe/index.js +204 -44
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
- package/src/components/inserter/block-patterns-tab/index.js +0 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -17
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
- package/src/components/inserter/block-patterns-tab/utils.js +5 -0
- package/src/components/inserter/category-tabs/index.js +8 -9
- package/src/components/inserter/hooks/use-block-types-state.js +6 -1
- package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/src/components/inserter/search-results.js +0 -6
- package/src/components/inserter-draggable-blocks/index.js +10 -1
- package/src/components/inspector-controls/README.md +2 -0
- package/src/components/inspector-controls/slot.js +6 -4
- package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
- package/src/components/media-placeholder/index.js +41 -37
- package/src/components/provider/test/use-block-sync.js +3 -1
- package/src/components/rich-text/content.scss +15 -10
- package/src/components/rich-text/index.js +8 -1
- package/src/components/tabbed-sidebar/index.js +1 -1
- package/src/components/tabbed-sidebar/style.scss +1 -1
- package/src/components/url-input/index.js +3 -4
- package/src/components/use-block-commands/index.js +245 -234
- package/src/hooks/border.js +3 -9
- package/src/hooks/color.js +1 -1
- package/src/hooks/dimensions.js +2 -2
- package/src/hooks/font-family.js +1 -1
- package/src/hooks/style.js +6 -12
- package/src/hooks/supports.js +7 -7
- package/src/hooks/test/style.js +1 -2
- package/src/hooks/typography.js +6 -6
- package/src/hooks/utils.js +8 -3
- package/src/layouts/flex.js +26 -18
- package/src/private-apis.js +6 -6
- package/src/store/private-selectors.js +6 -7
- package/src/store/selectors.js +60 -45
- package/src/store/test/private-selectors.js +5 -0
- package/src/store/test/selectors.js +87 -58
- package/src/store/utils.js +12 -11
- package/src/style.scss +1 -0
- package/src/utils/dom.js +26 -21
- package/src/utils/test/dom.js +224 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-info-slot-fill/index.js +0 -39
- package/build/components/block-info-slot-fill/index.js.map +0 -1
- package/build-module/components/block-info-slot-fill/index.js +0 -32
- package/build-module/components/block-info-slot-fill/index.js.map +0 -1
- package/src/components/block-info-slot-fill/index.js +0 -27
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
.block-editor-block-manager__no-results {
|
|
2
|
+
font-style: italic;
|
|
3
|
+
padding: $grid-unit-30 0;
|
|
4
|
+
text-align: center;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.block-editor-block-manager__search {
|
|
8
|
+
margin: $grid-unit-20 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.block-editor-block-manager__disabled-blocks-count {
|
|
12
|
+
border: $border-width solid $gray-300;
|
|
13
|
+
border-width: $border-width 0;
|
|
14
|
+
// Cover up horizontal areas off the sides of the box rectangle
|
|
15
|
+
box-shadow: -$grid-unit-40 0 0 0 $white, $grid-unit-40 0 0 0 $white;
|
|
16
|
+
padding: $grid-unit-10;
|
|
17
|
+
background-color: $white;
|
|
18
|
+
text-align: center;
|
|
19
|
+
position: sticky;
|
|
20
|
+
// When sticking, tuck the top border beneath the modal header border
|
|
21
|
+
top: ($grid-unit-05 + 1) * -1;
|
|
22
|
+
z-index: z-index(".block-editor-block-manager__disabled-blocks-count");
|
|
23
|
+
|
|
24
|
+
// Stick the category titles to the bottom
|
|
25
|
+
~ .block-editor-block-manager__results .block-editor-block-manager__category-title {
|
|
26
|
+
top: $grid-unit-40 - 1;
|
|
27
|
+
}
|
|
28
|
+
.is-link {
|
|
29
|
+
margin-left: 12px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.block-editor-block-manager__category {
|
|
34
|
+
margin: 0 0 $grid-unit-30 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.block-editor-block-manager__category-title {
|
|
38
|
+
position: sticky;
|
|
39
|
+
top: - $grid-unit-05; // Offsets the top padding on the modal content container
|
|
40
|
+
padding: $grid-unit-20 0;
|
|
41
|
+
background-color: $white;
|
|
42
|
+
z-index: z-index(".block-editor-block-manager__category-title");
|
|
43
|
+
|
|
44
|
+
.components-checkbox-control__label {
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.block-editor-block-manager__checklist {
|
|
50
|
+
margin-top: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.block-editor-block-manager__category-title,
|
|
54
|
+
.block-editor-block-manager__checklist-item {
|
|
55
|
+
border-bottom: 1px solid $gray-300;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.block-editor-block-manager__checklist-item {
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
align-items: center;
|
|
62
|
+
margin-bottom: 0;
|
|
63
|
+
padding: $grid-unit-10 0 $grid-unit-10 $grid-unit-20;
|
|
64
|
+
|
|
65
|
+
.components-modal__content &.components-checkbox-control__input-container {
|
|
66
|
+
margin: 0 $grid-unit-10;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.block-editor-block-icon {
|
|
70
|
+
margin-right: 10px;
|
|
71
|
+
fill: $gray-900;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.block-editor-block-manager__results {
|
|
76
|
+
border-top: $border-width solid $gray-300;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Remove the top border from results when adjacent to the disabled block count
|
|
80
|
+
.block-editor-block-manager__disabled-blocks-count + .block-editor-block-manager__results {
|
|
81
|
+
border-top-width: 0;
|
|
82
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# BlockMover
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
BlockMover component allows moving blocks inside the editor using up and down buttons.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
### Usage
|
|
7
|
+
## Usage
|
|
10
8
|
|
|
11
9
|
Shows the block mover buttons in the block toolbar.
|
|
12
10
|
|
|
@@ -15,13 +13,22 @@ import { BlockMover } from '@wordpress/block-editor';
|
|
|
15
13
|
const MyMover = () => <BlockMover clientIds={ [ clientId ] } />;
|
|
16
14
|
```
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
## Props
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
### clientIds
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
The IDs of the blocks to move.
|
|
23
21
|
|
|
24
22
|
- Type: `Array`
|
|
23
|
+
- Required: Yes
|
|
24
|
+
|
|
25
|
+
### hideDragHandle
|
|
26
|
+
|
|
27
|
+
If this property is true, the drag handle is hidden.
|
|
28
|
+
|
|
29
|
+
- Type: `boolean`
|
|
30
|
+
- Required: No
|
|
31
|
+
- Default: `false`
|
|
25
32
|
|
|
26
33
|
## Related components
|
|
27
34
|
|
|
@@ -14,6 +14,7 @@ import BlockMover from '../';
|
|
|
14
14
|
import { ExperimentalBlockEditorProvider } from '../../provider';
|
|
15
15
|
import { store as blockEditorStore } from '../../../store';
|
|
16
16
|
|
|
17
|
+
// For the purpose of this story, we need to register the core blocks samples.
|
|
17
18
|
registerCoreBlocks();
|
|
18
19
|
const blocks = [
|
|
19
20
|
// vertical
|
|
@@ -30,81 +31,82 @@ const blocks = [
|
|
|
30
31
|
] ),
|
|
31
32
|
];
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
/**
|
|
35
|
+
* BlockMover component allows moving blocks inside the editor using up and down buttons.
|
|
36
|
+
*/
|
|
37
|
+
const meta = {
|
|
38
|
+
title: 'BlockEditor/BlockMover',
|
|
39
|
+
component: BlockMover,
|
|
40
|
+
parameters: {
|
|
41
|
+
docs: { canvas: { sourceState: 'shown' } },
|
|
42
|
+
},
|
|
43
|
+
decorators: [
|
|
44
|
+
( Story ) => (
|
|
38
45
|
<ExperimentalBlockEditorProvider value={ blocks }>
|
|
39
|
-
|
|
46
|
+
<Toolbar label="Block Mover">
|
|
47
|
+
<Story />
|
|
48
|
+
</Toolbar>
|
|
40
49
|
</ExperimentalBlockEditorProvider>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<div>
|
|
61
|
-
<p>The mover by default is vertical</p>
|
|
62
|
-
<Toolbar label="Block Mover">
|
|
63
|
-
<BlockMover
|
|
64
|
-
clientIds={
|
|
65
|
-
blocks.length
|
|
66
|
-
? [ blocks[ 0 ].innerBlocks[ 1 ].clientId ]
|
|
67
|
-
: []
|
|
68
|
-
}
|
|
69
|
-
/>
|
|
70
|
-
</Toolbar>
|
|
71
|
-
|
|
72
|
-
<p style={ { marginTop: 36 } }>
|
|
73
|
-
But it can also accommodate horizontal blocks.
|
|
74
|
-
</p>
|
|
75
|
-
<Toolbar label="Block Mover">
|
|
76
|
-
<BlockMover
|
|
77
|
-
clientIds={
|
|
78
|
-
blocks.length
|
|
79
|
-
? [ blocks[ 1 ].innerBlocks[ 1 ].clientId ]
|
|
80
|
-
: []
|
|
81
|
-
}
|
|
82
|
-
/>
|
|
83
|
-
</Toolbar>
|
|
50
|
+
),
|
|
51
|
+
],
|
|
52
|
+
argTypes: {
|
|
53
|
+
clientIds: {
|
|
54
|
+
control: {
|
|
55
|
+
type: 'none',
|
|
56
|
+
},
|
|
57
|
+
description: 'The client IDs of the blocks to move.',
|
|
58
|
+
},
|
|
59
|
+
hideDragHandle: {
|
|
60
|
+
control: {
|
|
61
|
+
type: 'boolean',
|
|
62
|
+
},
|
|
63
|
+
description: 'If this property is true, the drag handle is hidden.',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
export default meta;
|
|
84
68
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
? [ blocks[ 1 ].innerBlocks[ 0 ].clientId ]
|
|
91
|
-
: []
|
|
92
|
-
}
|
|
93
|
-
hideDragHandle
|
|
94
|
-
/>
|
|
95
|
-
</Toolbar>
|
|
96
|
-
</div>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
69
|
+
export const Default = {
|
|
70
|
+
args: {
|
|
71
|
+
clientIds: [ blocks[ 0 ].innerBlocks[ 1 ].clientId ],
|
|
72
|
+
},
|
|
73
|
+
};
|
|
99
74
|
|
|
100
|
-
|
|
101
|
-
|
|
75
|
+
/**
|
|
76
|
+
* This story shows the block mover with horizontal orientation.
|
|
77
|
+
* It is necessary to render the blocks to update the block settings in the state.
|
|
78
|
+
*/
|
|
79
|
+
export const Horizontal = {
|
|
80
|
+
decorators: [
|
|
81
|
+
( Story ) => {
|
|
82
|
+
const { updateBlockListSettings } = useDispatch( blockEditorStore );
|
|
83
|
+
useEffect( () => {
|
|
84
|
+
/**
|
|
85
|
+
* This shouldn't be needed but unfortunately
|
|
86
|
+
* the layout orientation is not declarative, we need
|
|
87
|
+
* to render the blocks to update the block settings in the state.
|
|
88
|
+
*/
|
|
89
|
+
updateBlockListSettings( blocks[ 1 ].clientId, {
|
|
90
|
+
orientation: 'horizontal',
|
|
91
|
+
} );
|
|
92
|
+
}, [] );
|
|
93
|
+
return <Story />;
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
args: {
|
|
97
|
+
clientIds: [ blocks[ 1 ].innerBlocks[ 1 ].clientId ],
|
|
98
|
+
},
|
|
99
|
+
parameters: {
|
|
100
|
+
docs: { canvas: { sourceState: 'hidden' } },
|
|
101
|
+
},
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
/**
|
|
105
|
+
* You can hide the drag handle by `hideDragHandle` attribute.
|
|
106
|
+
*/
|
|
107
|
+
export const HideDragHandle = {
|
|
108
|
+
args: {
|
|
109
|
+
...Default.args,
|
|
110
|
+
hideDragHandle: true,
|
|
111
|
+
},
|
|
110
112
|
};
|
|
@@ -71,6 +71,9 @@
|
|
|
71
71
|
|
|
72
72
|
// Specificity is necessary to override block toolbar button styles.
|
|
73
73
|
.components-button.block-editor-block-mover-button {
|
|
74
|
+
// Prevent the SVGs inside the button from overflowing the button.
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
|
|
74
77
|
// Focus and toggle pseudo elements.
|
|
75
78
|
&::before {
|
|
76
79
|
content: "";
|
|
@@ -18,7 +18,6 @@ import { BlockPatternsList } from '@wordpress/block-editor';
|
|
|
18
18
|
const MyBlockPatternsList = () => (
|
|
19
19
|
<BlockPatternsList
|
|
20
20
|
blockPatterns={ shownBlockPatterns }
|
|
21
|
-
shownPatterns={ shownBlockPatterns }
|
|
22
21
|
onClickPattern={ onSelectBlockPattern }
|
|
23
22
|
/>
|
|
24
23
|
);
|
|
@@ -33,13 +32,6 @@ An array of block patterns that can be shown in the block patterns list.
|
|
|
33
32
|
- Type: `Array`
|
|
34
33
|
- Required: Yes
|
|
35
34
|
|
|
36
|
-
#### shownPatterns
|
|
37
|
-
|
|
38
|
-
An array of shown block patterns objects.
|
|
39
|
-
|
|
40
|
-
- Type: `Array`
|
|
41
|
-
- Required: Yes
|
|
42
|
-
|
|
43
35
|
#### onClickPattern
|
|
44
36
|
|
|
45
37
|
The performed event after a click on a block pattern. In most cases, the pattern is inserted in the block editor.
|
|
@@ -69,6 +61,14 @@ The aria label for the block patterns list.
|
|
|
69
61
|
- Required: No
|
|
70
62
|
- Default: `Block Patterns`
|
|
71
63
|
|
|
64
|
+
#### showTitlesAsTooltip
|
|
65
|
+
|
|
66
|
+
Whether to render the title of each pattern as a tooltip. User-defined patterns always show their visual title regardless of this prop.
|
|
67
|
+
|
|
68
|
+
- Type: `boolean`
|
|
69
|
+
- Required: No
|
|
70
|
+
- Default: `false`
|
|
71
|
+
|
|
72
72
|
## Related components
|
|
73
73
|
|
|
74
74
|
Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree.
|
|
@@ -39,14 +39,14 @@ function BlockPattern( {
|
|
|
39
39
|
pattern,
|
|
40
40
|
onClick,
|
|
41
41
|
onHover,
|
|
42
|
-
|
|
43
|
-
showTooltip,
|
|
42
|
+
showTitlesAsTooltip,
|
|
44
43
|
category,
|
|
45
44
|
} ) {
|
|
46
45
|
const [ isDragging, setIsDragging ] = useState( false );
|
|
47
46
|
const { blocks, viewportWidth } = pattern;
|
|
48
47
|
const instanceId = useInstanceId( BlockPattern );
|
|
49
48
|
const descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;
|
|
49
|
+
const isUserPattern = pattern.type === INSERTER_PATTERN_TYPES.user;
|
|
50
50
|
|
|
51
51
|
// When we have a selected category and the pattern is draggable, we need to update the
|
|
52
52
|
// pattern's categories in metadata to only contain the selected category, and pass this to
|
|
@@ -94,10 +94,7 @@ function BlockPattern( {
|
|
|
94
94
|
} }
|
|
95
95
|
>
|
|
96
96
|
<WithToolTip
|
|
97
|
-
showTooltip={
|
|
98
|
-
showTooltip &&
|
|
99
|
-
! pattern.type !== INSERTER_PATTERN_TYPES.user
|
|
100
|
-
}
|
|
97
|
+
showTooltip={ showTitlesAsTooltip && ! isUserPattern }
|
|
101
98
|
title={ pattern.title }
|
|
102
99
|
>
|
|
103
100
|
<Composite.Item
|
|
@@ -134,33 +131,30 @@ function BlockPattern( {
|
|
|
134
131
|
} }
|
|
135
132
|
onMouseLeave={ () => onHover?.( null ) }
|
|
136
133
|
>
|
|
137
|
-
<BlockPreview
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
134
|
+
<BlockPreview.Async
|
|
135
|
+
placeholder={ <BlockPatternPlaceholder /> }
|
|
136
|
+
>
|
|
137
|
+
<BlockPreview
|
|
138
|
+
blocks={ blocks }
|
|
139
|
+
viewportWidth={ viewportWidth }
|
|
140
|
+
/>
|
|
141
|
+
</BlockPreview.Async>
|
|
142
|
+
{ ( ! showTitlesAsTooltip || isUserPattern ) && (
|
|
143
143
|
<HStack
|
|
144
144
|
className="block-editor-patterns__pattern-details"
|
|
145
145
|
spacing={ 2 }
|
|
146
146
|
>
|
|
147
|
-
{ pattern.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
icon={ symbol }
|
|
154
|
-
/>
|
|
155
|
-
</div>
|
|
156
|
-
) }
|
|
157
|
-
{ ( ! showTooltip ||
|
|
158
|
-
pattern.type ===
|
|
159
|
-
INSERTER_PATTERN_TYPES.user ) && (
|
|
160
|
-
<div className="block-editor-block-patterns-list__item-title">
|
|
161
|
-
{ pattern.title }
|
|
147
|
+
{ isUserPattern && ! pattern.syncStatus && (
|
|
148
|
+
<div className="block-editor-patterns__pattern-icon-wrapper">
|
|
149
|
+
<Icon
|
|
150
|
+
className="block-editor-patterns__pattern-icon"
|
|
151
|
+
icon={ symbol }
|
|
152
|
+
/>
|
|
162
153
|
</div>
|
|
163
154
|
) }
|
|
155
|
+
<div className="block-editor-block-patterns-list__item-title">
|
|
156
|
+
{ pattern.title }
|
|
157
|
+
</div>
|
|
164
158
|
</HStack>
|
|
165
159
|
) }
|
|
166
160
|
|
|
@@ -187,13 +181,11 @@ function BlockPatternsList(
|
|
|
187
181
|
{
|
|
188
182
|
isDraggable,
|
|
189
183
|
blockPatterns,
|
|
190
|
-
shownPatterns,
|
|
191
184
|
onHover,
|
|
192
185
|
onClickPattern,
|
|
193
186
|
orientation,
|
|
194
187
|
label = __( 'Block patterns' ),
|
|
195
188
|
category,
|
|
196
|
-
showTitle = true,
|
|
197
189
|
showTitlesAsTooltip,
|
|
198
190
|
pagingProps,
|
|
199
191
|
},
|
|
@@ -205,11 +197,9 @@ function BlockPatternsList(
|
|
|
205
197
|
// Reset the active composite item whenever the available patterns change,
|
|
206
198
|
// to make sure that Composite widget can receive focus correctly when its
|
|
207
199
|
// composite items change. The first composite item will receive focus.
|
|
208
|
-
const firstCompositeItemId = blockPatterns
|
|
209
|
-
shownPatterns.includes( pattern )
|
|
210
|
-
)?.name;
|
|
200
|
+
const firstCompositeItemId = blockPatterns[ 0 ]?.name;
|
|
211
201
|
setActiveCompositeId( firstCompositeItemId );
|
|
212
|
-
}, [
|
|
202
|
+
}, [ blockPatterns ] );
|
|
213
203
|
|
|
214
204
|
return (
|
|
215
205
|
<Composite
|
|
@@ -221,24 +211,18 @@ function BlockPatternsList(
|
|
|
221
211
|
aria-label={ label }
|
|
222
212
|
ref={ ref }
|
|
223
213
|
>
|
|
224
|
-
{ blockPatterns.map( ( pattern ) =>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
category={ category }
|
|
237
|
-
/>
|
|
238
|
-
) : (
|
|
239
|
-
<BlockPatternPlaceholder key={ pattern.name } />
|
|
240
|
-
);
|
|
241
|
-
} ) }
|
|
214
|
+
{ blockPatterns.map( ( pattern ) => (
|
|
215
|
+
<BlockPattern
|
|
216
|
+
key={ pattern.name }
|
|
217
|
+
id={ pattern.name }
|
|
218
|
+
pattern={ pattern }
|
|
219
|
+
onClick={ onClickPattern }
|
|
220
|
+
onHover={ onHover }
|
|
221
|
+
isDraggable={ isDraggable }
|
|
222
|
+
showTitlesAsTooltip={ showTitlesAsTooltip }
|
|
223
|
+
category={ category }
|
|
224
|
+
/>
|
|
225
|
+
) ) }
|
|
242
226
|
{ pagingProps && <BlockPatternsPaging { ...pagingProps } /> }
|
|
243
227
|
</Composite>
|
|
244
228
|
);
|
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import blockLibraryStyles from '!!raw-loader!../../../../../block-library/build-style/style.css';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { useAsyncList } from '@wordpress/compose';
|
|
10
|
-
|
|
11
6
|
/**
|
|
12
7
|
* Internal dependencies
|
|
13
8
|
*/
|
|
@@ -26,13 +21,9 @@ export default {
|
|
|
26
21
|
|
|
27
22
|
export const Default = {
|
|
28
23
|
render: function Template( props ) {
|
|
29
|
-
const shownPatterns = useAsyncList( props.blockPatterns );
|
|
30
24
|
return (
|
|
31
25
|
<ExperimentalBlockEditorProvider settings={ blockEditorSettings }>
|
|
32
|
-
<BlockPatternsList
|
|
33
|
-
shownPatterns={ shownPatterns }
|
|
34
|
-
{ ...props }
|
|
35
|
-
/>
|
|
26
|
+
<BlockPatternsList { ...props } />
|
|
36
27
|
</ExperimentalBlockEditorProvider>
|
|
37
28
|
);
|
|
38
29
|
},
|
|
@@ -40,7 +31,6 @@ export const Default = {
|
|
|
40
31
|
blockPatterns: patterns,
|
|
41
32
|
isDraggable: false,
|
|
42
33
|
label: 'Block patterns story',
|
|
43
|
-
showTitle: true,
|
|
44
34
|
showTitlesAsTooltip: false,
|
|
45
35
|
},
|
|
46
36
|
argTypes: {
|
|
@@ -49,18 +39,11 @@ export const Default = {
|
|
|
49
39
|
description:
|
|
50
40
|
'Usually this component is used with `useAsyncList` for performance reasons and you should provide the returned list from that hook. Alternatively it should have the same value with `blockPatterns`.',
|
|
51
41
|
},
|
|
52
|
-
showTitle: {
|
|
53
|
-
description: 'Whether to render the title of each pattern.',
|
|
54
|
-
table: {
|
|
55
|
-
defaultValue: { summary: true },
|
|
56
|
-
type: { summary: 'boolean' },
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
42
|
onClickPattern: { type: 'function' },
|
|
60
43
|
onHover: { type: 'function' },
|
|
61
44
|
showTitlesAsTooltip: {
|
|
62
45
|
description:
|
|
63
|
-
'Whether to render the title of each pattern as a tooltip. If enabled
|
|
46
|
+
'Whether to render the title of each pattern as a tooltip. If enabled',
|
|
64
47
|
},
|
|
65
48
|
orientation: {
|
|
66
49
|
description: 'Orientation for the underlying composite widget.',
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
*/
|
|
21
21
|
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
22
22
|
import usePopoverScroll from './use-popover-scroll';
|
|
23
|
-
import { rectUnion,
|
|
23
|
+
import { rectUnion, getElementBounds } from '../../utils/dom';
|
|
24
24
|
|
|
25
25
|
const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
|
|
26
26
|
|
|
@@ -90,10 +90,10 @@ function BlockPopover(
|
|
|
90
90
|
getBoundingClientRect() {
|
|
91
91
|
return lastSelectedElement
|
|
92
92
|
? rectUnion(
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
getElementBounds( selectedElement ),
|
|
94
|
+
getElementBounds( lastSelectedElement )
|
|
95
95
|
)
|
|
96
|
-
:
|
|
96
|
+
: getElementBounds( selectedElement );
|
|
97
97
|
},
|
|
98
98
|
contextElement: selectedElement,
|
|
99
99
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useEffect, useState, flushSync } from '@wordpress/element';
|
|
5
|
+
import { createQueue } from '@wordpress/priority-queue';
|
|
6
|
+
|
|
7
|
+
const blockPreviewQueue = createQueue();
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Renders a component at the next idle time.
|
|
11
|
+
* @param {*} props
|
|
12
|
+
*/
|
|
13
|
+
export function Async( { children, placeholder } ) {
|
|
14
|
+
const [ shouldRender, setShouldRender ] = useState( false );
|
|
15
|
+
|
|
16
|
+
// In the future, we could try to use startTransition here, but currently
|
|
17
|
+
// react will batch all transitions, which means all previews will be
|
|
18
|
+
// rendered at the same time.
|
|
19
|
+
// https://react.dev/reference/react/startTransition#caveats
|
|
20
|
+
// > If there are multiple ongoing Transitions, React currently batches them
|
|
21
|
+
// > together. This is a limitation that will likely be removed in a future
|
|
22
|
+
// > release.
|
|
23
|
+
|
|
24
|
+
useEffect( () => {
|
|
25
|
+
const context = {};
|
|
26
|
+
blockPreviewQueue.add( context, () => {
|
|
27
|
+
// Synchronously run all renders so it consumes timeRemaining.
|
|
28
|
+
// See https://github.com/WordPress/gutenberg/pull/48238
|
|
29
|
+
flushSync( () => {
|
|
30
|
+
setShouldRender( true );
|
|
31
|
+
} );
|
|
32
|
+
} );
|
|
33
|
+
return () => {
|
|
34
|
+
blockPreviewQueue.cancel( context );
|
|
35
|
+
};
|
|
36
|
+
}, [] );
|
|
37
|
+
|
|
38
|
+
if ( ! shouldRender ) {
|
|
39
|
+
return placeholder;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return children;
|
|
43
|
+
}
|
|
@@ -19,6 +19,7 @@ import AutoHeightBlockPreview from './auto';
|
|
|
19
19
|
import EditorStyles from '../editor-styles';
|
|
20
20
|
import { store as blockEditorStore } from '../../store';
|
|
21
21
|
import { BlockListItems } from '../block-list';
|
|
22
|
+
import { Async } from './async';
|
|
22
23
|
|
|
23
24
|
const EMPTY_ADDITIONAL_STYLES = [];
|
|
24
25
|
|
|
@@ -86,6 +87,10 @@ export function BlockPreview( {
|
|
|
86
87
|
);
|
|
87
88
|
}
|
|
88
89
|
|
|
90
|
+
const MemoizedBlockPreview = memo( BlockPreview );
|
|
91
|
+
|
|
92
|
+
MemoizedBlockPreview.Async = Async;
|
|
93
|
+
|
|
89
94
|
/**
|
|
90
95
|
* BlockPreview renders a preview of a block or array of blocks.
|
|
91
96
|
*
|
|
@@ -97,7 +102,7 @@ export function BlockPreview( {
|
|
|
97
102
|
*
|
|
98
103
|
* @return {Component} The component to be rendered.
|
|
99
104
|
*/
|
|
100
|
-
export default
|
|
105
|
+
export default MemoizedBlockPreview;
|
|
101
106
|
|
|
102
107
|
/**
|
|
103
108
|
* This hook is used to lightly mark an element as a block preview wrapper
|
|
@@ -19,7 +19,7 @@ import { pipe, useCopyToClipboard } from '@wordpress/compose';
|
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
21
|
import BlockActions from '../block-actions';
|
|
22
|
-
import
|
|
22
|
+
import CommentIconSlotFill from '../../components/collab/block-comment-icon-slot';
|
|
23
23
|
import BlockHTMLConvertButton from './block-html-convert-button';
|
|
24
24
|
import __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';
|
|
25
25
|
import BlockSettingsMenuControls from '../block-settings-menu-controls';
|
|
@@ -295,7 +295,7 @@ export function BlockSettingsDropdown( {
|
|
|
295
295
|
</MenuItem>
|
|
296
296
|
</>
|
|
297
297
|
) }
|
|
298
|
-
<
|
|
298
|
+
<CommentIconSlotFill.Slot
|
|
299
299
|
fillProps={ { onClose } }
|
|
300
300
|
/>
|
|
301
301
|
</MenuGroup>
|
|
@@ -7,12 +7,12 @@ import { ToolbarGroup, ToolbarItem } from '@wordpress/components';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import BlockSettingsDropdown from './block-settings-dropdown';
|
|
10
|
-
import
|
|
10
|
+
import CommentIconToolbarSlotFill from '../../components/collab/block-comment-icon-toolbar-slot';
|
|
11
11
|
|
|
12
12
|
export function BlockSettingsMenu( { clientIds, ...props } ) {
|
|
13
13
|
return (
|
|
14
14
|
<ToolbarGroup>
|
|
15
|
-
<
|
|
15
|
+
<CommentIconToolbarSlotFill.Slot />
|
|
16
16
|
|
|
17
17
|
<ToolbarItem>
|
|
18
18
|
{ ( toggleProps ) => (
|