@wordpress/block-editor 14.3.3 → 14.4.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/README.md +46 -0
- package/build/autocompleters/link.js +2 -1
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/block-actions/index.js +1 -13
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-inspector/index.js +56 -75
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +5 -19
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/index.js +5 -8
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +3 -11
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +5 -3
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list/zoom-out-separator.js +14 -6
- package/build/components/block-list/zoom-out-separator.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +2 -4
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-parent-selector/index.js +13 -10
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +10 -20
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-paging/index.js +11 -13
- package/build/components/block-patterns-paging/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +2 -4
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +79 -76
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +1 -6
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-switcher/index.js +17 -14
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +16 -19
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/use-has-block-toolbar.js +3 -5
- package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
- package/build/components/block-tools/index.js +8 -11
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +1 -4
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +2 -5
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
- package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +14 -17
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-toolbar.js +2 -12
- package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build/components/block-variation-picker/index.js +2 -4
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +3 -4
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/button-block-appender/index.js +2 -4
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +2 -4
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/global-styles/border-panel.js +1 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +2 -4
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +3 -3
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +2 -4
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +24 -29
- package/build/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build/components/inner-blocks/index.js +1 -9
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +1 -1
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +24 -5
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +22 -12
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +23 -10
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +35 -13
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/menu.js +2 -2
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +5 -5
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +4 -4
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +11 -8
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-popover-header/index.js +4 -8
- package/build/components/inspector-popover-header/index.js.map +1 -1
- package/build/components/link-control/index.js +5 -10
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +2 -4
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/list-view/block-contents.js +1 -25
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +1 -4
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/media-placeholder/index.js +29 -43
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/rich-text/index.js +4 -8
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +2 -4
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/tool-selector/index.js +13 -12
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/url-input/button.js +14 -16
- package/build/components/url-input/button.js.map +1 -1
- package/build/components/url-input/index.js +2 -4
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +0 -61
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +2 -25
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/block-bindings.js +6 -13
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/duotone.js +4 -1
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/layout-child.js +3 -1
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/position.js +3 -2
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +5 -4
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/layouts/flex.js +6 -38
- package/build/layouts/flex.js.map +1 -1
- package/build/private-apis.js +0 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +13 -14
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +15 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +104 -7
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +22 -26
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +127 -56
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +4 -3
- package/build/store/utils.js.map +1 -1
- package/build/utils/block-bindings.js +50 -0
- package/build/utils/block-bindings.js.map +1 -1
- package/build/utils/index.js +7 -0
- package/build/utils/index.js.map +1 -1
- package/build-module/autocompleters/link.js +2 -1
- package/build-module/autocompleters/link.js.map +1 -1
- package/build-module/components/block-actions/index.js +1 -13
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +57 -76
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +5 -19
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/index.js +5 -8
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +3 -11
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +5 -3
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list/zoom-out-separator.js +14 -6
- package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +2 -4
- package/build-module/components/block-navigation/dropdown.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +13 -10
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +10 -20
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-paging/index.js +11 -13
- package/build-module/components/block-patterns-paging/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +2 -4
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +79 -76
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +2 -7
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +17 -14
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +17 -20
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/use-has-block-toolbar.js +3 -5
- package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
- package/build-module/components/block-tools/index.js +8 -11
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +1 -4
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +2 -5
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +14 -17
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +2 -12
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +2 -4
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +3 -4
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +2 -4
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +2 -4
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +1 -1
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +2 -4
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -1
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +2 -4
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +25 -30
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +1 -9
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +1 -1
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +27 -8
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +22 -12
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +23 -10
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +35 -13
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/menu.js +2 -2
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +6 -6
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +4 -4
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +12 -9
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-popover-header/index.js +4 -8
- package/build-module/components/inspector-popover-header/index.js.map +1 -1
- package/build-module/components/link-control/index.js +5 -10
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +2 -4
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +1 -25
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +2 -5
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +30 -44
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +4 -8
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +2 -4
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/tool-selector/index.js +13 -12
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/url-input/button.js +15 -17
- package/build-module/components/url-input/button.js.map +1 -1
- package/build-module/components/url-input/index.js +2 -4
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +1 -62
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +3 -26
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/block-bindings.js +6 -13
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/duotone.js +4 -1
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/layout-child.js +4 -1
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/position.js +4 -1
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +5 -4
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/layouts/flex.js +7 -39
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/private-apis.js +0 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +12 -12
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +14 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +98 -7
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +21 -25
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +129 -58
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -2
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/block-bindings.js +50 -0
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-module/utils/index.js +1 -0
- package/build-module/utils/index.js.map +1 -1
- package/build-style/content-rtl.css +16 -70
- package/build-style/content.css +16 -70
- package/build-style/default-editor-styles-rtl.css +10 -1
- package/build-style/default-editor-styles.css +10 -1
- package/build-style/style-rtl.css +51 -149
- package/build-style/style.css +51 -149
- package/package.json +32 -32
- package/src/autocompleters/link.js +2 -1
- package/src/components/block-actions/index.js +1 -13
- package/src/components/block-draggable/style.scss +2 -2
- package/src/components/block-inspector/index.js +79 -95
- package/src/components/block-inspector/style.scss +2 -0
- package/src/components/block-list/block.js +7 -28
- package/src/components/block-list/content.scss +1 -61
- package/src/components/block-list/index.js +21 -29
- package/src/components/block-list/use-block-props/index.js +3 -10
- package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +19 -11
- package/src/components/block-list/use-in-between-inserter.js +5 -2
- package/src/components/block-list/zoom-out-separator.js +24 -8
- package/src/components/block-navigation/dropdown.js +1 -2
- package/src/components/block-parent-selector/index.js +13 -10
- package/src/components/block-pattern-setup/setup-toolbar.js +5 -10
- package/src/components/block-patterns-paging/index.js +8 -7
- package/src/components/block-patterns-paging/style.scss +10 -27
- package/src/components/block-quick-navigation/index.js +1 -2
- package/src/components/block-settings-menu/block-settings-dropdown.js +120 -106
- package/src/components/block-settings-menu-controls/index.js +0 -15
- package/src/components/block-switcher/index.js +37 -30
- package/src/components/block-toolbar/index.js +22 -34
- package/src/components/block-toolbar/style.scss +10 -1
- package/src/components/block-toolbar/use-has-block-toolbar.js +19 -31
- package/src/components/block-tools/index.js +7 -16
- package/src/components/block-tools/insertion-point.js +1 -4
- package/src/components/block-tools/style.scss +3 -88
- package/src/components/block-tools/use-show-block-tools.js +2 -12
- package/src/components/block-tools/zoom-out-mode-inserter-button.js +2 -17
- package/src/components/block-tools/zoom-out-mode-inserters.js +11 -19
- package/src/components/block-tools/zoom-out-toolbar.js +2 -13
- package/src/components/block-variation-picker/index.js +1 -2
- package/src/components/block-variation-transforms/index.js +2 -2
- package/src/components/button-block-appender/content.scss +0 -5
- package/src/components/button-block-appender/index.js +1 -2
- package/src/components/colors-gradients/dropdown.js +1 -5
- package/src/components/font-family/README.md +5 -1
- package/src/components/global-styles/border-panel.js +1 -1
- package/src/components/global-styles/color-panel.js +1 -5
- package/src/components/global-styles/dimensions-panel.js +1 -1
- package/src/components/global-styles/filters-panel.js +1 -2
- package/src/components/global-styles/shadow-panel-components.js +28 -33
- package/src/components/global-styles/style.scss +5 -0
- package/src/components/inner-blocks/index.js +1 -16
- package/src/components/inserter/block-types-tab.js +1 -1
- package/src/components/inserter/hooks/use-block-types-state.js +34 -14
- package/src/components/inserter/hooks/use-insertion-point.js +35 -13
- package/src/components/inserter/hooks/use-patterns-state.js +46 -9
- package/src/components/inserter/media-tab/media-preview.js +38 -12
- package/src/components/inserter/menu.js +2 -2
- package/src/components/inserter/mobile-tab-navigation.js +10 -13
- package/src/components/inserter/quick-inserter.js +5 -4
- package/src/components/inserter/style.scss +0 -28
- package/src/components/inspector-controls-tabs/index.js +21 -20
- package/src/components/inspector-controls-tabs/style.scss +2 -6
- package/src/components/inspector-popover-header/index.js +2 -4
- package/src/components/inspector-popover-header/style.scss +0 -13
- package/src/components/link-control/index.js +2 -5
- package/src/components/link-control/settings-drawer.js +1 -2
- package/src/components/list-view/block-contents.js +1 -28
- package/src/components/list-view/block-select-button.js +2 -5
- package/src/components/list-view/style.scss +18 -14
- package/src/components/media-placeholder/content.scss +3 -19
- package/src/components/media-placeholder/index.js +23 -29
- package/src/components/rich-text/index.js +4 -13
- package/src/components/skip-to-selected-block/index.js +1 -2
- package/src/components/skip-to-selected-block/style.scss +0 -9
- package/src/components/tool-selector/index.js +14 -9
- package/src/components/tool-selector/style.scss +5 -0
- package/src/components/url-input/button.js +16 -12
- package/src/components/url-input/index.js +1 -2
- package/src/components/url-input/style.scss +0 -6
- package/src/components/use-block-commands/index.js +0 -58
- package/src/components/writing-flow/use-tab-nav.js +4 -36
- package/src/content.scss +0 -1
- package/src/hooks/block-bindings.js +9 -10
- package/src/hooks/duotone.js +4 -1
- package/src/hooks/layout-child.js +4 -1
- package/src/hooks/position.js +4 -1
- package/src/hooks/use-bindings-attributes.js +66 -63
- package/src/layouts/flex.js +10 -53
- package/src/private-apis.js +0 -2
- package/src/store/actions.js +14 -13
- package/src/store/private-actions.js +14 -0
- package/src/store/private-selectors.js +120 -16
- package/src/store/reducer.js +22 -28
- package/src/store/selectors.js +203 -114
- package/src/store/test/private-actions.js +15 -0
- package/src/store/test/private-selectors.js +34 -0
- package/src/store/test/reducer.js +40 -4
- package/src/store/test/selectors.js +183 -20
- package/src/store/utils.js +4 -2
- package/src/utils/block-bindings.js +49 -0
- package/src/utils/index.js +1 -0
- package/build/components/block-controls/use-has-block-controls.js +0 -43
- package/build/components/block-controls/use-has-block-controls.js.map +0 -1
- package/build/components/block-list/use-block-props/use-nav-mode-exit.js +0 -54
- package/build/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
- package/build/components/block-tools/block-selection-button.js +0 -259
- package/build/components/block-tools/block-selection-button.js.map +0 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +0 -57
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
- package/build/components/inserter/tabs.js +0 -78
- package/build/components/inserter/tabs.js.map +0 -1
- package/build-module/components/block-controls/use-has-block-controls.js +0 -34
- package/build-module/components/block-controls/use-has-block-controls.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js +0 -48
- package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
- package/build-module/components/block-tools/block-selection-button.js +0 -254
- package/build-module/components/block-tools/block-selection-button.js.map +0 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +0 -49
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
- package/build-module/components/inserter/tabs.js +0 -72
- package/build-module/components/inserter/tabs.js.map +0 -1
- package/src/components/block-controls/use-has-block-controls.js +0 -35
- package/src/components/block-list/use-block-props/use-nav-mode-exit.js +0 -46
- package/src/components/block-tools/block-selection-button.js +0 -302
- package/src/components/block-tools/block-toolbar-breadcrumb.js +0 -51
- package/src/components/inner-blocks/content.scss +0 -13
- package/src/components/inserter/tabs.js +0 -78
- package/src/components/inserter/test/block-types-tab.native.js +0 -67
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_icons","_i18n","_jsxRuntime","ZoomOutModeInserterButton","onClick","jsx","Button","variant","icon","plus","size","className","clsx","label","_x","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-mode-inserter-button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { plus } from '@wordpress/icons';\nimport { _x } from '@wordpress/i18n';\n\nfunction ZoomOutModeInserterButton( { onClick } ) {\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"primary\"\n\t\t\ticon={ plus }\n\t\t\tsize=\"compact\"\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-button-pattern-inserter__button',\n\t\t\t\t'block-editor-block-tools__zoom-out-mode-inserter-button'\n\t\t\t) }\n\t\t\tonClick={ onClick }\n\t\t\tlabel={ _x(\n\t\t\t\t'Add pattern',\n\t\t\t\t'Generic label for pattern inserter button'\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default ZoomOutModeInserterButton;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAAqC,IAAAI,WAAA,GAAAJ,OAAA;AAVrC;AACA;AACA;;AAGA;AACA;AACA;;AAKA,SAASK,yBAAyBA,CAAE;EAAEC;AAAQ,CAAC,EAAG;EACjD,oBACC,IAAAF,WAAA,CAAAG,GAAA,EAACN,WAAA,CAAAO,MAAM;IACNC,OAAO,EAAC,SAAS;IACjBC,IAAI,EAAGC,WAAM;IACbC,IAAI,EAAC,SAAS;IACdC,SAAS,EAAG,IAAAC,aAAI,EACf,8CAA8C,EAC9C,yDACD,CAAG;IACHR,OAAO,EAAGA,OAAS;IACnBS,KAAK,EAAG,IAAAC,QAAE,EACT,aAAa,EACb,2CACD;EAAG,CACH,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcd,yBAAyB","ignoreList":[]}
|
|
@@ -24,39 +24,38 @@ function ZoomOutModeInserters() {
|
|
|
24
24
|
const [isReady, setIsReady] = (0, _element.useState)(false);
|
|
25
25
|
const {
|
|
26
26
|
hasSelection,
|
|
27
|
-
|
|
27
|
+
insertionPoint,
|
|
28
28
|
blockOrder,
|
|
29
29
|
blockInsertionPointVisible,
|
|
30
30
|
setInserterIsOpened,
|
|
31
31
|
sectionRootClientId,
|
|
32
|
-
selectedBlockClientId
|
|
33
|
-
hoveredBlockClientId
|
|
32
|
+
selectedBlockClientId
|
|
34
33
|
} = (0, _data.useSelect)(select => {
|
|
35
34
|
const {
|
|
36
35
|
getSettings,
|
|
37
|
-
|
|
36
|
+
getInsertionPoint,
|
|
38
37
|
getBlockOrder,
|
|
39
38
|
getSelectionStart,
|
|
40
39
|
getSelectedBlockClientId,
|
|
41
|
-
|
|
42
|
-
isBlockInsertionPointVisible
|
|
43
|
-
getSectionRootClientId
|
|
40
|
+
getSectionRootClientId,
|
|
41
|
+
isBlockInsertionPointVisible
|
|
44
42
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
45
43
|
const root = getSectionRootClientId();
|
|
46
44
|
return {
|
|
47
45
|
hasSelection: !!getSelectionStart().clientId,
|
|
48
|
-
|
|
46
|
+
insertionPoint: getInsertionPoint(),
|
|
49
47
|
blockOrder: getBlockOrder(root),
|
|
50
48
|
blockInsertionPointVisible: isBlockInsertionPointVisible(),
|
|
51
49
|
sectionRootClientId: root,
|
|
52
50
|
setInserterIsOpened: getSettings().__experimentalSetIsInserterOpened,
|
|
53
|
-
selectedBlockClientId: getSelectedBlockClientId()
|
|
54
|
-
hoveredBlockClientId: getHoveredBlockClientId()
|
|
51
|
+
selectedBlockClientId: getSelectedBlockClientId()
|
|
55
52
|
};
|
|
56
53
|
}, []);
|
|
54
|
+
|
|
55
|
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
|
57
56
|
const {
|
|
58
57
|
showInsertionPoint
|
|
59
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
58
|
+
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
60
59
|
|
|
61
60
|
// Defer the initial rendering to avoid the jumps due to the animation.
|
|
62
61
|
(0, _element.useEffect)(() => {
|
|
@@ -67,20 +66,18 @@ function ZoomOutModeInserters() {
|
|
|
67
66
|
clearTimeout(timeout);
|
|
68
67
|
};
|
|
69
68
|
}, []);
|
|
70
|
-
if (!isReady) {
|
|
69
|
+
if (!isReady || !hasSelection) {
|
|
71
70
|
return null;
|
|
72
71
|
}
|
|
73
72
|
return [undefined, ...blockOrder].map((clientId, index) => {
|
|
74
|
-
const shouldRenderInsertionPoint = blockInsertionPointVisible &&
|
|
73
|
+
const shouldRenderInsertionPoint = blockInsertionPointVisible && insertionPoint?.index === index;
|
|
75
74
|
const previousClientId = clientId;
|
|
76
75
|
const nextClientId = blockOrder[index];
|
|
77
|
-
const isSelected =
|
|
78
|
-
const isHovered = hoveredBlockClientId === previousClientId || hoveredBlockClientId === nextClientId;
|
|
76
|
+
const isSelected = selectedBlockClientId === previousClientId || selectedBlockClientId === nextClientId;
|
|
79
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_inbetween.default, {
|
|
80
78
|
previousClientId: previousClientId,
|
|
81
79
|
nextClientId: nextClientId,
|
|
82
|
-
children: !shouldRenderInsertionPoint && /*#__PURE__*/(0, _jsxRuntime.jsx)(_zoomOutModeInserterButton.default, {
|
|
83
|
-
isVisible: isSelected || isHovered,
|
|
80
|
+
children: !shouldRenderInsertionPoint && isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)(_zoomOutModeInserterButton.default, {
|
|
84
81
|
onClick: () => {
|
|
85
82
|
setInserterIsOpened({
|
|
86
83
|
rootClientId: sectionRootClientId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_element","_inbetween","_interopRequireDefault","_zoomOutModeInserterButton","_store","_lockUnlock","_jsxRuntime","ZoomOutModeInserters","isReady","setIsReady","useState","hasSelection","
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_inbetween","_interopRequireDefault","_zoomOutModeInserterButton","_store","_lockUnlock","_jsxRuntime","ZoomOutModeInserters","isReady","setIsReady","useState","hasSelection","insertionPoint","blockOrder","blockInsertionPointVisible","setInserterIsOpened","sectionRootClientId","selectedBlockClientId","useSelect","select","getSettings","getInsertionPoint","getBlockOrder","getSelectionStart","getSelectedBlockClientId","getSectionRootClientId","isBlockInsertionPointVisible","unlock","blockEditorStore","root","clientId","__experimentalSetIsInserterOpened","showInsertionPoint","useDispatch","useEffect","timeout","setTimeout","clearTimeout","undefined","map","index","shouldRenderInsertionPoint","previousClientId","nextClientId","isSelected","jsx","default","children","onClick","rootClientId","insertionIndex","tab","category","operation","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-mode-inserters.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockPopoverInbetween from '../block-popover/inbetween';\nimport ZoomOutModeInserterButton from './zoom-out-mode-inserter-button';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction ZoomOutModeInserters() {\n\tconst [ isReady, setIsReady ] = useState( false );\n\tconst {\n\t\thasSelection,\n\t\tinsertionPoint,\n\t\tblockOrder,\n\t\tblockInsertionPointVisible,\n\t\tsetInserterIsOpened,\n\t\tsectionRootClientId,\n\t\tselectedBlockClientId,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSettings,\n\t\t\tgetInsertionPoint,\n\t\t\tgetBlockOrder,\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetSectionRootClientId,\n\t\t\tisBlockInsertionPointVisible,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst root = getSectionRootClientId();\n\n\t\treturn {\n\t\t\thasSelection: !! getSelectionStart().clientId,\n\t\t\tinsertionPoint: getInsertionPoint(),\n\t\t\tblockOrder: getBlockOrder( root ),\n\t\t\tblockInsertionPointVisible: isBlockInsertionPointVisible(),\n\t\t\tsectionRootClientId: root,\n\t\t\tsetInserterIsOpened:\n\t\t\t\tgetSettings().__experimentalSetIsInserterOpened,\n\t\t\tselectedBlockClientId: getSelectedBlockClientId(),\n\t\t};\n\t}, [] );\n\n\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\tconst { showInsertionPoint } = unlock( useDispatch( blockEditorStore ) );\n\n\t// Defer the initial rendering to avoid the jumps due to the animation.\n\tuseEffect( () => {\n\t\tconst timeout = setTimeout( () => {\n\t\t\tsetIsReady( true );\n\t\t}, 500 );\n\t\treturn () => {\n\t\t\tclearTimeout( timeout );\n\t\t};\n\t}, [] );\n\n\tif ( ! isReady || ! hasSelection ) {\n\t\treturn null;\n\t}\n\n\treturn [ undefined, ...blockOrder ].map( ( clientId, index ) => {\n\t\tconst shouldRenderInsertionPoint =\n\t\t\tblockInsertionPointVisible && insertionPoint?.index === index;\n\n\t\tconst previousClientId = clientId;\n\t\tconst nextClientId = blockOrder[ index ];\n\n\t\tconst isSelected =\n\t\t\tselectedBlockClientId === previousClientId ||\n\t\t\tselectedBlockClientId === nextClientId;\n\n\t\treturn (\n\t\t\t<BlockPopoverInbetween\n\t\t\t\tkey={ index }\n\t\t\t\tpreviousClientId={ previousClientId }\n\t\t\t\tnextClientId={ nextClientId }\n\t\t\t>\n\t\t\t\t{ ! shouldRenderInsertionPoint && isSelected && (\n\t\t\t\t\t<ZoomOutModeInserterButton\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetInserterIsOpened( {\n\t\t\t\t\t\t\t\trootClientId: sectionRootClientId,\n\t\t\t\t\t\t\t\tinsertionIndex: index,\n\t\t\t\t\t\t\t\ttab: 'patterns',\n\t\t\t\t\t\t\t\tcategory: 'all',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tshowInsertionPoint( sectionRootClientId, index, {\n\t\t\t\t\t\t\t\toperation: 'insert',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockPopoverInbetween>\n\t\t);\n\t} );\n}\n\nexport default ZoomOutModeInserters;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,O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GAEcvC,oBAAoB","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = ZoomOutToolbar;
|
|
8
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
8
|
var _icons = require("@wordpress/icons");
|
|
10
9
|
var _components = require("@wordpress/components");
|
|
11
10
|
var _data = require("@wordpress/data");
|
|
@@ -18,10 +17,6 @@ var _shuffle = _interopRequireDefault(require("../block-toolbar/shuffle"));
|
|
|
18
17
|
var _navigableToolbar = _interopRequireDefault(require("../navigable-toolbar"));
|
|
19
18
|
var _lockUnlock = require("../../lock-unlock");
|
|
20
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
/**
|
|
22
|
-
* External dependencies
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
20
|
/**
|
|
26
21
|
* WordPress dependencies
|
|
27
22
|
*/
|
|
@@ -37,7 +32,6 @@ function ZoomOutToolbar({
|
|
|
37
32
|
const selected = (0, _data.useSelect)(select => {
|
|
38
33
|
const {
|
|
39
34
|
getBlock,
|
|
40
|
-
hasBlockMovingClientId,
|
|
41
35
|
getNextBlockClientId,
|
|
42
36
|
getPreviousBlockClientId,
|
|
43
37
|
canRemoveBlock,
|
|
@@ -74,7 +68,6 @@ function ZoomOutToolbar({
|
|
|
74
68
|
isPrevBlockTemplatePart = prevBlockType?.name === 'core/template-part';
|
|
75
69
|
}
|
|
76
70
|
return {
|
|
77
|
-
blockMovingMode: hasBlockMovingClientId(),
|
|
78
71
|
isBlockTemplatePart,
|
|
79
72
|
isNextBlockTemplatePart,
|
|
80
73
|
isPrevBlockTemplatePart,
|
|
@@ -84,7 +77,6 @@ function ZoomOutToolbar({
|
|
|
84
77
|
};
|
|
85
78
|
}, [clientId]);
|
|
86
79
|
const {
|
|
87
|
-
blockMovingMode,
|
|
88
80
|
isBlockTemplatePart,
|
|
89
81
|
isNextBlockTemplatePart,
|
|
90
82
|
isPrevBlockTemplatePart,
|
|
@@ -97,12 +89,9 @@ function ZoomOutToolbar({
|
|
|
97
89
|
__unstableSetEditorMode,
|
|
98
90
|
resetZoomLevel
|
|
99
91
|
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
100
|
-
const classNames = (0, _clsx.default)('zoom-out-toolbar', {
|
|
101
|
-
'is-block-moving-mode': !!blockMovingMode
|
|
102
|
-
});
|
|
103
92
|
const showBlockDraggable = canMove && !isBlockTemplatePart;
|
|
104
93
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_navigableToolbar.default, {
|
|
105
|
-
className:
|
|
94
|
+
className: "zoom-out-toolbar"
|
|
106
95
|
/* translators: accessibility text for the block toolbar */,
|
|
107
96
|
"aria-label": (0, _i18n.__)('Block tools')
|
|
108
97
|
// The variant is applied as "toolbar" when undefined, which is the black border style of the dropdown from the toolbar popover.
|
|
@@ -152,6 +141,7 @@ function ZoomOutToolbar({
|
|
|
152
141
|
label: (0, _i18n.__)('Delete'),
|
|
153
142
|
onClick: () => {
|
|
154
143
|
removeBlock(clientId);
|
|
144
|
+
__unstableContentRef.current?.focus();
|
|
155
145
|
}
|
|
156
146
|
})]
|
|
157
147
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_icons","_components","_data","_blocks","_i18n","_store","_blockDraggable","_blockMover","_shuffle","_navigableToolbar","_lockUnlock","_jsxRuntime","ZoomOutToolbar","clientId","__unstableContentRef","selected","useSelect","select","getBlock","hasBlockMovingClientId","getNextBlockClientId","getPreviousBlockClientId","canRemoveBlock","canMoveBlock","getSettings","blockEditorStore","__experimentalSetIsInserterOpened","setIsInserterOpened","getBlockType","blocksStore","name","blockType","isBlockTemplatePart","isNextBlockTemplatePart","nextClientId","nextName","nextBlockType","isPrevBlockTemplatePart","prevClientId","prevName","prevBlockType","blockMovingMode","canRemove","canMove","removeBlock","__unstableSetEditorMode","resetZoomLevel","unlock","useDispatch","classNames","clsx","showBlockDraggable","jsxs","default","className","__","variant","orientation","children","jsx","clientIds","draggableProps","Button","icon","dragHandle","label","iconSize","size","tabIndex","hideDragHandle","isBlockMoverUpButtonDisabled","isBlockMoverDownButtonDisabled","as","ToolbarButton","edit","onClick","current","focus","trash"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-toolbar.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { dragHandle, trash, edit } from '@wordpress/icons';\nimport { Button, ToolbarButton } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockDraggable from '../block-draggable';\nimport BlockMover from '../block-mover';\nimport Shuffle from '../block-toolbar/shuffle';\nimport NavigableToolbar from '../navigable-toolbar';\nimport { unlock } from '../../lock-unlock';\n\nexport default function ZoomOutToolbar( { clientId, __unstableContentRef } ) {\n\tconst selected = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlock,\n\t\t\t\thasBlockMovingClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tcanRemoveBlock,\n\t\t\t\tcanMoveBlock,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst { __experimentalSetIsInserterOpened: setIsInserterOpened } =\n\t\t\t\tgetSettings();\n\n\t\t\tconst { getBlockType } = select( blocksStore );\n\t\t\tconst { name } = getBlock( clientId );\n\t\t\tconst blockType = getBlockType( name );\n\t\t\tconst isBlockTemplatePart =\n\t\t\t\tblockType?.name === 'core/template-part';\n\n\t\t\tlet isNextBlockTemplatePart = false;\n\t\t\tconst nextClientId = getNextBlockClientId();\n\t\t\tif ( nextClientId ) {\n\t\t\t\tconst { name: nextName } = getBlock( nextClientId );\n\t\t\t\tconst nextBlockType = getBlockType( nextName );\n\t\t\t\tisNextBlockTemplatePart =\n\t\t\t\t\tnextBlockType?.name === 'core/template-part';\n\t\t\t}\n\n\t\t\tlet isPrevBlockTemplatePart = false;\n\t\t\tconst prevClientId = getPreviousBlockClientId();\n\t\t\tif ( prevClientId ) {\n\t\t\t\tconst { name: prevName } = getBlock( prevClientId );\n\t\t\t\tconst prevBlockType = getBlockType( prevName );\n\t\t\t\tisPrevBlockTemplatePart =\n\t\t\t\t\tprevBlockType?.name === 'core/template-part';\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tblockMovingMode: hasBlockMovingClientId(),\n\t\t\t\tisBlockTemplatePart,\n\t\t\t\tisNextBlockTemplatePart,\n\t\t\t\tisPrevBlockTemplatePart,\n\t\t\t\tcanRemove: canRemoveBlock( clientId ),\n\t\t\t\tcanMove: canMoveBlock( clientId ),\n\t\t\t\tsetIsInserterOpened,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst {\n\t\tblockMovingMode,\n\t\tisBlockTemplatePart,\n\t\tisNextBlockTemplatePart,\n\t\tisPrevBlockTemplatePart,\n\t\tcanRemove,\n\t\tcanMove,\n\t\tsetIsInserterOpened,\n\t} = selected;\n\n\tconst { removeBlock, __unstableSetEditorMode, resetZoomLevel } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tconst classNames = clsx( 'zoom-out-toolbar', {\n\t\t'is-block-moving-mode': !! blockMovingMode,\n\t} );\n\n\tconst showBlockDraggable = canMove && ! isBlockTemplatePart;\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName={ classNames }\n\t\t\t/* translators: accessibility text for the block toolbar */\n\t\t\taria-label={ __( 'Block tools' ) }\n\t\t\t// The variant is applied as \"toolbar\" when undefined, which is the black border style of the dropdown from the toolbar popover.\n\t\t\tvariant=\"unstyled\"\n\t\t\torientation=\"vertical\"\n\t\t>\n\t\t\t{ showBlockDraggable && (\n\t\t\t\t<BlockDraggable clientIds={ [ clientId ] }>\n\t\t\t\t\t{ ( draggableProps ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ dragHandle }\n\t\t\t\t\t\t\tclassName=\"block-selection-button_drag-handle zoom-out-toolbar-button\"\n\t\t\t\t\t\t\tlabel={ __( 'Drag' ) }\n\t\t\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t// Should not be able to tab to drag handle as this\n\t\t\t\t\t\t\t// button can only be used with a pointer device.\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t{ ...draggableProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockDraggable>\n\t\t\t) }\n\t\t\t{ ! isBlockTemplatePart && (\n\t\t\t\t<BlockMover\n\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\thideDragHandle\n\t\t\t\t\tisBlockMoverUpButtonDisabled={ isPrevBlockTemplatePart }\n\t\t\t\t\tisBlockMoverDownButtonDisabled={ isNextBlockTemplatePart }\n\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ canMove && canRemove && (\n\t\t\t\t<Shuffle clientId={ clientId } as={ ToolbarButton } />\n\t\t\t) }\n\n\t\t\t{ ! isBlockTemplatePart && (\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"zoom-out-toolbar-button\"\n\t\t\t\t\ticon={ edit }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t// Setting may be undefined.\n\t\t\t\t\t\tif ( typeof setIsInserterOpened === 'function' ) {\n\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableSetEditorMode( 'edit' );\n\t\t\t\t\t\tresetZoomLevel();\n\t\t\t\t\t\t__unstableContentRef.current?.focus();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ canRemove && ! isBlockTemplatePart && (\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"zoom-out-toolbar-button\"\n\t\t\t\t\ticon={ trash }\n\t\t\t\t\tlabel={ __( 'Delete' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</NavigableToolbar>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,QAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,iBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AAA2C,IAAAY,WAAA,GAAAZ,OAAA;AAtB3C;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAQe,SAASa,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,EAAG;EAC5E,MAAMC,QAAQ,GAAG,IAAAC,eAAS,EACvBC,MAAM,IAAM;IACb,MAAM;MACLC,QAAQ;MACRC,sBAAsB;MACtBC,oBAAoB;MACpBC,wBAAwB;MACxBC,cAAc;MACdC,YAAY;MACZC;IACD,CAAC,GAAGP,MAAM,CAAEQ,YAAiB,CAAC;IAE9B,MAAM;MAAEC,iCAAiC,EAAEC;IAAoB,CAAC,GAC/DH,WA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ACd,CACD,EACCxB,OAAO,IAAID,SAAS,iBACrB,IAAA/B,WAAA,CAAAgD,GAAA,EAACnD,QAAA,CAAA6C,OAAO;MAACxC,QAAQ,EAAGA,QAAU;MAAC2D,EAAE,EAAGC;IAAe,CAAE,CACrD,EAEC,CAAEzC,mBAAmB,iBACtB,IAAArB,WAAA,CAAAgD,GAAA,EAAC1D,WAAA,CAAAwE,aAAa;MACbnB,SAAS,EAAC,yBAAyB;MACnCS,IAAI,EAAGW,WAAM;MACbT,KAAK,EAAG,IAAAV,QAAE,EAAE,MAAO,CAAG;MACtBoB,OAAO,EAAGA,CAAA,KAAM;QACf;QACA,IAAK,OAAOhD,mBAAmB,KAAK,UAAU,EAAG;UAChDA,mBAAmB,CAAE,KAAM,CAAC;QAC7B;QACAkB,uBAAuB,CAAE,MAAO,CAAC;QACjCC,cAAc,CAAC,CAAC;QAChBhC,oBAAoB,CAAC8D,OAAO,EAAEC,KAAK,CAAC,CAAC;MACtC;IAAG,CACH,CACD,EAECnC,SAAS,IAAI,CAAEV,mBAAmB,iBACnC,IAAArB,WAAA,CAAAgD,GAAA,EAAC1D,WAAA,CAAAwE,aAAa;MACbnB,SAAS,EAAC,yBAAyB;MACnCS,IAAI,EAAGe,YAAO;MACdb,KAAK,EAAG,IAAAV,QAAE,EAAE,QAAS,CAAG;MACxBoB,OAAO,EAAGA,CAAA,KAAM;QACf/B,WAAW,CAAE/B,QAAS,CAAC;MACxB;IAAG,CACH,CACD;EAAA,CACgB,CAAC;AAErB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_icons","require","_components","_data","_blocks","_i18n","_store","_blockDraggable","_interopRequireDefault","_blockMover","_shuffle","_navigableToolbar","_lockUnlock","_jsxRuntime","ZoomOutToolbar","clientId","__unstableContentRef","selected","useSelect","select","getBlock","getNextBlockClientId","getPreviousBlockClientId","canRemoveBlock","canMoveBlock","getSettings","blockEditorStore","__experimentalSetIsInserterOpened","setIsInserterOpened","getBlockType","blocksStore","name","blockType","isBlockTemplatePart","isNextBlockTemplatePart","nextClientId","nextName","nextBlockType","isPrevBlockTemplatePart","prevClientId","prevName","prevBlockType","canRemove","canMove","removeBlock","__unstableSetEditorMode","resetZoomLevel","unlock","useDispatch","showBlockDraggable","jsxs","default","className","__","variant","orientation","children","jsx","clientIds","draggableProps","Button","icon","dragHandle","label","iconSize","size","tabIndex","hideDragHandle","isBlockMoverUpButtonDisabled","isBlockMoverDownButtonDisabled","as","ToolbarButton","edit","onClick","current","focus","trash"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-toolbar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { dragHandle, trash, edit } from '@wordpress/icons';\nimport { Button, ToolbarButton } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockDraggable from '../block-draggable';\nimport BlockMover from '../block-mover';\nimport Shuffle from '../block-toolbar/shuffle';\nimport NavigableToolbar from '../navigable-toolbar';\nimport { unlock } from '../../lock-unlock';\n\nexport default function ZoomOutToolbar( { clientId, __unstableContentRef } ) {\n\tconst selected = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlock,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tcanRemoveBlock,\n\t\t\t\tcanMoveBlock,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst { __experimentalSetIsInserterOpened: setIsInserterOpened } =\n\t\t\t\tgetSettings();\n\n\t\t\tconst { getBlockType } = select( blocksStore );\n\t\t\tconst { name } = getBlock( clientId );\n\t\t\tconst blockType = getBlockType( name );\n\t\t\tconst isBlockTemplatePart =\n\t\t\t\tblockType?.name === 'core/template-part';\n\n\t\t\tlet isNextBlockTemplatePart = false;\n\t\t\tconst nextClientId = getNextBlockClientId();\n\t\t\tif ( nextClientId ) {\n\t\t\t\tconst { name: nextName } = getBlock( nextClientId );\n\t\t\t\tconst nextBlockType = getBlockType( nextName );\n\t\t\t\tisNextBlockTemplatePart =\n\t\t\t\t\tnextBlockType?.name === 'core/template-part';\n\t\t\t}\n\n\t\t\tlet isPrevBlockTemplatePart = false;\n\t\t\tconst prevClientId = getPreviousBlockClientId();\n\t\t\tif ( prevClientId ) {\n\t\t\t\tconst { name: prevName } = getBlock( prevClientId );\n\t\t\t\tconst prevBlockType = getBlockType( prevName );\n\t\t\t\tisPrevBlockTemplatePart =\n\t\t\t\t\tprevBlockType?.name === 'core/template-part';\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisBlockTemplatePart,\n\t\t\t\tisNextBlockTemplatePart,\n\t\t\t\tisPrevBlockTemplatePart,\n\t\t\t\tcanRemove: canRemoveBlock( clientId ),\n\t\t\t\tcanMove: canMoveBlock( clientId ),\n\t\t\t\tsetIsInserterOpened,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst {\n\t\tisBlockTemplatePart,\n\t\tisNextBlockTemplatePart,\n\t\tisPrevBlockTemplatePart,\n\t\tcanRemove,\n\t\tcanMove,\n\t\tsetIsInserterOpened,\n\t} = selected;\n\n\tconst { removeBlock, __unstableSetEditorMode, resetZoomLevel } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tconst showBlockDraggable = canMove && ! isBlockTemplatePart;\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"zoom-out-toolbar\"\n\t\t\t/* translators: accessibility text for the block toolbar */\n\t\t\taria-label={ __( 'Block tools' ) }\n\t\t\t// The variant is applied as \"toolbar\" when undefined, which is the black border style of the dropdown from the toolbar popover.\n\t\t\tvariant=\"unstyled\"\n\t\t\torientation=\"vertical\"\n\t\t>\n\t\t\t{ showBlockDraggable && (\n\t\t\t\t<BlockDraggable clientIds={ [ clientId ] }>\n\t\t\t\t\t{ ( draggableProps ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ dragHandle }\n\t\t\t\t\t\t\tclassName=\"block-selection-button_drag-handle zoom-out-toolbar-button\"\n\t\t\t\t\t\t\tlabel={ __( 'Drag' ) }\n\t\t\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t// Should not be able to tab to drag handle as this\n\t\t\t\t\t\t\t// button can only be used with a pointer device.\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t{ ...draggableProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockDraggable>\n\t\t\t) }\n\t\t\t{ ! isBlockTemplatePart && (\n\t\t\t\t<BlockMover\n\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\thideDragHandle\n\t\t\t\t\tisBlockMoverUpButtonDisabled={ isPrevBlockTemplatePart }\n\t\t\t\t\tisBlockMoverDownButtonDisabled={ isNextBlockTemplatePart }\n\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ canMove && canRemove && (\n\t\t\t\t<Shuffle clientId={ clientId } as={ ToolbarButton } />\n\t\t\t) }\n\n\t\t\t{ ! isBlockTemplatePart && (\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"zoom-out-toolbar-button\"\n\t\t\t\t\ticon={ edit }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t// Setting may be undefined.\n\t\t\t\t\t\tif ( typeof setIsInserterOpened === 'function' ) {\n\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableSetEditorMode( 'edit' );\n\t\t\t\t\t\tresetZoomLevel();\n\t\t\t\t\t\t__unstableContentRef.current?.focus();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ canRemove && ! isBlockTemplatePart && (\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"zoom-out-toolbar-button\"\n\t\t\t\t\ticon={ trash }\n\t\t\t\t\tlabel={ __( 'Delete' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t\t\t__unstableContentRef.current?.focus();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</NavigableToolbar>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,QAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,iBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AAA2C,IAAAY,WAAA,GAAAZ,OAAA;AAjB3C;AACA;AACA;;AAOA;AACA;AACA;;AAQe,SAASa,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,EAAG;EAC5E,MAAMC,QAAQ,GAAG,IAAAC,eAAS,EACvBC,MAAM,IAAM;IACb,MAAM;MACLC,QAAQ;MACRC,oBAAoB;MACpBC,wBAAwB;MACxBC,cAAc;MACdC,YAAY;MACZC;IACD,CAAC,GAAGN,MAAM,CAAEO,YAAiB,CAAC;IAE9B,MAAM;MAAEC,iCAAiC,EAAEC;IAAoB,CAAC,GAC/DH,WAAW,CAAC,CAAC;IAEd,MAAM;MAAEI;IAAa,CAAC,GAAGV,MAAM,CAAEW,aAAY,CAAC;IAC9C,MAAM;MAAEC;IAAK,CAAC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I,EAAGW,WAAM;MACbT,KAAK,EAAG,IAAAV,QAAE,EAAE,MAAO,CAAG;MACtBoB,OAAO,EAAGA,CAAA,KAAM;QACf;QACA,IAAK,OAAO7C,mBAAmB,KAAK,UAAU,EAAG;UAChDA,mBAAmB,CAAE,KAAM,CAAC;QAC7B;QACAiB,uBAAuB,CAAE,MAAO,CAAC;QACjCC,cAAc,CAAC,CAAC;QAChB9B,oBAAoB,CAAC0D,OAAO,EAAEC,KAAK,CAAC,CAAC;MACtC;IAAG,CACH,CACD,EAECjC,SAAS,IAAI,CAAET,mBAAmB,iBACnC,IAAApB,WAAA,CAAA4C,GAAA,EAACvD,WAAA,CAAAqE,aAAa;MACbnB,SAAS,EAAC,yBAAyB;MACnCS,IAAI,EAAGe,YAAO;MACdb,KAAK,EAAG,IAAAV,QAAE,EAAE,QAAS,CAAG;MACxBoB,OAAO,EAAGA,CAAA,KAAM;QACf7B,WAAW,CAAE7B,QAAS,CAAC;QACvBC,oBAAoB,CAAC0D,OAAO,EAAEC,KAAK,CAAC,CAAC;MACtC;IAAG,CACH,CACD;EAAA,CACgB,CAAC;AAErB","ignoreList":[]}
|
|
@@ -54,10 +54,8 @@ function BlockVariationPicker({
|
|
|
54
54
|
}, variation.name))
|
|
55
55
|
}), allowSkip && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
56
56
|
className: "block-editor-block-variation-picker__skip",
|
|
57
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
58
|
-
|
|
59
|
-
, {
|
|
60
|
-
__next40pxDefaultSize: false,
|
|
57
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
58
|
+
__next40pxDefaultSize: true,
|
|
61
59
|
variant: "link",
|
|
62
60
|
onClick: () => onSelect(),
|
|
63
61
|
children: (0, _i18n.__)('Skip')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_icons","_jsxRuntime","BlockVariationPicker","icon","layout","label","__","instructions","variations","onSelect","allowSkip","classes","clsx","length","jsxs","Placeholder","className","children","jsx","role","map","variation","Button","__next40pxDefaultSize","variant","src","iconSize","onClick","description","title","name","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-variation-picker/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button, Placeholder } from '@wordpress/components';\nimport { layout } from '@wordpress/icons';\n\nfunction BlockVariationPicker( {\n\ticon = layout,\n\tlabel = __( 'Choose variation' ),\n\tinstructions = __( 'Select a variation to start with:' ),\n\tvariations,\n\tonSelect,\n\tallowSkip,\n} ) {\n\tconst classes = clsx( 'block-editor-block-variation-picker', {\n\t\t'has-many-variations': variations.length > 4,\n\t} );\n\n\treturn (\n\t\t<Placeholder\n\t\t\ticon={ icon }\n\t\t\tlabel={ label }\n\t\t\tinstructions={ instructions }\n\t\t\tclassName={ classes }\n\t\t>\n\t\t\t{ /*\n\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t */\n\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t<ul\n\t\t\t\tclassName=\"block-editor-block-variation-picker__variations\"\n\t\t\t\trole=\"list\"\n\t\t\t\taria-label={ __( 'Block variations' ) }\n\t\t\t>\n\t\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t\t<li key={ variation.name }>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\tvariation.icon && variation.icon.src\n\t\t\t\t\t\t\t\t\t? variation.icon.src\n\t\t\t\t\t\t\t\t\t: variation.icon\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticonSize={ 48 }\n\t\t\t\t\t\t\tonClick={ () => onSelect( variation ) }\n\t\t\t\t\t\t\tclassName=\"block-editor-block-variation-picker__variation\"\n\t\t\t\t\t\t\tlabel={ variation.description || variation.title }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span className=\"block-editor-block-variation-picker__variation-label\">\n\t\t\t\t\t\t\t{ variation.title }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t\t{ allowSkip && (\n\t\t\t\t<div className=\"block-editor-block-variation-picker__skip\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_icons","_jsxRuntime","BlockVariationPicker","icon","layout","label","__","instructions","variations","onSelect","allowSkip","classes","clsx","length","jsxs","Placeholder","className","children","jsx","role","map","variation","Button","__next40pxDefaultSize","variant","src","iconSize","onClick","description","title","name","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-variation-picker/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button, Placeholder } from '@wordpress/components';\nimport { layout } from '@wordpress/icons';\n\nfunction BlockVariationPicker( {\n\ticon = layout,\n\tlabel = __( 'Choose variation' ),\n\tinstructions = __( 'Select a variation to start with:' ),\n\tvariations,\n\tonSelect,\n\tallowSkip,\n} ) {\n\tconst classes = clsx( 'block-editor-block-variation-picker', {\n\t\t'has-many-variations': variations.length > 4,\n\t} );\n\n\treturn (\n\t\t<Placeholder\n\t\t\ticon={ icon }\n\t\t\tlabel={ label }\n\t\t\tinstructions={ instructions }\n\t\t\tclassName={ classes }\n\t\t>\n\t\t\t{ /*\n\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t */\n\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t<ul\n\t\t\t\tclassName=\"block-editor-block-variation-picker__variations\"\n\t\t\t\trole=\"list\"\n\t\t\t\taria-label={ __( 'Block variations' ) }\n\t\t\t>\n\t\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t\t<li key={ variation.name }>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\tvariation.icon && variation.icon.src\n\t\t\t\t\t\t\t\t\t? variation.icon.src\n\t\t\t\t\t\t\t\t\t: variation.icon\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticonSize={ 48 }\n\t\t\t\t\t\t\tonClick={ () => onSelect( variation ) }\n\t\t\t\t\t\t\tclassName=\"block-editor-block-variation-picker__variation\"\n\t\t\t\t\t\t\tlabel={ variation.description || variation.title }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span className=\"block-editor-block-variation-picker__variation-label\">\n\t\t\t\t\t\t\t{ variation.title }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t\t{ allowSkip && (\n\t\t\t\t<div className=\"block-editor-block-variation-picker__skip\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => onSelect() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Skip' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</Placeholder>\n\t);\n}\n\nexport default BlockVariationPicker;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IA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gB,SAAS,CAACO,WAAW,IAAIP,SAAS,CAACQ;QAAO,CAClD,CAAC,eACF,IAAA5B,WAAA,CAAAiB,GAAA;UAAMF,SAAS,EAAC,sDAAsD;UAAAC,QAAA,EACnEI,SAAS,CAACQ;QAAK,CACZ,CAAC;MAAA,GAhBER,SAAS,CAACS,IAiBhB,CACH;IAAC,CACA,CAAC,EAEHpB,SAAS,iBACV,IAAAT,WAAA,CAAAiB,GAAA;MAAKF,SAAS,EAAC,2CAA2C;MAAAC,QAAA,eACzD,IAAAhB,WAAA,CAAAiB,GAAA,EAACnB,WAAA,CAAAuB,MAAM;QACNC,qBAAqB;QACrBC,OAAO,EAAC,MAAM;QACdG,OAAO,EAAGA,CAAA,KAAMlB,QAAQ,CAAC,CAAG;QAAAQ,QAAA,EAE1B,IAAAX,QAAE,EAAE,MAAO;MAAC,CACP;IAAC,CACL,CACL;EAAA,CACW,CAAC;AAEhB;AAAC,IAAAyB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc/B,oBAAoB","ignoreList":[]}
|
|
@@ -34,10 +34,9 @@ function VariationsButtons({
|
|
|
34
34
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.VisuallyHidden, {
|
|
35
35
|
as: "legend",
|
|
36
36
|
children: (0, _i18n.__)('Transform to variation')
|
|
37
|
-
}), variations.map(variation => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
__next40pxDefaultSize: false,
|
|
37
|
+
}), variations.map(variation => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
38
|
+
__next40pxDefaultSize: true,
|
|
39
|
+
size: "compact",
|
|
41
40
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockIcon.default, {
|
|
42
41
|
icon: variation.icon,
|
|
43
42
|
showColors: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_i18n","_components","_data","_element","_icons","_blockIcon","_interopRequireDefault","_store","_lockUnlock","_jsxRuntime","VariationsButtons","className","onSelectVariation","selectedValue","variations","jsxs","children","jsx","VisuallyHidden","as","__","map","variation","Button","__next40pxDefaultSize","icon","default","showColors","isPressed","name","label","title","sprintf","onClick","showTooltip","VariationsDropdown","selectOptions","description","value","info","DropdownMenu","text","popoverProps","position","chevronDown","toggleProps","iconPosition","MenuGroup","MenuItemsChoice","choices","onSelect","VariationsToggleGroupControl","__experimentalToggleGroupControl","hideLabelFromVision","onChange","__nextHasNoMarginBottom","__experimentalToggleGroupControlOptionIcon","__experimentalBlockVariationTransforms","blockClientId","updateBlockAttributes","useDispatch","blockEditorStore","activeBlockVariation","isContentOnly","useSelect","select","getActiveBlockVariation","getBlockVariations","blocksStore","getBlockName","getBlockAttributes","getBlockEditingMode","hasContentRoleAttribute","unlock","isContentBlock","hasUniqueIcons","useMemo","variationIcons","Set","forEach","add","src","size","length","variationName","find","attributes","baseClass","showButtons","ButtonComponent","Component","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-variation-transforms/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItemsChoice,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction VariationsButtons( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\treturn (\n\t\t<fieldset className={ className }>\n\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t{ __( 'Transform to variation' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t<Button\n\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\tkey={ variation.name }\n\t\t\t\t\ticon={ <BlockIcon icon={ variation.icon } showColors /> }\n\t\t\t\t\tisPressed={ selectedValue === variation.name }\n\t\t\t\t\tlabel={\n\t\t\t\t\t\tselectedValue === variation.name\n\t\t\t\t\t\t\t? variation.title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: Name of the block variation */\n\t\t\t\t\t\t\t\t\t__( 'Transform to %s' ),\n\t\t\t\t\t\t\t\t\tvariation.title\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t\tonClick={ () => onSelectVariation( variation.name ) }\n\t\t\t\t\taria-label={ variation.title }\n\t\t\t\t\tshowTooltip\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</fieldset>\n\t);\n}\n\nfunction VariationsDropdown( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\tconst selectOptions = variations.map(\n\t\t( { name, title, description } ) => ( {\n\t\t\tvalue: name,\n\t\t\tlabel: title,\n\t\t\tinfo: description,\n\t\t} )\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName={ className }\n\t\t\tlabel={ __( 'Transform to variation' ) }\n\t\t\ttext={ __( 'Transform to variation' ) }\n\t\t\tpopoverProps={ {\n\t\t\t\tposition: 'bottom center',\n\t\t\t\tclassName: `${ className }__popover`,\n\t\t\t} }\n\t\t\ticon={ chevronDown }\n\t\t\ttoggleProps={ { iconPosition: 'right' } }\n\t\t>\n\t\t\t{ () => (\n\t\t\t\t<div className={ `${ className }__container` }>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItemsChoice\n\t\t\t\t\t\t\tchoices={ selectOptions }\n\t\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\t\tonSelect={ onSelectVariation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n\nfunction VariationsToggleGroupControl( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<ToggleGroupControl\n\t\t\t\tlabel={ __( 'Transform to variation' ) }\n\t\t\t\tvalue={ selectedValue }\n\t\t\t\thideLabelFromVision\n\t\t\t\tonChange={ onSelectVariation }\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t>\n\t\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ variation.name }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<BlockIcon icon={ variation.icon } showColors />\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ variation.name }\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tselectedValue === variation.name\n\t\t\t\t\t\t\t\t? variation.title\n\t\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: Name of the block variation */\n\t\t\t\t\t\t\t\t\t\t__( 'Transform to %s' ),\n\t\t\t\t\t\t\t\t\t\tvariation.title\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ToggleGroupControl>\n\t\t</div>\n\t);\n}\n\nfunction __experimentalBlockVariationTransforms( { blockClientId } ) {\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { activeBlockVariation, variations, isContentOnly } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\n\t\t\tconst { getBlockName, getBlockAttributes, getBlockEditingMode } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst name = blockClientId && getBlockName( blockClientId );\n\n\t\t\tconst { hasContentRoleAttribute } = unlock( select( blocksStore ) );\n\t\t\tconst isContentBlock = hasContentRoleAttribute( name );\n\n\t\t\treturn {\n\t\t\t\tactiveBlockVariation: getActiveBlockVariation(\n\t\t\t\t\tname,\n\t\t\t\t\tgetBlockAttributes( blockClientId )\n\t\t\t\t),\n\t\t\t\tvariations: name && getBlockVariations( name, 'transform' ),\n\t\t\t\tisContentOnly:\n\t\t\t\t\tgetBlockEditingMode( blockClientId ) === 'contentOnly' &&\n\t\t\t\t\t! isContentBlock,\n\t\t\t};\n\t\t},\n\t\t[ blockClientId ]\n\t);\n\n\tconst selectedValue = activeBlockVariation?.name;\n\n\t// Check if each variation has a unique icon.\n\tconst hasUniqueIcons = useMemo( () => {\n\t\tconst variationIcons = new Set();\n\t\tif ( ! variations ) {\n\t\t\treturn false;\n\t\t}\n\t\tvariations.forEach( ( variation ) => {\n\t\t\tif ( variation.icon ) {\n\t\t\t\tvariationIcons.add( variation.icon?.src || variation.icon );\n\t\t\t}\n\t\t} );\n\t\treturn variationIcons.size === variations.length;\n\t}, [ variations ] );\n\n\tconst onSelectVariation = ( variationName ) => {\n\t\tupdateBlockAttributes( blockClientId, {\n\t\t\t...variations.find( ( { name } ) => name === variationName )\n\t\t\t\t.attributes,\n\t\t} );\n\t};\n\n\tif ( ! variations?.length || isContentOnly ) {\n\t\treturn null;\n\t}\n\n\tconst baseClass = 'block-editor-block-variation-transforms';\n\n\t// Show buttons if there are more than 5 variations because the ToggleGroupControl does not wrap\n\tconst showButtons = variations.length > 5;\n\n\tconst ButtonComponent = showButtons\n\t\t? VariationsButtons\n\t\t: VariationsToggleGroupControl;\n\n\tconst Component = hasUniqueIcons ? ButtonComponent : VariationsDropdown;\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={ baseClass }\n\t\t\tonSelectVariation={ onSelectVariation }\n\t\t\tselectedValue={ selectedValue }\n\t\t\tvariations={ variations }\n\t\t/>\n\t);\n}\n\nexport default __experimentalBlockVariationTransforms;\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,UAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAvB3C;AACA;AACA;;AAgBA;AACA;AACA;;AAKA,SAASW,iBAAiBA,CAAE;EAC3BC,SAAS;EACTC,iBAAiB;EACjBC,aAAa;EACbC;AACD,CAAC,EAAG;EACH,oBACC,IAAAL,WAAA,CAAAM,IAAA;IAAUJ,SAAS,EAAGA,SAAW;IAAAK,QAAA,gBAChC,IAAAP,WAAA,CAAAQ,GAAA,EAAChB,WAAA,CAAAiB,cAAc;MAACC,EAAE,EAAC,QAAQ;MAAAH,QAAA,EACxB,IAAAI,QAAE,EAAE,wBAAyB;IAAC,CACjB,CAAC,EACfN,UAAU,CAACO,GAAG,CAAIC,SAAS,iBAC5B,IAAAb,WAAA,CAAAQ,GAAA,EAAChB,WAAA,CAAAsB;IACA;IAAA;MACAC,qBAAqB,EAAG,KAAO;MAE/BC,IAAI,eAAG,IAAAhB,WAAA,CAAAQ,GAAA,EAACZ,UAAA,CAAAqB,OAAS;QAACD,IAAI,EAAGH,SAAS,CAACG,IAAM;QAACE,UAAU;MAAA,CAAE,CAAG;MACzDC,SAAS,EAAGf,aAAa,KAAKS,SAAS,CAACO,IAAM;MAC9CC,KAAK,EACJjB,aAAa,KAAKS,SAAS,CAACO,IAAI,GAC7BP,SAAS,CAACS,KAAK,GACf,IAAAC,aAAO,GACP;M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AAU,CAAG,CAAC;EAEnB,MAAMF,iBAAiB,GAAKwE,aAAa,IAAM;IAC9CzB,qBAAqB,CAAED,aAAa,EAAE;MACrC,GAAG5C,UAAU,CAACuE,IAAI,CAAE,CAAE;QAAExD;MAAK,CAAC,KAAMA,IAAI,KAAKuD,aAAc,CAAC,CAC1DE;IACH,CAAE,CAAC;EACJ,CAAC;EAED,IAAK,CAAExE,UAAU,EAAEqE,MAAM,IAAIpB,aAAa,EAAG;IAC5C,OAAO,IAAI;EACZ;EAEA,MAAMwB,SAAS,GAAG,yCAAyC;;EAE3D;EACA,MAAMC,WAAW,GAAG1E,UAAU,CAACqE,MAAM,GAAG,CAAC;EAEzC,MAAMM,eAAe,GAAGD,WAAW,GAChC9E,iBAAiB,GACjByC,4BAA4B;EAE/B,MAAMuC,SAAS,GAAGf,cAAc,GAAGc,eAAe,GAAGtD,kBAAkB;EAEvE,oBACC,IAAA1B,WAAA,CAAAQ,GAAA,EAACyE,SAAS;IACT/E,SAAS,EAAG4E,SAAW;IACvB3E,iBAAiB,EAAGA,iBAAmB;IACvCC,aAAa,EAAGA,aAAe;IAC/BC,UAAU,EAAGA;EAAY,CACzB,CAAC;AAEJ;AAAC,IAAA6E,QAAA,GAAAC,OAAA,CAAAlE,OAAA,GAEc+B,sCAAsC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_i18n","_components","_data","_element","_icons","_blockIcon","_interopRequireDefault","_store","_lockUnlock","_jsxRuntime","VariationsButtons","className","onSelectVariation","selectedValue","variations","jsxs","children","jsx","VisuallyHidden","as","__","map","variation","Button","__next40pxDefaultSize","size","icon","default","showColors","isPressed","name","label","title","sprintf","onClick","showTooltip","VariationsDropdown","selectOptions","description","value","info","DropdownMenu","text","popoverProps","position","chevronDown","toggleProps","iconPosition","MenuGroup","MenuItemsChoice","choices","onSelect","VariationsToggleGroupControl","__experimentalToggleGroupControl","hideLabelFromVision","onChange","__nextHasNoMarginBottom","__experimentalToggleGroupControlOptionIcon","__experimentalBlockVariationTransforms","blockClientId","updateBlockAttributes","useDispatch","blockEditorStore","activeBlockVariation","isContentOnly","useSelect","select","getActiveBlockVariation","getBlockVariations","blocksStore","getBlockName","getBlockAttributes","getBlockEditingMode","hasContentRoleAttribute","unlock","isContentBlock","hasUniqueIcons","useMemo","variationIcons","Set","forEach","add","src","length","variationName","find","attributes","baseClass","showButtons","ButtonComponent","Component","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-variation-transforms/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItemsChoice,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction VariationsButtons( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\treturn (\n\t\t<fieldset className={ className }>\n\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t{ __( 'Transform to variation' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tkey={ variation.name }\n\t\t\t\t\ticon={ <BlockIcon icon={ variation.icon } showColors /> }\n\t\t\t\t\tisPressed={ selectedValue === variation.name }\n\t\t\t\t\tlabel={\n\t\t\t\t\t\tselectedValue === variation.name\n\t\t\t\t\t\t\t? variation.title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: Name of the block variation */\n\t\t\t\t\t\t\t\t\t__( 'Transform to %s' ),\n\t\t\t\t\t\t\t\t\tvariation.title\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t\tonClick={ () => onSelectVariation( variation.name ) }\n\t\t\t\t\taria-label={ variation.title }\n\t\t\t\t\tshowTooltip\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</fieldset>\n\t);\n}\n\nfunction VariationsDropdown( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\tconst selectOptions = variations.map(\n\t\t( { name, title, description } ) => ( {\n\t\t\tvalue: name,\n\t\t\tlabel: title,\n\t\t\tinfo: description,\n\t\t} )\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName={ className }\n\t\t\tlabel={ __( 'Transform to variation' ) }\n\t\t\ttext={ __( 'Transform to variation' ) }\n\t\t\tpopoverProps={ {\n\t\t\t\tposition: 'bottom center',\n\t\t\t\tclassName: `${ className }__popover`,\n\t\t\t} }\n\t\t\ticon={ chevronDown }\n\t\t\ttoggleProps={ { iconPosition: 'right' } }\n\t\t>\n\t\t\t{ () => (\n\t\t\t\t<div className={ `${ className }__container` }>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItemsChoice\n\t\t\t\t\t\t\tchoices={ selectOptions }\n\t\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\t\tonSelect={ onSelectVariation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n\nfunction VariationsToggleGroupControl( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<ToggleGroupControl\n\t\t\t\tlabel={ __( 'Transform to variation' ) }\n\t\t\t\tvalue={ selectedValue }\n\t\t\t\thideLabelFromVision\n\t\t\t\tonChange={ onSelectVariation }\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t>\n\t\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ variation.name }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<BlockIcon icon={ variation.icon } showColors />\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ variation.name }\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tselectedValue === variation.name\n\t\t\t\t\t\t\t\t? variation.title\n\t\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: Name of the block variation */\n\t\t\t\t\t\t\t\t\t\t__( 'Transform to %s' ),\n\t\t\t\t\t\t\t\t\t\tvariation.title\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ToggleGroupControl>\n\t\t</div>\n\t);\n}\n\nfunction __experimentalBlockVariationTransforms( { blockClientId } ) {\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { activeBlockVariation, variations, isContentOnly } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\n\t\t\tconst { getBlockName, getBlockAttributes, getBlockEditingMode } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst name = blockClientId && getBlockName( blockClientId );\n\n\t\t\tconst { hasContentRoleAttribute } = unlock( select( blocksStore ) );\n\t\t\tconst isContentBlock = hasContentRoleAttribute( name );\n\n\t\t\treturn {\n\t\t\t\tactiveBlockVariation: getActiveBlockVariation(\n\t\t\t\t\tname,\n\t\t\t\t\tgetBlockAttributes( blockClientId )\n\t\t\t\t),\n\t\t\t\tvariations: name && getBlockVariations( name, 'transform' ),\n\t\t\t\tisContentOnly:\n\t\t\t\t\tgetBlockEditingMode( blockClientId ) === 'contentOnly' &&\n\t\t\t\t\t! isContentBlock,\n\t\t\t};\n\t\t},\n\t\t[ blockClientId ]\n\t);\n\n\tconst selectedValue = activeBlockVariation?.name;\n\n\t// Check if each variation has a unique icon.\n\tconst hasUniqueIcons = useMemo( () => {\n\t\tconst variationIcons = new Set();\n\t\tif ( ! variations ) {\n\t\t\treturn false;\n\t\t}\n\t\tvariations.forEach( ( variation ) => {\n\t\t\tif ( variation.icon ) {\n\t\t\t\tvariationIcons.add( variation.icon?.src || variation.icon );\n\t\t\t}\n\t\t} );\n\t\treturn variationIcons.size === variations.length;\n\t}, [ variations ] );\n\n\tconst onSelectVariation = ( variationName ) => {\n\t\tupdateBlockAttributes( blockClientId, {\n\t\t\t...variations.find( ( { name } ) => name === variationName )\n\t\t\t\t.attributes,\n\t\t} );\n\t};\n\n\tif ( ! variations?.length || isContentOnly ) {\n\t\treturn null;\n\t}\n\n\tconst baseClass = 'block-editor-block-variation-transforms';\n\n\t// Show buttons if there are more than 5 variations because the ToggleGroupControl does not wrap\n\tconst showButtons = variations.length > 5;\n\n\tconst ButtonComponent = showButtons\n\t\t? VariationsButtons\n\t\t: VariationsToggleGroupControl;\n\n\tconst Component = hasUniqueIcons ? ButtonComponent : VariationsDropdown;\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={ baseClass }\n\t\t\tonSelectVariation={ onSelectVariation }\n\t\t\tselectedValue={ selectedValue }\n\t\t\tvariations={ variations }\n\t\t/>\n\t);\n}\n\nexport default __experimentalBlockVariationTransforms;\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,UAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAA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D;EACA,MAAMC,WAAW,GAAG1E,UAAU,CAACqE,MAAM,GAAG,CAAC;EAEzC,MAAMM,eAAe,GAAGD,WAAW,GAChC9E,iBAAiB,GACjB0C,4BAA4B;EAE/B,MAAMsC,SAAS,GAAGd,cAAc,GAAGa,eAAe,GAAGrD,kBAAkB;EAEvE,oBACC,IAAA3B,WAAA,CAAAQ,GAAA,EAACyE,SAAS;IACT/E,SAAS,EAAG4E,SAAW;IACvB3E,iBAAiB,EAAGA,iBAAmB;IACvCC,aAAa,EAAGA,aAAe;IAC/BC,UAAU,EAAGA;EAAY,CACzB,CAAC;AAEJ;AAAC,IAAA6E,QAAA,GAAAC,OAAA,CAAAjE,OAAA,GAEc+B,sCAAsC","ignoreList":[]}
|
|
@@ -56,10 +56,8 @@ function ButtonBlockAppender({
|
|
|
56
56
|
const label = hasSingleBlockType ? (0, _i18n.sprintf)(
|
|
57
57
|
// translators: %s: the name of the block when there is only one
|
|
58
58
|
(0, _i18n._x)('Add %s', 'directly add the only allowed block'), blockTitle) : (0, _i18n._x)('Add block', 'Generic label for block inserter button');
|
|
59
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
60
|
-
|
|
61
|
-
, {
|
|
62
|
-
__next40pxDefaultSize: false,
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
60
|
+
__next40pxDefaultSize: true,
|
|
63
61
|
ref: mergedInserterButtonRef,
|
|
64
62
|
onFocus: onFocus,
|
|
65
63
|
tabIndex: tabIndex,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_element","_i18n","_icons","_deprecated","_inserter","_compose","_jsxRuntime","ButtonBlockAppender","rootClientId","className","onFocus","tabIndex","onSelect","ref","inserterButtonRef","useRef","mergedInserterButtonRef","useMergeRefs","jsx","default","position","__experimentalIsQuick","onSelectOrClose","args","current","focus","renderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","isToggleButton","label","sprintf","_x","Button","__next40pxDefaultSize","clsx","onClick","undefined","showTooltip","children","Icon","icon","plus","isAppender","ButtonBlockerAppender","exports","forwardRef","props","deprecated","alternative","since","_default"],"sources":["@wordpress/block-editor/src/components/button-block-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { Icon, plus } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport { useMergeRefs } from '@wordpress/compose';\n\nfunction ButtonBlockAppender(\n\t{ rootClientId, className, onFocus, tabIndex, onSelect },\n\tref\n) {\n\tconst inserterButtonRef = useRef();\n\n\tconst mergedInserterButtonRef = useMergeRefs( [ inserterButtonRef, ref ] );\n\treturn (\n\t\t<Inserter\n\t\t\tposition=\"bottom center\"\n\t\t\trootClientId={ rootClientId }\n\t\t\t__experimentalIsQuick\n\t\t\tonSelectOrClose={ ( ...args ) => {\n\t\t\t\tif ( onSelect && typeof onSelect === 'function' ) {\n\t\t\t\t\tonSelect( ...args );\n\t\t\t\t}\n\t\t\t\tinserterButtonRef.current?.focus();\n\t\t\t} }\n\t\t\trenderToggle={ ( {\n\t\t\t\tonToggle,\n\t\t\t\tdisabled,\n\t\t\t\tisOpen,\n\t\t\t\tblockTitle,\n\t\t\t\thasSingleBlockType,\n\t\t\t} ) => {\n\t\t\t\tconst isToggleButton = ! hasSingleBlockType;\n\t\t\t\tconst label = hasSingleBlockType\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t\t\t\t\t_x(\n\t\t\t\t\t\t\t\t'Add %s',\n\t\t\t\t\t\t\t\t'directly add the only allowed block'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tblockTitle\n\t\t\t\t\t )\n\t\t\t\t\t: _x(\n\t\t\t\t\t\t\t'Add block',\n\t\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t );\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_element","_i18n","_icons","_deprecated","_inserter","_compose","_jsxRuntime","ButtonBlockAppender","rootClientId","className","onFocus","tabIndex","onSelect","ref","inserterButtonRef","useRef","mergedInserterButtonRef","useMergeRefs","jsx","default","position","__experimentalIsQuick","onSelectOrClose","args","current","focus","renderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","isToggleButton","label","sprintf","_x","Button","__next40pxDefaultSize","clsx","onClick","undefined","showTooltip","children","Icon","icon","plus","isAppender","ButtonBlockerAppender","exports","forwardRef","props","deprecated","alternative","since","_default"],"sources":["@wordpress/block-editor/src/components/button-block-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { Icon, plus } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport { useMergeRefs } from '@wordpress/compose';\n\nfunction ButtonBlockAppender(\n\t{ rootClientId, className, onFocus, tabIndex, onSelect },\n\tref\n) {\n\tconst inserterButtonRef = useRef();\n\n\tconst mergedInserterButtonRef = useMergeRefs( [ inserterButtonRef, ref ] );\n\treturn (\n\t\t<Inserter\n\t\t\tposition=\"bottom center\"\n\t\t\trootClientId={ rootClientId }\n\t\t\t__experimentalIsQuick\n\t\t\tonSelectOrClose={ ( ...args ) => {\n\t\t\t\tif ( onSelect && typeof onSelect === 'function' ) {\n\t\t\t\t\tonSelect( ...args );\n\t\t\t\t}\n\t\t\t\tinserterButtonRef.current?.focus();\n\t\t\t} }\n\t\t\trenderToggle={ ( {\n\t\t\t\tonToggle,\n\t\t\t\tdisabled,\n\t\t\t\tisOpen,\n\t\t\t\tblockTitle,\n\t\t\t\thasSingleBlockType,\n\t\t\t} ) => {\n\t\t\t\tconst isToggleButton = ! hasSingleBlockType;\n\t\t\t\tconst label = hasSingleBlockType\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t\t\t\t\t_x(\n\t\t\t\t\t\t\t\t'Add %s',\n\t\t\t\t\t\t\t\t'directly add the only allowed block'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tblockTitle\n\t\t\t\t\t )\n\t\t\t\t\t: _x(\n\t\t\t\t\t\t\t'Add block',\n\t\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t );\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tref={ mergedInserterButtonRef }\n\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'block-editor-button-block-appender'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\taria-haspopup={ isToggleButton ? 'true' : undefined }\n\t\t\t\t\t\taria-expanded={ isToggleButton ? isOpen : undefined }\n\t\t\t\t\t\t// Disable reason: There shouldn't be a case where this button is disabled but not visually hidden.\n\t\t\t\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ plus } />\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} }\n\t\t\tisAppender\n\t\t/>\n\t);\n}\n\n/**\n * Use `ButtonBlockAppender` instead.\n *\n * @deprecated\n */\nexport const ButtonBlockerAppender = forwardRef( ( props, ref ) => {\n\tdeprecated( `wp.blockEditor.ButtonBlockerAppender`, {\n\t\talternative: 'wp.blockEditor.ButtonBlockAppender',\n\t\tsince: '5.9',\n\t} );\n\n\treturn ButtonBlockAppender( props, ref );\n} );\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md\n */\nexport default forwardRef( ButtonBlockAppender );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAAkD,IAAAQ,WAAA,GAAAR,OAAA;AAlBlD;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAIA,SAASS,mBAAmBA,CAC3B;EAAEC,YAAY;EAAEC,SAAS;EAAEC,OAAO;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EACxDC,GAAG,EACF;EACD,MAAMC,iBAAiB,GAAG,IAAAC,eAAM,EAAC,CAAC;EAElC,MAAMC,uBAAuB,GAAG,IAAAC,qBAAY,EAAE,CAAEH,iBAAiB,EAAED,GAAG,CAAG,CAAC;EAC1E,oBACC,IAAAP,WAAA,CAAAY,GAAA,EAACd,SAAA,CAAAe,OAAQ;IACRC,QAAQ,EAAC,eAAe;IACxBZ,YAAY,EAAGA,YAAc;IAC7Ba,qBAAqB;IACrBC,eAAe,EAAGA,CAAE,GAAGC,IAAI,KAAM;MAChC,IAAKX,QAAQ,IAAI,OAAOA,QAAQ,KAAK,UAAU,EAAG;QACjDA,QAAQ,CAAE,GAAGW,IAAK,CAA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AAO9C,mBAAmB,CAAE2C,KAAK,EAAErC,GAAI,CAAC;AACzC,CAAE,CAAC;;AAEH;AACA;AACA;AAFA,IAAAyC,QAAA,GAAAN,OAAA,CAAA7B,OAAA,GAGe,IAAA8B,mBAAU,EAAE1C,mBAAoB,CAAC","ignoreList":[]}
|
|
@@ -86,10 +86,8 @@ const renderToggle = settings => ({
|
|
|
86
86
|
}),
|
|
87
87
|
'aria-expanded': isOpen
|
|
88
88
|
};
|
|
89
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
90
|
-
|
|
91
|
-
, {
|
|
92
|
-
__next40pxDefaultSize: false,
|
|
89
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
90
|
+
__next40pxDefaultSize: true,
|
|
93
91
|
...toggleProps,
|
|
94
92
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(LabeledColorIndicator, {
|
|
95
93
|
colorValue: colorValue,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_control","_jsxRuntime","WithToolsPanelItem","setting","children","panelId","props","clearValue","colorValue","onColorChange","gradientValue","onGradientChange","jsx","__experimentalToolsPanelItem","hasValue","label","onDeselect","isShownByDefault","undefined","className","resetAllFilter","LabeledColorIndicator","jsxs","__experimentalHStack","justify","ColorIndicator","FlexItem","title","renderToggle","settings","onToggle","isOpen","toggleProps","onClick","clsx","Button","__next40pxDefaultSize","ColorGradientSettingsDropdown","colors","disableCustomColors","disableCustomGradients","enableAlpha","gradients","__experimentalIsRenderedInSidebar","popoverProps","placement","offset","shift","Fragment","map","index","_setting$gradientValu","controlProps","clearable","showTitle","toggleSettings","Dropdown","renderContent","__experimentalDropdownContentWrapper","paddingSize","default"],"sources":["@wordpress/block-editor/src/components/colors-gradients/dropdown.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tColorIndicator,\n\tDropdown,\n\tFlexItem,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\t__experimentalHStack as HStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from './control';\n\n// When the `ColorGradientSettingsDropdown` controls are being rendered to a\n// `ToolsPanel` they must be wrapped in a `ToolsPanelItem`.\nconst WithToolsPanelItem = ( { setting, children, panelId, ...props } ) => {\n\tconst clearValue = () => {\n\t\tif ( setting.colorValue ) {\n\t\t\tsetting.onColorChange();\n\t\t} else if ( setting.gradientValue ) {\n\t\t\tsetting.onGradientChange();\n\t\t}\n\t};\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => {\n\t\t\t\treturn !! setting.colorValue || !! setting.gradientValue;\n\t\t\t} }\n\t\t\tlabel={ setting.label }\n\t\t\tonDeselect={ clearValue }\n\t\t\tisShownByDefault={\n\t\t\t\tsetting.isShownByDefault !== undefined\n\t\t\t\t\t? setting.isShownByDefault\n\t\t\t\t\t: true\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t\tpanelId={ panelId }\n\t\t\t// Pass resetAllFilter if supplied due to rendering via SlotFill\n\t\t\t// into parent ToolsPanel.\n\t\t\tresetAllFilter={ setting.resetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanelItem>\n\t);\n};\n\nconst LabeledColorIndicator = ( { colorValue, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ColorIndicator\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-indicator\"\n\t\t\tcolorValue={ colorValue }\n\t\t/>\n\t\t<FlexItem\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-name\"\n\t\t\ttitle={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\n// Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`\n// or as a `Button` if it isn't e.g. the controls are being rendered in\n// a `ToolsPanel`.\nconst renderToggle =\n\t( settings ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst { colorValue, label } = settings;\n\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: clsx(\n\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t{ 'is-open': isOpen }\n\t\t\t),\n\t\t\t'aria-expanded': isOpen,\n\t\t};\n\n\t\treturn (\n\t\t\t<Button
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_control","_jsxRuntime","WithToolsPanelItem","setting","children","panelId","props","clearValue","colorValue","onColorChange","gradientValue","onGradientChange","jsx","__experimentalToolsPanelItem","hasValue","label","onDeselect","isShownByDefault","undefined","className","resetAllFilter","LabeledColorIndicator","jsxs","__experimentalHStack","justify","ColorIndicator","FlexItem","title","renderToggle","settings","onToggle","isOpen","toggleProps","onClick","clsx","Button","__next40pxDefaultSize","ColorGradientSettingsDropdown","colors","disableCustomColors","disableCustomGradients","enableAlpha","gradients","__experimentalIsRenderedInSidebar","popoverProps","placement","offset","shift","Fragment","map","index","_setting$gradientValu","controlProps","clearable","showTitle","toggleSettings","Dropdown","renderContent","__experimentalDropdownContentWrapper","paddingSize","default"],"sources":["@wordpress/block-editor/src/components/colors-gradients/dropdown.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tColorIndicator,\n\tDropdown,\n\tFlexItem,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\t__experimentalHStack as HStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from './control';\n\n// When the `ColorGradientSettingsDropdown` controls are being rendered to a\n// `ToolsPanel` they must be wrapped in a `ToolsPanelItem`.\nconst WithToolsPanelItem = ( { setting, children, panelId, ...props } ) => {\n\tconst clearValue = () => {\n\t\tif ( setting.colorValue ) {\n\t\t\tsetting.onColorChange();\n\t\t} else if ( setting.gradientValue ) {\n\t\t\tsetting.onGradientChange();\n\t\t}\n\t};\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => {\n\t\t\t\treturn !! setting.colorValue || !! setting.gradientValue;\n\t\t\t} }\n\t\t\tlabel={ setting.label }\n\t\t\tonDeselect={ clearValue }\n\t\t\tisShownByDefault={\n\t\t\t\tsetting.isShownByDefault !== undefined\n\t\t\t\t\t? setting.isShownByDefault\n\t\t\t\t\t: true\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t\tpanelId={ panelId }\n\t\t\t// Pass resetAllFilter if supplied due to rendering via SlotFill\n\t\t\t// into parent ToolsPanel.\n\t\t\tresetAllFilter={ setting.resetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanelItem>\n\t);\n};\n\nconst LabeledColorIndicator = ( { colorValue, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ColorIndicator\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-indicator\"\n\t\t\tcolorValue={ colorValue }\n\t\t/>\n\t\t<FlexItem\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-name\"\n\t\t\ttitle={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\n// Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`\n// or as a `Button` if it isn't e.g. the controls are being rendered in\n// a `ToolsPanel`.\nconst renderToggle =\n\t( settings ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst { colorValue, label } = settings;\n\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: clsx(\n\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t{ 'is-open': isOpen }\n\t\t\t),\n\t\t\t'aria-expanded': isOpen,\n\t\t};\n\n\t\treturn (\n\t\t\t<Button __next40pxDefaultSize { ...toggleProps }>\n\t\t\t\t<LabeledColorIndicator\n\t\t\t\t\tcolorValue={ colorValue }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t/>\n\t\t\t</Button>\n\t\t);\n\t};\n\n// Renders a collection of color controls as dropdowns. Depending upon the\n// context in which these dropdowns are being rendered, they may be wrapped\n// in an `ItemGroup` with each dropdown's toggle as an `Item`, or alternatively,\n// the may be individually wrapped in a `ToolsPanelItem` with the toggle as\n// a regular `Button`.\n//\n// For more context see: https://github.com/WordPress/gutenberg/pull/40084\nexport default function ColorGradientSettingsDropdown( {\n\tcolors,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\tenableAlpha,\n\tgradients,\n\tsettings,\n\t__experimentalIsRenderedInSidebar,\n\t...props\n} ) {\n\tlet popoverProps;\n\tif ( __experimentalIsRenderedInSidebar ) {\n\t\tpopoverProps = {\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t};\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ settings.map( ( setting, index ) => {\n\t\t\t\tconst controlProps = {\n\t\t\t\t\tclearable: false,\n\t\t\t\t\tcolorValue: setting.colorValue,\n\t\t\t\t\tcolors,\n\t\t\t\t\tdisableCustomColors,\n\t\t\t\t\tdisableCustomGradients,\n\t\t\t\t\tenableAlpha,\n\t\t\t\t\tgradientValue: setting.gradientValue,\n\t\t\t\t\tgradients,\n\t\t\t\t\tlabel: setting.label,\n\t\t\t\t\tonColorChange: setting.onColorChange,\n\t\t\t\t\tonGradientChange: setting.onGradientChange,\n\t\t\t\t\tshowTitle: false,\n\t\t\t\t\t__experimentalIsRenderedInSidebar,\n\t\t\t\t\t...setting,\n\t\t\t\t};\n\t\t\t\tconst toggleSettings = {\n\t\t\t\t\tcolorValue: setting.gradientValue ?? setting.colorValue,\n\t\t\t\t\tlabel: setting.label,\n\t\t\t\t};\n\n\t\t\t\treturn (\n\t\t\t\t\tsetting && (\n\t\t\t\t\t\t// If not in an `ItemGroup` wrap the dropdown in a\n\t\t\t\t\t\t// `ToolsPanelItem`\n\t\t\t\t\t\t<WithToolsPanelItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tsetting={ setting }\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__dropdown\"\n\t\t\t\t\t\t\t\trenderToggle={ renderToggle( toggleSettings ) }\n\t\t\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-panel-color-gradient-settings__dropdown-content\">\n\t\t\t\t\t\t\t\t\t\t\t<ColorGradientControl\n\t\t\t\t\t\t\t\t\t\t\t\t{ ...controlProps }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</WithToolsPanelItem>\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAaA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA6C,IAAAG,WAAA,GAAAH,OAAA;AArB7C;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA,MAAMI,kBAAkB,GAAGA,CAAE;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,OAAO;EAAE,GAAGC;AAAM,CAAC,KAAM;EAC1E,MAAMC,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,CAACO,aAAa;QACpCgC,SAAS;QACT3B,KAAK,EAAEZ,OAAO,CAACY,KAAK;QACpBN,aAAa,EAAEN,OAAO,CAACM,aAAa;QACpCE,gBAAgB,EAAER,OAAO,CAACQ,gBAAgB;QAC1C2C,SAAS,EAAE,KAAK;QAChBX,iCAAiC;QACjC,GAAGxC;MACJ,CAAC;MACD,MAAMoD,cAAc,GAAG;QACtB/C,UAAU,GAAA2C,qBAAA,GAAEhD,OAAO,CAACO,aAAa,cAAAyC,qBAAA,cAAAA,qBAAA,GAAIhD,OAAO,CAACK,UAAU;QACvDO,KAAK,EAAEZ,OAAO,CAACY;MAChB,CAAC;MAED,OACCZ,OAAO;MAAA;MACN;MACA;MACA,IAAAF,WAAA,CAAAW,GAAA,EAACV,kBAAkB;QAElBC,OAAO,EAAGA,OAAS;QAAA,GACdG,KAAK;QAAAF,QAAA,eAEV,IAAAH,WAAA,CAAAW,GAAA,EAACb,WAAA,CAAAyD,QAAQ;UACRZ,YAAY,EAAGA,YAAc;UAC7BzB,SAAS,EAAC,4DAA4D;UACtES,YAAY,EAAGA,YAAY,CAAE2B,cAAe,CAAG;UAC/CE,aAAa,EAAGA,CAAA,kBACf,IAAAxD,WAAA,CAAAW,GAAA,EAACb,WAAA,CAAA2D,oCAAsB;YAACC,WAAW,EAAC,MAAM;YAAAvD,QAAA,eACzC,IAAAH,WAAA,CAAAW,GAAA;cAAKO,SAAS,EAAC,8DAA8D;cAAAf,QAAA,eAC5E,IAAAH,WAAA,CAAAW,GAAA,EAACZ,QAAA,CAAA4D,OAAoB;gBAAA,GACfR;cAAY,CACjB;YAAC,CACE;UAAC,CACiB;QACtB,CACH;MAAC,GAjBIF,KAkBa,CACpB;IAEH,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
|
|
@@ -221,7 +221,7 @@ function BorderPanel({
|
|
|
221
221
|
onDeselect: () => resetBorder(),
|
|
222
222
|
isShownByDefault: showBorderByDefault,
|
|
223
223
|
panelId: panelId,
|
|
224
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.
|
|
224
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BorderBoxControl, {
|
|
225
225
|
colors: colors,
|
|
226
226
|
enableAlpha: true,
|
|
227
227
|
enableStyle: showBorderStyle,
|