@wordpress/block-editor 10.5.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 +10 -0
- 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-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-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-variation-picker/index.js +1 -2
- package/build/components/block-variation-picker/index.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 +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +20 -6
- 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/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 +1 -0
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +0 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/use-internal-input-value.js +3 -3
- package/build/components/link-control/use-internal-input-value.js.map +1 -1
- package/build/components/list-view/block.js +5 -2
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +13 -12
- 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-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.js +36 -4
- package/build/components/off-canvas-editor/block.js.map +1 -1
- package/build/components/off-canvas-editor/branch.js +3 -5
- package/build/components/off-canvas-editor/branch.js.map +1 -1
- package/build/components/off-canvas-editor/index.js +20 -11
- package/build/components/off-canvas-editor/index.js.map +1 -1
- package/build/components/off-canvas-editor/leaf.js +1 -1
- package/build/components/off-canvas-editor/leaf.js.map +1 -1
- 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/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/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 +9 -1
- 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/content-lock-ui.js +1 -1
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/dimensions.js +25 -7
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/layout.js +57 -1
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/min-height.js +4 -10
- package/build/hooks/min-height.js.map +1 -1
- package/build/store/reducer.js +393 -270
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +57 -47
- 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-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-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-variation-picker/index.js +1 -2
- package/build-module/components/block-variation-picker/index.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 +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +22 -8
- 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/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 +1 -0
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +0 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/use-internal-input-value.js +3 -3
- package/build-module/components/link-control/use-internal-input-value.js.map +1 -1
- package/build-module/components/list-view/block.js +5 -2
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +12 -11
- 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-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.js +36 -6
- package/build-module/components/off-canvas-editor/block.js.map +1 -1
- package/build-module/components/off-canvas-editor/branch.js +3 -4
- package/build-module/components/off-canvas-editor/branch.js.map +1 -1
- package/build-module/components/off-canvas-editor/index.js +20 -12
- package/build-module/components/off-canvas-editor/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/leaf.js +1 -1
- package/build-module/components/off-canvas-editor/leaf.js.map +1 -1
- 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/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/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 +8 -1
- 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/content-lock-ui.js +1 -1
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/dimensions.js +25 -8
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/layout.js +55 -0
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/min-height.js +3 -9
- package/build-module/hooks/min-height.js.map +1 -1
- package/build-module/store/reducer.js +391 -271
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +54 -47
- 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 +286 -662
- package/build-style/style.css +286 -662
- package/package.json +32 -30
- package/src/autocompleters/block.js +2 -6
- package/src/autocompleters/link.js +2 -0
- 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-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} +1 -15
- package/src/components/block-list-appender/{style.scss → content.scss} +0 -0
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +24 -6
- 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-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-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/style.scss +12 -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/default-block-appender/{style.scss → content.scss} +0 -0
- 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 +1 -0
- package/src/components/inner-blocks/{style.scss → content.scss} +0 -0
- package/src/components/inner-blocks/index.js +23 -6
- 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/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 +176 -11
- package/src/components/inserter/tabs.js +12 -1
- 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 +1 -0
- package/src/components/link-control/search-input.js +0 -1
- package/src/components/link-control/test/index.js +188 -401
- package/src/components/link-control/use-internal-input-value.js +3 -3
- package/src/components/list-view/block.js +3 -0
- package/src/components/list-view/branch.js +10 -8
- 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/appender.js +93 -0
- package/src/components/off-canvas-editor/block-edit-button.js +27 -0
- package/src/components/off-canvas-editor/block.js +88 -22
- package/src/components/off-canvas-editor/branch.js +3 -5
- package/src/components/off-canvas-editor/index.js +59 -33
- package/src/components/off-canvas-editor/leaf.js +5 -1
- package/src/components/off-canvas-editor/link-ui.js +166 -0
- package/src/components/off-canvas-editor/style.scss +17 -388
- package/src/components/off-canvas-editor/update-attributes.js +99 -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/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/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 +13 -1
- 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/content-lock-ui.js +1 -1
- package/src/hooks/dimensions.js +45 -7
- package/src/hooks/layout.js +60 -0
- package/src/hooks/min-height.js +2 -19
- package/src/store/reducer.js +459 -423
- package/src/store/selectors.js +56 -57
- package/src/store/test/performance.js +71 -0
- package/src/store/test/reducer.js +623 -491
- package/src/store/test/selectors.js +1820 -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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { createBlock } from '@wordpress/blocks';
|
|
5
|
+
|
|
6
|
+
const mediaTypeTag = { image: 'img', video: 'video', audio: 'audio' };
|
|
7
|
+
|
|
8
|
+
export function getBlockAndPreviewFromMedia( media, mediaType ) {
|
|
9
|
+
// Add the common attributes between the different media types.
|
|
10
|
+
const attributes = {
|
|
11
|
+
id: media.id,
|
|
12
|
+
};
|
|
13
|
+
// Some props are named differently between the Media REST API and Media Library API.
|
|
14
|
+
// For example `source_url` is used in the former and `url` is used in the latter.
|
|
15
|
+
const mediaSrc = media.source_url || media.url;
|
|
16
|
+
const alt = media.alt_text || media.alt || undefined;
|
|
17
|
+
const caption = media.caption?.raw || media.caption;
|
|
18
|
+
if ( caption && typeof caption === 'string' ) {
|
|
19
|
+
attributes.caption = caption;
|
|
20
|
+
}
|
|
21
|
+
if ( mediaType === 'image' ) {
|
|
22
|
+
attributes.url = mediaSrc;
|
|
23
|
+
attributes.alt = alt;
|
|
24
|
+
} else if ( [ 'video', 'audio' ].includes( mediaType ) ) {
|
|
25
|
+
attributes.src = mediaSrc;
|
|
26
|
+
}
|
|
27
|
+
const PreviewTag = mediaTypeTag[ mediaType ];
|
|
28
|
+
const preview = (
|
|
29
|
+
<PreviewTag
|
|
30
|
+
src={ mediaSrc }
|
|
31
|
+
alt={ alt }
|
|
32
|
+
controls={ mediaType === 'audio' ? true : undefined }
|
|
33
|
+
inert="true"
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
return [ createBlock( `core/${ mediaType }`, attributes ), preview ];
|
|
37
|
+
}
|
|
@@ -28,7 +28,9 @@ import BlockPatternsTabs, {
|
|
|
28
28
|
BlockPatternsCategoryDialog,
|
|
29
29
|
} from './block-patterns-tab';
|
|
30
30
|
import ReusableBlocksTab from './reusable-blocks-tab';
|
|
31
|
+
import { MediaTab, MediaCategoryDialog, useMediaCategories } from './media-tab';
|
|
31
32
|
import InserterSearchResults from './search-results';
|
|
33
|
+
import useDebouncedInput from './hooks/use-debounced-input';
|
|
32
34
|
import useInsertionPoint from './hooks/use-insertion-point';
|
|
33
35
|
import InserterTabs from './tabs';
|
|
34
36
|
import { store as blockEditorStore } from '../../store';
|
|
@@ -48,12 +50,13 @@ function InserterMenu(
|
|
|
48
50
|
},
|
|
49
51
|
ref
|
|
50
52
|
) {
|
|
51
|
-
const [ filterValue, setFilterValue ] =
|
|
52
|
-
__experimentalFilterValue
|
|
53
|
-
);
|
|
53
|
+
const [ filterValue, setFilterValue, delayedFilterValue ] =
|
|
54
|
+
useDebouncedInput( __experimentalFilterValue );
|
|
54
55
|
const [ hoveredItem, setHoveredItem ] = useState( null );
|
|
55
56
|
const [ selectedPatternCategory, setSelectedPatternCategory ] =
|
|
56
57
|
useState( null );
|
|
58
|
+
const [ selectedMediaCategory, setSelectedMediaCategory ] =
|
|
59
|
+
useState( null );
|
|
57
60
|
const [ selectedTab, setSelectedTab ] = useState( null );
|
|
58
61
|
|
|
59
62
|
const [ destinationRootClientId, onInsertBlocks, onToggleInsertionPoint ] =
|
|
@@ -68,7 +71,6 @@ function InserterMenu(
|
|
|
68
71
|
( select ) => {
|
|
69
72
|
const { __experimentalGetAllowedPatterns, getSettings } =
|
|
70
73
|
select( blockEditorStore );
|
|
71
|
-
|
|
72
74
|
return {
|
|
73
75
|
showPatterns: !! __experimentalGetAllowedPatterns(
|
|
74
76
|
destinationRootClientId
|
|
@@ -80,6 +82,9 @@ function InserterMenu(
|
|
|
80
82
|
[ destinationRootClientId ]
|
|
81
83
|
);
|
|
82
84
|
|
|
85
|
+
const mediaCategories = useMediaCategories( destinationRootClientId );
|
|
86
|
+
const showMedia = !! mediaCategories.length;
|
|
87
|
+
|
|
83
88
|
const onInsert = useCallback(
|
|
84
89
|
( blocks, meta, shouldForceFocusBlock ) => {
|
|
85
90
|
onInsertBlocks( blocks, meta, shouldForceFocusBlock );
|
|
@@ -136,7 +141,7 @@ function InserterMenu(
|
|
|
136
141
|
destinationRootClientId,
|
|
137
142
|
onInsert,
|
|
138
143
|
onHover,
|
|
139
|
-
|
|
144
|
+
delayedFilterValue,
|
|
140
145
|
showMostUsedBlocks,
|
|
141
146
|
showInserterHelpPanel,
|
|
142
147
|
]
|
|
@@ -170,16 +175,36 @@ function InserterMenu(
|
|
|
170
175
|
[ destinationRootClientId, onInsert, onHover ]
|
|
171
176
|
);
|
|
172
177
|
|
|
178
|
+
const mediaTab = useMemo(
|
|
179
|
+
() => (
|
|
180
|
+
<MediaTab
|
|
181
|
+
rootClientId={ destinationRootClientId }
|
|
182
|
+
selectedCategory={ selectedMediaCategory }
|
|
183
|
+
onSelectCategory={ setSelectedMediaCategory }
|
|
184
|
+
onInsert={ onInsert }
|
|
185
|
+
/>
|
|
186
|
+
),
|
|
187
|
+
[
|
|
188
|
+
destinationRootClientId,
|
|
189
|
+
onInsert,
|
|
190
|
+
selectedMediaCategory,
|
|
191
|
+
setSelectedMediaCategory,
|
|
192
|
+
]
|
|
193
|
+
);
|
|
194
|
+
|
|
173
195
|
const getCurrentTab = useCallback(
|
|
174
196
|
( tab ) => {
|
|
175
197
|
if ( tab.name === 'blocks' ) {
|
|
176
198
|
return blocksTab;
|
|
177
199
|
} else if ( tab.name === 'patterns' ) {
|
|
178
200
|
return patternsTab;
|
|
201
|
+
} else if ( tab.name === 'reusable' ) {
|
|
202
|
+
return reusableBlocksTab;
|
|
203
|
+
} else if ( tab.name === 'media' ) {
|
|
204
|
+
return mediaTab;
|
|
179
205
|
}
|
|
180
|
-
return reusableBlocksTab;
|
|
181
206
|
},
|
|
182
|
-
[ blocksTab, patternsTab, reusableBlocksTab ]
|
|
207
|
+
[ blocksTab, patternsTab, reusableBlocksTab, mediaTab ]
|
|
183
208
|
);
|
|
184
209
|
|
|
185
210
|
const searchRef = useRef();
|
|
@@ -190,9 +215,16 @@ function InserterMenu(
|
|
|
190
215
|
} ) );
|
|
191
216
|
|
|
192
217
|
const showPatternPanel =
|
|
193
|
-
selectedTab === 'patterns' &&
|
|
194
|
-
|
|
195
|
-
|
|
218
|
+
selectedTab === 'patterns' &&
|
|
219
|
+
! delayedFilterValue &&
|
|
220
|
+
selectedPatternCategory;
|
|
221
|
+
const showAsTabs =
|
|
222
|
+
! delayedFilterValue &&
|
|
223
|
+
( showPatterns || hasReusableBlocks || showMedia );
|
|
224
|
+
const showMediaPanel =
|
|
225
|
+
selectedTab === 'media' &&
|
|
226
|
+
! delayedFilterValue &&
|
|
227
|
+
selectedMediaCategory;
|
|
196
228
|
return (
|
|
197
229
|
<div className="block-editor-inserter__menu">
|
|
198
230
|
<div
|
|
@@ -201,6 +233,7 @@ function InserterMenu(
|
|
|
201
233
|
} ) }
|
|
202
234
|
>
|
|
203
235
|
<SearchControl
|
|
236
|
+
__nextHasNoMarginBottom
|
|
204
237
|
className="block-editor-inserter__search"
|
|
205
238
|
onChange={ ( value ) => {
|
|
206
239
|
if ( hoveredItem ) setHoveredItem( null );
|
|
@@ -211,10 +244,10 @@ function InserterMenu(
|
|
|
211
244
|
placeholder={ __( 'Search' ) }
|
|
212
245
|
ref={ searchRef }
|
|
213
246
|
/>
|
|
214
|
-
{ !!
|
|
247
|
+
{ !! delayedFilterValue && (
|
|
215
248
|
<div className="block-editor-inserter__no-tab-container">
|
|
216
249
|
<InserterSearchResults
|
|
217
|
-
filterValue={
|
|
250
|
+
filterValue={ delayedFilterValue }
|
|
218
251
|
onSelect={ onSelect }
|
|
219
252
|
onHover={ onHover }
|
|
220
253
|
rootClientId={ rootClientId }
|
|
@@ -232,18 +265,26 @@ function InserterMenu(
|
|
|
232
265
|
<InserterTabs
|
|
233
266
|
showPatterns={ showPatterns }
|
|
234
267
|
showReusableBlocks={ hasReusableBlocks }
|
|
268
|
+
showMedia={ showMedia }
|
|
235
269
|
prioritizePatterns={ prioritizePatterns }
|
|
236
270
|
onSelect={ setSelectedTab }
|
|
237
271
|
>
|
|
238
272
|
{ getCurrentTab }
|
|
239
273
|
</InserterTabs>
|
|
240
274
|
) }
|
|
241
|
-
{ !
|
|
275
|
+
{ ! delayedFilterValue && ! showAsTabs && (
|
|
242
276
|
<div className="block-editor-inserter__no-tab-container">
|
|
243
277
|
{ blocksTab }
|
|
244
278
|
</div>
|
|
245
279
|
) }
|
|
246
280
|
</div>
|
|
281
|
+
{ showMediaPanel && (
|
|
282
|
+
<MediaCategoryDialog
|
|
283
|
+
rootClientId={ destinationRootClientId }
|
|
284
|
+
onInsert={ onInsert }
|
|
285
|
+
category={ selectedMediaCategory }
|
|
286
|
+
/>
|
|
287
|
+
) }
|
|
247
288
|
{ showInserterHelpPanel && hoveredItem && (
|
|
248
289
|
<InserterPreviewPanel item={ hoveredItem } />
|
|
249
290
|
) }
|
|
@@ -252,6 +293,7 @@ function InserterMenu(
|
|
|
252
293
|
rootClientId={ destinationRootClientId }
|
|
253
294
|
onInsert={ onInsertPattern }
|
|
254
295
|
category={ selectedPatternCategory }
|
|
296
|
+
showTitlesAsTooltip
|
|
255
297
|
/>
|
|
256
298
|
) }
|
|
257
299
|
</div>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __, isRTL } from '@wordpress/i18n';
|
|
5
|
+
import {
|
|
6
|
+
__experimentalItemGroup as ItemGroup,
|
|
7
|
+
__experimentalItem as Item,
|
|
8
|
+
__experimentalHStack as HStack,
|
|
9
|
+
__experimentalVStack as VStack,
|
|
10
|
+
__experimentalSpacer as Spacer,
|
|
11
|
+
__experimentalHeading as Heading,
|
|
12
|
+
__experimentalView as View,
|
|
13
|
+
__experimentalNavigatorProvider as NavigatorProvider,
|
|
14
|
+
__experimentalNavigatorScreen as NavigatorScreen,
|
|
15
|
+
__experimentalNavigatorButton as NavigatorButton,
|
|
16
|
+
__experimentalNavigatorBackButton as NavigatorBackButton,
|
|
17
|
+
FlexBlock,
|
|
18
|
+
} from '@wordpress/components';
|
|
19
|
+
import { Icon, chevronRight, chevronLeft } from '@wordpress/icons';
|
|
20
|
+
|
|
21
|
+
function ScreenHeader( { title } ) {
|
|
22
|
+
return (
|
|
23
|
+
<VStack spacing={ 0 }>
|
|
24
|
+
<View>
|
|
25
|
+
<Spacer marginBottom={ 0 } paddingX={ 4 } paddingY={ 3 }>
|
|
26
|
+
<HStack spacing={ 2 }>
|
|
27
|
+
<NavigatorBackButton
|
|
28
|
+
style={
|
|
29
|
+
// TODO: This style override is also used in ToolsPanelHeader.
|
|
30
|
+
// It should be supported out-of-the-box by Button.
|
|
31
|
+
{ minWidth: 24, padding: 0 }
|
|
32
|
+
}
|
|
33
|
+
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
34
|
+
isSmall
|
|
35
|
+
aria-label={ __( 'Navigate to the previous view' ) }
|
|
36
|
+
/>
|
|
37
|
+
<Spacer>
|
|
38
|
+
<Heading level={ 5 }>{ title }</Heading>
|
|
39
|
+
</Spacer>
|
|
40
|
+
</HStack>
|
|
41
|
+
</Spacer>
|
|
42
|
+
</View>
|
|
43
|
+
</VStack>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default function MobileTabNavigation( { categories, children } ) {
|
|
48
|
+
return (
|
|
49
|
+
<NavigatorProvider
|
|
50
|
+
initialPath="/"
|
|
51
|
+
className="block-editor-inserter__mobile-tab-navigation"
|
|
52
|
+
>
|
|
53
|
+
<NavigatorScreen path="/">
|
|
54
|
+
<ItemGroup>
|
|
55
|
+
{ categories.map( ( category ) => (
|
|
56
|
+
<NavigatorButton
|
|
57
|
+
key={ category.name }
|
|
58
|
+
path={ `/category/${ category.name }` }
|
|
59
|
+
as={ Item }
|
|
60
|
+
isAction
|
|
61
|
+
>
|
|
62
|
+
<HStack>
|
|
63
|
+
<FlexBlock>{ category.label }</FlexBlock>
|
|
64
|
+
<Icon
|
|
65
|
+
icon={
|
|
66
|
+
isRTL() ? chevronLeft : chevronRight
|
|
67
|
+
}
|
|
68
|
+
/>
|
|
69
|
+
</HStack>
|
|
70
|
+
</NavigatorButton>
|
|
71
|
+
) ) }
|
|
72
|
+
</ItemGroup>
|
|
73
|
+
</NavigatorScreen>
|
|
74
|
+
{ categories.map( ( category ) => (
|
|
75
|
+
<NavigatorScreen
|
|
76
|
+
key={ category.name }
|
|
77
|
+
path={ `/category/${ category.name }` }
|
|
78
|
+
>
|
|
79
|
+
<ScreenHeader title={ __( 'Back' ) } />
|
|
80
|
+
{ children( category ) }
|
|
81
|
+
</NavigatorScreen>
|
|
82
|
+
) ) }
|
|
83
|
+
</NavigatorProvider>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { isEmpty } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -25,6 +25,7 @@ import usePatternsState from './hooks/use-patterns-state';
|
|
|
25
25
|
import useBlockTypesState from './hooks/use-block-types-state';
|
|
26
26
|
import { searchBlockItems, searchItems } from './search-items';
|
|
27
27
|
import InserterListbox from '../inserter-listbox';
|
|
28
|
+
import { orderBy } from '../../utils/sorting';
|
|
28
29
|
|
|
29
30
|
const INITIAL_INSERTER_RESULTS = 9;
|
|
30
31
|
/**
|
|
@@ -91,7 +92,7 @@ function InserterSearchResults( {
|
|
|
91
92
|
return [];
|
|
92
93
|
}
|
|
93
94
|
const results = searchBlockItems(
|
|
94
|
-
orderBy( blockTypes,
|
|
95
|
+
orderBy( blockTypes, 'frecency', 'desc' ),
|
|
95
96
|
blockTypeCategories,
|
|
96
97
|
blockTypeCollections,
|
|
97
98
|
filterValue
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import BlockLibrary from '../library';
|
|
5
5
|
import BlockEditorProvider from '../../provider';
|
|
6
|
-
import { patternCategories, patterns, reusableBlocks } from './fixtures';
|
|
6
|
+
import { patternCategories, patterns, reusableBlocks } from './utils/fixtures';
|
|
7
7
|
import Inserter from '../';
|
|
8
8
|
|
|
9
9
|
export default { title: 'BlockEditor/Inserter' };
|
|
File without changes
|
|
@@ -107,10 +107,6 @@ $block-inserter-tabs-height: 44px;
|
|
|
107
107
|
.components-search-control__icon {
|
|
108
108
|
right: $grid-unit-10 + ($grid-unit-60 - $icon-size) * 0.5;
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
.components-base-control__field {
|
|
112
|
-
margin-bottom: 0;
|
|
113
|
-
}
|
|
114
110
|
}
|
|
115
111
|
|
|
116
112
|
.block-editor-inserter__tabs {
|
|
@@ -125,6 +121,12 @@ $block-inserter-tabs-height: 44px;
|
|
|
125
121
|
.components-tab-panel__tabs-item {
|
|
126
122
|
flex-grow: 1;
|
|
127
123
|
margin-bottom: -$border-width;
|
|
124
|
+
&[id$="reusable"] {
|
|
125
|
+
flex-grow: inherit;
|
|
126
|
+
// These are to align the `reusable` icon with the search icon.
|
|
127
|
+
padding-left: $grid-unit-20;
|
|
128
|
+
padding-right: $grid-unit-20;
|
|
129
|
+
}
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
|
|
@@ -279,13 +281,13 @@ $block-inserter-tabs-height: 44px;
|
|
|
279
281
|
padding: $grid-unit-20;
|
|
280
282
|
overflow-y: auto;
|
|
281
283
|
height: 100%;
|
|
284
|
+
// Push the listitem wrapping the "explore" button to the bottom of the panel.
|
|
285
|
+
div[role="listitem"]:last-child {
|
|
286
|
+
margin-top: auto;
|
|
287
|
+
}
|
|
282
288
|
}
|
|
283
289
|
|
|
284
|
-
.block-editor-inserter__patterns-
|
|
285
|
-
flex-grow: 1;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
.block-editor-inserter__patterns-category-panel {
|
|
290
|
+
.block-editor-inserter__patterns-category-dialog {
|
|
289
291
|
background: $gray-100;
|
|
290
292
|
border-left: $border-width solid $gray-200;
|
|
291
293
|
border-right: $border-width solid $gray-200;
|
|
@@ -314,9 +316,13 @@ $block-inserter-tabs-height: 44px;
|
|
|
314
316
|
box-shadow: 0 0 0 2px $gray-900, 0 15px 25px rgb(0 0 0 / 7%);
|
|
315
317
|
}
|
|
316
318
|
}
|
|
319
|
+
}
|
|
317
320
|
|
|
318
|
-
|
|
319
|
-
|
|
321
|
+
.block-editor-inserter__patterns-category-panel {
|
|
322
|
+
padding: 0 $grid-unit-20;
|
|
323
|
+
|
|
324
|
+
@include break-medium {
|
|
325
|
+
padding: 0;
|
|
320
326
|
}
|
|
321
327
|
}
|
|
322
328
|
|
|
@@ -474,3 +480,162 @@ $block-inserter-tabs-height: 44px;
|
|
|
474
480
|
.block-editor-inserter__patterns-category-panel-title {
|
|
475
481
|
font-size: calc(1.25 * 13px);
|
|
476
482
|
}
|
|
483
|
+
|
|
484
|
+
.block-editor-inserter__media-tabs-container {
|
|
485
|
+
height: 100%;
|
|
486
|
+
|
|
487
|
+
nav {
|
|
488
|
+
height: 100%;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.block-editor-inserter__media-library-button {
|
|
492
|
+
padding: $grid-unit-20;
|
|
493
|
+
justify-content: center;
|
|
494
|
+
margin-top: $grid-unit-20;
|
|
495
|
+
width: 100%;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.block-editor-inserter__media-tabs {
|
|
500
|
+
display: flex;
|
|
501
|
+
flex-direction: column;
|
|
502
|
+
padding: $grid-unit-20;
|
|
503
|
+
overflow-y: auto;
|
|
504
|
+
height: 100%;
|
|
505
|
+
|
|
506
|
+
// Push the listitem wrapping the "open media library" button to the bottom of the panel.
|
|
507
|
+
div[role="listitem"]:last-child {
|
|
508
|
+
margin-top: auto;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
&__media-category {
|
|
512
|
+
&.is-selected {
|
|
513
|
+
color: var(--wp-admin-theme-color);
|
|
514
|
+
position: relative;
|
|
515
|
+
|
|
516
|
+
.components-flex-item {
|
|
517
|
+
filter: brightness(0.95);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
svg {
|
|
521
|
+
fill: var(--wp-admin-theme-color);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
&::after {
|
|
525
|
+
content: "";
|
|
526
|
+
position: absolute;
|
|
527
|
+
top: 0;
|
|
528
|
+
bottom: 0;
|
|
529
|
+
left: 0;
|
|
530
|
+
right: 0;
|
|
531
|
+
border-radius: $radius-block-ui;
|
|
532
|
+
opacity: 0.04;
|
|
533
|
+
background: var(--wp-admin-theme-color);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.block-editor-inserter__media-dialog {
|
|
540
|
+
background: $gray-100;
|
|
541
|
+
border-left: $border-width solid $gray-200;
|
|
542
|
+
border-right: $border-width solid $gray-200;
|
|
543
|
+
position: absolute;
|
|
544
|
+
padding: $grid-unit-20 $grid-unit-30;
|
|
545
|
+
top: 0;
|
|
546
|
+
left: 0;
|
|
547
|
+
height: 100%;
|
|
548
|
+
width: 100%;
|
|
549
|
+
overflow-y: auto;
|
|
550
|
+
scrollbar-gutter: stable both-edges;
|
|
551
|
+
|
|
552
|
+
@include break-medium {
|
|
553
|
+
left: 100%;
|
|
554
|
+
display: block;
|
|
555
|
+
width: 300px;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.block-editor-block-preview__container {
|
|
559
|
+
box-shadow: 0 15px 25px rgb(0 0 0 / 7%);
|
|
560
|
+
&:hover {
|
|
561
|
+
box-shadow: 0 0 0 2px $gray-900, 0 15px 25px rgb(0 0 0 / 7%);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.block-editor-inserter__media-panel {
|
|
567
|
+
height: 100%;
|
|
568
|
+
padding: 0 $grid-unit-20;
|
|
569
|
+
|
|
570
|
+
@include break-medium {
|
|
571
|
+
padding: 0;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.block-editor-inserter__media-panel-spinner {
|
|
575
|
+
height: 100%;
|
|
576
|
+
display: flex;
|
|
577
|
+
align-items: center;
|
|
578
|
+
justify-content: center;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.block-editor-inserter__media-panel-search {
|
|
582
|
+
&.components-search-control {
|
|
583
|
+
input[type="search"].components-search-control__input {
|
|
584
|
+
background: $white;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.block-editor-inserter__media-list {
|
|
591
|
+
margin-top: $grid-unit-20;
|
|
592
|
+
&__list-item {
|
|
593
|
+
cursor: pointer;
|
|
594
|
+
margin-bottom: $grid-unit-30;
|
|
595
|
+
|
|
596
|
+
&.is-placeholder {
|
|
597
|
+
min-height: 100px;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
&[draggable="true"] .block-editor-block-preview__container {
|
|
601
|
+
cursor: grab;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
&__item {
|
|
606
|
+
height: 100%;
|
|
607
|
+
|
|
608
|
+
&-preview {
|
|
609
|
+
display: flex;
|
|
610
|
+
align-items: center;
|
|
611
|
+
overflow: hidden;
|
|
612
|
+
border-radius: 4px;
|
|
613
|
+
|
|
614
|
+
> * {
|
|
615
|
+
margin: 0 auto;
|
|
616
|
+
max-width: 100%;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
&:hover &-preview {
|
|
621
|
+
box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
&:focus &-preview {
|
|
625
|
+
box-shadow: inset 0 0 0 1px $white, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
626
|
+
|
|
627
|
+
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
628
|
+
outline: 2px solid transparent;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
.block-editor-inserter__mobile-tab-navigation {
|
|
635
|
+
padding: $grid-unit-20;
|
|
636
|
+
height: 100%;
|
|
637
|
+
|
|
638
|
+
> * {
|
|
639
|
+
height: 100%;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { symbol as reusableBlockIcon } from '@wordpress/icons';
|
|
4
5
|
import { useMemo } from '@wordpress/element';
|
|
5
6
|
import { TabPanel } from '@wordpress/components';
|
|
6
7
|
import { __ } from '@wordpress/i18n';
|
|
@@ -19,12 +20,19 @@ const reusableBlocksTab = {
|
|
|
19
20
|
name: 'reusable',
|
|
20
21
|
/* translators: Reusable blocks tab title in the block inserter. */
|
|
21
22
|
title: __( 'Reusable' ),
|
|
23
|
+
icon: reusableBlockIcon,
|
|
24
|
+
};
|
|
25
|
+
const mediaTab = {
|
|
26
|
+
name: 'media',
|
|
27
|
+
/* translators: Media tab title in the block inserter. */
|
|
28
|
+
title: __( 'Media' ),
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
function InserterTabs( {
|
|
25
32
|
children,
|
|
26
33
|
showPatterns = false,
|
|
27
34
|
showReusableBlocks = false,
|
|
35
|
+
showMedia = false,
|
|
28
36
|
onSelect,
|
|
29
37
|
prioritizePatterns,
|
|
30
38
|
} ) {
|
|
@@ -37,10 +45,12 @@ function InserterTabs( {
|
|
|
37
45
|
if ( ! prioritizePatterns && showPatterns ) {
|
|
38
46
|
tempTabs.push( patternsTab );
|
|
39
47
|
}
|
|
48
|
+
if ( showMedia ) {
|
|
49
|
+
tempTabs.push( mediaTab );
|
|
50
|
+
}
|
|
40
51
|
if ( showReusableBlocks ) {
|
|
41
52
|
tempTabs.push( reusableBlocksTab );
|
|
42
53
|
}
|
|
43
|
-
|
|
44
54
|
return tempTabs;
|
|
45
55
|
}, [
|
|
46
56
|
prioritizePatterns,
|
|
@@ -48,6 +58,7 @@ function InserterTabs( {
|
|
|
48
58
|
showPatterns,
|
|
49
59
|
patternsTab,
|
|
50
60
|
showReusableBlocks,
|
|
61
|
+
showMedia,
|
|
51
62
|
reusableBlocksTab,
|
|
52
63
|
] );
|
|
53
64
|
|
|
@@ -10,6 +10,8 @@ import { useMemo, useRef, memo } from '@wordpress/element';
|
|
|
10
10
|
import {
|
|
11
11
|
createBlock,
|
|
12
12
|
createBlocksFromInnerBlocksTemplate,
|
|
13
|
+
isReusableBlock,
|
|
14
|
+
isTemplatePart,
|
|
13
15
|
} from '@wordpress/blocks';
|
|
14
16
|
import { __experimentalTruncate as Truncate } from '@wordpress/components';
|
|
15
17
|
import { ENTER, isAppleOS } from '@wordpress/keycodes';
|
|
@@ -47,6 +49,8 @@ function InserterListItem( {
|
|
|
47
49
|
];
|
|
48
50
|
}, [ item.name, item.initialAttributes, item.initialAttributes ] );
|
|
49
51
|
|
|
52
|
+
const isSynced = isReusableBlock( item ) || isTemplatePart( item );
|
|
53
|
+
|
|
50
54
|
return (
|
|
51
55
|
<InserterDraggableBlocks
|
|
52
56
|
isEnabled={ isDraggable && ! item.disabled }
|
|
@@ -55,7 +59,13 @@ function InserterListItem( {
|
|
|
55
59
|
>
|
|
56
60
|
{ ( { draggable, onDragStart, onDragEnd } ) => (
|
|
57
61
|
<div
|
|
58
|
-
className=
|
|
62
|
+
className={ classnames(
|
|
63
|
+
'block-editor-block-types-list__list-item',
|
|
64
|
+
|
|
65
|
+
{
|
|
66
|
+
'is-synced': isSynced,
|
|
67
|
+
}
|
|
68
|
+
) }
|
|
59
69
|
draggable={ draggable }
|
|
60
70
|
onDragStart={ ( event ) => {
|
|
61
71
|
isDragging.current = true;
|
|
@@ -1,8 +1,34 @@
|
|
|
1
|
+
|
|
1
2
|
.block-editor-block-types-list__list-item {
|
|
2
3
|
display: block;
|
|
3
4
|
width: 33.33%;
|
|
4
5
|
padding: 0;
|
|
5
6
|
margin: 0;
|
|
7
|
+
|
|
8
|
+
&.is-synced {
|
|
9
|
+
.components-button.block-editor-block-types-list__item {
|
|
10
|
+
&:not(:disabled) {
|
|
11
|
+
.block-editor-block-icon.has-colors {
|
|
12
|
+
color: var(--wp-block-synced-color);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&:hover {
|
|
16
|
+
.block-editor-block-types-list__item-title {
|
|
17
|
+
color: var(--wp-block-synced-color) !important;
|
|
18
|
+
filter: brightness(0.95);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
svg {
|
|
22
|
+
color: var(--wp-block-synced-color) !important;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&::after {
|
|
27
|
+
background: var(--wp-block-synced-color);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
6
32
|
}
|
|
7
33
|
|
|
8
34
|
.components-button.block-editor-block-types-list__item {
|
|
@@ -13,6 +13,7 @@ const InspectorControlsDimensions = createSlotFill(
|
|
|
13
13
|
const InspectorControlsTypography = createSlotFill(
|
|
14
14
|
'InspectorControlsTypography'
|
|
15
15
|
);
|
|
16
|
+
const InspectorControlsListView = createSlotFill( 'InspectorControlsListView' );
|
|
16
17
|
|
|
17
18
|
const groups = {
|
|
18
19
|
default: InspectorControlsDefault,
|
|
@@ -20,6 +21,7 @@ const groups = {
|
|
|
20
21
|
border: InspectorControlsBorder,
|
|
21
22
|
color: InspectorControlsColor,
|
|
22
23
|
dimensions: InspectorControlsDimensions,
|
|
24
|
+
list: InspectorControlsListView,
|
|
23
25
|
typography: InspectorControlsTypography,
|
|
24
26
|
};
|
|
25
27
|
|