@wordpress/block-editor 12.21.0 → 12.23.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 +4 -0
- package/README.md +4 -0
- package/build/components/block-actions/index.js +2 -4
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.js +5 -5
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.native.js +5 -4
- package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build/components/block-list/block-crash-boundary.native.js +49 -0
- package/build/components/block-list/block-crash-boundary.native.js.map +1 -0
- package/build/components/block-list/block-crash-warning.native.js +24 -0
- package/build/components/block-list/block-crash-warning.native.js.map +1 -0
- package/build/components/block-list/block.js +11 -3
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +7 -2
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-mover/button.js +4 -1
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +5 -1
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +4 -1
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-settings/container.native.js +2 -1
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +36 -32
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +1 -3
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-switcher/index.js +4 -3
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +8 -5
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/shuffle.js +19 -10
- package/build/components/block-toolbar/shuffle.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +48 -8
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +14 -2
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +108 -11
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +11 -0
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +9 -2
- package/build/components/global-styles/advanced-panel.js.map +1 -1
- package/build/components/global-styles/background-panel.js +444 -0
- package/build/components/global-styles/background-panel.js.map +1 -0
- package/build/components/global-styles/color-panel.js +2 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +8 -33
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +3 -0
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build/components/global-styles/hooks.js +1 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +13 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +16 -15
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +2 -3
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/iframe/index.js +43 -34
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/index.js +3 -6
- package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +5 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
- package/build/components/inserter/library.js +2 -0
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/menu.js +11 -11
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +1 -1
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/search-items.js +36 -15
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +2 -3
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/tabs.js +1 -2
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js +36 -0
- package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -0
- package/build/components/keyboard-shortcuts/index.js +11 -0
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +18 -12
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +4 -11
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/index.js +17 -2
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-list-view-collapse-items.js +47 -0
- package/build/components/list-view/use-list-view-collapse-items.js.map +1 -0
- package/build/components/list-view/utils.js +5 -3
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/rich-text/index.js +14 -11
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +17 -11
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +2 -2
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/with-deprecations.js +0 -3
- package/build/components/rich-text/with-deprecations.js.map +1 -1
- package/build/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
- package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +50 -36
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/use-block-display-information/index.js +4 -6
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +4 -0
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/warning/index.native.js +9 -4
- package/build/components/warning/index.native.js.map +1 -1
- package/build/hooks/anchor.js +9 -10
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +85 -402
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/index.js +9 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout-child.js +28 -6
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/layout.js +21 -10
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +1 -1
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-zoom-out.js +47 -0
- package/build/hooks/use-zoom-out.js.map +1 -0
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/private-apis.js +6 -1
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +5 -1
- package/build/private-apis.native.js.map +1 -1
- package/build/store/private-actions.js +13 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-keys.js +2 -1
- package/build/store/private-keys.js.map +1 -1
- package/build/store/private-selectors.js +24 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +53 -26
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +34 -32
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +7 -1
- package/build/store/utils.js.map +1 -1
- package/build/utils/transform-styles/index.js +2 -1
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +2 -4
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +5 -5
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.native.js +5 -4
- package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build-module/components/block-list/block-crash-boundary.native.js +42 -0
- package/build-module/components/block-list/block-crash-boundary.native.js.map +1 -0
- package/build-module/components/block-list/block-crash-warning.native.js +15 -0
- package/build-module/components/block-list/block-crash-warning.native.js.map +1 -0
- package/build-module/components/block-list/block.js +11 -3
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +7 -2
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-mover/button.js +4 -1
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +5 -1
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +4 -1
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +3 -2
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +37 -33
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +1 -3
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +4 -3
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +8 -5
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/shuffle.js +19 -10
- package/build-module/components/block-toolbar/shuffle.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +50 -10
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +14 -2
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +109 -12
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +12 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +9 -2
- package/build-module/components/global-styles/advanced-panel.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +430 -0
- package/build-module/components/global-styles/background-panel.js.map +1 -0
- package/build-module/components/global-styles/color-panel.js +2 -1
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +9 -34
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +3 -0
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -0
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +17 -16
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +1 -2
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/iframe/index.js +43 -34
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.js +3 -6
- package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +5 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
- package/build-module/components/inserter/library.js +2 -0
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/menu.js +11 -11
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/search-items.js +33 -15
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.js +2 -3
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/tabs.js +1 -2
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js +28 -0
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/index.js +11 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +19 -13
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +6 -13
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/index.js +17 -2
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-list-view-collapse-items.js +40 -0
- package/build-module/components/list-view/use-list-view-collapse-items.js.map +1 -0
- package/build-module/components/list-view/utils.js +2 -1
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/rich-text/index.js +15 -12
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +16 -11
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +2 -2
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/with-deprecations.js +0 -3
- package/build-module/components/rich-text/with-deprecations.js.map +1 -1
- package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
- package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +50 -36
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +5 -7
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +4 -0
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/warning/index.native.js +9 -4
- package/build-module/components/warning/index.native.js.map +1 -1
- package/build-module/hooks/anchor.js +10 -11
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +82 -397
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/index.js +3 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout-child.js +28 -6
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/layout.js +21 -10
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +1 -1
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +41 -0
- package/build-module/hooks/use-zoom-out.js.map +1 -0
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/private-apis.js +7 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +5 -1
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/private-actions.js +12 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-keys.js +1 -0
- package/build-module/store/private-keys.js.map +1 -1
- package/build-module/store/private-selectors.js +22 -4
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +52 -26
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +35 -33
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +6 -1
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +2 -1
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +18 -1
- package/build-style/content.css +18 -1
- package/build-style/style-rtl.css +92 -99
- package/build-style/style.css +92 -99
- package/package.json +31 -31
- package/src/components/block-actions/index.js +2 -8
- package/src/components/block-bindings-toolbar-indicator/style.scss +10 -8
- package/src/components/block-heading-level-dropdown/README.md +5 -5
- package/src/components/block-heading-level-dropdown/index.js +5 -5
- package/src/components/block-heading-level-dropdown/index.native.js +5 -4
- package/src/components/block-list/block-crash-boundary.native.js +43 -0
- package/src/components/block-list/block-crash-warning.native.js +19 -0
- package/src/components/block-list/block.js +19 -3
- package/src/components/block-list/block.native.js +14 -7
- package/src/components/block-list/content.scss +16 -0
- package/src/components/block-mover/button.js +4 -1
- package/src/components/block-mover/index.js +8 -1
- package/src/components/block-patterns-list/index.js +22 -17
- package/src/components/block-preview/style.scss +28 -0
- package/src/components/block-settings/container.native.js +5 -1
- package/src/components/block-settings-menu/block-settings-dropdown.js +49 -58
- package/src/components/block-settings-menu-controls/README.md +0 -9
- package/src/components/block-settings-menu-controls/index.js +1 -6
- package/src/components/block-switcher/index.js +5 -3
- package/src/components/block-switcher/style.scss +1 -1
- package/src/components/block-toolbar/index.js +25 -20
- package/src/components/block-toolbar/shuffle.js +20 -14
- package/src/components/block-toolbar/style.scss +1 -1
- package/src/components/block-toolbar/test/index.native.js +1 -7
- package/src/components/block-tools/block-selection-button.js +66 -9
- package/src/components/block-tools/index.js +18 -1
- package/src/components/button-block-appender/content.scss +5 -1
- package/src/components/child-layout-control/index.js +147 -35
- package/src/components/convert-to-group-buttons/toolbar.js +13 -1
- package/src/components/default-block-appender/content.scss +2 -2
- package/src/components/global-styles/advanced-panel.js +8 -2
- package/src/components/global-styles/background-panel.js +591 -0
- package/src/components/global-styles/color-panel.js +2 -1
- package/src/components/global-styles/dimensions-panel.js +9 -34
- package/src/components/global-styles/get-global-styles-changes.js +3 -0
- package/src/components/global-styles/hooks.js +1 -0
- package/src/components/global-styles/index.js +4 -0
- package/src/components/global-styles/style.scss +78 -1
- package/src/{hooks/test/background.js → components/global-styles/test/background-panel.js} +36 -1
- package/src/components/global-styles/test/get-global-styles-changes.js +22 -3
- package/src/components/global-styles/test/use-global-styles-output.js +40 -9
- package/src/components/global-styles/use-global-styles-output.js +30 -17
- package/src/components/global-styles/utils.js +1 -18
- package/src/components/iframe/index.js +79 -53
- package/src/components/inserter/block-patterns-explorer/index.js +2 -9
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +7 -1
- package/src/components/inserter/block-patterns-tab/index.js +1 -0
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +5 -0
- package/src/components/inserter/library.js +4 -0
- package/src/components/inserter/menu.js +12 -11
- package/src/components/inserter/mobile-tab-navigation.js +1 -1
- package/src/components/inserter/search-items.js +37 -15
- package/src/components/inserter/search-results.js +1 -2
- package/src/components/inserter/style.scss +6 -12
- package/src/components/inserter/tabs.js +1 -2
- package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +31 -0
- package/src/components/keyboard-shortcuts/index.js +11 -0
- package/src/components/link-control/style.scss +0 -5
- package/src/components/list-view/block-select-button.js +15 -19
- package/src/components/list-view/block.js +12 -21
- package/src/components/list-view/index.js +18 -1
- package/src/components/list-view/style.scss +38 -28
- package/src/components/list-view/use-list-view-collapse-items.js +33 -0
- package/src/components/list-view/utils.js +4 -1
- package/src/components/rich-text/README.md +6 -0
- package/src/components/rich-text/index.js +30 -13
- package/src/components/rich-text/index.native.js +14 -11
- package/src/components/rich-text/native/get-format-colors.native.js +1 -1
- package/src/components/rich-text/native/index.native.js +2 -2
- package/src/components/rich-text/with-deprecations.js +0 -3
- package/src/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
- package/src/components/url-popover/image-url-input-ui.js +68 -51
- package/src/components/use-block-display-information/index.js +8 -10
- package/src/components/use-moving-animation/index.js +1 -0
- package/src/components/warning/index.native.js +19 -15
- package/src/hooks/anchor.js +43 -61
- package/src/hooks/background.js +100 -516
- package/src/hooks/index.js +3 -0
- package/src/hooks/layout-child.js +44 -8
- package/src/hooks/layout.js +22 -18
- package/src/hooks/position.js +1 -1
- package/src/hooks/test/__snapshots__/anchor.native.js.snap +7 -0
- package/src/hooks/test/anchor.native.js +32 -0
- package/src/hooks/use-zoom-out.js +36 -0
- package/src/index.js +1 -0
- package/src/private-apis.js +13 -1
- package/src/private-apis.native.js +4 -0
- package/src/store/private-actions.js +12 -0
- package/src/store/private-keys.js +1 -0
- package/src/store/private-selectors.js +54 -27
- package/src/store/reducer.js +63 -41
- package/src/store/selectors.js +195 -180
- package/src/store/test/private-actions.js +10 -0
- package/src/store/test/private-selectors.js +13 -0
- package/src/store/test/reducer.js +26 -0
- package/src/store/test/selectors.js +90 -199
- package/src/store/utils.js +13 -0
- package/src/style.scss +0 -2
- package/src/utils/transform-styles/index.js +2 -1
- package/tsconfig.json +1 -0
- package/build/utils/calculate-scale.js +0 -17
- package/build/utils/calculate-scale.js.map +0 -1
- package/build-module/utils/calculate-scale.js +0 -11
- package/build-module/utils/calculate-scale.js.map +0 -1
- package/src/hooks/anchor.scss +0 -4
- package/src/hooks/background.scss +0 -75
- package/src/utils/calculate-scale.js +0 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Pressable","View","classnames","useCallback","useMemo","useState","useRef","memo","GlobalStylesContext","getMergedGlobalStyles","useMobileGlobalStylesColors","useGlobalStyles","withFilters","__experimentalGetAccessibleBlockLabel","getAccessibleBlockLabel","getBlockType","getDefaultBlockName","isUnmodifiedBlock","isUnmodifiedDefaultBlock","switchToBlockType","useDispatch","useSelect","withDispatch","withSelect","compose","ifCondition","BlockEdit","BlockDraggable","BlockInvalidWarning","BlockOutline","store","blockEditorStore","useLayout","useScrollUponInsertion","useSettings","unlock","EMPTY_ARRAY","mergeWrapperProps","propsA","propsB","newProps","hasOwnProperty","className","style","BlockWrapper","accessibilityLabel","blockCategory","children","clientId","draggingClientId","draggingEnabled","hasInnerBlocks","isDescendentBlockSelected","isSelected","isTouchable","marginHorizontal","marginVertical","name","onFocus","blockWrapperStyles","flex","blockWrapperStyle","accessible","ref","isLayoutCalculated","setIsLayoutCalculated","elementRef","onLayout","createElement","accessibilityRole","disabled","onPress","enabled","testID","BlockListBlock","attributes","blockWidth","blockWrapperWidth","canRemove","contentStyle","isLocked","isSelectionEnabled","isStackedHorizontally","isValid","onDeleteBlock","onInsertBlocksAfter","onMerge","onReplace","parentBlockAlignment","parentWidth","rootClientId","setAttributes","toggleSelection","wrapperProps","baseGlobalStyles","blockType","isDescendantOfParentSelected","isParentSelected","order","mayDisplayControls","blockEditingMode","select","getBlockCount","getBlockHierarchyRootClientId","getBlockIndex","getBlockParents","getSelectedBlockClientId","getSettings","hasSelectedInnerBlock","getBlockName","isFirstMultiSelectedBlock","getMultiSelectedBlockClientIds","getBlockEditingMode","currentBlockType","currentBlockCategory","category","blockOrder","descendentBlockSelected","selectedBlockClientId","parents","parentSelected","selectedParents","descendantOfParentSelected","includes","blockHasInnerBlocks","isDraggingEnabled","currentDraggingClientId","globalStylesBaseStyles","__experimentalGlobalStylesBaseStyles","every","id","removeBlock","selectBlock","initialBlockWidth","setBlockWidth","parentLayout","defaultColors","globalStyle","fontSizes","onRemove","nativeEvent","layoutWidth","Math","floor","layout","width","getEditWrapperProps","mergedStyle","JSON","stringify","Object","fromEntries","entries","filter","key","BLOCK_STYLE_ATTRIBUTES","isFocused","Provider","value","insertBlocksAfter","undefined","mergeBlocks","__unstableParentLayout","keys","length","applyWithSelect","isBlockSelected","getBlockMode","getTemplateLock","getBlockWithoutAttributes","getBlockAttributes","canRemoveBlock","canMoveBlock","block","templateLock","canMove","mode","applyWithDispatch","dispatch","ownProps","registry","updateBlockAttributes","insertBlocks","replaceBlocks","__unstableMarkLastChangeAsPersistent","moveBlocksToPosition","newAttributes","multiSelectedBlockClientIds","clientIds","onInsertBlocks","blocks","index","forward","getPreviousBlockClientId","getNextBlockClientId","getBlock","getBlockOrder","getBlockRootClientId","canInsertBlockType","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","firstClientId","batch","replacement","nextRootClientId","rootAttributes","previousRootAttributes","nextBlockClientId","previousBlockClientId","previousRootClientId","indexToSelect","initialPosition","selectionEnabled"],"sources":["@wordpress/block-editor/src/components/block-list/block.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Pressable, View } from 'react-native';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n\tuseRef,\n\tmemo,\n} from '@wordpress/element';\nimport {\n\tGlobalStylesContext,\n\tgetMergedGlobalStyles,\n\tuseMobileGlobalStylesColors,\n\tuseGlobalStyles,\n\twithFilters,\n} from '@wordpress/components';\nimport {\n\t__experimentalGetAccessibleBlockLabel as getAccessibleBlockLabel,\n\tgetBlockType,\n\tgetDefaultBlockName,\n\tisUnmodifiedBlock,\n\tisUnmodifiedDefaultBlock,\n\tswitchToBlockType,\n} from '@wordpress/blocks';\nimport {\n\tuseDispatch,\n\tuseSelect,\n\twithDispatch,\n\twithSelect,\n} from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockEdit from '../block-edit';\nimport BlockDraggable from '../block-draggable';\nimport BlockInvalidWarning from './block-invalid-warning';\nimport BlockOutline from './block-outline';\nimport { store as blockEditorStore } from '../../store';\nimport { useLayout } from './layout';\nimport useScrollUponInsertion from './use-scroll-upon-insertion';\nimport { useSettings } from '../use-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Merges wrapper props with special handling for classNames and styles.\n *\n * @param {Object} propsA\n * @param {Object} propsB\n *\n * @return {Object} Merged props.\n */\nfunction mergeWrapperProps( propsA, propsB ) {\n\tconst newProps = {\n\t\t...propsA,\n\t\t...propsB,\n\t};\n\n\t// May be set to undefined, so check if the property is set!\n\tif (\n\t\tpropsA?.hasOwnProperty( 'className' ) &&\n\t\tpropsB?.hasOwnProperty( 'className' )\n\t) {\n\t\tnewProps.className = classnames( propsA.className, propsB.className );\n\t}\n\n\tif (\n\t\tpropsA?.hasOwnProperty( 'style' ) &&\n\t\tpropsB?.hasOwnProperty( 'style' )\n\t) {\n\t\tnewProps.style = { ...propsA.style, ...propsB.style };\n\t}\n\n\treturn newProps;\n}\n\nfunction BlockWrapper( {\n\taccessibilityLabel,\n\tblockCategory,\n\tchildren,\n\tclientId,\n\tdraggingClientId,\n\tdraggingEnabled,\n\thasInnerBlocks,\n\tisDescendentBlockSelected,\n\tisSelected,\n\tisTouchable,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonFocus,\n} ) {\n\tconst blockWrapperStyles = { flex: 1 };\n\tconst blockWrapperStyle = [\n\t\tblockWrapperStyles,\n\t\t{\n\t\t\tmarginVertical,\n\t\t\tmarginHorizontal,\n\t\t},\n\t];\n\tconst accessible = ! ( isSelected || isDescendentBlockSelected );\n\n\tconst ref = useRef();\n\tconst [ isLayoutCalculated, setIsLayoutCalculated ] = useState();\n\tuseScrollUponInsertion( {\n\t\tclientId,\n\t\tisSelected,\n\t\tisLayoutCalculated,\n\t\telementRef: ref,\n\t} );\n\tconst onLayout = useCallback( () => {\n\t\tsetIsLayoutCalculated( true );\n\t}, [] );\n\n\treturn (\n\t\t<Pressable\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessible={ accessible }\n\t\t\tdisabled={ ! isTouchable }\n\t\t\tonPress={ onFocus }\n\t\t\tstyle={ blockWrapperStyle }\n\t\t\tref={ ref }\n\t\t\tonLayout={ onLayout }\n\t\t>\n\t\t\t<BlockOutline\n\t\t\t\tblockCategory={ blockCategory }\n\t\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tname={ name }\n\t\t\t/>\n\t\t\t<BlockDraggable\n\t\t\t\tclientId={ clientId }\n\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\tenabled={ draggingEnabled }\n\t\t\t\ttestID=\"draggable-trigger-content\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</BlockDraggable>\n\t\t</Pressable>\n\t);\n}\n\nfunction BlockListBlock( {\n\tattributes,\n\tblockWidth: blockWrapperWidth,\n\tcanRemove,\n\tclientId,\n\tcontentStyle,\n\tisLocked,\n\tisSelected,\n\tisSelectionEnabled,\n\tisStackedHorizontally,\n\tisValid,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonDeleteBlock,\n\tonInsertBlocksAfter,\n\tonMerge,\n\tonReplace,\n\tparentBlockAlignment,\n\tparentWidth,\n\trootClientId,\n\tsetAttributes,\n\ttoggleSelection,\n\twrapperProps,\n} ) {\n\tconst {\n\t\tbaseGlobalStyles,\n\t\tblockCategory,\n\t\tblockType,\n\t\tdraggingClientId,\n\t\tdraggingEnabled,\n\t\thasInnerBlocks,\n\t\tisDescendantOfParentSelected,\n\t\tisDescendentBlockSelected,\n\t\tisParentSelected,\n\t\torder,\n\t\tmayDisplayControls,\n\t\tblockEditingMode,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockHierarchyRootClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetSettings,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlockName,\n\t\t\t\tisFirstMultiSelectedBlock,\n\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentBlockType = getBlockType( name || 'core/missing' );\n\t\t\tconst currentBlockCategory = currentBlockType?.category;\n\t\t\tconst blockOrder = getBlockIndex( clientId );\n\t\t\tconst descendentBlockSelected = hasSelectedInnerBlock(\n\t\t\t\tclientId,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\t\tconst parents = getBlockParents( clientId, true );\n\t\t\tconst parentSelected =\n\t\t\t\t// Set false as a default value to prevent re-render when it's changed from null to false.\n\t\t\t\t( selectedBlockClientId || false ) &&\n\t\t\t\tselectedBlockClientId === rootClientId;\n\n\t\t\tconst selectedParents = clientId ? parents : [];\n\t\t\tconst descendantOfParentSelected =\n\t\t\t\tselectedParents.includes( rootClientId );\n\t\t\tconst blockHasInnerBlocks = getBlockCount( clientId ) > 0;\n\n\t\t\t// For blocks with inner blocks, we only enable the dragging in the nested\n\t\t\t// blocks if any of them are selected. This way we prevent the long-press\n\t\t\t// gesture from being disabled for elements within the block UI.\n\t\t\tconst isDraggingEnabled =\n\t\t\t\t! blockHasInnerBlocks ||\n\t\t\t\tisSelected ||\n\t\t\t\t! descendentBlockSelected;\n\t\t\t// Dragging nested blocks is not supported yet. For this reason, the block to be dragged\n\t\t\t// will be the top in the hierarchy.\n\t\t\tconst currentDraggingClientId =\n\t\t\t\tgetBlockHierarchyRootClientId( clientId );\n\n\t\t\tconst globalStylesBaseStyles =\n\t\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles;\n\n\t\t\treturn {\n\t\t\t\tbaseGlobalStyles: globalStylesBaseStyles,\n\t\t\t\tblockCategory: currentBlockCategory,\n\t\t\t\tblockType: currentBlockType,\n\t\t\t\tdraggingClientId: currentDraggingClientId,\n\t\t\t\tdraggingEnabled: isDraggingEnabled,\n\t\t\t\thasInnerBlocks: blockHasInnerBlocks,\n\t\t\t\tisDescendantOfParentSelected: descendantOfParentSelected,\n\t\t\t\tisDescendentBlockSelected: descendentBlockSelected,\n\t\t\t\tisParentSelected: parentSelected,\n\t\t\t\torder: blockOrder,\n\t\t\t\tmayDisplayControls:\n\t\t\t\t\tisSelected ||\n\t\t\t\t\t( isFirstMultiSelectedBlock( clientId ) &&\n\t\t\t\t\t\tgetMultiSelectedBlockClientIds().every(\n\t\t\t\t\t\t\t( id ) => getBlockName( id ) === name\n\t\t\t\t\t\t) ),\n\t\t\t\tblockEditingMode: getBlockEditingMode( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, isSelected, name, rootClientId ]\n\t);\n\tconst { removeBlock, selectBlock } = useDispatch( blockEditorStore );\n\tconst initialBlockWidth = blockWrapperWidth - 2 * marginHorizontal;\n\tconst [ blockWidth, setBlockWidth ] = useState( initialBlockWidth );\n\tconst parentLayout = useLayout() || {};\n\tconst defaultColors = useMobileGlobalStylesColors();\n\tconst globalStyle = useGlobalStyles();\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\n\tconst onRemove = useCallback(\n\t\t() => removeBlock( clientId ),\n\t\t[ clientId, removeBlock ]\n\t);\n\tconst onFocus = useCallback( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tselectBlock( clientId );\n\t\t}\n\t}, [ selectBlock, clientId, isSelected ] );\n\n\tconst onLayout = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tconst layoutWidth = Math.floor( nativeEvent.layout.width );\n\n\t\t\tif ( ! blockWidth || ! layoutWidth ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( blockWidth !== layoutWidth ) {\n\t\t\t\tsetBlockWidth( layoutWidth );\n\t\t\t}\n\t\t},\n\t\t[ blockWidth, setBlockWidth ]\n\t);\n\n\t// Determine whether the block has props to apply to the wrapper.\n\tif ( blockType?.getEditWrapperProps ) {\n\t\twrapperProps = mergeWrapperProps(\n\t\t\twrapperProps,\n\t\t\tblockType.getEditWrapperProps( attributes )\n\t\t);\n\t}\n\n\t// Inherited styles merged with block level styles.\n\tconst mergedStyle = useMemo( () => {\n\t\treturn getMergedGlobalStyles(\n\t\t\tbaseGlobalStyles,\n\t\t\tglobalStyle,\n\t\t\twrapperProps?.style,\n\t\t\tattributes,\n\t\t\tdefaultColors,\n\t\t\tname,\n\t\t\tfontSizes || EMPTY_ARRAY\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\t// It is crucial to keep the dependencies array minimal to prevent unnecessary calls that could negatively impact performance.\n\t\t// JSON.stringify is used for the following purposes:\n\t\t// 1. To create a single, comparable value from the globalStyle, wrapperProps.style, and attributes objects. This allows useMemo to\n\t\t// efficiently determine if a change has occurred in any of these objects.\n\t\t// 2. To filter the attributes object, ensuring that only the relevant attributes (included in\n\t\t// GlobalStylesContext.BLOCK_STYLE_ATTRIBUTES) are considered as dependencies. This reduces the likelihood of\n\t\t// unnecessary useMemo calls when other, unrelated attributes change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( globalStyle ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( wrapperProps?.style ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries( attributes ?? {} ).filter( ( [ key ] ) =>\n\t\t\t\t\tGlobalStylesContext.BLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t] );\n\n\tconst isFocused = isSelected || isDescendentBlockSelected;\n\tconst isTouchable =\n\t\tisSelected ||\n\t\tisDescendantOfParentSelected ||\n\t\tisParentSelected ||\n\t\t! rootClientId;\n\n\tconst accessibilityLabel = getAccessibleBlockLabel(\n\t\tblockType,\n\t\tattributes,\n\t\torder + 1\n\t);\n\n\treturn (\n\t\t<BlockWrapper\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tblockCategory={ blockCategory }\n\t\t\tclientId={ clientId }\n\t\t\tdraggingClientId={ draggingClientId }\n\t\t\tdraggingEnabled={ draggingEnabled }\n\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\tisDescendentBlockSelected={ isDescendentBlockSelected }\n\t\t\tisFocused={ isFocused }\n\t\t\tisSelected={ isSelected }\n\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\tisTouchable={ isTouchable }\n\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\tmarginVertical={ marginVertical }\n\t\t\tname={ name }\n\t\t\tonFocus={ onFocus }\n\t\t>\n\t\t\t{ () =>\n\t\t\t\t! isValid ? (\n\t\t\t\t\t<BlockInvalidWarning clientId={ clientId } />\n\t\t\t\t) : (\n\t\t\t\t\t<GlobalStylesContext.Provider value={ mergedStyle }>\n\t\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\t\t\t\tinsertBlocksAfter={\n\t\t\t\t\t\t\t\tisLocked ? undefined : onInsertBlocksAfter\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tisSelectionEnabled={ isSelectionEnabled }\n\t\t\t\t\t\t\tmergeBlocks={ canRemove ? onMerge : undefined }\n\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tonRemove={ canRemove ? onRemove : undefined }\n\t\t\t\t\t\t\tonReplace={ canRemove ? onReplace : undefined }\n\t\t\t\t\t\t\tparentBlockAlignment={ parentBlockAlignment }\n\t\t\t\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tstyle={ mergedStyle }\n\t\t\t\t\t\t\ttoggleSelection={ toggleSelection }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tObject.keys( parentLayout ).length\n\t\t\t\t\t\t\t\t\t? parentLayout\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\t\t\t\tmayDisplayControls={ mayDisplayControls }\n\t\t\t\t\t\t\tblockEditingMode={ blockEditingMode }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<View onLayout={ onLayout } />\n\t\t\t\t\t</GlobalStylesContext.Provider>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockWrapper>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select, { clientId, rootClientId } ) => {\n\tconst {\n\t\tisBlockSelected,\n\t\tgetBlockMode,\n\t\tisSelectionEnabled,\n\t\tgetTemplateLock,\n\t\tgetBlockWithoutAttributes,\n\t\tgetBlockAttributes,\n\t\tcanRemoveBlock,\n\t\tcanMoveBlock,\n\t} = unlock( select( blockEditorStore ) );\n\tconst block = getBlockWithoutAttributes( clientId );\n\tconst attributes = getBlockAttributes( clientId );\n\tconst isSelected = isBlockSelected( clientId );\n\tconst templateLock = getTemplateLock( rootClientId );\n\tconst canRemove = canRemoveBlock( clientId, rootClientId );\n\tconst canMove = canMoveBlock( clientId, rootClientId );\n\n\t// The fallback to `{}` is a temporary fix.\n\t// This function should never be called when a block is not present in\n\t// the state. It happens now because the order in withSelect rendering\n\t// is not correct.\n\tconst { name, isValid } = block || {};\n\n\t// Do not add new properties here, use `useSelect` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tmode: getBlockMode( clientId ),\n\t\tisSelectionEnabled: isSelectionEnabled(),\n\t\tisLocked: !! templateLock,\n\t\tcanRemove,\n\t\tcanMove,\n\t\t// Users of the editor.BlockListBlock filter used to be able to\n\t\t// access the block prop.\n\t\t// Ideally these blocks would rely on the clientId prop only.\n\t\t// This is kept for backward compatibility reasons.\n\t\tblock,\n\t\tname,\n\t\tattributes,\n\t\tisValid,\n\t\tisSelected,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tinsertBlocks,\n\t\tmergeBlocks,\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tmoveBlocksToPosition,\n\t\tremoveBlock,\n\t} = dispatch( blockEditorStore );\n\n\t// Do not add new properties here, use `useDispatch` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tsetAttributes( newAttributes ) {\n\t\t\tconst { getMultiSelectedBlockClientIds } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst multiSelectedBlockClientIds =\n\t\t\t\tgetMultiSelectedBlockClientIds();\n\t\t\tconst { clientId } = ownProps;\n\t\t\tconst clientIds = multiSelectedBlockClientIds.length\n\t\t\t\t? multiSelectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\n\t\t\tupdateBlockAttributes( clientIds, newAttributes );\n\t\t},\n\t\tonInsertBlocks( blocks, index ) {\n\t\t\tconst { rootClientId } = ownProps;\n\t\t\tinsertBlocks( blocks, index, rootClientId );\n\t\t},\n\t\tonInsertBlocksAfter( blocks ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst { getBlockIndex } = registry.select( blockEditorStore );\n\t\t\tconst index = getBlockIndex( clientId );\n\t\t\tinsertBlocks( blocks, index + 1, rootClientId );\n\t\t},\n\t\tonMerge( forward ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst {\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t} = registry.select( blockEditorStore );\n\n\t\t\t/**\n\t\t\t * Moves the block with clientId up one level. If the block type\n\t\t\t * cannot be inserted at the new location, it will be attempted to\n\t\t\t * convert to the default block type.\n\t\t\t *\n\t\t\t * @param {string} _clientId The block to move.\n\t\t\t * @param {boolean} changeSelection Whether to change the selection\n\t\t\t * to the moved block.\n\t\t\t */\n\t\t\tfunction moveFirstItemUp( _clientId, changeSelection = true ) {\n\t\t\t\tconst targetRootClientId = getBlockRootClientId( _clientId );\n\t\t\t\tconst blockOrder = getBlockOrder( _clientId );\n\t\t\t\tconst [ firstClientId ] = blockOrder;\n\n\t\t\t\tif (\n\t\t\t\t\tblockOrder.length === 1 &&\n\t\t\t\t\tisUnmodifiedBlock( getBlock( firstClientId ) )\n\t\t\t\t) {\n\t\t\t\t\tremoveBlock( _clientId );\n\t\t\t\t} else {\n\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tgetBlockName( firstClientId ),\n\t\t\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ firstClientId ],\n\t\t\t\t\t\t\t\t_clientId,\n\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\tgetBlockIndex( _clientId )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst replacement = switchToBlockType(\n\t\t\t\t\t\t\t\tgetBlock( firstClientId ),\n\t\t\t\t\t\t\t\tgetDefaultBlockName()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( replacement && replacement.length ) {\n\t\t\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\t\tgetBlockIndex( _clientId ),\n\t\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( firstClientId, false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! getBlockOrder( _clientId ).length &&\n\t\t\t\t\t\t\tisUnmodifiedBlock( getBlock( _clientId ) )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tremoveBlock( _clientId, false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For `Delete` or forward merge, we should do the exact same thing\n\t\t\t// as `Backspace`, but from the other block.\n\t\t\tif ( forward ) {\n\t\t\t\tif ( rootClientId ) {\n\t\t\t\t\tconst nextRootClientId =\n\t\t\t\t\t\tgetNextBlockClientId( rootClientId );\n\n\t\t\t\t\tif ( nextRootClientId ) {\n\t\t\t\t\t\t// If there is a block that follows with the same parent\n\t\t\t\t\t\t// block name and the same attributes, merge the inner\n\t\t\t\t\t\t// blocks.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( nextRootClientId )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( nextRootClientId );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t\tgetBlockOrder( nextRootClientId ),\n\t\t\t\t\t\t\t\t\t\tnextRootClientId,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( nextRootClientId, false );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmergeBlocks( rootClientId, nextRootClientId );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\n\t\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( getBlockOrder( nextBlockClientId ).length ) {\n\t\t\t\t\tmoveFirstItemUp( nextBlockClientId, false );\n\t\t\t\t} else {\n\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst previousBlockClientId =\n\t\t\t\t\tgetPreviousBlockClientId( clientId );\n\n\t\t\t\tif ( previousBlockClientId ) {\n\t\t\t\t\tmergeBlocks( previousBlockClientId, clientId );\n\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\tconst previousRootClientId =\n\t\t\t\t\t\tgetPreviousBlockClientId( rootClientId );\n\n\t\t\t\t\t// If there is a preceding block with the same parent block\n\t\t\t\t\t// name and the same attributes, merge the inner blocks.\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreviousRootClientId &&\n\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( previousRootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( previousRootClientId );\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\tgetBlockOrder( rootClientId ),\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tpreviousRootClientId\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( rootClientId, false );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveFirstItemUp( rootClientId );\n\t\t\t\t} else {\n\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonReplace( blocks, indexToSelect, initialPosition ) {\n\t\t\tif (\n\t\t\t\tblocks.length &&\n\t\t\t\t! isUnmodifiedDefaultBlock( blocks[ blocks.length - 1 ] )\n\t\t\t) {\n\t\t\t\t__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t\treplaceBlocks(\n\t\t\t\t[ ownProps.clientId ],\n\t\t\t\tblocks,\n\t\t\t\tindexToSelect,\n\t\t\t\tinitialPosition\n\t\t\t);\n\t\t},\n\t\ttoggleSelection( selectionEnabled ) {\n\t\t\ttoggleSelection( selectionEnabled );\n\t\t},\n\t};\n} );\n\nexport default compose(\n\tmemo,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\t// Block is sometimes not mounted at the right time, causing it be undefined\n\t// see issue for more info\n\t// https://github.com/WordPress/gutenberg/issues/17013\n\tifCondition( ( { block } ) => !! block ),\n\twithFilters( 'editor.BlockListBlock' )\n)( BlockListBlock );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,OAAOC,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,WAAW,EACXC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,IAAI,QACE,oBAAoB;AAC3B,SACCC,mBAAmB,EACnBC,qBAAqB,EACrBC,2BAA2B,EAC3BC,eAAe,EACfC,WAAW,QACL,uBAAuB;AAC9B,SACCC,qCAAqC,IAAIC,uBAAuB,EAChEC,YAAY,EACZC,mBAAmB,EACnBC,iBAAiB,EACjBC,wBAAwB,EACxBC,iBAAiB,QACX,mBAAmB;AAC1B,SACCC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,UAAU,QACJ,iBAAiB;AACxB,SAASC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;;AAEzD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,SAAS,QAAQ,UAAU;AACpC,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,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sBAAsB,CAAEtD,GAAG,CAC7B,CAAC,EACA;cACD0B,QAAQ,CAACwB,KAAK,CAAE,MAAM;gBACrBnB,oBAAoB,CACnBW,aAAa,CAAE1G,YAAa,CAAC,EAC7BA,YAAY,EACZyH,oBACD,CAAC;gBACDhF,WAAW,CAAEzC,YAAY,EAAE,KAAM,CAAC;cACnC,CAAE,CAAC;cACH;YACD;UACD;UAEA6G,eAAe,CAAE7G,YAAa,CAAC;QAChC,CAAC,MAAM;UACNyC,WAAW,CAAEnF,QAAS,CAAC;QACxB;MACD;IACD,CAAC;IACDuC,SAASA,CAAEuG,MAAM,EAAEsB,aAAa,EAAEC,eAAe,EAAG;MACnD,IACCvB,MAAM,CAAC1B,MAAM,IACb,CAAElJ,wBAAwB,CAAE4K,MAAM,CAAEA,MAAM,CAAC1B,MAAM,GAAG,CAAC,CAAG,CAAC,EACxD;QACDoB,oCAAoC,CAAC,CAAC;MACvC;MACAD,aAAa,CACZ,CAAEJ,QAAQ,CAACnI,QAAQ,CAAE,EACrB8I,MAAM,EACNsB,aAAa,EACbC,eACD,CAAC;IACF,CAAC;IACDzH,eAAeA,CAAE0H,gBAAgB,EAAG;MACnC1H,eAAe,CAAE0H,gBAAiB,CAAC;IACpC;EACD,CAAC;AACF,CAAE,CAAC;AAEH,eAAe9L,OAAO,CACrBjB,IAAI,EACJ8J,eAAe,EACfY,iBAAiB;AACjB;AACA;AACA;AACAxJ,WAAW,CAAE,CAAE;EAAEoJ;AAAM,CAAC,KAAM,CAAC,CAAEA,KAAM,CAAC,EACxCjK,WAAW,CAAE,uBAAwB,CACtC,CAAC,CAAE8D,cAAe,CAAC"}
|
|
1
|
+
{"version":3,"names":["Pressable","View","classnames","useCallback","useMemo","useState","useRef","memo","GlobalStylesContext","getMergedGlobalStyles","useMobileGlobalStylesColors","useGlobalStyles","withFilters","__experimentalGetAccessibleBlockLabel","getAccessibleBlockLabel","getBlockType","getDefaultBlockName","isUnmodifiedBlock","isUnmodifiedDefaultBlock","switchToBlockType","useDispatch","useSelect","withDispatch","withSelect","compose","ifCondition","BlockEdit","BlockDraggable","BlockInvalidWarning","BlockOutline","store","blockEditorStore","useLayout","useScrollUponInsertion","useSettings","unlock","BlockCrashBoundary","BlockCrashWarning","EMPTY_ARRAY","mergeWrapperProps","propsA","propsB","newProps","hasOwnProperty","className","style","BlockWrapper","accessibilityLabel","blockCategory","children","clientId","draggingClientId","draggingEnabled","hasInnerBlocks","isDescendentBlockSelected","isSelected","isTouchable","marginHorizontal","marginVertical","name","onFocus","blockWrapperStyles","flex","blockWrapperStyle","accessible","ref","isLayoutCalculated","setIsLayoutCalculated","elementRef","onLayout","createElement","accessibilityRole","disabled","onPress","blockName","fallback","enabled","testID","BlockListBlock","attributes","blockWidth","blockWrapperWidth","canRemove","contentStyle","isLocked","isSelectionEnabled","isStackedHorizontally","isValid","onDeleteBlock","onInsertBlocksAfter","onMerge","onReplace","parentBlockAlignment","parentWidth","rootClientId","setAttributes","toggleSelection","wrapperProps","baseGlobalStyles","blockType","isDescendantOfParentSelected","isParentSelected","order","mayDisplayControls","blockEditingMode","select","getBlockCount","getBlockHierarchyRootClientId","getBlockIndex","getBlockParents","getSelectedBlockClientId","getSettings","hasSelectedInnerBlock","getBlockName","isFirstMultiSelectedBlock","getMultiSelectedBlockClientIds","getBlockEditingMode","currentBlockType","currentBlockCategory","category","blockOrder","descendentBlockSelected","selectedBlockClientId","parents","parentSelected","selectedParents","descendantOfParentSelected","includes","blockHasInnerBlocks","isDraggingEnabled","currentDraggingClientId","globalStylesBaseStyles","__experimentalGlobalStylesBaseStyles","every","id","removeBlock","selectBlock","initialBlockWidth","setBlockWidth","parentLayout","defaultColors","globalStyle","fontSizes","onRemove","nativeEvent","layoutWidth","Math","floor","layout","width","getEditWrapperProps","mergedStyle","JSON","stringify","Object","fromEntries","entries","filter","key","BLOCK_STYLE_ATTRIBUTES","isFocused","Provider","value","insertBlocksAfter","undefined","mergeBlocks","__unstableParentLayout","keys","length","applyWithSelect","isBlockSelected","getBlockMode","getTemplateLock","getBlockWithoutAttributes","getBlockAttributes","canRemoveBlock","canMoveBlock","block","templateLock","canMove","mode","applyWithDispatch","dispatch","ownProps","registry","updateBlockAttributes","insertBlocks","replaceBlocks","__unstableMarkLastChangeAsPersistent","moveBlocksToPosition","newAttributes","multiSelectedBlockClientIds","clientIds","onInsertBlocks","blocks","index","forward","getPreviousBlockClientId","getNextBlockClientId","getBlock","getBlockOrder","getBlockRootClientId","canInsertBlockType","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","firstClientId","batch","replacement","nextRootClientId","rootAttributes","previousRootAttributes","nextBlockClientId","previousBlockClientId","previousRootClientId","indexToSelect","initialPosition","selectionEnabled"],"sources":["@wordpress/block-editor/src/components/block-list/block.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Pressable, View } from 'react-native';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n\tuseRef,\n\tmemo,\n} from '@wordpress/element';\nimport {\n\tGlobalStylesContext,\n\tgetMergedGlobalStyles,\n\tuseMobileGlobalStylesColors,\n\tuseGlobalStyles,\n\twithFilters,\n} from '@wordpress/components';\nimport {\n\t__experimentalGetAccessibleBlockLabel as getAccessibleBlockLabel,\n\tgetBlockType,\n\tgetDefaultBlockName,\n\tisUnmodifiedBlock,\n\tisUnmodifiedDefaultBlock,\n\tswitchToBlockType,\n} from '@wordpress/blocks';\nimport {\n\tuseDispatch,\n\tuseSelect,\n\twithDispatch,\n\twithSelect,\n} from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockEdit from '../block-edit';\nimport BlockDraggable from '../block-draggable';\nimport BlockInvalidWarning from './block-invalid-warning';\nimport BlockOutline from './block-outline';\nimport { store as blockEditorStore } from '../../store';\nimport { useLayout } from './layout';\nimport useScrollUponInsertion from './use-scroll-upon-insertion';\nimport { useSettings } from '../use-settings';\nimport { unlock } from '../../lock-unlock';\nimport BlockCrashBoundary from './block-crash-boundary';\nimport BlockCrashWarning from './block-crash-warning';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Merges wrapper props with special handling for classNames and styles.\n *\n * @param {Object} propsA\n * @param {Object} propsB\n *\n * @return {Object} Merged props.\n */\nfunction mergeWrapperProps( propsA, propsB ) {\n\tconst newProps = {\n\t\t...propsA,\n\t\t...propsB,\n\t};\n\n\t// May be set to undefined, so check if the property is set!\n\tif (\n\t\tpropsA?.hasOwnProperty( 'className' ) &&\n\t\tpropsB?.hasOwnProperty( 'className' )\n\t) {\n\t\tnewProps.className = classnames( propsA.className, propsB.className );\n\t}\n\n\tif (\n\t\tpropsA?.hasOwnProperty( 'style' ) &&\n\t\tpropsB?.hasOwnProperty( 'style' )\n\t) {\n\t\tnewProps.style = { ...propsA.style, ...propsB.style };\n\t}\n\n\treturn newProps;\n}\n\nfunction BlockWrapper( {\n\taccessibilityLabel,\n\tblockCategory,\n\tchildren,\n\tclientId,\n\tdraggingClientId,\n\tdraggingEnabled,\n\thasInnerBlocks,\n\tisDescendentBlockSelected,\n\tisSelected,\n\tisTouchable,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonFocus,\n} ) {\n\tconst blockWrapperStyles = { flex: 1 };\n\tconst blockWrapperStyle = [\n\t\tblockWrapperStyles,\n\t\t{\n\t\t\tmarginVertical,\n\t\t\tmarginHorizontal,\n\t\t},\n\t];\n\tconst accessible = ! ( isSelected || isDescendentBlockSelected );\n\n\tconst ref = useRef();\n\tconst [ isLayoutCalculated, setIsLayoutCalculated ] = useState();\n\tuseScrollUponInsertion( {\n\t\tclientId,\n\t\tisSelected,\n\t\tisLayoutCalculated,\n\t\telementRef: ref,\n\t} );\n\tconst onLayout = useCallback( () => {\n\t\tsetIsLayoutCalculated( true );\n\t}, [] );\n\n\treturn (\n\t\t<Pressable\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessible={ accessible }\n\t\t\tdisabled={ ! isTouchable }\n\t\t\tonPress={ onFocus }\n\t\t\tstyle={ blockWrapperStyle }\n\t\t\tref={ ref }\n\t\t\tonLayout={ onLayout }\n\t\t>\n\t\t\t<BlockOutline\n\t\t\t\tblockCategory={ blockCategory }\n\t\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tname={ name }\n\t\t\t/>\n\t\t\t<BlockCrashBoundary\n\t\t\t\tblockName={ name }\n\t\t\t\tfallback={ <BlockCrashWarning /> }\n\t\t\t>\n\t\t\t\t<BlockDraggable\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\t\tenabled={ draggingEnabled }\n\t\t\t\t\ttestID=\"draggable-trigger-content\"\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</BlockDraggable>\n\t\t\t</BlockCrashBoundary>\n\t\t</Pressable>\n\t);\n}\n\nfunction BlockListBlock( {\n\tattributes,\n\tblockWidth: blockWrapperWidth,\n\tcanRemove,\n\tclientId,\n\tcontentStyle,\n\tisLocked,\n\tisSelected,\n\tisSelectionEnabled,\n\tisStackedHorizontally,\n\tisValid,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonDeleteBlock,\n\tonInsertBlocksAfter,\n\tonMerge,\n\tonReplace,\n\tparentBlockAlignment,\n\tparentWidth,\n\trootClientId,\n\tsetAttributes,\n\ttoggleSelection,\n\twrapperProps,\n} ) {\n\tconst {\n\t\tbaseGlobalStyles,\n\t\tblockCategory,\n\t\tblockType,\n\t\tdraggingClientId,\n\t\tdraggingEnabled,\n\t\thasInnerBlocks,\n\t\tisDescendantOfParentSelected,\n\t\tisDescendentBlockSelected,\n\t\tisParentSelected,\n\t\torder,\n\t\tmayDisplayControls,\n\t\tblockEditingMode,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockHierarchyRootClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetSettings,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlockName,\n\t\t\t\tisFirstMultiSelectedBlock,\n\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentBlockType = getBlockType( name || 'core/missing' );\n\t\t\tconst currentBlockCategory = currentBlockType?.category;\n\t\t\tconst blockOrder = getBlockIndex( clientId );\n\t\t\tconst descendentBlockSelected = hasSelectedInnerBlock(\n\t\t\t\tclientId,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\t\tconst parents = getBlockParents( clientId, true );\n\t\t\tconst parentSelected =\n\t\t\t\t// Set false as a default value to prevent re-render when it's changed from null to false.\n\t\t\t\t( selectedBlockClientId || false ) &&\n\t\t\t\tselectedBlockClientId === rootClientId;\n\n\t\t\tconst selectedParents = clientId ? parents : [];\n\t\t\tconst descendantOfParentSelected =\n\t\t\t\tselectedParents.includes( rootClientId );\n\t\t\tconst blockHasInnerBlocks = getBlockCount( clientId ) > 0;\n\n\t\t\t// For blocks with inner blocks, we only enable the dragging in the nested\n\t\t\t// blocks if any of them are selected. This way we prevent the long-press\n\t\t\t// gesture from being disabled for elements within the block UI.\n\t\t\tconst isDraggingEnabled =\n\t\t\t\t! blockHasInnerBlocks ||\n\t\t\t\tisSelected ||\n\t\t\t\t! descendentBlockSelected;\n\t\t\t// Dragging nested blocks is not supported yet. For this reason, the block to be dragged\n\t\t\t// will be the top in the hierarchy.\n\t\t\tconst currentDraggingClientId =\n\t\t\t\tgetBlockHierarchyRootClientId( clientId );\n\n\t\t\tconst globalStylesBaseStyles =\n\t\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles;\n\n\t\t\treturn {\n\t\t\t\tbaseGlobalStyles: globalStylesBaseStyles,\n\t\t\t\tblockCategory: currentBlockCategory,\n\t\t\t\tblockType: currentBlockType,\n\t\t\t\tdraggingClientId: currentDraggingClientId,\n\t\t\t\tdraggingEnabled: isDraggingEnabled,\n\t\t\t\thasInnerBlocks: blockHasInnerBlocks,\n\t\t\t\tisDescendantOfParentSelected: descendantOfParentSelected,\n\t\t\t\tisDescendentBlockSelected: descendentBlockSelected,\n\t\t\t\tisParentSelected: parentSelected,\n\t\t\t\torder: blockOrder,\n\t\t\t\tmayDisplayControls:\n\t\t\t\t\tisSelected ||\n\t\t\t\t\t( isFirstMultiSelectedBlock( clientId ) &&\n\t\t\t\t\t\tgetMultiSelectedBlockClientIds().every(\n\t\t\t\t\t\t\t( id ) => getBlockName( id ) === name\n\t\t\t\t\t\t) ),\n\t\t\t\tblockEditingMode: getBlockEditingMode( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, isSelected, name, rootClientId ]\n\t);\n\tconst { removeBlock, selectBlock } = useDispatch( blockEditorStore );\n\tconst initialBlockWidth = blockWrapperWidth - 2 * marginHorizontal;\n\tconst [ blockWidth, setBlockWidth ] = useState( initialBlockWidth );\n\tconst parentLayout = useLayout() || {};\n\tconst defaultColors = useMobileGlobalStylesColors();\n\tconst globalStyle = useGlobalStyles();\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\n\tconst onRemove = useCallback(\n\t\t() => removeBlock( clientId ),\n\t\t[ clientId, removeBlock ]\n\t);\n\tconst onFocus = useCallback( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tselectBlock( clientId );\n\t\t}\n\t}, [ selectBlock, clientId, isSelected ] );\n\n\tconst onLayout = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tconst layoutWidth = Math.floor( nativeEvent.layout.width );\n\n\t\t\tif ( ! blockWidth || ! layoutWidth ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( blockWidth !== layoutWidth ) {\n\t\t\t\tsetBlockWidth( layoutWidth );\n\t\t\t}\n\t\t},\n\t\t[ blockWidth, setBlockWidth ]\n\t);\n\n\t// Determine whether the block has props to apply to the wrapper.\n\tif ( blockType?.getEditWrapperProps ) {\n\t\twrapperProps = mergeWrapperProps(\n\t\t\twrapperProps,\n\t\t\tblockType.getEditWrapperProps( attributes )\n\t\t);\n\t}\n\n\t// Inherited styles merged with block level styles.\n\tconst mergedStyle = useMemo( () => {\n\t\treturn getMergedGlobalStyles(\n\t\t\tbaseGlobalStyles,\n\t\t\tglobalStyle,\n\t\t\twrapperProps?.style,\n\t\t\tattributes,\n\t\t\tdefaultColors,\n\t\t\tname,\n\t\t\tfontSizes || EMPTY_ARRAY\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\t// It is crucial to keep the dependencies array minimal to prevent unnecessary calls that could negatively impact performance.\n\t\t// JSON.stringify is used for the following purposes:\n\t\t// 1. To create a single, comparable value from the globalStyle, wrapperProps.style, and attributes objects. This allows useMemo to\n\t\t// efficiently determine if a change has occurred in any of these objects.\n\t\t// 2. To filter the attributes object, ensuring that only the relevant attributes (included in\n\t\t// GlobalStylesContext.BLOCK_STYLE_ATTRIBUTES) are considered as dependencies. This reduces the likelihood of\n\t\t// unnecessary useMemo calls when other, unrelated attributes change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( globalStyle ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( wrapperProps?.style ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries( attributes ?? {} ).filter( ( [ key ] ) =>\n\t\t\t\t\tGlobalStylesContext.BLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t] );\n\n\tconst isFocused = isSelected || isDescendentBlockSelected;\n\tconst isTouchable =\n\t\tisSelected ||\n\t\tisDescendantOfParentSelected ||\n\t\tisParentSelected ||\n\t\t! rootClientId;\n\n\tconst accessibilityLabel = getAccessibleBlockLabel(\n\t\tblockType,\n\t\tattributes,\n\t\torder + 1\n\t);\n\n\treturn (\n\t\t<BlockWrapper\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tblockCategory={ blockCategory }\n\t\t\tclientId={ clientId }\n\t\t\tdraggingClientId={ draggingClientId }\n\t\t\tdraggingEnabled={ draggingEnabled }\n\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\tisDescendentBlockSelected={ isDescendentBlockSelected }\n\t\t\tisFocused={ isFocused }\n\t\t\tisSelected={ isSelected }\n\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\tisTouchable={ isTouchable }\n\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\tmarginVertical={ marginVertical }\n\t\t\tname={ name }\n\t\t\tonFocus={ onFocus }\n\t\t>\n\t\t\t{ () =>\n\t\t\t\t! isValid ? (\n\t\t\t\t\t<BlockInvalidWarning clientId={ clientId } />\n\t\t\t\t) : (\n\t\t\t\t\t<GlobalStylesContext.Provider value={ mergedStyle }>\n\t\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\t\t\t\tinsertBlocksAfter={\n\t\t\t\t\t\t\t\tisLocked ? undefined : onInsertBlocksAfter\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tisSelectionEnabled={ isSelectionEnabled }\n\t\t\t\t\t\t\tmergeBlocks={ canRemove ? onMerge : undefined }\n\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tonRemove={ canRemove ? onRemove : undefined }\n\t\t\t\t\t\t\tonReplace={ canRemove ? onReplace : undefined }\n\t\t\t\t\t\t\tparentBlockAlignment={ parentBlockAlignment }\n\t\t\t\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tstyle={ mergedStyle }\n\t\t\t\t\t\t\ttoggleSelection={ toggleSelection }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tObject.keys( parentLayout ).length\n\t\t\t\t\t\t\t\t\t? parentLayout\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\t\t\t\tmayDisplayControls={ mayDisplayControls }\n\t\t\t\t\t\t\tblockEditingMode={ blockEditingMode }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<View onLayout={ onLayout } />\n\t\t\t\t\t</GlobalStylesContext.Provider>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockWrapper>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select, { clientId, rootClientId } ) => {\n\tconst {\n\t\tisBlockSelected,\n\t\tgetBlockMode,\n\t\tisSelectionEnabled,\n\t\tgetTemplateLock,\n\t\tgetBlockWithoutAttributes,\n\t\tgetBlockAttributes,\n\t\tcanRemoveBlock,\n\t\tcanMoveBlock,\n\t} = unlock( select( blockEditorStore ) );\n\tconst block = getBlockWithoutAttributes( clientId );\n\tconst attributes = getBlockAttributes( clientId );\n\tconst isSelected = isBlockSelected( clientId );\n\tconst templateLock = getTemplateLock( rootClientId );\n\tconst canRemove = canRemoveBlock( clientId, rootClientId );\n\tconst canMove = canMoveBlock( clientId, rootClientId );\n\n\t// The fallback to `{}` is a temporary fix.\n\t// This function should never be called when a block is not present in\n\t// the state. It happens now because the order in withSelect rendering\n\t// is not correct.\n\tconst { name, isValid } = block || {};\n\n\t// Do not add new properties here, use `useSelect` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tmode: getBlockMode( clientId ),\n\t\tisSelectionEnabled: isSelectionEnabled(),\n\t\tisLocked: !! templateLock,\n\t\tcanRemove,\n\t\tcanMove,\n\t\t// Users of the editor.BlockListBlock filter used to be able to\n\t\t// access the block prop.\n\t\t// Ideally these blocks would rely on the clientId prop only.\n\t\t// This is kept for backward compatibility reasons.\n\t\tblock,\n\t\tname,\n\t\tattributes,\n\t\tisValid,\n\t\tisSelected,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tinsertBlocks,\n\t\tmergeBlocks,\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tmoveBlocksToPosition,\n\t\tremoveBlock,\n\t} = dispatch( blockEditorStore );\n\n\t// Do not add new properties here, use `useDispatch` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tsetAttributes( newAttributes ) {\n\t\t\tconst { getMultiSelectedBlockClientIds } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst multiSelectedBlockClientIds =\n\t\t\t\tgetMultiSelectedBlockClientIds();\n\t\t\tconst { clientId } = ownProps;\n\t\t\tconst clientIds = multiSelectedBlockClientIds.length\n\t\t\t\t? multiSelectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\n\t\t\tupdateBlockAttributes( clientIds, newAttributes );\n\t\t},\n\t\tonInsertBlocks( blocks, index ) {\n\t\t\tconst { rootClientId } = ownProps;\n\t\t\tinsertBlocks( blocks, index, rootClientId );\n\t\t},\n\t\tonInsertBlocksAfter( blocks ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst { getBlockIndex } = registry.select( blockEditorStore );\n\t\t\tconst index = getBlockIndex( clientId );\n\t\t\tinsertBlocks( blocks, index + 1, rootClientId );\n\t\t},\n\t\tonMerge( forward ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst {\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t} = registry.select( blockEditorStore );\n\n\t\t\t/**\n\t\t\t * Moves the block with clientId up one level. If the block type\n\t\t\t * cannot be inserted at the new location, it will be attempted to\n\t\t\t * convert to the default block type.\n\t\t\t *\n\t\t\t * @param {string} _clientId The block to move.\n\t\t\t * @param {boolean} changeSelection Whether to change the selection\n\t\t\t * to the moved block.\n\t\t\t */\n\t\t\tfunction moveFirstItemUp( _clientId, changeSelection = true ) {\n\t\t\t\tconst targetRootClientId = getBlockRootClientId( _clientId );\n\t\t\t\tconst blockOrder = getBlockOrder( _clientId );\n\t\t\t\tconst [ firstClientId ] = blockOrder;\n\n\t\t\t\tif (\n\t\t\t\t\tblockOrder.length === 1 &&\n\t\t\t\t\tisUnmodifiedBlock( getBlock( firstClientId ) )\n\t\t\t\t) {\n\t\t\t\t\tremoveBlock( _clientId );\n\t\t\t\t} else {\n\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tgetBlockName( firstClientId ),\n\t\t\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ firstClientId ],\n\t\t\t\t\t\t\t\t_clientId,\n\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\tgetBlockIndex( _clientId )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst replacement = switchToBlockType(\n\t\t\t\t\t\t\t\tgetBlock( firstClientId ),\n\t\t\t\t\t\t\t\tgetDefaultBlockName()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( replacement && replacement.length ) {\n\t\t\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\t\tgetBlockIndex( _clientId ),\n\t\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( firstClientId, false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! getBlockOrder( _clientId ).length &&\n\t\t\t\t\t\t\tisUnmodifiedBlock( getBlock( _clientId ) )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tremoveBlock( _clientId, false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For `Delete` or forward merge, we should do the exact same thing\n\t\t\t// as `Backspace`, but from the other block.\n\t\t\tif ( forward ) {\n\t\t\t\tif ( rootClientId ) {\n\t\t\t\t\tconst nextRootClientId =\n\t\t\t\t\t\tgetNextBlockClientId( rootClientId );\n\n\t\t\t\t\tif ( nextRootClientId ) {\n\t\t\t\t\t\t// If there is a block that follows with the same parent\n\t\t\t\t\t\t// block name and the same attributes, merge the inner\n\t\t\t\t\t\t// blocks.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( nextRootClientId )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( nextRootClientId );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t\tgetBlockOrder( nextRootClientId ),\n\t\t\t\t\t\t\t\t\t\tnextRootClientId,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( nextRootClientId, false );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmergeBlocks( rootClientId, nextRootClientId );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\n\t\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( getBlockOrder( nextBlockClientId ).length ) {\n\t\t\t\t\tmoveFirstItemUp( nextBlockClientId, false );\n\t\t\t\t} else {\n\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst previousBlockClientId =\n\t\t\t\t\tgetPreviousBlockClientId( clientId );\n\n\t\t\t\tif ( previousBlockClientId ) {\n\t\t\t\t\tmergeBlocks( previousBlockClientId, clientId );\n\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\tconst previousRootClientId =\n\t\t\t\t\t\tgetPreviousBlockClientId( rootClientId );\n\n\t\t\t\t\t// If there is a preceding block with the same parent block\n\t\t\t\t\t// name and the same attributes, merge the inner blocks.\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreviousRootClientId &&\n\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( previousRootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( previousRootClientId );\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\tgetBlockOrder( rootClientId ),\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tpreviousRootClientId\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( rootClientId, false );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveFirstItemUp( rootClientId );\n\t\t\t\t} else {\n\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonReplace( blocks, indexToSelect, initialPosition ) {\n\t\t\tif (\n\t\t\t\tblocks.length &&\n\t\t\t\t! isUnmodifiedDefaultBlock( blocks[ blocks.length - 1 ] )\n\t\t\t) {\n\t\t\t\t__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t\treplaceBlocks(\n\t\t\t\t[ ownProps.clientId ],\n\t\t\t\tblocks,\n\t\t\t\tindexToSelect,\n\t\t\t\tinitialPosition\n\t\t\t);\n\t\t},\n\t\ttoggleSelection( selectionEnabled ) {\n\t\t\ttoggleSelection( selectionEnabled );\n\t\t},\n\t};\n} );\n\nexport default compose(\n\tmemo,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\t// Block is sometimes not mounted at the right time, causing it be undefined\n\t// see issue for more info\n\t// https://github.com/WordPress/gutenberg/issues/17013\n\tifCondition( ( { block } ) => !! block ),\n\twithFilters( 'editor.BlockListBlock' )\n)( BlockListBlock );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,OAAOC,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,WAAW,EACXC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,IAAI,QACE,oBAAoB;AAC3B,SACCC,mBAAmB,EACnBC,qBAAqB,EACrBC,2BAA2B,EAC3BC,eAAe,EACfC,WAAW,QACL,uBAAuB;AAC9B,SACCC,qCAAqC,IAAIC,uBAAuB,EAChEC,YAAY,EACZC,mBAAmB,EACnBC,iBAAiB,EACjBC,wBAAwB,EACxBC,iBAAiB,QACX,mBAAmB;AAC1B,SACCC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,UAAU,QACJ,iBAAiB;AACxB,SAASC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;;AAEzD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,SAAS,QAAQ,UAAU;AACpC,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,OAAOC,iBAAiB,MAAM,uBAAuB;AAErD,MAAMC,WAAW,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,i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B,GAAG,IACJqD,cAAc,CAAErD,GAAG,CAAE,KACrBsD,sBAAsB,CAAEtD,GAAG,CAC7B,CAAC,EACA;cACD0B,QAAQ,CAACwB,KAAK,CAAE,MAAM;gBACrBnB,oBAAoB,CACnBW,aAAa,CAAE1G,YAAa,CAAC,EAC7BA,YAAY,EACZyH,oBACD,CAAC;gBACDhF,WAAW,CAAEzC,YAAY,EAAE,KAAM,CAAC;cACnC,CAAE,CAAC;cACH;YACD;UACD;UAEA6G,eAAe,CAAE7G,YAAa,CAAC;QAChC,CAAC,MAAM;UACNyC,WAAW,CAAErF,QAAS,CAAC;QACxB;MACD;IACD,CAAC;IACDyC,SAASA,CAAEuG,MAAM,EAAEsB,aAAa,EAAEC,eAAe,EAAG;MACnD,IACCvB,MAAM,CAAC1B,MAAM,IACb,CAAEtJ,wBAAwB,CAAEgL,MAAM,CAAEA,MAAM,CAAC1B,MAAM,GAAG,CAAC,CAAG,CAAC,EACxD;QACDoB,oCAAoC,CAAC,CAAC;MACvC;MACAD,aAAa,CACZ,CAAEJ,QAAQ,CAACrI,QAAQ,CAAE,EACrBgJ,MAAM,EACNsB,aAAa,EACbC,eACD,CAAC;IACF,CAAC;IACDzH,eAAeA,CAAE0H,gBAAgB,EAAG;MACnC1H,eAAe,CAAE0H,gBAAiB,CAAC;IACpC;EACD,CAAC;AACF,CAAE,CAAC;AAEH,eAAelM,OAAO,CACrBjB,IAAI,EACJkK,eAAe,EACfY,iBAAiB;AACjB;AACA;AACA;AACA5J,WAAW,CAAE,CAAE;EAAEwJ;AAAM,CAAC,KAAM,CAAC,CAAEA,KAAM,CAAC,EACxCrK,WAAW,CAAE,uBAAwB,CACtC,CAAC,CAAEkE,cAAe,CAAC"}
|
|
@@ -57,6 +57,9 @@ const BlockMoverButton = forwardRef(({
|
|
|
57
57
|
const instanceId = useInstanceId(BlockMoverButton);
|
|
58
58
|
const normalizedClientIds = Array.isArray(clientIds) ? clientIds : [clientIds];
|
|
59
59
|
const blocksCount = normalizedClientIds.length;
|
|
60
|
+
const {
|
|
61
|
+
disabled
|
|
62
|
+
} = props;
|
|
60
63
|
const {
|
|
61
64
|
blockType,
|
|
62
65
|
isDisabled,
|
|
@@ -86,7 +89,7 @@ const BlockMoverButton = forwardRef(({
|
|
|
86
89
|
} = getBlockListSettings(blockRootClientId) || {};
|
|
87
90
|
return {
|
|
88
91
|
blockType: block ? getBlockType(block.name) : null,
|
|
89
|
-
isDisabled: direction === 'up' ? isFirstBlock : isLastBlock,
|
|
92
|
+
isDisabled: disabled || (direction === 'up' ? isFirstBlock : isLastBlock),
|
|
90
93
|
rootClientId: blockRootClientId,
|
|
91
94
|
firstIndex: firstBlockIndex,
|
|
92
95
|
isFirst: isFirstBlock,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","getBlockType","Button","VisuallyHidden","useInstanceId","useSelect","useDispatch","forwardRef","__","isRTL","chevronLeft","chevronRight","chevronUp","chevronDown","getBlockMoverDescription","store","blockEditorStore","getArrowIcon","direction","orientation","getMovementDirectionLabel","moveDirection","BlockMoverButton","clientIds","moverOrientation","props","ref","instanceId","normalizedClientIds","Array","isArray","blocksCount","length","blockType","isDisabled","rootClientId","isFirst","isLast","firstIndex","select","getBlockIndex","getBlockRootClientId","getBlockOrder","getBlock","getBlockListSettings","firstClientId","blockRootClientId","firstBlockIndex","lastBlockIndex","blockOrder","block","isFirstBlock","isLastBlock","blockListOrientation","name","moveBlocksDown","moveBlocksUp","moverFunction","onClick","event","descriptionId","createElement","Fragment","className","icon","label","disabled","__experimentalIsFocusable","id","title","BlockMoverUpButton","BlockMoverDownButton"],"sources":["@wordpress/block-editor/src/components/block-mover/button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tchevronLeft,\n\tchevronRight,\n\tchevronUp,\n\tchevronDown,\n} from '@wordpress/icons';\nimport { getBlockMoverDescription } from './mover-description';\nimport { store as blockEditorStore } from '../../store';\n\nconst getArrowIcon = ( direction, orientation ) => {\n\tif ( direction === 'up' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? chevronRight : chevronLeft;\n\t\t}\n\t\treturn chevronUp;\n\t} else if ( direction === 'down' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? chevronLeft : chevronRight;\n\t\t}\n\t\treturn chevronDown;\n\t}\n\treturn null;\n};\n\nconst getMovementDirectionLabel = ( moveDirection, orientation ) => {\n\tif ( moveDirection === 'up' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? __( 'Move right' ) : __( 'Move left' );\n\t\t}\n\t\treturn __( 'Move up' );\n\t} else if ( moveDirection === 'down' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? __( 'Move left' ) : __( 'Move right' );\n\t\t}\n\t\treturn __( 'Move down' );\n\t}\n\treturn null;\n};\n\nconst BlockMoverButton = forwardRef(\n\t(\n\t\t{ clientIds, direction, orientation: moverOrientation, ...props },\n\t\tref\n\t) => {\n\t\tconst instanceId = useInstanceId( BlockMoverButton );\n\t\tconst normalizedClientIds = Array.isArray( clientIds )\n\t\t\t? clientIds\n\t\t\t: [ clientIds ];\n\t\tconst blocksCount = normalizedClientIds.length;\n\n\t\tconst {\n\t\t\tblockType,\n\t\t\tisDisabled,\n\t\t\trootClientId,\n\t\t\tisFirst,\n\t\t\tisLast,\n\t\t\tfirstIndex,\n\t\t\torientation = 'vertical',\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\tgetBlock,\n\t\t\t\t\tgetBlockListSettings,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst firstClientId = normalizedClientIds[ 0 ];\n\t\t\t\tconst blockRootClientId = getBlockRootClientId( firstClientId );\n\t\t\t\tconst firstBlockIndex = getBlockIndex( firstClientId );\n\t\t\t\tconst lastBlockIndex = getBlockIndex(\n\t\t\t\t\tnormalizedClientIds[ normalizedClientIds.length - 1 ]\n\t\t\t\t);\n\t\t\t\tconst blockOrder = getBlockOrder( blockRootClientId );\n\t\t\t\tconst block = getBlock( firstClientId );\n\t\t\t\tconst isFirstBlock = firstBlockIndex === 0;\n\t\t\t\tconst isLastBlock = lastBlockIndex === blockOrder.length - 1;\n\t\t\t\tconst { orientation: blockListOrientation } =\n\t\t\t\t\tgetBlockListSettings( blockRootClientId ) || {};\n\n\t\t\t\treturn {\n\t\t\t\t\tblockType: block ? getBlockType( block.name ) : null,\n\t\t\t\t\tisDisabled: direction === 'up' ? isFirstBlock : isLastBlock,\n\t\t\t\t\trootClientId: blockRootClientId,\n\t\t\t\t\tfirstIndex: firstBlockIndex,\n\t\t\t\t\tisFirst: isFirstBlock,\n\t\t\t\t\tisLast: isLastBlock,\n\t\t\t\t\torientation: moverOrientation || blockListOrientation,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientIds, direction ]\n\t\t);\n\n\t\tconst { moveBlocksDown, moveBlocksUp } =\n\t\t\tuseDispatch( blockEditorStore );\n\t\tconst moverFunction =\n\t\t\tdirection === 'up' ? moveBlocksUp : moveBlocksDown;\n\n\t\tconst onClick = ( event ) => {\n\t\t\tmoverFunction( clientIds, rootClientId );\n\t\t\tif ( props.onClick ) {\n\t\t\t\tprops.onClick( event );\n\t\t\t}\n\t\t};\n\n\t\tconst descriptionId = `block-editor-block-mover-button__description-${ instanceId }`;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-mover-button',\n\t\t\t\t\t\t`is-${ direction }-button`\n\t\t\t\t\t) }\n\t\t\t\t\ticon={ getArrowIcon( direction, orientation ) }\n\t\t\t\t\tlabel={ getMovementDirectionLabel(\n\t\t\t\t\t\tdirection,\n\t\t\t\t\t\torientation\n\t\t\t\t\t) }\n\t\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tonClick={ isDisabled ? null : onClick }\n\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t/>\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ getBlockMoverDescription(\n\t\t\t\t\t\tblocksCount,\n\t\t\t\t\t\tblockType && blockType.title,\n\t\t\t\t\t\tfirstIndex,\n\t\t\t\t\t\tisFirst,\n\t\t\t\t\t\tisLast,\n\t\t\t\t\t\tdirection === 'up' ? -1 : 1,\n\t\t\t\t\t\torientation\n\t\t\t\t\t) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t</>\n\t\t);\n\t}\n);\n\nexport const BlockMoverUpButton = forwardRef( ( props, ref ) => {\n\treturn <BlockMoverButton direction=\"up\" ref={ ref } { ...props } />;\n} );\n\nexport const BlockMoverDownButton = forwardRef( ( props, ref ) => {\n\treturn <BlockMoverButton direction=\"down\" ref={ ref } { ...props } />;\n} );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SACCC,WA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AS,KAAK,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,EAC3BC,WACD,CACe,CACf,CAAC;AAEL,CACD,CAAC;AAED,OAAO,MAAMmD,kBAAkB,GAAG/D,UAAU,CAAE,CAAEkB,KAAK,EAAEC,GAAG,KAAM;EAC/D,OAAOmC,aAAA,CAACvC,gBAAgB;IAACJ,SAAS,EAAC,IAAI;IAACQ,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACpE,CAAE,CAAC;AAEH,OAAO,MAAM8C,oBAAoB,GAAGhE,UAAU,CAAE,CAAEkB,KAAK,EAAEC,GAAG,KAAM;EACjE,OAAOmC,aAAA,CAACvC,gBAAgB;IAACJ,SAAS,EAAC,MAAM;IAACQ,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACtE,CAAE,CAAC"}
|
|
1
|
+
{"version":3,"names":["classnames","getBlockType","Button","VisuallyHidden","useInstanceId","useSelect","useDispatch","forwardRef","__","isRTL","chevronLeft","chevronRight","chevronUp","chevronDown","getBlockMoverDescription","store","blockEditorStore","getArrowIcon","direction","orientation","getMovementDirectionLabel","moveDirection","BlockMoverButton","clientIds","moverOrientation","props","ref","instanceId","normalizedClientIds","Array","isArray","blocksCount","length","disabled","blockType","isDisabled","rootClientId","isFirst","isLast","firstIndex","select","getBlockIndex","getBlockRootClientId","getBlockOrder","getBlock","getBlockListSettings","firstClientId","blockRootClientId","firstBlockIndex","lastBlockIndex","blockOrder","block","isFirstBlock","isLastBlock","blockListOrientation","name","moveBlocksDown","moveBlocksUp","moverFunction","onClick","event","descriptionId","createElement","Fragment","className","icon","label","__experimentalIsFocusable","id","title","BlockMoverUpButton","BlockMoverDownButton"],"sources":["@wordpress/block-editor/src/components/block-mover/button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tchevronLeft,\n\tchevronRight,\n\tchevronUp,\n\tchevronDown,\n} from '@wordpress/icons';\nimport { getBlockMoverDescription } from './mover-description';\nimport { store as blockEditorStore } from '../../store';\n\nconst getArrowIcon = ( direction, orientation ) => {\n\tif ( direction === 'up' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? chevronRight : chevronLeft;\n\t\t}\n\t\treturn chevronUp;\n\t} else if ( direction === 'down' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? chevronLeft : chevronRight;\n\t\t}\n\t\treturn chevronDown;\n\t}\n\treturn null;\n};\n\nconst getMovementDirectionLabel = ( moveDirection, orientation ) => {\n\tif ( moveDirection === 'up' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? __( 'Move right' ) : __( 'Move left' );\n\t\t}\n\t\treturn __( 'Move up' );\n\t} else if ( moveDirection === 'down' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? __( 'Move left' ) : __( 'Move right' );\n\t\t}\n\t\treturn __( 'Move down' );\n\t}\n\treturn null;\n};\n\nconst BlockMoverButton = forwardRef(\n\t(\n\t\t{ clientIds, direction, orientation: moverOrientation, ...props },\n\t\tref\n\t) => {\n\t\tconst instanceId = useInstanceId( BlockMoverButton );\n\t\tconst normalizedClientIds = Array.isArray( clientIds )\n\t\t\t? clientIds\n\t\t\t: [ clientIds ];\n\t\tconst blocksCount = normalizedClientIds.length;\n\t\tconst { disabled } = props;\n\n\t\tconst {\n\t\t\tblockType,\n\t\t\tisDisabled,\n\t\t\trootClientId,\n\t\t\tisFirst,\n\t\t\tisLast,\n\t\t\tfirstIndex,\n\t\t\torientation = 'vertical',\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\tgetBlock,\n\t\t\t\t\tgetBlockListSettings,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst firstClientId = normalizedClientIds[ 0 ];\n\t\t\t\tconst blockRootClientId = getBlockRootClientId( firstClientId );\n\t\t\t\tconst firstBlockIndex = getBlockIndex( firstClientId );\n\t\t\t\tconst lastBlockIndex = getBlockIndex(\n\t\t\t\t\tnormalizedClientIds[ normalizedClientIds.length - 1 ]\n\t\t\t\t);\n\t\t\t\tconst blockOrder = getBlockOrder( blockRootClientId );\n\t\t\t\tconst block = getBlock( firstClientId );\n\t\t\t\tconst isFirstBlock = firstBlockIndex === 0;\n\t\t\t\tconst isLastBlock = lastBlockIndex === blockOrder.length - 1;\n\t\t\t\tconst { orientation: blockListOrientation } =\n\t\t\t\t\tgetBlockListSettings( blockRootClientId ) || {};\n\n\t\t\t\treturn {\n\t\t\t\t\tblockType: block ? getBlockType( block.name ) : null,\n\t\t\t\t\tisDisabled:\n\t\t\t\t\t\tdisabled ||\n\t\t\t\t\t\t( direction === 'up' ? isFirstBlock : isLastBlock ),\n\t\t\t\t\trootClientId: blockRootClientId,\n\t\t\t\t\tfirstIndex: firstBlockIndex,\n\t\t\t\t\tisFirst: isFirstBlock,\n\t\t\t\t\tisLast: isLastBlock,\n\t\t\t\t\torientation: moverOrientation || blockListOrientation,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientIds, direction ]\n\t\t);\n\n\t\tconst { moveBlocksDown, moveBlocksUp } =\n\t\t\tuseDispatch( blockEditorStore );\n\t\tconst moverFunction =\n\t\t\tdirection === 'up' ? moveBlocksUp : moveBlocksDown;\n\n\t\tconst onClick = ( event ) => {\n\t\t\tmoverFunction( clientIds, rootClientId );\n\t\t\tif ( props.onClick ) {\n\t\t\t\tprops.onClick( event );\n\t\t\t}\n\t\t};\n\n\t\tconst descriptionId = `block-editor-block-mover-button__description-${ instanceId }`;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-mover-button',\n\t\t\t\t\t\t`is-${ direction }-button`\n\t\t\t\t\t) }\n\t\t\t\t\ticon={ getArrowIcon( direction, orientation ) }\n\t\t\t\t\tlabel={ getMovementDirectionLabel(\n\t\t\t\t\t\tdirection,\n\t\t\t\t\t\torientation\n\t\t\t\t\t) }\n\t\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tonClick={ isDisabled ? null : onClick }\n\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t/>\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ getBlockMoverDescription(\n\t\t\t\t\t\tblocksCount,\n\t\t\t\t\t\tblockType && blockType.title,\n\t\t\t\t\t\tfirstIndex,\n\t\t\t\t\t\tisFirst,\n\t\t\t\t\t\tisLast,\n\t\t\t\t\t\tdirection === 'up' ? -1 : 1,\n\t\t\t\t\t\torientation\n\t\t\t\t\t) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t</>\n\t\t);\n\t}\n);\n\nexport const BlockMoverUpButton = forwardRef( ( props, ref ) => {\n\treturn <BlockMoverButton direction=\"up\" ref={ ref } { ...props } />;\n} );\n\nexport const BlockMoverDownButton = forwardRef( ( props, ref ) => {\n\treturn <BlockMoverButton direction=\"down\" ref={ ref } { ...props } />;\n} );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAA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AA,CACzB,CAAC,EACFL,aAAA,CAAC3D,cAAc;IAACiE,EAAE,EAAGP;EAAe,GACjC/C,wBAAwB,CACzBiB,WAAW,EACXG,SAAS,IAAIA,SAAS,CAACmC,KAAK,EAC5B9B,UAAU,EACVF,OAAO,EACPC,MAAM,EACNpB,SAAS,KAAK,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,EAC3BC,WACD,CACe,CACf,CAAC;AAEL,CACD,CAAC;AAED,OAAO,MAAMmD,kBAAkB,GAAG/D,UAAU,CAAE,CAAEkB,KAAK,EAAEC,GAAG,KAAM;EAC/D,OAAOoC,aAAA,CAACxC,gBAAgB;IAACJ,SAAS,EAAC,IAAI;IAACQ,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACpE,CAAE,CAAC;AAEH,OAAO,MAAM8C,oBAAoB,GAAGhE,UAAU,CAAE,CAAEkB,KAAK,EAAEC,GAAG,KAAM;EACjE,OAAOoC,aAAA,CAACxC,gBAAgB;IAACJ,SAAS,EAAC,MAAM;IAACQ,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACtE,CAAE,CAAC"}
|
|
@@ -21,7 +21,9 @@ import { BlockMoverUpButton, BlockMoverDownButton } from './button';
|
|
|
21
21
|
import { store as blockEditorStore } from '../../store';
|
|
22
22
|
function BlockMover({
|
|
23
23
|
clientIds,
|
|
24
|
-
hideDragHandle
|
|
24
|
+
hideDragHandle,
|
|
25
|
+
isBlockMoverUpButtonDisabled,
|
|
26
|
+
isBlockMoverDownButtonDisabled
|
|
25
27
|
}) {
|
|
26
28
|
const {
|
|
27
29
|
canMove,
|
|
@@ -75,9 +77,11 @@ function BlockMover({
|
|
|
75
77
|
})), createElement("div", {
|
|
76
78
|
className: "block-editor-block-mover__move-button-container"
|
|
77
79
|
}, createElement(ToolbarItem, null, itemProps => createElement(BlockMoverUpButton, {
|
|
80
|
+
disabled: isBlockMoverUpButtonDisabled,
|
|
78
81
|
clientIds: clientIds,
|
|
79
82
|
...itemProps
|
|
80
83
|
})), createElement(ToolbarItem, null, itemProps => createElement(BlockMoverDownButton, {
|
|
84
|
+
disabled: isBlockMoverDownButtonDisabled,
|
|
81
85
|
clientIds: clientIds,
|
|
82
86
|
...itemProps
|
|
83
87
|
}))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","dragHandle","ToolbarGroup","ToolbarItem","Button","useSelect","__","BlockDraggable","BlockMoverUpButton","BlockMoverDownButton","store","blockEditorStore","BlockMover","clientIds","hideDragHandle","canMove","rootClientId","isFirst","isLast","orientation","select","getBlockIndex","getBlockListSettings","canMoveBlocks","getBlockOrder","getBlockRootClientId","normalizedClientIds","Array","isArray","firstClientId","_rootClientId","firstIndex","lastIndex","length","blockOrder","dragHandleLabel","createElement","className","fadeWhenDisabled","draggableProps","icon","label","tabIndex","itemProps"],"sources":["@wordpress/block-editor/src/components/block-mover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\n\nimport { dragHandle } from '@wordpress/icons';\nimport { ToolbarGroup, ToolbarItem, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockDraggable from '../block-draggable';\nimport { BlockMoverUpButton, BlockMoverDownButton } from './button';\nimport { store as blockEditorStore } from '../../store';\n\nfunction BlockMover( {
|
|
1
|
+
{"version":3,"names":["classnames","dragHandle","ToolbarGroup","ToolbarItem","Button","useSelect","__","BlockDraggable","BlockMoverUpButton","BlockMoverDownButton","store","blockEditorStore","BlockMover","clientIds","hideDragHandle","isBlockMoverUpButtonDisabled","isBlockMoverDownButtonDisabled","canMove","rootClientId","isFirst","isLast","orientation","select","getBlockIndex","getBlockListSettings","canMoveBlocks","getBlockOrder","getBlockRootClientId","normalizedClientIds","Array","isArray","firstClientId","_rootClientId","firstIndex","lastIndex","length","blockOrder","dragHandleLabel","createElement","className","fadeWhenDisabled","draggableProps","icon","label","tabIndex","itemProps","disabled"],"sources":["@wordpress/block-editor/src/components/block-mover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\n\nimport { dragHandle } from '@wordpress/icons';\nimport { ToolbarGroup, ToolbarItem, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockDraggable from '../block-draggable';\nimport { BlockMoverUpButton, BlockMoverDownButton } from './button';\nimport { store as blockEditorStore } from '../../store';\n\nfunction BlockMover( {\n\tclientIds,\n\thideDragHandle,\n\tisBlockMoverUpButtonDisabled,\n\tisBlockMoverDownButtonDisabled,\n} ) {\n\tconst { canMove, rootClientId, isFirst, isLast, orientation } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tcanMoveBlocks,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst normalizedClientIds = Array.isArray( clientIds )\n\t\t\t\t? clientIds\n\t\t\t\t: [ clientIds ];\n\t\t\tconst firstClientId = normalizedClientIds[ 0 ];\n\t\t\tconst _rootClientId = getBlockRootClientId( firstClientId );\n\t\t\tconst firstIndex = getBlockIndex( firstClientId );\n\t\t\tconst lastIndex = getBlockIndex(\n\t\t\t\tnormalizedClientIds[ normalizedClientIds.length - 1 ]\n\t\t\t);\n\t\t\tconst blockOrder = getBlockOrder( _rootClientId );\n\n\t\t\treturn {\n\t\t\t\tcanMove: canMoveBlocks( clientIds, _rootClientId ),\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisFirst: firstIndex === 0,\n\t\t\t\tisLast: lastIndex === blockOrder.length - 1,\n\t\t\t\torientation: getBlockListSettings( _rootClientId )?.orientation,\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\tif ( ! canMove || ( isFirst && isLast && ! rootClientId ) ) {\n\t\treturn null;\n\t}\n\n\tconst dragHandleLabel = __( 'Drag' );\n\n\treturn (\n\t\t<ToolbarGroup\n\t\t\tclassName={ classnames( 'block-editor-block-mover', {\n\t\t\t\t'is-horizontal': orientation === 'horizontal',\n\t\t\t} ) }\n\t\t>\n\t\t\t{ ! hideDragHandle && (\n\t\t\t\t<BlockDraggable clientIds={ clientIds } fadeWhenDisabled>\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-editor-block-mover__drag-handle\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\tlabel={ dragHandleLabel }\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<div className=\"block-editor-block-mover__move-button-container\">\n\t\t\t\t<ToolbarItem>\n\t\t\t\t\t{ ( itemProps ) => (\n\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\tdisabled={ isBlockMoverUpButtonDisabled }\n\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t{ ...itemProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarItem>\n\t\t\t\t<ToolbarItem>\n\t\t\t\t\t{ ( itemProps ) => (\n\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\tdisabled={ isBlockMoverDownButtonDisabled }\n\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t{ ...itemProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarItem>\n\t\t\t</div>\n\t\t</ToolbarGroup>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-mover/README.md\n */\nexport default BlockMover;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;;AAEA,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,YAAY,EAAEC,WAAW,EAAEC,MAAM,QAAQ,uBAAuB;AACzE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,kBAAkB,EAAEC,oBAAoB,QAAQ,UAAU;AACnE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAEvD,SAASC,UAAUA,CAAE;EACpBC,SAAS;EACTC,cAAc;EACdC,4BAA4B;EAC5BC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,OAAO;IAAEC,YAAY;IAAEC,OAAO;IAAEC,MAAM;IAAEC;EAAY,CAAC,GAAGhB,SAAS,CACtEiB,MAAM,IAAM;IACb,MAAM;MACLC,aAAa;MACbC,oBAAoB;MACpBC,aAAa;MACbC,aAAa;MACbC;IACD,CAAC,GAAGL,MAAM,CAAEX,gBAAiB,CAAC;IAC9B,MAAMiB,mBAAmB,GAAGC,KAAK,CAACC,OAAO,CAAEjB,SAAU,CAAC,GACnDA,SAAS,GACT,CAAEA,SAAS,CAAE;IAChB,MAAMkB,aAAa,GAAGH,mBAAmB,CAAE,CAAC,CAAE;IAC9C,MAAMI,aAAa,GAAGL,oBAAoB,CAAEI,aAAc,CAAC;IAC3D,MAAME,UAAU,GAAGV,aAAa,CAAEQ,aAAc,CAAC;IACjD,MAAMG,SAAS,GAAGX,aAAa,CAC9BK,mBAAmB,CAAEA,mBAAmB,CAACO,MAAM,GAAG,CAAC,CACpD,CAAC;IACD,MA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,QAAQ,EAAG9B,8BAAgC;IAC3CH,SAAS,EAAGA,SAAW;IAAA,GAClBgC;EAAS,CACd,CAEU,CACT,CACQ,CAAC;AAEjB;;AAEA;AACA;AACA;AACA,eAAejC,UAAU"}
|
|
@@ -44,6 +44,7 @@ function BlockPattern({
|
|
|
44
44
|
pattern,
|
|
45
45
|
onClick,
|
|
46
46
|
onHover,
|
|
47
|
+
showTitle = true,
|
|
47
48
|
showTooltip
|
|
48
49
|
}) {
|
|
49
50
|
const [isDragging, setIsDragging] = useState(false);
|
|
@@ -104,7 +105,7 @@ function BlockPattern({
|
|
|
104
105
|
}, createElement(BlockPreview, {
|
|
105
106
|
blocks: blocks,
|
|
106
107
|
viewportWidth: viewportWidth
|
|
107
|
-
}), createElement(HStack, {
|
|
108
|
+
}), showTitle && createElement(HStack, {
|
|
108
109
|
className: "block-editor-patterns__pattern-details"
|
|
109
110
|
}, pattern.type === INSERTER_PATTERN_TYPES.user && !pattern.syncStatus && createElement("div", {
|
|
110
111
|
className: "block-editor-patterns__pattern-icon-wrapper"
|
|
@@ -130,6 +131,7 @@ function BlockPatternsList({
|
|
|
130
131
|
onClickPattern,
|
|
131
132
|
orientation,
|
|
132
133
|
label = __('Block patterns'),
|
|
134
|
+
showTitle = true,
|
|
133
135
|
showTitlesAsTooltip,
|
|
134
136
|
pagingProps
|
|
135
137
|
}, ref) {
|
|
@@ -160,6 +162,7 @@ function BlockPatternsList({
|
|
|
160
162
|
onClick: onClickPattern,
|
|
161
163
|
onHover: onHover,
|
|
162
164
|
isDraggable: isDraggable,
|
|
165
|
+
showTitle: showTitle,
|
|
163
166
|
showTooltip: showTitlesAsTooltip
|
|
164
167
|
}) : createElement(BlockPatternPlaceholder, {
|
|
165
168
|
key: pattern.name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","useEffect","useState","forwardRef","VisuallyHidden","Tooltip","privateApis","componentsPrivateApis","__experimentalHStack","HStack","useInstanceId","__","Icon","symbol","unlock","BlockPreview","InserterDraggableBlocks","BlockPatternsPaging","INSERTER_PATTERN_TYPES","CompositeV2","Composite","CompositeItemV2","CompositeItem","useCompositeStoreV2","useCompositeStore","WithToolTip","showTooltip","title","children","createElement","text","Fragment","BlockPattern","id","isDraggable","pattern","onClick","onHover","isDragging","setIsDragging","blocks","viewportWidth","instanceId","descriptionId","isEnabled","draggable","onDragStart","onDragEnd","className","event","type","user","render","role","description","undefined","syncStatus","onMouseEnter","onMouseLeave","icon","BlockPatternPlaceholder","BlockPatternsList","blockPatterns","shownPatterns","onClickPattern","orientation","label","showTitlesAsTooltip","pagingProps","ref","compositeStore","setActiveId","store","map","isShown","includes","key","name"],"sources":["@wordpress/block-editor/src/components/block-patterns-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useState, forwardRef } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\tTooltip,\n\tprivateApis as componentsPrivateApis,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, symbol } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport BlockPreview from '../block-preview';\nimport InserterDraggableBlocks from '../inserter-draggable-blocks';\nimport BlockPatternsPaging from '../block-patterns-paging';\nimport { INSERTER_PATTERN_TYPES } from '../inserter/block-patterns-tab/utils';\n\nconst {\n\tCompositeV2: Composite,\n\tCompositeItemV2: CompositeItem,\n\tuseCompositeStoreV2: useCompositeStore,\n} = unlock( componentsPrivateApis );\n\nconst WithToolTip = ( { showTooltip, title, children } ) => {\n\tif ( showTooltip ) {\n\t\treturn <Tooltip text={ title }>{ children }</Tooltip>;\n\t}\n\treturn <>{ children }</>;\n};\n\nfunction BlockPattern( {\n\tid,\n\tisDraggable,\n\tpattern,\n\tonClick,\n\tonHover,\n\tshowTooltip,\n} ) {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\tconst { blocks, viewportWidth } = pattern;\n\tconst instanceId = useInstanceId( BlockPattern );\n\tconst descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;\n\n\treturn (\n\t\t<InserterDraggableBlocks\n\t\t\tisEnabled={ isDraggable }\n\t\t\tblocks={ blocks }\n\t\t\tpattern={ pattern }\n\t\t>\n\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-block-patterns-list__list-item\"\n\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( true );\n\t\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\tonDragStart( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonDragEnd={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( false );\n\t\t\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\t\t\tonDragEnd( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<WithToolTip\n\t\t\t\t\t\tshowTooltip={\n\t\t\t\t\t\t\tshowTooltip &&\n\t\t\t\t\t\t\t! pattern.type !== INSERTER_PATTERN_TYPES.user\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttitle={ pattern.title }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CompositeItem\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\tpattern.description\n\t\t\t\t\t\t\t\t\t\t\t? descriptionId\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__item',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__list-item-synced':\n\t\t\t\t\t\t\t\t\t\t\t\tpattern.type ===\n\t\t\t\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user &&\n\t\t\t\t\t\t\t\t\t\t\t\t! pattern.syncStatus,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid={ id }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonClick( pattern, blocks );\n\t\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseEnter={ () => {\n\t\t\t\t\t\t\t\tif ( isDragging ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonHover?.( pattern );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseLeave={ () => onHover?.( null ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<HStack className=\"block-editor-patterns__pattern-details\">\n\t\t\t\t\t\t\t\t{ pattern.type ===\n\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user &&\n\t\t\t\t\t\t\t\t\t! pattern.syncStatus && (\n\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-patterns__pattern-icon-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-patterns__pattern-icon\"\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ symbol }\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) }\n\t\t\t\t\t\t\t\t{ ( ! showTooltip ||\n\t\t\t\t\t\t\t\t\tpattern.type ===\n\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user ) && (\n\t\t\t\t\t\t\t\t\t<div className=\"block-editor-block-patterns-list__item-title\">\n\t\t\t\t\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</HStack>\n\n\t\t\t\t\t\t\t{ !! pattern.description && (\n\t\t\t\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t\t\t\t{ pattern.description }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</CompositeItem>\n\t\t\t\t\t</WithToolTip>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</InserterDraggableBlocks>\n\t);\n}\n\nfunction BlockPatternPlaceholder() {\n\treturn (\n\t\t<div className=\"block-editor-block-patterns-list__item is-placeholder\" />\n\t);\n}\n\nfunction BlockPatternsList(\n\t{\n\t\tisDraggable,\n\t\tblockPatterns,\n\t\tshownPatterns,\n\t\tonHover,\n\t\tonClickPattern,\n\t\torientation,\n\t\tlabel = __( 'Block patterns' ),\n\t\tshowTitlesAsTooltip,\n\t\tpagingProps,\n\t},\n\tref\n) {\n\tconst compositeStore = useCompositeStore( { orientation } );\n\tconst { setActiveId } = compositeStore;\n\n\tuseEffect( () => {\n\t\t// We reset the active composite item whenever the\n\t\t// available patterns change, to make sure that\n\t\t// focus is put back to the start.\n\t\tsetActiveId( undefined );\n\t}, [ setActiveId, shownPatterns, blockPatterns ] );\n\n\treturn (\n\t\t<Composite\n\t\t\tstore={ compositeStore }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-patterns-list\"\n\t\t\taria-label={ label }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ blockPatterns.map( ( pattern ) => {\n\t\t\t\tconst isShown = shownPatterns.includes( pattern );\n\t\t\t\treturn isShown ? (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tid={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonClick={ onClickPattern }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tisDraggable={ isDraggable }\n\t\t\t\t\t\tshowTooltip={ showTitlesAsTooltip }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockPatternPlaceholder key={ pattern.name } />\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ pagingProps && <BlockPatternsPaging { ...pagingProps } /> }\n\t\t</Composite>\n\t);\n}\n\nexport default forwardRef( BlockPatternsList );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;AACpE,SACCC,cAAc,EACdC,OAAO,EACPC,WAAW,IAAIC,qBAAqB,EACpCC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,SAASC,sBAAsB,QAAQ,sCAAsC;AAE7E,MAAM;EACLC,WAAW,EAAEC,SAAS;EACtBC,eAAe,EAAEC,aAAa;EAC9BC,mBAAmB,EAAEC;AACtB,CAAC,GAAGV,MAA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,cAAgB;MAC1B3B,OAAO,EAAGA,OAAS;MACnBH,WAAW,EAAGA,WAAa;MAC3BR,WAAW,EAAGyC;IAAqB,CACnC,CAAC,GAEFtC,aAAA,CAAC+B,uBAAuB;MAACgB,GAAG,EAAGzC,OAAO,CAAC0C;IAAM,CAAE,CAC/C;EACF,CAAE,CAAC,EACDT,WAAW,IAAIvC,aAAA,CAACZ,mBAAmB;IAAA,GAAMmD;EAAW,CAAI,CAChD,CAAC;AAEd;AAEA,eAAejE,UAAU,CAAE0D,iBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"names":["classnames","useEffect","useState","forwardRef","VisuallyHidden","Tooltip","privateApis","componentsPrivateApis","__experimentalHStack","HStack","useInstanceId","__","Icon","symbol","unlock","BlockPreview","InserterDraggableBlocks","BlockPatternsPaging","INSERTER_PATTERN_TYPES","CompositeV2","Composite","CompositeItemV2","CompositeItem","useCompositeStoreV2","useCompositeStore","WithToolTip","showTooltip","title","children","createElement","text","Fragment","BlockPattern","id","isDraggable","pattern","onClick","onHover","showTitle","isDragging","setIsDragging","blocks","viewportWidth","instanceId","descriptionId","isEnabled","draggable","onDragStart","onDragEnd","className","event","type","user","render","role","description","undefined","syncStatus","onMouseEnter","onMouseLeave","icon","BlockPatternPlaceholder","BlockPatternsList","blockPatterns","shownPatterns","onClickPattern","orientation","label","showTitlesAsTooltip","pagingProps","ref","compositeStore","setActiveId","store","map","isShown","includes","key","name"],"sources":["@wordpress/block-editor/src/components/block-patterns-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useState, forwardRef } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\tTooltip,\n\tprivateApis as componentsPrivateApis,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, symbol } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport BlockPreview from '../block-preview';\nimport InserterDraggableBlocks from '../inserter-draggable-blocks';\nimport BlockPatternsPaging from '../block-patterns-paging';\nimport { INSERTER_PATTERN_TYPES } from '../inserter/block-patterns-tab/utils';\n\nconst {\n\tCompositeV2: Composite,\n\tCompositeItemV2: CompositeItem,\n\tuseCompositeStoreV2: useCompositeStore,\n} = unlock( componentsPrivateApis );\n\nconst WithToolTip = ( { showTooltip, title, children } ) => {\n\tif ( showTooltip ) {\n\t\treturn <Tooltip text={ title }>{ children }</Tooltip>;\n\t}\n\treturn <>{ children }</>;\n};\n\nfunction BlockPattern( {\n\tid,\n\tisDraggable,\n\tpattern,\n\tonClick,\n\tonHover,\n\tshowTitle = true,\n\tshowTooltip,\n} ) {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\tconst { blocks, viewportWidth } = pattern;\n\tconst instanceId = useInstanceId( BlockPattern );\n\tconst descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;\n\n\treturn (\n\t\t<InserterDraggableBlocks\n\t\t\tisEnabled={ isDraggable }\n\t\t\tblocks={ blocks }\n\t\t\tpattern={ pattern }\n\t\t>\n\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-block-patterns-list__list-item\"\n\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( true );\n\t\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\tonDragStart( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonDragEnd={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( false );\n\t\t\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\t\t\tonDragEnd( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<WithToolTip\n\t\t\t\t\t\tshowTooltip={\n\t\t\t\t\t\t\tshowTooltip &&\n\t\t\t\t\t\t\t! pattern.type !== INSERTER_PATTERN_TYPES.user\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttitle={ pattern.title }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CompositeItem\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\tpattern.description\n\t\t\t\t\t\t\t\t\t\t\t? descriptionId\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__item',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__list-item-synced':\n\t\t\t\t\t\t\t\t\t\t\t\tpattern.type ===\n\t\t\t\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user &&\n\t\t\t\t\t\t\t\t\t\t\t\t! pattern.syncStatus,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid={ id }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonClick( pattern, blocks );\n\t\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseEnter={ () => {\n\t\t\t\t\t\t\t\tif ( isDragging ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonHover?.( pattern );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseLeave={ () => onHover?.( null ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{ showTitle && (\n\t\t\t\t\t\t\t\t<HStack className=\"block-editor-patterns__pattern-details\">\n\t\t\t\t\t\t\t\t\t{ pattern.type ===\n\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user &&\n\t\t\t\t\t\t\t\t\t\t! pattern.syncStatus && (\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-patterns__pattern-icon-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-patterns__pattern-icon\"\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( ! showTooltip ||\n\t\t\t\t\t\t\t\t\t\tpattern.type ===\n\t\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user ) && (\n\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-block-patterns-list__item-title\">\n\t\t\t\t\t\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t\t{ !! pattern.description && (\n\t\t\t\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t\t\t\t{ pattern.description }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</CompositeItem>\n\t\t\t\t\t</WithToolTip>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</InserterDraggableBlocks>\n\t);\n}\n\nfunction BlockPatternPlaceholder() {\n\treturn (\n\t\t<div className=\"block-editor-block-patterns-list__item is-placeholder\" />\n\t);\n}\n\nfunction BlockPatternsList(\n\t{\n\t\tisDraggable,\n\t\tblockPatterns,\n\t\tshownPatterns,\n\t\tonHover,\n\t\tonClickPattern,\n\t\torientation,\n\t\tlabel = __( 'Block patterns' ),\n\t\tshowTitle = true,\n\t\tshowTitlesAsTooltip,\n\t\tpagingProps,\n\t},\n\tref\n) {\n\tconst compositeStore = useCompositeStore( { orientation } );\n\tconst { setActiveId } = compositeStore;\n\n\tuseEffect( () => {\n\t\t// We reset the active composite item whenever the\n\t\t// available patterns change, to make sure that\n\t\t// focus is put back to the start.\n\t\tsetActiveId( undefined );\n\t}, [ setActiveId, shownPatterns, blockPatterns ] );\n\n\treturn (\n\t\t<Composite\n\t\t\tstore={ compositeStore }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-patterns-list\"\n\t\t\taria-label={ label }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ blockPatterns.map( ( pattern ) => {\n\t\t\t\tconst isShown = shownPatterns.includes( pattern );\n\t\t\t\treturn isShown ? (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tid={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonClick={ onClickPattern }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tisDraggable={ isDraggable }\n\t\t\t\t\t\tshowTitle={ showTitle }\n\t\t\t\t\t\tshowTooltip={ showTitlesAsTooltip }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockPatternPlaceholder key={ pattern.name } />\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ pagingProps && <BlockPatternsPaging { ...pagingProps } /> }\n\t\t</Composite>\n\t);\n}\n\nexport default forwardRef( BlockPatternsList );\n"],"mappings":";AAAA;AACA;AACA;AAC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D,MAAMC,cAAc,GAAG/C,iBAAiB,CAAE;IAAE0C;EAAY,CAAE,CAAC;EAC3D,MAAM;IAAEM;EAAY,CAAC,GAAGD,cAAc;EAEtCtE,SAAS,CAAE,MAAM;IAChB;IACA;IACA;IACAuE,WAAW,CAAEhB,SAAU,CAAC;EACzB,CAAC,EAAE,CAAEgB,WAAW,EAAER,aAAa,EAAED,aAAa,CAAG,CAAC;EAElD,OACClC,aAAA,CAACT,SAAS;IACTqD,KAAK,EAAGF,cAAgB;IACxBjB,IAAI,EAAC,SAAS;IACdL,SAAS,EAAC,kCAAkC;IAC5C,cAAakB,KAAO;IACpBG,GAAG,EAAGA;EAAK,GAETP,aAAa,CAACW,GAAG,CAAIvC,OAAO,IAAM;IACnC,MAAMwC,OAAO,GAAGX,aAAa,CAACY,QAAQ,CAAEzC,OAAQ,CAAC;IACjD,OAAOwC,OAAO,GACb9C,aAAA,CAACG,YAAY;MACZ6C,GAAG,EAAG1C,OAAO,CAAC2C,IAAM;MACpB7C,EAAE,EAAGE,OAAO,CAAC2C,IAAM;MACnB3C,OAAO,EAAGA,OAAS;MACnBC,OAAO,EAAG6B,cAAgB;MAC1B5B,OAAO,EAAGA,OAAS;MACnBH,WAAW,EAAGA,WAAa;MAC3BI,SAAS,EAAGA,SAAW;MACvBZ,WAAW,EAAG0C;IAAqB,CACnC,CAAC,GAEFvC,aAAA,CAACgC,uBAAuB;MAACgB,GAAG,EAAG1C,OAAO,CAAC2C;IAAM,CAAE,CAC/C;EACF,CAAE,CAAC,EACDT,WAAW,IAAIxC,aAAA,CAACZ,mBAAmB;IAAA,GAAMoD;EAAW,CAAI,CAChD,CAAC;AAEd;AAEA,eAAelE,UAAU,CAAE2D,iBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
1
|
+
import { createElement, Fragment } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
@@ -12,6 +12,7 @@ import styles from './container.native.scss';
|
|
|
12
12
|
import InspectorControls from '../inspector-controls';
|
|
13
13
|
import ImageLinkDestinationsScreen from '../image-link-destinations';
|
|
14
14
|
import useMultipleOriginColorsAndGradients from '../colors-gradients/use-multiple-origin-colors-and-gradients';
|
|
15
|
+
import AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';
|
|
15
16
|
export const blockSettingsScreens = {
|
|
16
17
|
settings: 'Settings',
|
|
17
18
|
color: 'Color',
|
|
@@ -38,7 +39,7 @@ export default function BottomSheetSettings(props) {
|
|
|
38
39
|
main: true
|
|
39
40
|
}, createElement(BottomSheet.NavigationScreen, {
|
|
40
41
|
name: blockSettingsScreens.settings
|
|
41
|
-
}, createElement(InspectorControls.Slot, null)), createElement(BottomSheet.NavigationScreen, {
|
|
42
|
+
}, createElement(Fragment, null, createElement(InspectorControls.Slot, null), createElement(AdvancedControls, null))), createElement(BottomSheet.NavigationScreen, {
|
|
42
43
|
name: BottomSheet.SubSheet.screenName
|
|
43
44
|
}, createElement(BottomSheet.SubSheet.Slot, null)), createElement(BottomSheet.NavigationScreen, {
|
|
44
45
|
name: blockSettingsScreens.color
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BottomSheet","ColorSettings","FocalPointSettingsPanel","LinkPickerScreen","useDispatch","useSelect","styles","InspectorControls","ImageLinkDestinationsScreen","useMultipleOriginColorsAndGradients","blockSettingsScreens","settings","color","focalPoint","linkPicker","imageLinkDestinations","BottomSheetSettings","props","colorSettings","closeGeneralSidebar","editorSidebarOpened","select","isEditorSidebarOpened","createElement","isVisible","onClose","hideHeader","contentStyle","content","hasNavigation","testID","NavigationContainer","animate","main","NavigationScreen","name","Slot","SubSheet","screenName","defaultSettings","fullScreen","isScrollable","returnScreenName"],"sources":["@wordpress/block-editor/src/components/block-settings/container.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBottomSheet,\n\tColorSettings,\n\tFocalPointSettingsPanel,\n\tLinkPickerScreen,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport styles from './container.native.scss';\nimport InspectorControls from '../inspector-controls';\nimport ImageLinkDestinationsScreen from '../image-link-destinations';\nimport useMultipleOriginColorsAndGradients from '../colors-gradients/use-multiple-origin-colors-and-gradients';\n\nexport const blockSettingsScreens = {\n\tsettings: 'Settings',\n\tcolor: 'Color',\n\tfocalPoint: 'FocalPoint',\n\tlinkPicker: 'linkPicker',\n\timageLinkDestinations: 'imageLinkDestinations',\n};\n\nexport default function BottomSheetSettings( props ) {\n\tconst colorSettings = useMultipleOriginColorsAndGradients();\n\tconst { closeGeneralSidebar } = useDispatch( 'core/edit-post' );\n\tconst editorSidebarOpened = useSelect( ( select ) =>\n\t\tselect( 'core/edit-post' ).isEditorSidebarOpened()\n\t);\n\n\treturn (\n\t\t<BottomSheet\n\t\t\tisVisible={ editorSidebarOpened }\n\t\t\tonClose={ closeGeneralSidebar }\n\t\t\thideHeader\n\t\t\tcontentStyle={ styles.content }\n\t\t\thasNavigation\n\t\t\ttestID=\"block-settings-modal\"\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<BottomSheet.NavigationContainer animate main>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ blockSettingsScreens.settings }\n\t\t\t\t>\n\t\t\t\t\t<InspectorControls.Slot />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ BottomSheet.SubSheet.screenName }\n\t\t\t\t>\n\t\t\t\t\t<BottomSheet.SubSheet.Slot />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ blockSettingsScreens.color }\n\t\t\t\t>\n\t\t\t\t\t<ColorSettings defaultSettings={ colorSettings } />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ blockSettingsScreens.focalPoint }\n\t\t\t\t\tfullScreen\n\t\t\t\t>\n\t\t\t\t\t<FocalPointSettingsPanel />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ blockSettingsScreens.linkPicker }\n\t\t\t\t\tfullScreen\n\t\t\t\t\tisScrollable\n\t\t\t\t>\n\t\t\t\t\t<LinkPickerScreen\n\t\t\t\t\t\treturnScreenName={ blockSettingsScreens.settings }\n\t\t\t\t\t/>\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ blockSettingsScreens.imageLinkDestinations }\n\t\t\t\t>\n\t\t\t\t\t<ImageLinkDestinationsScreen { ...props } />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t</BottomSheet.NavigationContainer>\n\t\t</BottomSheet>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,WAAW,EACXC,aAAa,EACbC,uBAAuB,EACvBC,gBAAgB,QACV,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,2BAA2B,MAAM,4BAA4B;AACpE,OAAOC,mCAAmC,MAAM,8DAA8D;
|
|
1
|
+
{"version":3,"names":["BottomSheet","ColorSettings","FocalPointSettingsPanel","LinkPickerScreen","useDispatch","useSelect","styles","InspectorControls","ImageLinkDestinationsScreen","useMultipleOriginColorsAndGradients","AdvancedControls","blockSettingsScreens","settings","color","focalPoint","linkPicker","imageLinkDestinations","BottomSheetSettings","props","colorSettings","closeGeneralSidebar","editorSidebarOpened","select","isEditorSidebarOpened","createElement","isVisible","onClose","hideHeader","contentStyle","content","hasNavigation","testID","NavigationContainer","animate","main","NavigationScreen","name","Fragment","Slot","SubSheet","screenName","defaultSettings","fullScreen","isScrollable","returnScreenName"],"sources":["@wordpress/block-editor/src/components/block-settings/container.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBottomSheet,\n\tColorSettings,\n\tFocalPointSettingsPanel,\n\tLinkPickerScreen,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport styles from './container.native.scss';\nimport InspectorControls from '../inspector-controls';\nimport ImageLinkDestinationsScreen from '../image-link-destinations';\nimport useMultipleOriginColorsAndGradients from '../colors-gradients/use-multiple-origin-colors-and-gradients';\nimport AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';\n\nexport const blockSettingsScreens = {\n\tsettings: 'Settings',\n\tcolor: 'Color',\n\tfocalPoint: 'FocalPoint',\n\tlinkPicker: 'linkPicker',\n\timageLinkDestinations: 'imageLinkDestinations',\n};\n\nexport default function BottomSheetSettings( props ) {\n\tconst colorSettings = useMultipleOriginColorsAndGradients();\n\tconst { closeGeneralSidebar } = useDispatch( 'core/edit-post' );\n\tconst editorSidebarOpened = useSelect( ( select ) =>\n\t\tselect( 'core/edit-post' ).isEditorSidebarOpened()\n\t);\n\n\treturn (\n\t\t<BottomSheet\n\t\t\tisVisible={ editorSidebarOpened }\n\t\t\tonClose={ closeGeneralSidebar }\n\t\t\thideHeader\n\t\t\tcontentStyle={ styles.content }\n\t\t\thasNavigation\n\t\t\ttestID=\"block-settings-modal\"\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<BottomSheet.NavigationContainer animate main>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ blockSettingsScreens.settings }\n\t\t\t\t>\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorControls.Slot />\n\t\t\t\t\t\t<AdvancedControls />\n\t\t\t\t\t</>\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ BottomSheet.SubSheet.screenName }\n\t\t\t\t>\n\t\t\t\t\t<BottomSheet.SubSheet.Slot />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ blockSettingsScreens.color }\n\t\t\t\t>\n\t\t\t\t\t<ColorSettings defaultSettings={ colorSettings } />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ blockSettingsScreens.focalPoint }\n\t\t\t\t\tfullScreen\n\t\t\t\t>\n\t\t\t\t\t<FocalPointSettingsPanel />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ blockSettingsScreens.linkPicker }\n\t\t\t\t\tfullScreen\n\t\t\t\t\tisScrollable\n\t\t\t\t>\n\t\t\t\t\t<LinkPickerScreen\n\t\t\t\t\t\treturnScreenName={ blockSettingsScreens.settings }\n\t\t\t\t\t/>\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ blockSettingsScreens.imageLinkDestinations }\n\t\t\t\t>\n\t\t\t\t\t<ImageLinkDestinationsScreen { ...props } />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t</BottomSheet.NavigationContainer>\n\t\t</BottomSheet>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,WAAW,EACXC,aAAa,EACbC,uBAAuB,EACvBC,gBAAgB,QACV,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,2BAA2B,MAAM,4BAA4B;AACpE,OAAOC,mCAAmC,MAAM,8DAA8D;AAC9G,OAAOC,gBAAgB,MAAM,oDAAoD;AAEjF,OAAO,MAAMC,oBAAoB,GAAG;EACnCC,QAAQ,EAAE,UAAU;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