@wordpress/block-editor 12.0.0 → 12.2.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 +6 -0
- package/README.md +1 -1
- package/build/autocompleters/block.js +13 -5
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +6 -3
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-controls/slot.js +12 -4
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-controls/slot.native.js +10 -1
- package/build/components/block-controls/slot.native.js.map +1 -1
- package/build/components/block-draggable/index.js +11 -7
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.js +2 -2
- package/build/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
- package/build/components/block-editing-mode/index.js +84 -0
- package/build/components/block-editing-mode/index.js.map +1 -0
- package/build/components/block-list/block-invalid-warning.native.js +15 -7
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block-list-block-context.js +15 -0
- package/build/components/block-list/block-list-block-context.js.map +1 -0
- package/build/components/block-list/block-list-item-cell.native.js +15 -2
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +158 -195
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +57 -0
- package/build/components/block-list/block-outline.native.js.map +1 -0
- package/build/components/block-list/block.js +29 -37
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +347 -311
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +260 -357
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/insertion-point.native.js +4 -2
- package/build/components/block-list/insertion-point.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +2 -2
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +7 -5
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list-appender/index.js +15 -1
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +19 -4
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +8 -10
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +15 -4
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/preview-panel.js +1 -2
- package/build/components/block-styles/preview-panel.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +8 -0
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +125 -0
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -0
- package/build/components/block-switcher/index.js +34 -12
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +3 -3
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-toolbar/index.js +9 -7
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +22 -65
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +11 -5
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +3 -8
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +3 -2
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +7 -2
- package/build/components/convert-to-group-buttons/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.native.js +87 -3
- package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +23 -37
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +86 -0
- package/build/components/global-styles/advanced-panel.js.map +1 -0
- package/build/components/global-styles/color-panel.js +4 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +9 -8
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +1 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +24 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +1 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +27 -4
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +30 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/iframe/index.js +14 -7
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +24 -8
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/inner-blocks/index.js +2 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +7 -7
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +13 -5
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/index.js +3 -7
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -4
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/search-results.js +19 -6
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +5 -0
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/fill.js +1 -1
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +1 -1
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/slot.js +3 -6
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls/slot.native.js +1 -1
- package/build/components/inspector-controls/slot.native.js.map +1 -1
- package/build/components/line-height-control/index.js +7 -2
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/use-internal-input-value.js +9 -8
- package/build/components/link-control/use-internal-input-value.js.map +1 -1
- package/build/components/list-view/appender.js +6 -1
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/block-contents.js +9 -2
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +2 -1
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +25 -29
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +1 -3
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +43 -22
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +27 -3
- package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +163 -11
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/media-placeholder/index.js +68 -7
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +2 -2
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/preview-options/index.js +6 -1
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +0 -2
- package/build/components/publish-date-time-picker/index.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/components/url-input/index.js +4 -2
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +25 -15
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +8 -1
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/writing-flow/use-arrow-nav.js +13 -7
- package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build/hooks/align.js +4 -8
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/behaviors.js +115 -0
- package/build/hooks/behaviors.js.map +1 -0
- package/build/hooks/border.js +1 -1
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +8 -12
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/dimensions.js +0 -30
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +5 -9
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +8 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.js +10 -11
- 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/style.js +1 -1
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/use-editor-wrapper-styles.native.js +255 -0
- package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -0
- package/build/hooks/use-typography-props.js +14 -10
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/index.native.js +31 -0
- package/build/index.native.js.map +1 -0
- package/build/private-apis.js +4 -7
- package/build/private-apis.js.map +1 -1
- package/build/store/private-actions.js +46 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +88 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +36 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +28 -18
- package/build/store/selectors.js.map +1 -1
- package/build/utils/order-inserter-block-items.js +41 -0
- package/build/utils/order-inserter-block-items.js.map +1 -0
- package/build/utils/use-should-contextual-toolbar-show.js +16 -12
- package/build/utils/use-should-contextual-toolbar-show.js.map +1 -1
- package/build-module/autocompleters/block.js +12 -5
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +5 -3
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-controls/slot.js +11 -4
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-controls/slot.native.js +9 -1
- package/build-module/components/block-controls/slot.native.js.map +1 -1
- package/build-module/components/block-draggable/index.js +10 -6
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.js +2 -2
- package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +72 -0
- package/build-module/components/block-editing-mode/index.js.map +1 -0
- package/build-module/components/block-list/block-invalid-warning.native.js +16 -8
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-list/block-list-block-context.js +6 -0
- package/build-module/components/block-list/block-list-block-context.js.map +1 -0
- package/build-module/components/block-list/block-list-item-cell.native.js +13 -2
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +160 -190
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +44 -0
- package/build-module/components/block-list/block-outline.native.js.map +1 -0
- package/build-module/components/block-list/block.js +26 -34
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +345 -310
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +263 -355
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/insertion-point.native.js +4 -2
- package/build-module/components/block-list/insertion-point.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +1 -1
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +6 -5
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +15 -1
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +18 -4
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +8 -9
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +13 -5
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/preview-panel.js +1 -2
- package/build-module/components/block-styles/preview-panel.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +7 -0
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +108 -0
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -0
- package/build-module/components/block-switcher/index.js +33 -12
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -3
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +8 -7
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +22 -65
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +11 -5
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +3 -7
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +3 -2
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +7 -2
- package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.native.js +76 -1
- package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +22 -36
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +74 -0
- package/build-module/components/global-styles/advanced-panel.js.map +1 -0
- package/build-module/components/global-styles/color-panel.js +5 -2
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +9 -8
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +3 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +25 -4
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +25 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/iframe/index.js +15 -8
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +24 -8
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +2 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +7 -6
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +13 -5
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/index.js +3 -7
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -4
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-results.js +16 -6
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +4 -0
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +1 -1
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +1 -1
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +4 -7
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls/slot.native.js +1 -1
- package/build-module/components/inspector-controls/slot.native.js.map +1 -1
- package/build-module/components/line-height-control/index.js +7 -2
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/use-internal-input-value.js +9 -8
- package/build-module/components/link-control/use-internal-input-value.js.map +1 -1
- package/build-module/components/list-view/appender.js +6 -2
- package/build-module/components/list-view/appender.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +9 -3
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +2 -1
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +24 -29
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +1 -3
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +44 -23
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +26 -3
- package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +160 -11
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +66 -7
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +2 -2
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/preview-options/index.js +7 -2
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +0 -2
- package/build-module/components/publish-date-time-picker/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/index.js +4 -2
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +25 -16
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +8 -1
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.js +13 -7
- package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build-module/hooks/align.js +4 -7
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/behaviors.js +97 -0
- package/build-module/hooks/behaviors.js.map +1 -0
- package/build-module/hooks/border.js +1 -1
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +8 -11
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/dimensions.js +0 -28
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +4 -7
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout.js +9 -11
- 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/style.js +1 -1
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/use-editor-wrapper-styles.native.js +242 -0
- package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -0
- package/build-module/hooks/use-typography-props.js +14 -10
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/index.native.js +6 -0
- package/build-module/index.native.js.map +1 -0
- package/build-module/private-apis.js +3 -5
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-actions.js +42 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +79 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +34 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +26 -17
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/order-inserter-block-items.js +32 -0
- package/build-module/utils/order-inserter-block-items.js.map +1 -0
- package/build-module/utils/use-should-contextual-toolbar-show.js +16 -12
- package/build-module/utils/use-should-contextual-toolbar-show.js.map +1 -1
- package/build-style/content-rtl.css +32 -14
- package/build-style/content.css +32 -14
- package/build-style/default-editor-styles-rtl.css +1 -1
- package/build-style/default-editor-styles.css +1 -1
- package/build-style/style-rtl.css +56 -77
- package/build-style/style.css +57 -77
- package/package.json +32 -31
- package/src/autocompleters/block.js +15 -7
- package/src/components/block-breadcrumb/index.js +11 -3
- package/src/components/block-breadcrumb/style.scss +2 -1
- package/src/components/block-controls/slot.js +8 -4
- package/src/components/block-controls/slot.native.js +6 -1
- package/src/components/block-draggable/index.js +10 -6
- package/src/components/block-draggable/use-scroll-when-dragging.js +8 -2
- package/src/components/block-editing-mode/index.js +71 -0
- package/src/components/block-list/block-invalid-warning.native.js +17 -9
- package/src/components/block-list/block-list-block-context.js +6 -0
- package/src/components/block-list/block-list-item-cell.native.js +10 -1
- package/src/components/block-list/block-list-item.native.js +180 -208
- package/src/components/block-list/block-outline.native.js +58 -0
- package/src/components/block-list/block.js +38 -56
- package/src/components/block-list/block.native.js +531 -501
- package/src/components/block-list/content.scss +5 -6
- package/src/components/block-list/index.native.js +324 -382
- package/src/components/block-list/insertion-point.native.js +2 -2
- package/src/components/block-list/test/block-invalid-warning.native.js +48 -0
- package/src/components/block-list/test/index.native.js +205 -0
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-list/use-in-between-inserter.js +7 -3
- package/src/components/block-list-appender/index.js +22 -4
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +26 -1
- package/src/components/block-mover/style.scss +1 -0
- package/src/components/block-pattern-setup/style.scss +1 -4
- package/src/components/block-patterns-list/style.scss +1 -4
- package/src/components/block-settings-menu/block-settings-dropdown.js +10 -17
- package/src/components/block-settings-menu-controls/index.js +24 -4
- package/src/components/block-styles/preview-panel.js +1 -3
- package/src/components/block-styles/style.scss +4 -4
- package/src/components/block-switcher/block-transformations-menu.js +12 -0
- package/src/components/block-switcher/block-variation-transformations.js +115 -0
- package/src/components/block-switcher/index.js +38 -5
- package/src/components/block-switcher/pattern-transformations-menu.js +5 -5
- package/src/components/block-switcher/style.scss +6 -5
- package/src/components/block-toolbar/index.js +10 -11
- package/src/components/block-tools/block-contextual-toolbar.js +32 -67
- package/src/components/block-tools/insertion-point.js +23 -9
- package/src/components/block-tools/selected-block-popover.js +3 -5
- package/src/components/block-tools/style.scss +8 -0
- package/src/components/button-block-appender/content.scss +22 -0
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +16 -2
- package/src/components/convert-to-group-buttons/index.js +9 -2
- package/src/components/convert-to-group-buttons/index.native.js +79 -1
- package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +32 -38
- package/src/components/global-styles/advanced-panel.js +82 -0
- package/src/components/global-styles/color-panel.js +6 -1
- package/src/components/global-styles/dimensions-panel.js +9 -8
- package/src/components/global-styles/hooks.js +1 -5
- package/src/components/global-styles/index.js +6 -1
- package/src/components/global-styles/style.scss +17 -0
- package/src/components/global-styles/test/utils.js +57 -1
- package/src/components/global-styles/typography-panel.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +21 -3
- package/src/components/global-styles/utils.js +27 -0
- package/src/components/iframe/index.js +22 -12
- package/src/components/image-editor/use-save-image.js +20 -9
- package/src/components/inner-blocks/README.md +5 -0
- package/src/components/inner-blocks/index.js +2 -0
- package/src/components/inner-blocks/index.native.js +16 -6
- package/src/components/inner-blocks/use-nested-settings-update.js +20 -3
- package/src/components/inserter/index.js +1 -9
- package/src/components/inserter/quick-inserter.js +0 -2
- package/src/components/inserter/search-results.js +32 -6
- package/src/components/inserter-draggable-blocks/index.js +4 -0
- package/src/components/inspector-controls/fill.js +1 -1
- package/src/components/inspector-controls/fill.native.js +1 -1
- package/src/components/inspector-controls/slot.js +4 -9
- package/src/components/inspector-controls/slot.native.js +1 -1
- package/src/components/line-height-control/index.js +7 -2
- package/src/components/line-height-control/stories/index.js +1 -1
- package/src/components/link-control/test/index.js +42 -0
- package/src/components/link-control/use-internal-input-value.js +8 -7
- package/src/components/list-view/appender.js +3 -2
- package/src/components/list-view/block-contents.js +32 -20
- package/src/components/list-view/block-select-button.js +5 -1
- package/src/components/list-view/block.js +34 -37
- package/src/components/list-view/branch.js +1 -7
- package/src/components/list-view/index.js +42 -17
- package/src/components/list-view/style.scss +7 -7
- package/src/components/list-view/test/use-list-view-drop-zone.js +88 -12
- package/src/components/list-view/use-list-view-client-ids.js +21 -4
- package/src/components/list-view/use-list-view-drop-zone.js +194 -11
- package/src/components/media-placeholder/index.js +74 -1
- package/src/components/multi-selection-inspector/index.js +2 -2
- package/src/components/preview-options/index.js +9 -2
- package/src/components/publish-date-time-picker/index.js +0 -2
- package/src/components/spacing-sizes-control/spacing-input-control.js +1 -0
- package/src/components/url-input/README.md +6 -0
- package/src/components/url-input/index.js +2 -2
- package/src/components/use-block-drop-zone/index.js +31 -17
- package/src/components/use-resize-canvas/index.js +9 -1
- package/src/components/writing-flow/test/index.js +15 -0
- package/src/components/writing-flow/use-arrow-nav.js +17 -4
- package/src/hooks/align.js +5 -12
- package/src/hooks/behaviors.js +104 -0
- package/src/hooks/border.js +2 -1
- package/src/hooks/color.js +2 -1
- package/src/hooks/content-lock-ui.js +3 -15
- package/src/hooks/dimensions.js +0 -40
- package/src/hooks/duotone.js +4 -11
- package/src/hooks/index.js +1 -0
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/layout.js +14 -20
- package/src/hooks/position.js +2 -1
- package/src/hooks/style.js +2 -1
- package/src/hooks/test/use-editor-wrapper-styles.native.js +282 -0
- package/src/hooks/test/use-typography-props.js +47 -2
- package/src/hooks/use-editor-wrapper-styles.native.js +250 -0
- package/src/hooks/use-editor-wrapper-styles.native.scss +11 -0
- package/src/hooks/use-typography-props.js +10 -11
- package/src/index.native.js +6 -0
- package/src/private-apis.js +2 -4
- package/src/store/private-actions.js +39 -0
- package/src/store/private-selectors.js +95 -0
- package/src/store/reducer.js +27 -0
- package/src/store/selectors.js +25 -15
- package/src/store/test/private-actions.js +32 -1
- package/src/store/test/private-selectors.js +158 -0
- package/src/store/test/reducer.js +48 -0
- package/src/style.scss +0 -3
- package/src/utils/order-inserter-block-items.js +26 -0
- package/src/utils/use-should-contextual-toolbar-show.js +19 -9
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-list/block-list-compact.native.js +0 -75
- package/build/components/block-list/block-list-compact.native.js.map +0 -1
- package/build/components/off-canvas-editor/appender.js +0 -125
- package/build/components/off-canvas-editor/appender.js.map +0 -1
- package/build/components/off-canvas-editor/block-contents.js +0 -141
- package/build/components/off-canvas-editor/block-contents.js.map +0 -1
- package/build/components/off-canvas-editor/block-select-button.js +0 -126
- package/build/components/off-canvas-editor/block-select-button.js.map +0 -1
- package/build/components/off-canvas-editor/block.js +0 -297
- package/build/components/off-canvas-editor/block.js.map +0 -1
- package/build/components/off-canvas-editor/branch.js +0 -197
- package/build/components/off-canvas-editor/branch.js.map +0 -1
- package/build/components/off-canvas-editor/context.js +0 -19
- package/build/components/off-canvas-editor/context.js.map +0 -1
- package/build/components/off-canvas-editor/drop-indicator.js +0 -118
- package/build/components/off-canvas-editor/drop-indicator.js.map +0 -1
- package/build/components/off-canvas-editor/expander.js +0 -41
- package/build/components/off-canvas-editor/expander.js.map +0 -1
- package/build/components/off-canvas-editor/index.js +0 -236
- package/build/components/off-canvas-editor/index.js.map +0 -1
- package/build/components/off-canvas-editor/leaf-more-menu.js +0 -146
- package/build/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
- package/build/components/off-canvas-editor/leaf.js +0 -60
- package/build/components/off-canvas-editor/leaf.js.map +0 -1
- package/build/components/off-canvas-editor/link-ui.js +0 -186
- package/build/components/off-canvas-editor/link-ui.js.map +0 -1
- package/build/components/off-canvas-editor/update-attributes.js +0 -108
- package/build/components/off-canvas-editor/update-attributes.js.map +0 -1
- package/build/components/off-canvas-editor/use-block-selection.js +0 -139
- package/build/components/off-canvas-editor/use-block-selection.js.map +0 -1
- package/build/components/off-canvas-editor/use-inserted-block.js +0 -58
- package/build/components/off-canvas-editor/use-inserted-block.js.map +0 -1
- package/build/components/off-canvas-editor/use-list-view-client-ids.js +0 -33
- package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js +0 -235
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -60
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
- package/build/components/off-canvas-editor/utils.js +0 -60
- package/build/components/off-canvas-editor/utils.js.map +0 -1
- package/build-module/components/block-list/block-list-compact.native.js +0 -60
- package/build-module/components/block-list/block-list-compact.native.js.map +0 -1
- package/build-module/components/off-canvas-editor/appender.js +0 -108
- package/build-module/components/off-canvas-editor/appender.js.map +0 -1
- package/build-module/components/off-canvas-editor/block-contents.js +0 -121
- package/build-module/components/off-canvas-editor/block-contents.js.map +0 -1
- package/build-module/components/off-canvas-editor/block-select-button.js +0 -107
- package/build-module/components/off-canvas-editor/block-select-button.js.map +0 -1
- package/build-module/components/off-canvas-editor/block.js +0 -273
- package/build-module/components/off-canvas-editor/block.js.map +0 -1
- package/build-module/components/off-canvas-editor/branch.js +0 -179
- package/build-module/components/off-canvas-editor/branch.js.map +0 -1
- package/build-module/components/off-canvas-editor/context.js +0 -7
- package/build-module/components/off-canvas-editor/context.js.map +0 -1
- package/build-module/components/off-canvas-editor/drop-indicator.js +0 -111
- package/build-module/components/off-canvas-editor/drop-indicator.js.map +0 -1
- package/build-module/components/off-canvas-editor/expander.js +0 -32
- package/build-module/components/off-canvas-editor/expander.js.map +0 -1
- package/build-module/components/off-canvas-editor/index.js +0 -213
- package/build-module/components/off-canvas-editor/index.js.map +0 -1
- package/build-module/components/off-canvas-editor/leaf-more-menu.js +0 -128
- package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
- package/build-module/components/off-canvas-editor/leaf.js +0 -45
- package/build-module/components/off-canvas-editor/leaf.js.map +0 -1
- package/build-module/components/off-canvas-editor/link-ui.js +0 -166
- package/build-module/components/off-canvas-editor/link-ui.js.map +0 -1
- package/build-module/components/off-canvas-editor/update-attributes.js +0 -97
- package/build-module/components/off-canvas-editor/update-attributes.js.map +0 -1
- package/build-module/components/off-canvas-editor/use-block-selection.js +0 -124
- package/build-module/components/off-canvas-editor/use-block-selection.js.map +0 -1
- package/build-module/components/off-canvas-editor/use-inserted-block.js +0 -47
- package/build-module/components/off-canvas-editor/use-inserted-block.js.map +0 -1
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +0 -24
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +0 -220
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -50
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
- package/build-module/components/off-canvas-editor/utils.js +0 -44
- package/build-module/components/off-canvas-editor/utils.js.map +0 -1
- package/src/components/block-list/block-list-compact.native.js +0 -63
- package/src/components/off-canvas-editor/README.md +0 -5
- package/src/components/off-canvas-editor/appender.js +0 -124
- package/src/components/off-canvas-editor/block-contents.js +0 -156
- package/src/components/off-canvas-editor/block-select-button.js +0 -128
- package/src/components/off-canvas-editor/block.js +0 -347
- package/src/components/off-canvas-editor/branch.js +0 -238
- package/src/components/off-canvas-editor/context.js +0 -8
- package/src/components/off-canvas-editor/drop-indicator.js +0 -126
- package/src/components/off-canvas-editor/expander.js +0 -26
- package/src/components/off-canvas-editor/index.js +0 -271
- package/src/components/off-canvas-editor/leaf-more-menu.js +0 -157
- package/src/components/off-canvas-editor/leaf.js +0 -52
- package/src/components/off-canvas-editor/link-ui.js +0 -167
- package/src/components/off-canvas-editor/style.scss +0 -34
- package/src/components/off-canvas-editor/test/use-inserted-block.js +0 -108
- package/src/components/off-canvas-editor/test/utils.js +0 -50
- package/src/components/off-canvas-editor/update-attributes.js +0 -99
- package/src/components/off-canvas-editor/use-block-selection.js +0 -169
- package/src/components/off-canvas-editor/use-inserted-block.js +0 -47
- package/src/components/off-canvas-editor/use-list-view-client-ids.js +0 -29
- package/src/components/off-canvas-editor/use-list-view-drop-zone.js +0 -260
- package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -58
- package/src/components/off-canvas-editor/utils.js +0 -58
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* External dependencies
|
|
6
|
-
*/
|
|
7
|
-
import classnames from 'classnames';
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { useSelect } from '@wordpress/data';
|
|
13
|
-
import { forwardRef, useEffect, useState } from '@wordpress/element';
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { unlock } from '../../lock-unlock';
|
|
19
|
-
import ListViewBlockSelectButton from './block-select-button';
|
|
20
|
-
import BlockDraggable from '../block-draggable';
|
|
21
|
-
import { store as blockEditorStore } from '../../store';
|
|
22
|
-
import { updateAttributes } from './update-attributes';
|
|
23
|
-
import { LinkUI } from './link-ui';
|
|
24
|
-
import { useInsertedBlock } from './use-inserted-block';
|
|
25
|
-
import { useListViewContext } from './context';
|
|
26
|
-
const BLOCKS_WITH_LINK_UI_SUPPORT = ['core/navigation-link', 'core/navigation-submenu'];
|
|
27
|
-
const ListViewBlockContents = forwardRef((_ref, ref) => {
|
|
28
|
-
let {
|
|
29
|
-
onClick,
|
|
30
|
-
onToggleExpanded,
|
|
31
|
-
block,
|
|
32
|
-
isSelected,
|
|
33
|
-
position,
|
|
34
|
-
siblingBlockCount,
|
|
35
|
-
level,
|
|
36
|
-
isExpanded,
|
|
37
|
-
selectedClientIds,
|
|
38
|
-
...props
|
|
39
|
-
} = _ref;
|
|
40
|
-
const {
|
|
41
|
-
clientId
|
|
42
|
-
} = block;
|
|
43
|
-
const [isLinkUIOpen, setIsLinkUIOpen] = useState();
|
|
44
|
-
const {
|
|
45
|
-
blockMovingClientId,
|
|
46
|
-
selectedBlockInBlockEditor,
|
|
47
|
-
lastInsertedBlockClientId
|
|
48
|
-
} = useSelect(select => {
|
|
49
|
-
const {
|
|
50
|
-
hasBlockMovingClientId,
|
|
51
|
-
getSelectedBlockClientId,
|
|
52
|
-
getLastInsertedBlocksClientIds
|
|
53
|
-
} = unlock(select(blockEditorStore));
|
|
54
|
-
const lastInsertedBlocksClientIds = getLastInsertedBlocksClientIds();
|
|
55
|
-
return {
|
|
56
|
-
blockMovingClientId: hasBlockMovingClientId(),
|
|
57
|
-
selectedBlockInBlockEditor: getSelectedBlockClientId(),
|
|
58
|
-
lastInsertedBlockClientId: lastInsertedBlocksClientIds && lastInsertedBlocksClientIds[0]
|
|
59
|
-
};
|
|
60
|
-
}, [clientId]);
|
|
61
|
-
const {
|
|
62
|
-
insertedBlockAttributes,
|
|
63
|
-
insertedBlockName,
|
|
64
|
-
setInsertedBlockAttributes
|
|
65
|
-
} = useInsertedBlock(lastInsertedBlockClientId);
|
|
66
|
-
const hasExistingLinkValue = insertedBlockAttributes === null || insertedBlockAttributes === void 0 ? void 0 : insertedBlockAttributes.url;
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
if (clientId === lastInsertedBlockClientId && BLOCKS_WITH_LINK_UI_SUPPORT !== null && BLOCKS_WITH_LINK_UI_SUPPORT !== void 0 && BLOCKS_WITH_LINK_UI_SUPPORT.includes(insertedBlockName) && !hasExistingLinkValue // don't re-show the Link UI if the block already has a link value.
|
|
69
|
-
) {
|
|
70
|
-
setIsLinkUIOpen(true);
|
|
71
|
-
}
|
|
72
|
-
}, [lastInsertedBlockClientId, clientId, insertedBlockName, hasExistingLinkValue]);
|
|
73
|
-
const {
|
|
74
|
-
renderAdditionalBlockUI
|
|
75
|
-
} = useListViewContext();
|
|
76
|
-
const isBlockMoveTarget = blockMovingClientId && selectedBlockInBlockEditor === clientId;
|
|
77
|
-
const className = classnames('block-editor-list-view-block-contents', {
|
|
78
|
-
'is-dropping-before': isBlockMoveTarget
|
|
79
|
-
}); // Only include all selected blocks if the currently clicked on block
|
|
80
|
-
// is one of the selected blocks. This ensures that if a user attempts
|
|
81
|
-
// to drag a block that isn't part of the selection, they're still able
|
|
82
|
-
// to drag it and rearrange its position.
|
|
83
|
-
|
|
84
|
-
const draggableClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId];
|
|
85
|
-
return createElement(Fragment, null, renderAdditionalBlockUI && renderAdditionalBlockUI(block), isLinkUIOpen && createElement(LinkUI, {
|
|
86
|
-
clientId: lastInsertedBlockClientId,
|
|
87
|
-
link: insertedBlockAttributes,
|
|
88
|
-
onClose: () => setIsLinkUIOpen(false),
|
|
89
|
-
hasCreateSuggestion: false,
|
|
90
|
-
onChange: updatedValue => {
|
|
91
|
-
updateAttributes(updatedValue, setInsertedBlockAttributes, insertedBlockAttributes);
|
|
92
|
-
setIsLinkUIOpen(false);
|
|
93
|
-
},
|
|
94
|
-
onCancel: () => setIsLinkUIOpen(false)
|
|
95
|
-
}), createElement(BlockDraggable, {
|
|
96
|
-
clientIds: draggableClientIds
|
|
97
|
-
}, _ref2 => {
|
|
98
|
-
let {
|
|
99
|
-
draggable,
|
|
100
|
-
onDragStart,
|
|
101
|
-
onDragEnd
|
|
102
|
-
} = _ref2;
|
|
103
|
-
return createElement(ListViewBlockSelectButton, _extends({
|
|
104
|
-
ref: ref,
|
|
105
|
-
className: className,
|
|
106
|
-
block: block,
|
|
107
|
-
onClick: onClick,
|
|
108
|
-
onToggleExpanded: onToggleExpanded,
|
|
109
|
-
isSelected: isSelected,
|
|
110
|
-
position: position,
|
|
111
|
-
siblingBlockCount: siblingBlockCount,
|
|
112
|
-
level: level,
|
|
113
|
-
draggable: draggable,
|
|
114
|
-
onDragStart: onDragStart,
|
|
115
|
-
onDragEnd: onDragEnd,
|
|
116
|
-
isExpanded: isExpanded
|
|
117
|
-
}, props));
|
|
118
|
-
}));
|
|
119
|
-
});
|
|
120
|
-
export default ListViewBlockContents;
|
|
121
|
-
//# sourceMappingURL=block-contents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/off-canvas-editor/block-contents.js"],"names":["classnames","useSelect","forwardRef","useEffect","useState","unlock","ListViewBlockSelectButton","BlockDraggable","store","blockEditorStore","updateAttributes","LinkUI","useInsertedBlock","useListViewContext","BLOCKS_WITH_LINK_UI_SUPPORT","ListViewBlockContents","ref","onClick","onToggleExpanded","block","isSelected","position","siblingBlockCount","level","isExpanded","selectedClientIds","props","clientId","isLinkUIOpen","setIsLinkUIOpen","blockMovingClientId","selectedBlockInBlockEditor","lastInsertedBlockClientId","select","hasBlockMovingClientId","getSelectedBlockClientId","getLastInsertedBlocksClientIds","lastInsertedBlocksClientIds","insertedBlockAttributes","insertedBlockName","setInsertedBlockAttributes","hasExistingLinkValue","url","includes","renderAdditionalBlockUI","isBlockMoveTarget","className","draggableClientIds","updatedValue","draggable","onDragStart","onDragEnd"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,UAAT,EAAqBC,SAArB,EAAgCC,QAAhC,QAAgD,oBAAhD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,OAAOC,yBAAP,MAAsC,uBAAtC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,SAASC,KAAK,IAAIC,gBAA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AAgB,IAAA,SAAS,EAAGkB;AAA5B,KACG;AAAA,QAAE;AAAEE,MAAAA,SAAF;AAAaC,MAAAA,WAAb;AAA0BC,MAAAA;AAA1B,KAAF;AAAA,WACD,cAAC,yBAAD;AACC,MAAA,GAAG,EAAGnC,GADP;AAEC,MAAA,SAAS,EAAG8B,SAFb;AAGC,MAAA,KAAK,EAAG3B,KAHT;AAIC,MAAA,OAAO,EAAGF,OAJX;AAKC,MAAA,gBAAgB,EAAGC,gBALpB;AAMC,MAAA,UAAU,EAAGE,UANd;AAOC,MAAA,QAAQ,EAAGC,QAPZ;AAQC,MAAA,iBAAiB,EAAGC,iBARrB;AASC,MAAA,KAAK,EAAGC,KATT;AAUC,MAAA,SAAS,EAAG0B,SAVb;AAWC,MAAA,WAAW,EAAGC,WAXf;AAYC,MAAA,SAAS,EAAGC,SAZb;AAaC,MAAA,UAAU,EAAG3B;AAbd,OAcME,KAdN,EADC;AAAA,GADH,CAnBD,CADD;AA0CA,CA5HsC,CAAxC;AA+HA,eAAeX,qBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef, useEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport ListViewBlockSelectButton from './block-select-button';\nimport BlockDraggable from '../block-draggable';\nimport { store as blockEditorStore } from '../../store';\nimport { updateAttributes } from './update-attributes';\nimport { LinkUI } from './link-ui';\nimport { useInsertedBlock } from './use-inserted-block';\nimport { useListViewContext } from './context';\n\nconst BLOCKS_WITH_LINK_UI_SUPPORT = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n];\n\nconst ListViewBlockContents = forwardRef(\n\t(\n\t\t{\n\t\t\tonClick,\n\t\t\tonToggleExpanded,\n\t\t\tblock,\n\t\t\tisSelected,\n\t\t\tposition,\n\t\t\tsiblingBlockCount,\n\t\t\tlevel,\n\t\t\tisExpanded,\n\t\t\tselectedClientIds,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst { clientId } = block;\n\t\tconst [ isLinkUIOpen, setIsLinkUIOpen ] = useState();\n\t\tconst {\n\t\t\tblockMovingClientId,\n\t\t\tselectedBlockInBlockEditor,\n\t\t\tlastInsertedBlockClientId,\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\thasBlockMovingClientId,\n\t\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\t\tgetLastInsertedBlocksClientIds,\n\t\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\t\tconst lastInsertedBlocksClientIds =\n\t\t\t\t\tgetLastInsertedBlocksClientIds();\n\t\t\t\treturn {\n\t\t\t\t\tblockMovingClientId: hasBlockMovingClientId(),\n\t\t\t\t\tselectedBlockInBlockEditor: getSelectedBlockClientId(),\n\t\t\t\t\tlastInsertedBlockClientId:\n\t\t\t\t\t\tlastInsertedBlocksClientIds &&\n\t\t\t\t\t\tlastInsertedBlocksClientIds[ 0 ],\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\t\tconst {\n\t\t\tinsertedBlockAttributes,\n\t\t\tinsertedBlockName,\n\t\t\tsetInsertedBlockAttributes,\n\t\t} = useInsertedBlock( lastInsertedBlockClientId );\n\n\t\tconst hasExistingLinkValue = insertedBlockAttributes?.url;\n\n\t\tuseEffect( () => {\n\t\t\tif (\n\t\t\t\tclientId === lastInsertedBlockClientId &&\n\t\t\t\tBLOCKS_WITH_LINK_UI_SUPPORT?.includes( insertedBlockName ) &&\n\t\t\t\t! hasExistingLinkValue // don't re-show the Link UI if the block already has a link value.\n\t\t\t) {\n\t\t\t\tsetIsLinkUIOpen( true );\n\t\t\t}\n\t\t}, [\n\t\t\tlastInsertedBlockClientId,\n\t\t\tclientId,\n\t\t\tinsertedBlockName,\n\t\t\thasExistingLinkValue,\n\t\t] );\n\n\t\tconst { renderAdditionalBlockUI } = useListViewContext();\n\n\t\tconst isBlockMoveTarget =\n\t\t\tblockMovingClientId && selectedBlockInBlockEditor === clientId;\n\n\t\tconst className = classnames( 'block-editor-list-view-block-contents', {\n\t\t\t'is-dropping-before': isBlockMoveTarget,\n\t\t} );\n\n\t\t// Only include all selected blocks if the currently clicked on block\n\t\t// is one of the selected blocks. This ensures that if a user attempts\n\t\t// to drag a block that isn't part of the selection, they're still able\n\t\t// to drag it and rearrange its position.\n\t\tconst draggableClientIds = selectedClientIds.includes( clientId )\n\t\t\t? selectedClientIds\n\t\t\t: [ clientId ];\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ renderAdditionalBlockUI && renderAdditionalBlockUI( block ) }\n\t\t\t\t{ isLinkUIOpen && (\n\t\t\t\t\t<LinkUI\n\t\t\t\t\t\tclientId={ lastInsertedBlockClientId }\n\t\t\t\t\t\tlink={ insertedBlockAttributes }\n\t\t\t\t\t\tonClose={ () => setIsLinkUIOpen( false ) }\n\t\t\t\t\t\thasCreateSuggestion={ false }\n\t\t\t\t\t\tonChange={ ( updatedValue ) => {\n\t\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\tsetInsertedBlockAttributes,\n\t\t\t\t\t\t\t\tinsertedBlockAttributes\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsetIsLinkUIOpen( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonCancel={ () => setIsLinkUIOpen( false ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BlockDraggable clientIds={ draggableClientIds }>\n\t\t\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t\t\t<ListViewBlockSelectButton\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\t\tonToggleExpanded={ onToggleExpanded }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\tsiblingBlockCount={ siblingBlockCount }\n\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\t\t\tonDragStart={ onDragStart }\n\t\t\t\t\t\t\tonDragEnd={ onDragEnd }\n\t\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\t\t{ ...props }\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);\n\t}\n);\n\nexport default ListViewBlockContents;\n"]}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* External dependencies
|
|
5
|
-
*/
|
|
6
|
-
import classnames from 'classnames';
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { Button, __experimentalHStack as HStack, __experimentalTruncate as Truncate } from '@wordpress/components';
|
|
12
|
-
import { forwardRef } from '@wordpress/element';
|
|
13
|
-
import { Icon, lockSmall as lock } from '@wordpress/icons';
|
|
14
|
-
import { SPACE, ENTER } from '@wordpress/keycodes';
|
|
15
|
-
import { sprintf, __ } from '@wordpress/i18n';
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import BlockIcon from '../block-icon';
|
|
21
|
-
import useBlockDisplayInformation from '../use-block-display-information';
|
|
22
|
-
import useBlockDisplayTitle from '../block-title/use-block-display-title';
|
|
23
|
-
import ListViewExpander from './expander';
|
|
24
|
-
import { useBlockLock } from '../block-lock';
|
|
25
|
-
|
|
26
|
-
function ListViewBlockSelectButton(_ref, ref) {
|
|
27
|
-
let {
|
|
28
|
-
className,
|
|
29
|
-
block,
|
|
30
|
-
onClick,
|
|
31
|
-
onToggleExpanded,
|
|
32
|
-
tabIndex,
|
|
33
|
-
onFocus,
|
|
34
|
-
onDragStart,
|
|
35
|
-
onDragEnd,
|
|
36
|
-
draggable
|
|
37
|
-
} = _ref;
|
|
38
|
-
const {
|
|
39
|
-
clientId
|
|
40
|
-
} = block;
|
|
41
|
-
const blockInformation = useBlockDisplayInformation(clientId);
|
|
42
|
-
const blockTitle = useBlockDisplayTitle({
|
|
43
|
-
clientId,
|
|
44
|
-
context: 'list-view'
|
|
45
|
-
});
|
|
46
|
-
const {
|
|
47
|
-
isLocked
|
|
48
|
-
} = useBlockLock(clientId); // The `href` attribute triggers the browser's native HTML drag operations.
|
|
49
|
-
// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.
|
|
50
|
-
// We need to clear any HTML drag data to prevent `pasteHandler` from firing
|
|
51
|
-
// inside the `useOnBlockDrop` hook.
|
|
52
|
-
|
|
53
|
-
const onDragStartHandler = event => {
|
|
54
|
-
event.dataTransfer.clearData();
|
|
55
|
-
onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(event);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
function onKeyDownHandler(event) {
|
|
59
|
-
if (event.keyCode === ENTER || event.keyCode === SPACE) {
|
|
60
|
-
onClick(event);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const editAriaLabel = blockInformation ? sprintf( // translators: %s: The title of the block.
|
|
65
|
-
__('Edit %s block'), blockInformation.title) : __('Edit');
|
|
66
|
-
return createElement(Fragment, null, createElement(Button, {
|
|
67
|
-
className: classnames('block-editor-list-view-block-select-button', className),
|
|
68
|
-
onClick: onClick,
|
|
69
|
-
onKeyDown: onKeyDownHandler,
|
|
70
|
-
ref: ref,
|
|
71
|
-
tabIndex: tabIndex,
|
|
72
|
-
onFocus: onFocus,
|
|
73
|
-
onDragStart: onDragStartHandler,
|
|
74
|
-
onDragEnd: onDragEnd,
|
|
75
|
-
draggable: draggable,
|
|
76
|
-
href: `#block-${clientId}`,
|
|
77
|
-
"aria-hidden": true,
|
|
78
|
-
title: editAriaLabel
|
|
79
|
-
}, createElement(ListViewExpander, {
|
|
80
|
-
onClick: onToggleExpanded
|
|
81
|
-
}), createElement(BlockIcon, {
|
|
82
|
-
icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon,
|
|
83
|
-
showColors: true,
|
|
84
|
-
context: "list-view"
|
|
85
|
-
}), createElement(HStack, {
|
|
86
|
-
alignment: "center",
|
|
87
|
-
className: "block-editor-list-view-block-select-button__label-wrapper",
|
|
88
|
-
justify: "flex-start",
|
|
89
|
-
spacing: 1
|
|
90
|
-
}, createElement("span", {
|
|
91
|
-
className: "block-editor-list-view-block-select-button__title"
|
|
92
|
-
}, createElement(Truncate, {
|
|
93
|
-
ellipsizeMode: "auto"
|
|
94
|
-
}, blockTitle)), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && createElement("span", {
|
|
95
|
-
className: "block-editor-list-view-block-select-button__anchor-wrapper"
|
|
96
|
-
}, createElement(Truncate, {
|
|
97
|
-
className: "block-editor-list-view-block-select-button__anchor",
|
|
98
|
-
ellipsizeMode: "auto"
|
|
99
|
-
}, blockInformation.anchor)), isLocked && createElement("span", {
|
|
100
|
-
className: "block-editor-list-view-block-select-button__lock"
|
|
101
|
-
}, createElement(Icon, {
|
|
102
|
-
icon: lock
|
|
103
|
-
})))));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export default forwardRef(ListViewBlockSelectButton);
|
|
107
|
-
//# sourceMappingURL=block-select-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/off-canvas-editor/block-select-button.js"],"names":["classnames","Button","__experimentalHStack","HStack","__experimentalTruncate","Truncate","forwardRef","Icon","lockSmall","lock","SPACE","ENTER","sprintf","__","BlockIcon","useBlockDisplayInformation","useBlockDisplayTitle","ListViewExpander","useBlockLock","ListViewBlockSelectButton","ref","className","block","onClick","onToggleExpanded","tabIndex","onFocus","onDragStart","onDragEnd","draggable","clientId","blockInformation","blockTitle","context","isLocked","onDragStartHandler","event","dataTransfer","clearData","onKeyDownHandler","keyCode","editAriaLabel","title","icon","anchor"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,MADD,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,sBAAsB,IAAIC,QAH3B,QAIO,uBAJP;AAKA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,IAAT,EAAeC,SAAS,IAAIC,IAA5B,QAAwC,kBAAxC;AACA,SAASC,KAAT,EAAgBC,KAAhB,QAA6B,qBAA7B;AACA,SAASC,OAAT,EAAkBC,EAAlB,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,0BAAP,MAAuC,kCAAvC;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,gBAAP,MAA6B,YAA7B;AACA,SAASC,YAAT,QAA6B,eAA7B;;AAEA,SAASC,yBAAT,OAYCC,GAZD,EAaE;AAAA,MAZD;AACCC,IAAAA,SADD;AAECC,IAAAA,KAFD;AAGCC,IAAAA,OAHD;AAICC,IAAAA,gBAJD;AAKCC,IAAAA,QALD;AAMCC,IAAAA,OAND;AAOCC,IAAAA,WAPD;AAQCC,IAAAA,SARD;AASCC,IAAAA;AATD,GAYC;AACD,QAAM;AAAEC,IAAAA;AAAF,MAAeR,KAArB;AACA,QAAMS,gBAAgB,GAAGhB,0BAA0B,CAAEe,QAAF,CAAnD;AACA,QAAME,UAAU,GAAGhB,oBAAoB,CAAE;AACxCc,IAAAA,QADwC;AAExCG,IAAAA,OAAO,EAAE;AAF+B,GAAF,CAAvC;AAIA,QAAM;AAAEC,IAAAA;AAAF,MAAehB,YAAY,CAAEY,QAAF,CAAjC,CAPC,CASD;AACA;AACA;AACA;;AACA,QAAMK,kBAAkB,GAA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AAC,2DAFX;AAGC,IAAA,OAAO,EAAC,YAHT;AAIC,IAAA,OAAO,EAAG;AAJX,KAMC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,cAAC,QAAD;AAAU,IAAA,aAAa,EAAC;AAAxB,KAAiCX,UAAjC,CADD,CAND,EASG,CAAAD,gBAAgB,SAAhB,IAAAA,gBAAgB,WAAhB,YAAAA,gBAAgB,CAAEa,MAAlB,KACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,cAAC,QAAD;AACC,IAAA,SAAS,EAAC,oDADX;AAEC,IAAA,aAAa,EAAC;AAFf,KAIGb,gBAAgB,CAACa,MAJpB,CADD,CAVF,EAmBGV,QAAQ,IACT;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAGzB;AAAb,IADD,CApBF,CAvBD,CADD,CADD;AAqDA;;AAED,eAAeH,UAAU,CAAEa,yBAAF,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport { Icon, lockSmall as lock } from '@wordpress/icons';\nimport { SPACE, ENTER } from '@wordpress/keycodes';\nimport { sprintf, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\nimport { useBlockLock } from '../block-lock';\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock,\n\t\tonClick,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t},\n\tref\n) {\n\tconst { clientId } = block;\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId,\n\t\tcontext: 'list-view',\n\t} );\n\tconst { isLocked } = useBlockLock( clientId );\n\n\t// The `href` attribute triggers the browser's native HTML drag operations.\n\t// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.\n\t// We need to clear any HTML drag data to prevent `pasteHandler` from firing\n\t// inside the `useOnBlockDrop` hook.\n\tconst onDragStartHandler = ( event ) => {\n\t\tevent.dataTransfer.clearData();\n\t\tonDragStart?.( event );\n\t};\n\n\tfunction onKeyDownHandler( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\tconst editAriaLabel = blockInformation\n\t\t? sprintf(\n\t\t\t\t// translators: %s: The title of the block.\n\t\t\t\t__( 'Edit %s block' ),\n\t\t\t\tblockInformation.title\n\t\t )\n\t\t: __( 'Edit' );\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonKeyDown={ onKeyDownHandler }\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tonDragStart={ onDragStartHandler }\n\t\t\t\tonDragEnd={ onDragEnd }\n\t\t\t\tdraggable={ draggable }\n\t\t\t\thref={ `#block-${ clientId }` }\n\t\t\t\taria-hidden={ true }\n\t\t\t\ttitle={ editAriaLabel }\n\t\t\t>\n\t\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\tshowColors\n\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__anchor\"\n\t\t\t\t\t\t\t\tellipsizeMode=\"auto\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ blockInformation.anchor }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isLocked && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__lock\">\n\t\t\t\t\t\t\t<Icon icon={ lock } />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport default forwardRef( ListViewBlockSelectButton );\n"]}
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* External dependencies
|
|
5
|
-
*/
|
|
6
|
-
import classnames from 'classnames';
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { hasBlockSupport } from '@wordpress/blocks';
|
|
12
|
-
import { __experimentalTreeGridCell as TreeGridCell, __experimentalTreeGridItem as TreeGridItem } from '@wordpress/components';
|
|
13
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
14
|
-
import { moreVertical } from '@wordpress/icons';
|
|
15
|
-
import { useState, useRef, useEffect, useCallback, memo } from '@wordpress/element';
|
|
16
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
17
|
-
import { sprintf, __ } from '@wordpress/i18n';
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import ListViewLeaf from './leaf';
|
|
23
|
-
import { BlockMoverUpButton, BlockMoverDownButton } from '../block-mover/button';
|
|
24
|
-
import ListViewBlockContents from './block-contents';
|
|
25
|
-
import BlockSettingsDropdown from '../block-settings-menu/block-settings-dropdown';
|
|
26
|
-
import { useListViewContext } from './context';
|
|
27
|
-
import { getBlockPositionDescription } from './utils';
|
|
28
|
-
import { store as blockEditorStore } from '../../store';
|
|
29
|
-
import useBlockDisplayInformation from '../use-block-display-information';
|
|
30
|
-
import { useBlockLock } from '../block-lock';
|
|
31
|
-
|
|
32
|
-
function ListViewBlock(_ref) {
|
|
33
|
-
let {
|
|
34
|
-
block: {
|
|
35
|
-
clientId
|
|
36
|
-
},
|
|
37
|
-
isDragged,
|
|
38
|
-
isSelected,
|
|
39
|
-
isBranchSelected,
|
|
40
|
-
selectBlock,
|
|
41
|
-
position,
|
|
42
|
-
level,
|
|
43
|
-
rowCount,
|
|
44
|
-
siblingBlockCount,
|
|
45
|
-
showBlockMovers,
|
|
46
|
-
path,
|
|
47
|
-
isExpanded,
|
|
48
|
-
selectedClientIds,
|
|
49
|
-
preventAnnouncement
|
|
50
|
-
} = _ref;
|
|
51
|
-
const cellRef = useRef(null);
|
|
52
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
53
|
-
const {
|
|
54
|
-
isLocked,
|
|
55
|
-
isContentLocked
|
|
56
|
-
} = useBlockLock(clientId);
|
|
57
|
-
const forceSelectionContentLock = useSelect(select => {
|
|
58
|
-
if (isSelected) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (!isContentLocked) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return select(blockEditorStore).hasSelectedInnerBlock(clientId, true);
|
|
67
|
-
}, [isContentLocked, clientId, isSelected]);
|
|
68
|
-
const isFirstSelectedBlock = forceSelectionContentLock || isSelected && selectedClientIds[0] === clientId;
|
|
69
|
-
const isLastSelectedBlock = forceSelectionContentLock || isSelected && selectedClientIds[selectedClientIds.length - 1] === clientId;
|
|
70
|
-
const {
|
|
71
|
-
toggleBlockHighlight
|
|
72
|
-
} = useDispatch(blockEditorStore);
|
|
73
|
-
const blockInformation = useBlockDisplayInformation(clientId);
|
|
74
|
-
const block = useSelect(select => select(blockEditorStore).getBlock(clientId), [clientId]); // If ListView has experimental features related to the Persistent List View,
|
|
75
|
-
// only focus the selected list item on mount; otherwise the list would always
|
|
76
|
-
// try to steal the focus from the editor canvas.
|
|
77
|
-
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
if (!isTreeGridMounted && isSelected) {
|
|
80
|
-
cellRef.current.focus();
|
|
81
|
-
}
|
|
82
|
-
}, []);
|
|
83
|
-
const onMouseEnter = useCallback(() => {
|
|
84
|
-
setIsHovered(true);
|
|
85
|
-
toggleBlockHighlight(clientId, true);
|
|
86
|
-
}, [clientId, setIsHovered, toggleBlockHighlight]);
|
|
87
|
-
const onMouseLeave = useCallback(() => {
|
|
88
|
-
setIsHovered(false);
|
|
89
|
-
toggleBlockHighlight(clientId, false);
|
|
90
|
-
}, [clientId, setIsHovered, toggleBlockHighlight]);
|
|
91
|
-
const selectEditorBlock = useCallback(event => {
|
|
92
|
-
selectBlock(event, clientId);
|
|
93
|
-
event.preventDefault();
|
|
94
|
-
}, [clientId, selectBlock]);
|
|
95
|
-
const updateSelection = useCallback(newClientId => {
|
|
96
|
-
selectBlock(undefined, newClientId);
|
|
97
|
-
}, [selectBlock]);
|
|
98
|
-
const {
|
|
99
|
-
isTreeGridMounted,
|
|
100
|
-
expand,
|
|
101
|
-
collapse,
|
|
102
|
-
LeafMoreMenu
|
|
103
|
-
} = useListViewContext();
|
|
104
|
-
const toggleExpanded = useCallback(event => {
|
|
105
|
-
// Prevent shift+click from opening link in a new window when toggling.
|
|
106
|
-
event.preventDefault();
|
|
107
|
-
event.stopPropagation();
|
|
108
|
-
|
|
109
|
-
if (isExpanded === true) {
|
|
110
|
-
collapse(clientId);
|
|
111
|
-
} else if (isExpanded === false) {
|
|
112
|
-
expand(clientId);
|
|
113
|
-
}
|
|
114
|
-
}, [clientId, expand, collapse, isExpanded]);
|
|
115
|
-
const instanceId = useInstanceId(ListViewBlock);
|
|
116
|
-
|
|
117
|
-
if (!block) {
|
|
118
|
-
return null;
|
|
119
|
-
} // When a block hides its toolbar it also hides the block settings menu,
|
|
120
|
-
// since that menu is part of the toolbar in the editor canvas.
|
|
121
|
-
// List View respects this by also hiding the block settings menu.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const showBlockActions = !!block && hasBlockSupport(block.name, '__experimentalToolbar', true);
|
|
125
|
-
const descriptionId = `list-view-block-select-button__${instanceId}`;
|
|
126
|
-
const blockPositionDescription = getBlockPositionDescription(position, siblingBlockCount, level);
|
|
127
|
-
|
|
128
|
-
let blockAriaLabel = __('Link');
|
|
129
|
-
|
|
130
|
-
if (blockInformation) {
|
|
131
|
-
blockAriaLabel = isLocked ? sprintf( // translators: %s: The title of the block. This string indicates a link to select the locked block.
|
|
132
|
-
__('%s link (locked)'), blockInformation.title) : sprintf( // translators: %s: The title of the block. This string indicates a link to select the block.
|
|
133
|
-
__('%s link'), blockInformation.title);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const settingsAriaLabel = blockInformation ? sprintf( // translators: %s: The title of the block.
|
|
137
|
-
__('Options for %s block'), blockInformation.title) : __('Options');
|
|
138
|
-
const hasSiblings = siblingBlockCount > 0;
|
|
139
|
-
const hasRenderedMovers = showBlockMovers && hasSiblings;
|
|
140
|
-
const moverCellClassName = classnames('block-editor-list-view-block__mover-cell', {
|
|
141
|
-
'is-visible': isHovered || isSelected
|
|
142
|
-
});
|
|
143
|
-
const listViewBlockSettingsClassName = classnames('block-editor-list-view-block__menu-cell', {
|
|
144
|
-
'is-visible': isHovered || isFirstSelectedBlock
|
|
145
|
-
});
|
|
146
|
-
let colSpan;
|
|
147
|
-
|
|
148
|
-
if (hasRenderedMovers) {
|
|
149
|
-
colSpan = 1;
|
|
150
|
-
} else if (!showBlockActions) {
|
|
151
|
-
colSpan = 2;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const classes = classnames({
|
|
155
|
-
'is-selected': isSelected || forceSelectionContentLock,
|
|
156
|
-
'is-first-selected': isFirstSelectedBlock,
|
|
157
|
-
'is-last-selected': isLastSelectedBlock,
|
|
158
|
-
'is-branch-selected': isBranchSelected,
|
|
159
|
-
'is-dragging': isDragged,
|
|
160
|
-
'has-single-cell': !showBlockActions
|
|
161
|
-
}); // Only include all selected blocks if the currently clicked on block
|
|
162
|
-
// is one of the selected blocks. This ensures that if a user attempts
|
|
163
|
-
// to alter a block that isn't part of the selection, they're still able
|
|
164
|
-
// to do so.
|
|
165
|
-
|
|
166
|
-
const dropdownClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId];
|
|
167
|
-
const MoreMenuComponent = LeafMoreMenu ? LeafMoreMenu : BlockSettingsDropdown;
|
|
168
|
-
return createElement(ListViewLeaf, {
|
|
169
|
-
className: classes,
|
|
170
|
-
onMouseEnter: onMouseEnter,
|
|
171
|
-
onMouseLeave: onMouseLeave,
|
|
172
|
-
onFocus: onMouseEnter,
|
|
173
|
-
onBlur: onMouseLeave,
|
|
174
|
-
level: level,
|
|
175
|
-
position: position,
|
|
176
|
-
rowCount: rowCount,
|
|
177
|
-
path: path,
|
|
178
|
-
id: `list-view-block-${clientId}`,
|
|
179
|
-
"data-block": clientId,
|
|
180
|
-
isExpanded: isContentLocked ? undefined : isExpanded,
|
|
181
|
-
"aria-selected": !!isSelected || forceSelectionContentLock
|
|
182
|
-
}, createElement(TreeGridCell, {
|
|
183
|
-
className: "block-editor-list-view-block__contents-cell",
|
|
184
|
-
colSpan: colSpan,
|
|
185
|
-
ref: cellRef,
|
|
186
|
-
"aria-label": blockAriaLabel,
|
|
187
|
-
"aria-selected": !!isSelected || forceSelectionContentLock,
|
|
188
|
-
"aria-expanded": isContentLocked ? undefined : isExpanded,
|
|
189
|
-
"aria-describedby": descriptionId
|
|
190
|
-
}, _ref2 => {
|
|
191
|
-
let {
|
|
192
|
-
ref,
|
|
193
|
-
tabIndex,
|
|
194
|
-
onFocus
|
|
195
|
-
} = _ref2;
|
|
196
|
-
return createElement("div", {
|
|
197
|
-
className: "block-editor-list-view-block__contents-container"
|
|
198
|
-
}, createElement(ListViewBlockContents, {
|
|
199
|
-
block: block,
|
|
200
|
-
onClick: selectEditorBlock,
|
|
201
|
-
onToggleExpanded: toggleExpanded,
|
|
202
|
-
isSelected: isSelected,
|
|
203
|
-
position: position,
|
|
204
|
-
siblingBlockCount: siblingBlockCount,
|
|
205
|
-
level: level,
|
|
206
|
-
ref: ref,
|
|
207
|
-
tabIndex: tabIndex,
|
|
208
|
-
onFocus: onFocus,
|
|
209
|
-
isExpanded: isExpanded,
|
|
210
|
-
selectedClientIds: selectedClientIds,
|
|
211
|
-
preventAnnouncement: preventAnnouncement
|
|
212
|
-
}), createElement("div", {
|
|
213
|
-
className: "block-editor-list-view-block-select-button__description",
|
|
214
|
-
id: descriptionId
|
|
215
|
-
}, blockPositionDescription));
|
|
216
|
-
}), hasRenderedMovers && createElement(Fragment, null, createElement(TreeGridCell, {
|
|
217
|
-
className: moverCellClassName,
|
|
218
|
-
withoutGridItem: true
|
|
219
|
-
}, createElement(TreeGridItem, null, _ref3 => {
|
|
220
|
-
let {
|
|
221
|
-
ref,
|
|
222
|
-
tabIndex,
|
|
223
|
-
onFocus
|
|
224
|
-
} = _ref3;
|
|
225
|
-
return createElement(BlockMoverUpButton, {
|
|
226
|
-
orientation: "vertical",
|
|
227
|
-
clientIds: [clientId],
|
|
228
|
-
ref: ref,
|
|
229
|
-
tabIndex: tabIndex,
|
|
230
|
-
onFocus: onFocus
|
|
231
|
-
});
|
|
232
|
-
}), createElement(TreeGridItem, null, _ref4 => {
|
|
233
|
-
let {
|
|
234
|
-
ref,
|
|
235
|
-
tabIndex,
|
|
236
|
-
onFocus
|
|
237
|
-
} = _ref4;
|
|
238
|
-
return createElement(BlockMoverDownButton, {
|
|
239
|
-
orientation: "vertical",
|
|
240
|
-
clientIds: [clientId],
|
|
241
|
-
ref: ref,
|
|
242
|
-
tabIndex: tabIndex,
|
|
243
|
-
onFocus: onFocus
|
|
244
|
-
});
|
|
245
|
-
}))), showBlockActions && createElement(Fragment, null, createElement(TreeGridCell, {
|
|
246
|
-
className: listViewBlockSettingsClassName,
|
|
247
|
-
"aria-selected": !!isSelected || forceSelectionContentLock
|
|
248
|
-
}, _ref5 => {
|
|
249
|
-
let {
|
|
250
|
-
ref,
|
|
251
|
-
tabIndex,
|
|
252
|
-
onFocus
|
|
253
|
-
} = _ref5;
|
|
254
|
-
return createElement(Fragment, null, createElement(MoreMenuComponent, {
|
|
255
|
-
clientIds: dropdownClientIds,
|
|
256
|
-
block: block,
|
|
257
|
-
clientId: clientId,
|
|
258
|
-
icon: moreVertical,
|
|
259
|
-
label: settingsAriaLabel,
|
|
260
|
-
toggleProps: {
|
|
261
|
-
ref,
|
|
262
|
-
className: 'block-editor-list-view-block__menu',
|
|
263
|
-
tabIndex,
|
|
264
|
-
onFocus
|
|
265
|
-
},
|
|
266
|
-
disableOpenOnArrowDown: true,
|
|
267
|
-
__experimentalSelectBlock: updateSelection
|
|
268
|
-
}));
|
|
269
|
-
})));
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export default memo(ListViewBlock);
|
|
273
|
-
//# sourceMappingURL=block.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/off-canvas-editor/block.js"],"names":["classnames","hasBlockSupport","__experimentalTreeGridCell","TreeGridCell","__experimentalTreeGridItem","TreeGridItem","useInstanceId","moreVertical","useState","useRef","useEffect","useCallback","memo","useDispatch","useSelect","sprintf","__","ListViewLeaf","BlockMoverUpButton","BlockMoverDownButton","ListViewBlockContents","BlockSettingsDropdown","useListViewContext","getBlockPositionDescription","store","blockEditorStore","useBlockDisplayInformation","useBlockLock","ListViewBlock","block","clientId","isDragged","isSelected","isBranchSelected","selectBlock","position","level","rowCount","siblingBlockCount","showBlockMovers","path","isExpanded","selectedClientIds","preventAnnouncement","cellRef","isHovered","setIsHovered","isLocked","isContentLocked","forceSelectionContentLock","select","hasSelectedInnerBlock","isFirstSelectedBlock","isLastSelectedBlock","length","toggleBlockHighlight","blockInformation","getBlock","isTreeGridMounted","current","focus","onMouseEnter","onMouseLeave","selectEditorBlock","event","preventDefault","updateSelection","newClientId","undefined","expand","collapse","LeafMoreMenu","toggleExpanded","stopPropagation","instanceId","showBlockActions","name","descriptionId","blockPositionDescription","blockAriaLabel","title","settingsAriaLabel","hasSiblings","hasRenderedMovers","moverCellClassName","listViewBlockSettingsClassName","colSpan","classes","dropdownClientIds","includes","MoreMenuComponent","ref","tabIndex","onFocus","className"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SACCC,0BAA0B,IAAIC,YAD/B,EAECC,0BAA0B,IAAIC,YAF/B,QAGO,uBAHP;AAIA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SACCC,QADD,EAECC,MAFD,EAGCC,SAHD,EAICC,WAJD,EAKCC,IALD,QAMO,oBANP;AAOA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,OAAT,EAAkBC,EAAlB,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,QAAzB;AACA,SACCC,kBADD,EAECC,oBAFD,QAGO,uBAHP;AAIA,OAAOC,qBAAP,MAAkC,kBAAlC;AACA,OAAOC,qBAAP,MAAkC,gDAAlC;AACA,SAASC,kBAAT,QAAmC,W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,KAFT;AAGC,MAAA,QAAQ,EAAGC,QAHZ;AAIC,MAAA,IAAI,EAAGvB,YAJR;AAKC,MAAA,KAAK,EAAG0E,iBALT;AAMC,MAAA,WAAW,EAAG;AACbU,QAAAA,GADa;AAEbG,QAAAA,SAAS,EACR,oCAHY;AAIbF,QAAAA,QAJa;AAKbC,QAAAA;AALa,OANf;AAaC,MAAA,sBAAsB,MAbvB;AAcC,MAAA,yBAAyB,EACxB3B;AAfF,MADD,CADC;AAAA,GANH,CADD,CAnFF,CADD;AAsHA;;AAED,eAAetD,IAAI,CAAEgB,aAAF,CAAnB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport {\n\t__experimentalTreeGridCell as TreeGridCell,\n\t__experimentalTreeGridItem as TreeGridItem,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { moreVertical } from '@wordpress/icons';\nimport {\n\tuseState,\n\tuseRef,\n\tuseEffect,\n\tuseCallback,\n\tmemo,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { sprintf, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ListViewLeaf from './leaf';\nimport {\n\tBlockMoverUpButton,\n\tBlockMoverDownButton,\n} from '../block-mover/button';\nimport ListViewBlockContents from './block-contents';\nimport BlockSettingsDropdown from '../block-settings-menu/block-settings-dropdown';\nimport { useListViewContext } from './context';\nimport { getBlockPositionDescription } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { useBlockLock } from '../block-lock';\n\nfunction ListViewBlock( {\n\tblock: { clientId },\n\tisDragged,\n\tisSelected,\n\tisBranchSelected,\n\tselectBlock,\n\tposition,\n\tlevel,\n\trowCount,\n\tsiblingBlockCount,\n\tshowBlockMovers,\n\tpath,\n\tisExpanded,\n\tselectedClientIds,\n\tpreventAnnouncement,\n} ) {\n\tconst cellRef = useRef( null );\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\n\tconst { isLocked, isContentLocked } = useBlockLock( clientId );\n\tconst forceSelectionContentLock = useSelect(\n\t\t( select ) => {\n\t\t\tif ( isSelected ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( ! isContentLocked ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn select( blockEditorStore ).hasSelectedInnerBlock(\n\t\t\t\tclientId,\n\t\t\t\ttrue\n\t\t\t);\n\t\t},\n\t\t[ isContentLocked, clientId, isSelected ]\n\t);\n\n\tconst isFirstSelectedBlock =\n\t\tforceSelectionContentLock ||\n\t\t( isSelected && selectedClientIds[ 0 ] === clientId );\n\tconst isLastSelectedBlock =\n\t\tforceSelectionContentLock ||\n\t\t( isSelected &&\n\t\t\tselectedClientIds[ selectedClientIds.length - 1 ] === clientId );\n\n\tconst { toggleBlockHighlight } = useDispatch( blockEditorStore );\n\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst block = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\t// If ListView has experimental features related to the Persistent List View,\n\t// only focus the selected list item on mount; otherwise the list would always\n\t// try to steal the focus from the editor canvas.\n\tuseEffect( () => {\n\t\tif ( ! isTreeGridMounted && isSelected ) {\n\t\t\tcellRef.current.focus();\n\t\t}\n\t}, [] );\n\n\tconst onMouseEnter = useCallback( () => {\n\t\tsetIsHovered( true );\n\t\ttoggleBlockHighlight( clientId, true );\n\t}, [ clientId, setIsHovered, toggleBlockHighlight ] );\n\tconst onMouseLeave = useCallback( () => {\n\t\tsetIsHovered( false );\n\t\ttoggleBlockHighlight( clientId, false );\n\t}, [ clientId, setIsHovered, toggleBlockHighlight ] );\n\n\tconst selectEditorBlock = useCallback(\n\t\t( event ) => {\n\t\t\tselectBlock( event, clientId );\n\t\t\tevent.preventDefault();\n\t\t},\n\t\t[ clientId, selectBlock ]\n\t);\n\n\tconst updateSelection = useCallback(\n\t\t( newClientId ) => {\n\t\t\tselectBlock( undefined, newClientId );\n\t\t},\n\t\t[ selectBlock ]\n\t);\n\n\tconst { isTreeGridMounted, expand, collapse, LeafMoreMenu } =\n\t\tuseListViewContext();\n\n\tconst toggleExpanded = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent shift+click from opening link in a new window when toggling.\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tif ( isExpanded === true ) {\n\t\t\t\tcollapse( clientId );\n\t\t\t} else if ( isExpanded === false ) {\n\t\t\t\texpand( clientId );\n\t\t\t}\n\t\t},\n\t\t[ clientId, expand, collapse, isExpanded ]\n\t);\n\n\tconst instanceId = useInstanceId( ListViewBlock );\n\n\tif ( ! block ) {\n\t\treturn null;\n\t}\n\n\t// When a block hides its toolbar it also hides the block settings menu,\n\t// since that menu is part of the toolbar in the editor canvas.\n\t// List View respects this by also hiding the block settings menu.\n\tconst showBlockActions =\n\t\t!! block &&\n\t\thasBlockSupport( block.name, '__experimentalToolbar', true );\n\n\tconst descriptionId = `list-view-block-select-button__${ instanceId }`;\n\tconst blockPositionDescription = getBlockPositionDescription(\n\t\tposition,\n\t\tsiblingBlockCount,\n\t\tlevel\n\t);\n\n\tlet blockAriaLabel = __( 'Link' );\n\tif ( blockInformation ) {\n\t\tblockAriaLabel = isLocked\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %s: The title of the block. This string indicates a link to select the locked block.\n\t\t\t\t\t__( '%s link (locked)' ),\n\t\t\t\t\tblockInformation.title\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %s: The title of the block. This string indicates a link to select the block.\n\t\t\t\t\t__( '%s link' ),\n\t\t\t\t\tblockInformation.title\n\t\t\t );\n\t}\n\n\tconst settingsAriaLabel = blockInformation\n\t\t? sprintf(\n\t\t\t\t// translators: %s: The title of the block.\n\t\t\t\t__( 'Options for %s block' ),\n\t\t\t\tblockInformation.title\n\t\t )\n\t\t: __( 'Options' );\n\n\tconst hasSiblings = siblingBlockCount > 0;\n\tconst hasRenderedMovers = showBlockMovers && hasSiblings;\n\tconst moverCellClassName = classnames(\n\t\t'block-editor-list-view-block__mover-cell',\n\t\t{ 'is-visible': isHovered || isSelected }\n\t);\n\n\tconst listViewBlockSettingsClassName = classnames(\n\t\t'block-editor-list-view-block__menu-cell',\n\t\t{ 'is-visible': isHovered || isFirstSelectedBlock }\n\t);\n\n\tlet colSpan;\n\tif ( hasRenderedMovers ) {\n\t\tcolSpan = 1;\n\t} else if ( ! showBlockActions ) {\n\t\tcolSpan = 2;\n\t}\n\n\tconst classes = classnames( {\n\t\t'is-selected': isSelected || forceSelectionContentLock,\n\t\t'is-first-selected': isFirstSelectedBlock,\n\t\t'is-last-selected': isLastSelectedBlock,\n\t\t'is-branch-selected': isBranchSelected,\n\t\t'is-dragging': isDragged,\n\t\t'has-single-cell': ! showBlockActions,\n\t} );\n\n\t// Only include all selected blocks if the currently clicked on block\n\t// is one of the selected blocks. This ensures that if a user attempts\n\t// to alter a block that isn't part of the selection, they're still able\n\t// to do so.\n\tconst dropdownClientIds = selectedClientIds.includes( clientId )\n\t\t? selectedClientIds\n\t\t: [ clientId ];\n\n\tconst MoreMenuComponent = LeafMoreMenu\n\t\t? LeafMoreMenu\n\t\t: BlockSettingsDropdown;\n\n\treturn (\n\t\t<ListViewLeaf\n\t\t\tclassName={ classes }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\tonFocus={ onMouseEnter }\n\t\t\tonBlur={ onMouseLeave }\n\t\t\tlevel={ level }\n\t\t\tposition={ position }\n\t\t\trowCount={ rowCount }\n\t\t\tpath={ path }\n\t\t\tid={ `list-view-block-${ clientId }` }\n\t\t\tdata-block={ clientId }\n\t\t\tisExpanded={ isContentLocked ? undefined : isExpanded }\n\t\t\taria-selected={ !! isSelected || forceSelectionContentLock }\n\t\t>\n\t\t\t<TreeGridCell\n\t\t\t\tclassName=\"block-editor-list-view-block__contents-cell\"\n\t\t\t\tcolSpan={ colSpan }\n\t\t\t\tref={ cellRef }\n\t\t\t\taria-label={ blockAriaLabel }\n\t\t\t\taria-selected={ !! isSelected || forceSelectionContentLock }\n\t\t\t\taria-expanded={ isContentLocked ? undefined : isExpanded }\n\t\t\t\taria-describedby={ descriptionId }\n\t\t\t>\n\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t<div className=\"block-editor-list-view-block__contents-container\">\n\t\t\t\t\t\t<ListViewBlockContents\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\tonClick={ selectEditorBlock }\n\t\t\t\t\t\t\tonToggleExpanded={ toggleExpanded }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\tsiblingBlockCount={ siblingBlockCount }\n\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\tpreventAnnouncement={ preventAnnouncement }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__description\"\n\t\t\t\t\t\t\tid={ descriptionId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ blockPositionDescription }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TreeGridCell>\n\t\t\t{ hasRenderedMovers && (\n\t\t\t\t<>\n\t\t\t\t\t<TreeGridCell\n\t\t\t\t\t\tclassName={ moverCellClassName }\n\t\t\t\t\t\twithoutGridItem\n\t\t\t\t\t>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ showBlockActions && (\n\t\t\t\t<>\n\t\t\t\t\t<TreeGridCell\n\t\t\t\t\t\tclassName={ listViewBlockSettingsClassName }\n\t\t\t\t\t\taria-selected={\n\t\t\t\t\t\t\t!! isSelected || forceSelectionContentLock\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<MoreMenuComponent\n\t\t\t\t\t\t\t\t\tclientIds={ dropdownClientIds }\n\t\t\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\tlabel={ settingsAriaLabel }\n\t\t\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-list-view-block__menu',\n\t\t\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tdisableOpenOnArrowDown\n\t\t\t\t\t\t\t\t\t__experimentalSelectBlock={\n\t\t\t\t\t\t\t\t\t\tupdateSelection\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) }\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</ListViewLeaf>\n\t);\n}\n\nexport default memo( ListViewBlock );\n"]}
|