@wordpress/block-editor 12.15.0 → 12.16.1-next.79a6196f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/README.md +12 -10
- package/build/components/block-canvas/index.js +21 -7
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-card/index.js +2 -2
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-controls/hook.js +3 -23
- package/build/components/block-controls/hook.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.js +6 -1
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-draggable/index.js +76 -6
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +0 -6
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
- package/build/components/block-edit/context.js +5 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +18 -9
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-editing-mode/index.js +2 -3
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +3 -4
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -1
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-list-item-cell.native.js +1 -0
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build/components/block-list/block.js +257 -95
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +58 -23
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +3 -5
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/private-block-context.js +14 -0
- package/build/components/block-list/private-block-context.js.map +1 -0
- package/build/components/block-list/use-block-props/index.js +49 -69
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +3 -2
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list/use-scroll-upon-insertion.native.js +41 -0
- package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
- package/build/components/block-lock/toolbar.js +21 -27
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-mover/index.js +2 -1
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +5 -5
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +2 -9
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-rename/modal.js +3 -0
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-settings/container.native.js +6 -4
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-styles/index.js +1 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +3 -2
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-switcher/index.js +4 -4
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +90 -29
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build/components/block-tools/block-toolbar-popover.js +84 -0
- package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build/components/block-tools/index.js +27 -24
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +4 -3
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +2 -1
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +29 -2
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +1 -1
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/colors/utils.js +10 -2
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +6 -2
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +28 -17
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/duotone-control/index.js +1 -4
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/font-sizes/utils.js +10 -2
- package/build/components/font-sizes/utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +2 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +24 -21
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +4 -3
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +2 -1
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +6 -3
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +192 -0
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -0
- package/build/components/global-styles/hooks.js +3 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +7 -1
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/index.js +7 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +43 -36
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +22 -8
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +8 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/height-control/index.js +6 -2
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/image-link-destinations/index.native.js +118 -0
- package/build/components/image-link-destinations/index.native.js.map +1 -0
- package/build/components/image-size-control/index.js +2 -2
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.native.js +14 -5
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +61 -22
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +18 -4
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +5 -6
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +5 -9
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -9
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +10 -10
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +9 -9
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +10 -14
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +4 -14
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +1 -2
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/library.js +3 -7
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +2 -2
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/menu.js +26 -33
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +2 -2
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/tabs.js +21 -21
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter-button/index.native.js +98 -0
- package/build/components/inserter-button/index.native.js.map +1 -0
- package/build/components/inserter-button/sparkles.js +23 -0
- package/build/components/inserter-button/sparkles.js.map +1 -0
- package/build/components/inserter-draggable-blocks/index.js +8 -4
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-list-item/index.js +2 -4
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +3 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +3 -3
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +3 -3
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +34 -23
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +4 -0
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +57 -3
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/media-upload-progress/constants.js +19 -0
- package/build/components/media-upload-progress/constants.js.map +1 -0
- package/build/components/media-upload-progress/index.native.js +42 -17
- package/build/components/media-upload-progress/index.native.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +11 -16
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/plain-text/index.native.js +8 -3
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +6 -62
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/index.js +3 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +7 -1
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/content.js +26 -23
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +2 -1
- package/build/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build/components/rich-text/index.js +19 -37
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +9 -16
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js +22 -24
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +22 -57
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +7 -3
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-mark-persistent.js +1 -1
- package/build/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build/components/rich-text/with-deprecations.js +50 -0
- package/build/components/rich-text/with-deprecations.js.map +1 -0
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/url-input/index.js +9 -6
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +14 -18
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +108 -17
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +100 -92
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +9 -12
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +4 -1
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-settings/index.js +14 -0
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/writing-flow/index.js +0 -1
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-drag-selection.js +15 -4
- package/build/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js +73 -27
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +7 -4
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +21 -69
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +11 -1
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +14 -30
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/aria-label.js +9 -1
- package/build/hooks/aria-label.js.map +1 -1
- package/build/hooks/background.js +198 -36
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +24 -32
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-renaming.js +18 -22
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/border.js +53 -80
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +79 -90
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +29 -29
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +13 -30
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-class-name.native.js +9 -1
- package/build/hooks/custom-class-name.native.js.map +1 -1
- package/build/hooks/dimensions.js +13 -14
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +31 -61
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +23 -28
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +52 -120
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +27 -16
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +15 -6
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout-child.js +68 -0
- package/build/hooks/layout-child.js.map +1 -0
- package/build/hooks/layout.js +25 -104
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/padding.js +2 -2
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +40 -62
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +52 -89
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +25 -10
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +43 -18
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-typography-props.js +10 -2
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +200 -10
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +2 -6
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +0 -2
- package/build/private-apis.native.js.map +1 -1
- package/build/store/actions.js +0 -16
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +54 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +46 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +18 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +11 -73
- package/build/store/selectors.js.map +1 -1
- package/build/store/undo-ignore.js +12 -0
- package/build/store/undo-ignore.js.map +1 -0
- package/build/store/utils.js +66 -0
- package/build/store/utils.js.map +1 -0
- package/build/utils/get-px-from-css-unit.js +16 -0
- package/build/utils/get-px-from-css-unit.js.map +1 -0
- package/build/utils/index.js +2 -2
- package/build/utils/index.js.map +1 -1
- package/build/utils/object.js +38 -99
- package/build/utils/object.js.map +1 -1
- package/build/utils/selection.js +9 -1
- package/build/utils/selection.js.map +1 -1
- package/build/utils/use-can-block-toolbar-be-focused.js +46 -0
- package/build/utils/use-can-block-toolbar-be-focused.js.map +1 -0
- package/build-module/components/block-canvas/index.js +22 -8
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +2 -2
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-controls/hook.js +4 -24
- package/build-module/components/block-controls/hook.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +6 -1
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-draggable/index.js +76 -6
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +1 -7
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
- package/build-module/components/block-edit/context.js +2 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +19 -10
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +3 -4
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-info-slot-fill/index.js +3 -3
- package/build-module/components/block-info-slot-fill/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -1
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-list-item-cell.native.js +1 -0
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build-module/components/block-list/block.js +261 -99
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +60 -25
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +3 -5
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/private-block-context.js +6 -0
- package/build-module/components/block-list/private-block-context.js.map +1 -0
- package/build-module/components/block-list/use-block-props/index.js +50 -70
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +3 -2
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list/use-scroll-upon-insertion.native.js +33 -0
- package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
- package/build-module/components/block-lock/toolbar.js +22 -28
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-mover/index.js +2 -1
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +6 -6
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -10
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js +3 -0
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +4 -2
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +3 -2
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-switcher/index.js +4 -4
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +89 -27
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build-module/components/block-tools/block-toolbar-popover.js +74 -0
- package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build-module/components/block-tools/index.js +27 -24
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +2 -1
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +2 -1
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +30 -3
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +1 -1
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/colors/utils.js +9 -1
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +5 -1
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +29 -18
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/duotone-control/index.js +1 -4
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/font-sizes/utils.js +9 -1
- package/build-module/components/font-sizes/utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -2
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +26 -23
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +5 -4
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +3 -2
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +8 -5
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +184 -0
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +3 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +7 -1
- package/build-module/components/global-styles/image-settings-panel.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/typography-panel.js +45 -38
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +15 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +7 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/height-control/index.js +6 -2
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/image-link-destinations/index.native.js +109 -0
- package/build-module/components/image-link-destinations/index.native.js.map +1 -0
- package/build-module/components/image-size-control/index.js +2 -2
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.native.js +3 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +62 -23
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +18 -4
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +5 -6
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +6 -10
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +11 -10
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +11 -11
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +11 -11
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +7 -11
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +4 -14
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +2 -2
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +1 -2
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/library.js +3 -7
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +26 -33
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +2 -2
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/tabs.js +22 -22
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inserter-button/index.native.js +89 -0
- package/build-module/components/inserter-button/index.native.js.map +1 -0
- package/build-module/components/inserter-button/sparkles.js +15 -0
- package/build-module/components/inserter-button/sparkles.js.map +1 -0
- package/build-module/components/inserter-draggable-blocks/index.js +9 -5
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +2 -4
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +3 -3
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +3 -3
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +35 -24
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +4 -0
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +58 -4
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/media-upload-progress/constants.js +7 -0
- package/build-module/components/media-upload-progress/constants.js.map +1 -0
- package/build-module/components/media-upload-progress/index.native.js +37 -8
- package/build-module/components/media-upload-progress/index.native.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +11 -16
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/plain-text/index.native.js +6 -1
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/preview-options/index.js +6 -62
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/index.js +3 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +7 -1
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/content.js +25 -21
- package/build-module/components/rich-text/content.js.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +2 -1
- package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build-module/components/rich-text/index.js +21 -39
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +10 -18
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
- 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 +22 -56
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +7 -3
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build-module/components/rich-text/with-deprecations.js +42 -0
- package/build-module/components/rich-text/with-deprecations.js.map +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/index.js +9 -6
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +14 -18
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +107 -18
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +102 -94
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +9 -12
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +4 -1
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +13 -1
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-flow/index.js +0 -1
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-drag-selection.js +15 -4
- package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js +73 -27
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +7 -4
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +20 -67
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -0
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/anchor.js +12 -27
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/aria-label.js +7 -1
- package/build-module/hooks/aria-label.js.map +1 -1
- package/build-module/hooks/background.js +197 -37
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +22 -30
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-renaming.js +17 -21
- package/build-module/hooks/block-renaming.js.map +1 -1
- package/build-module/hooks/border.js +52 -79
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +78 -88
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +27 -27
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +12 -28
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-class-name.native.js +7 -1
- package/build-module/hooks/custom-class-name.native.js.map +1 -1
- package/build-module/hooks/dimensions.js +15 -16
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +30 -61
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +20 -25
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +50 -120
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +20 -16
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +10 -6
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout-child.js +60 -0
- package/build-module/hooks/layout-child.js.map +1 -0
- package/build-module/hooks/layout.js +21 -100
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/padding.js +2 -2
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/position.js +38 -59
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +52 -85
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +26 -11
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/typography.native.js +43 -17
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +9 -1
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +194 -9
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +2 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +0 -2
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/actions.js +0 -15
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +52 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +44 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +18 -2
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +4 -65
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/undo-ignore.js +5 -0
- package/build-module/store/undo-ignore.js.map +1 -0
- package/build-module/store/utils.js +56 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-module/utils/get-px-from-css-unit.js +9 -0
- package/build-module/utils/get-px-from-css-unit.js.map +1 -0
- package/build-module/utils/index.js +1 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/object.js +37 -97
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/selection.js +9 -1
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/use-can-block-toolbar-be-focused.js +40 -0
- package/build-module/utils/use-can-block-toolbar-be-focused.js.map +1 -0
- package/build-style/content-rtl.css +7 -6
- package/build-style/content.css +7 -6
- package/build-style/style-rtl.css +164 -301
- package/build-style/style.css +164 -301
- package/package.json +31 -31
- package/src/components/alignment-control/README.md +0 -5
- package/src/components/block-alignment-control/README.md +0 -5
- package/src/components/block-alignment-matrix-control/README.md +0 -10
- package/src/components/block-breadcrumb/README.md +0 -5
- package/src/components/block-canvas/index.js +29 -17
- package/src/components/block-canvas/style.scss +6 -0
- package/src/components/block-caption/README.md +2 -7
- package/src/components/block-card/README.md +0 -5
- package/src/components/block-card/index.js +6 -4
- package/src/components/block-card/style.scss +7 -3
- package/src/components/block-controls/hook.js +8 -30
- package/src/components/block-controls/test/index.js +3 -3
- package/src/components/block-draggable/draggable-chip.js +11 -1
- package/src/components/block-draggable/index.js +116 -4
- package/src/components/block-draggable/index.native.js +0 -5
- package/src/components/block-draggable/style.scss +35 -0
- package/src/components/block-draggable/test/helpers.native.js +8 -7
- package/src/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/src/components/block-edit/context.js +3 -0
- package/src/components/block-edit/index.js +36 -10
- package/src/components/block-editing-mode/index.js +3 -3
- package/src/components/block-icon/README.md +0 -5
- package/src/components/block-info-slot-fill/index.js +6 -3
- package/src/components/block-inspector/README.md +0 -5
- package/src/components/block-inspector/index.js +3 -1
- package/src/components/block-inspector/style.scss +0 -4
- package/src/components/block-list/block-list-item-cell.native.js +5 -1
- package/src/components/block-list/block.js +309 -104
- package/src/components/block-list/block.native.js +69 -21
- package/src/components/block-list/content.scss +14 -10
- package/src/components/block-list/index.native.js +3 -5
- package/src/components/block-list/{block-list-block-context.js → private-block-context.js} +1 -1
- package/src/components/block-list/use-block-props/index.js +43 -86
- package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
- package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
- package/src/components/block-list/use-in-between-inserter.js +4 -1
- package/src/components/block-list/use-scroll-upon-insertion.native.js +52 -0
- package/src/components/block-lock/toolbar.js +23 -34
- package/src/components/block-mover/README.md +0 -5
- package/src/components/block-mover/index.js +1 -1
- package/src/components/block-parent-selector/README.md +0 -5
- package/src/components/block-patterns-list/README.md +0 -5
- package/src/components/block-patterns-list/index.js +9 -6
- package/src/components/block-removal-warning-modal/index.js +7 -14
- package/src/components/block-rename/modal.js +7 -1
- package/src/components/block-settings/container.native.js +3 -5
- package/src/components/block-styles/index.js +1 -1
- package/src/components/block-styles/index.native.js +4 -2
- package/src/components/block-styles/style.scss +0 -11
- package/src/components/block-switcher/index.js +49 -59
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
- package/src/components/block-toolbar/README.md +0 -5
- package/src/components/block-toolbar/index.js +179 -95
- package/src/components/block-toolbar/style.scss +50 -66
- package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
- package/src/components/block-tools/block-toolbar-popover.js +84 -0
- package/src/components/block-tools/index.js +42 -29
- package/src/components/block-tools/style.scss +60 -172
- package/src/components/block-types-list/README.md +0 -5
- package/src/components/block-types-list/index.native.js +2 -1
- package/src/components/block-variation-picker/README.md +0 -5
- package/src/components/block-variation-picker/index.native.js +1 -1
- package/src/components/block-variation-transforms/README.md +0 -5
- package/src/components/block-variation-transforms/index.js +49 -3
- package/src/components/border-radius-control/linked-button.js +1 -1
- package/src/components/caption/README.md +0 -5
- package/src/components/color-palette/test/__snapshots__/control.js.snap +0 -1
- package/src/components/colors/utils.js +8 -1
- package/src/components/colors/with-colors.js +3 -1
- package/src/components/colors-gradients/control.js +49 -30
- package/src/components/colors-gradients/style.scss +0 -7
- package/src/components/contrast-checker/README.md +0 -4
- package/src/components/copy-handler/README.md +0 -10
- package/src/components/duotone-control/index.js +2 -5
- package/src/components/duotone-control/style.scss +1 -6
- package/src/components/font-sizes/utils.js +7 -1
- package/src/components/global-styles/border-panel.js +2 -1
- package/src/components/global-styles/color-panel.js +36 -26
- package/src/components/global-styles/dimensions-panel.js +4 -3
- package/src/components/global-styles/effects-panel.js +2 -1
- package/src/components/global-styles/filters-panel.js +6 -5
- package/src/components/global-styles/get-global-styles-changes.js +210 -0
- package/src/components/global-styles/hooks.js +5 -0
- package/src/components/global-styles/image-settings-panel.js +6 -0
- package/src/components/global-styles/index.js +1 -0
- package/src/components/global-styles/test/get-global-styles-changes.js +234 -0
- package/src/components/global-styles/typography-panel.js +60 -47
- package/src/components/global-styles/use-global-styles-output.js +9 -5
- package/src/components/global-styles/utils.js +7 -0
- package/src/components/height-control/README.md +2 -7
- package/src/components/height-control/index.js +4 -0
- package/src/components/image-link-destinations/index.native.js +152 -0
- package/src/components/image-link-destinations/style.native.scss +16 -0
- package/src/components/image-size-control/index.js +5 -2
- package/src/components/index.native.js +3 -2
- package/src/components/inner-blocks/README.md +13 -2
- package/src/components/inner-blocks/index.js +68 -29
- package/src/components/inner-blocks/index.native.js +19 -7
- package/src/components/inner-blocks/use-inner-block-template-sync.js +5 -7
- package/src/components/inner-blocks/use-nested-settings-update.js +6 -13
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -15
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +15 -13
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +15 -18
- package/src/components/inserter/block-patterns-tab/utils.js +11 -12
- package/src/components/inserter/hooks/use-block-types-state.js +9 -11
- package/src/components/inserter/hooks/use-patterns-state.js +2 -2
- package/src/components/inserter/index.js +0 -1
- package/src/components/inserter/library.js +2 -8
- package/src/components/inserter/media-tab/media-panel.js +1 -1
- package/src/components/inserter/menu.js +26 -36
- package/src/components/inserter/preview-panel.js +2 -2
- package/src/components/inserter/style.scss +21 -21
- package/src/components/inserter/tabs.js +34 -25
- package/src/components/inserter-button/README.md +62 -0
- package/src/components/inserter-button/index.native.js +116 -0
- package/src/components/inserter-button/sparkles.js +15 -0
- package/src/components/inserter-button/style.native.scss +72 -0
- package/src/components/inserter-draggable-blocks/index.js +18 -5
- package/src/components/inserter-list-item/index.js +6 -6
- package/src/components/inspector-controls/block-support-tools-panel.js +2 -0
- package/src/components/inspector-controls/fill.js +6 -3
- package/src/components/inspector-controls/fill.native.js +6 -3
- package/src/components/inspector-controls-tabs/index.js +39 -28
- package/src/components/inspector-controls-tabs/style.scss +3 -2
- package/src/components/letter-spacing-control/README.md +0 -5
- package/src/components/line-height-control/README.md +0 -5
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/README.md +0 -5
- package/src/components/list-view/block-select-button.js +4 -0
- package/src/components/list-view/block.js +73 -2
- package/src/components/list-view/style.scss +6 -0
- package/src/components/media-upload-progress/constants.js +6 -0
- package/src/components/media-upload-progress/index.native.js +66 -14
- package/src/components/media-upload-progress/test/index.native.js +2 -2
- package/src/components/multi-selection-inspector/README.md +0 -5
- package/src/components/navigable-toolbar/README.md +2 -0
- package/src/components/navigable-toolbar/index.js +15 -13
- package/src/components/plain-text/index.native.js +6 -1
- package/src/components/preview-options/index.js +6 -86
- package/src/components/provider/index.js +1 -1
- package/src/components/provider/test/use-block-sync.js +20 -17
- package/src/components/provider/use-block-sync.js +6 -0
- package/src/components/rich-text/content.js +27 -20
- package/src/components/rich-text/get-rich-text-values.js +6 -1
- package/src/components/rich-text/index.js +23 -52
- package/src/components/rich-text/index.native.js +8 -25
- package/src/components/rich-text/native/get-format-colors.native.js +33 -40
- package/src/components/rich-text/native/index.native.js +22 -71
- package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +3 -3
- package/src/components/rich-text/native/test/index.native.js +72 -5
- package/src/components/rich-text/use-input-rules.js +8 -3
- package/src/components/rich-text/use-mark-persistent.js +1 -2
- package/src/components/rich-text/with-deprecations.js +51 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/src/components/text-decoration-control/README.md +40 -0
- package/src/components/text-transform-control/README.md +0 -4
- package/src/components/ungroup-button/README.md +0 -5
- package/src/components/unit-control/README.md +0 -4
- package/src/components/url-input/index.js +11 -11
- package/src/components/use-block-commands/index.js +18 -21
- package/src/components/use-block-drop-zone/index.js +181 -30
- package/src/components/use-moving-animation/index.js +107 -103
- package/src/components/use-on-block-drop/index.js +9 -24
- package/src/components/use-on-block-drop/test/index.js +12 -26
- package/src/components/use-resize-canvas/README.md +3 -7
- package/src/components/use-resize-canvas/index.js +4 -1
- package/src/components/use-settings/README.md +0 -4
- package/src/components/use-settings/index.js +15 -1
- package/src/components/writing-flow/index.js +0 -1
- package/src/components/writing-flow/use-drag-selection.js +18 -4
- package/src/components/writing-flow/use-selection-observer.js +99 -37
- package/src/components/writing-flow/use-tab-nav.js +7 -7
- package/src/hooks/align.js +16 -81
- package/src/hooks/align.native.js +1 -0
- package/src/hooks/anchor.js +14 -38
- package/src/hooks/aria-label.js +8 -5
- package/src/hooks/background.js +269 -32
- package/src/hooks/block-hooks.js +22 -51
- package/src/hooks/block-renaming.js +23 -37
- package/src/hooks/border.js +62 -124
- package/src/hooks/color.js +111 -138
- package/src/hooks/content-lock-ui.js +110 -122
- package/src/hooks/custom-class-name.js +9 -45
- package/src/hooks/custom-class-name.native.js +8 -5
- package/src/hooks/dimensions.js +14 -16
- package/src/hooks/duotone.js +70 -127
- package/src/hooks/font-family.js +14 -36
- package/src/hooks/font-size.js +67 -168
- package/src/hooks/index.js +58 -16
- package/src/hooks/index.native.js +22 -6
- package/src/hooks/layout-child.js +53 -0
- package/src/hooks/layout.js +17 -103
- package/src/hooks/padding.js +2 -2
- package/src/hooks/position.js +50 -90
- package/src/hooks/style.js +118 -193
- package/src/hooks/test/align.js +1 -178
- package/src/hooks/test/anchor.js +4 -9
- package/src/hooks/test/custom-class-name.js +3 -8
- package/src/hooks/test/style.js +4 -14
- package/src/hooks/typography.js +14 -16
- package/src/hooks/typography.native.js +31 -33
- package/src/hooks/use-typography-props.js +7 -1
- package/src/hooks/utils.js +261 -10
- package/src/private-apis.js +2 -6
- package/src/private-apis.native.js +0 -2
- package/src/store/actions.js +0 -15
- package/src/store/private-actions.js +48 -0
- package/src/store/private-selectors.js +56 -0
- package/src/store/reducer.js +20 -1
- package/src/store/selectors.js +10 -82
- package/src/store/undo-ignore.js +4 -0
- package/src/store/utils.js +74 -0
- package/src/style.scss +1 -2
- package/src/utils/get-px-from-css-unit.js +8 -0
- package/src/utils/index.js +1 -1
- package/src/utils/object.js +34 -104
- package/src/utils/selection.js +9 -2
- package/src/utils/test/object.js +1 -96
- package/src/utils/use-can-block-toolbar-be-focused.js +48 -0
- package/build/components/block-list/block-list-block-context.js +0 -14
- package/build/components/block-list/block-list-block-context.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
- package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build/components/block-tools/back-compat.js +0 -45
- package/build/components/block-tools/back-compat.js.map +0 -1
- package/build/components/block-tools/block-contextual-toolbar.js +0 -91
- package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build/components/block-tools/selected-block-tools.js +0 -113
- package/build/components/block-tools/selected-block-tools.js.map +0 -1
- package/build/components/inserter/hooks/use-debounced-input.js +0 -22
- package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build/components/use-display-block-controls/index.js +0 -39
- package/build/components/use-display-block-controls/index.js.map +0 -1
- package/build/components/use-display-block-controls/index.native.js +0 -39
- package/build/components/use-display-block-controls/index.native.js.map +0 -1
- package/build/hooks/custom-fields.js +0 -120
- package/build/hooks/custom-fields.js.map +0 -1
- package/build/utils/parse-css-unit-to-px.js +0 -302
- package/build/utils/parse-css-unit-to-px.js.map +0 -1
- package/build/utils/use-should-contextual-toolbar-show.js +0 -63
- package/build/utils/use-should-contextual-toolbar-show.js.map +0 -1
- package/build-module/components/block-list/block-list-block-context.js +0 -6
- package/build-module/components/block-list/block-list-block-context.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build-module/components/block-tools/back-compat.js +0 -35
- package/build-module/components/block-tools/back-compat.js.map +0 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build-module/components/block-tools/selected-block-tools.js +0 -105
- package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.js +0 -32
- package/build-module/components/use-display-block-controls/index.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.native.js +0 -32
- package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
- package/build-module/hooks/custom-fields.js +0 -118
- package/build-module/hooks/custom-fields.js.map +0 -1
- package/build-module/utils/parse-css-unit-to-px.js +0 -294
- package/build-module/utils/parse-css-unit-to-px.js.map +0 -1
- package/build-module/utils/use-should-contextual-toolbar-show.js +0 -57
- package/build-module/utils/use-should-contextual-toolbar-show.js.map +0 -1
- package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
- package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
- package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
- package/src/components/block-parent-selector/style.scss +0 -11
- package/src/components/block-tools/back-compat.js +0 -35
- package/src/components/block-tools/block-contextual-toolbar.js +0 -100
- package/src/components/block-tools/selected-block-tools.js +0 -127
- package/src/components/inserter/hooks/use-debounced-input.js +0 -18
- package/src/components/preview-options/README.md +0 -94
- package/src/components/preview-options/style.scss +0 -64
- package/src/components/use-display-block-controls/index.js +0 -36
- package/src/components/use-display-block-controls/index.native.js +0 -37
- package/src/hooks/custom-fields.js +0 -142
- package/src/hooks/test/color.js +0 -112
- package/src/utils/parse-css-unit-to-px.js +0 -329
- package/src/utils/test/parse-css-unit-to-px.js +0 -172
- package/src/utils/use-should-contextual-toolbar-show.js +0 -85
|
@@ -10,25 +10,17 @@ var _element = require("@wordpress/element");
|
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
var _blocks = require("@wordpress/blocks");
|
|
12
12
|
var _compose = require("@wordpress/compose");
|
|
13
|
-
var _data = require("@wordpress/data");
|
|
14
13
|
var _warning = _interopRequireDefault(require("@wordpress/warning"));
|
|
15
14
|
var _useMovingAnimation = _interopRequireDefault(require("../../use-moving-animation"));
|
|
16
|
-
var
|
|
15
|
+
var _privateBlockContext = require("../private-block-context");
|
|
17
16
|
var _useFocusFirstElement = require("./use-focus-first-element");
|
|
18
17
|
var _useIsHovered = require("./use-is-hovered");
|
|
19
18
|
var _context = require("../../block-edit/context");
|
|
20
|
-
var _useBlockClassNames = require("./use-block-class-names");
|
|
21
|
-
var _useBlockDefaultClassName = require("./use-block-default-class-name");
|
|
22
|
-
var _useBlockCustomClassName = require("./use-block-custom-class-name");
|
|
23
|
-
var _useBlockMovingModeClassNames = require("./use-block-moving-mode-class-names");
|
|
24
19
|
var _useFocusHandler = require("./use-focus-handler");
|
|
25
20
|
var _useSelectedBlockEventHandlers = require("./use-selected-block-event-handlers");
|
|
26
21
|
var _useNavModeExit = require("./use-nav-mode-exit");
|
|
27
22
|
var _useBlockRefs = require("./use-block-refs");
|
|
28
23
|
var _useIntersectionObserver = require("./use-intersection-observer");
|
|
29
|
-
var _store = require("../../../store");
|
|
30
|
-
var _blockContentOverlay = _interopRequireDefault(require("../../block-content-overlay"));
|
|
31
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
32
24
|
/**
|
|
33
25
|
* External dependencies
|
|
34
26
|
*/
|
|
@@ -41,12 +33,6 @@ var _lockUnlock = require("../../../lock-unlock");
|
|
|
41
33
|
* Internal dependencies
|
|
42
34
|
*/
|
|
43
35
|
|
|
44
|
-
/**
|
|
45
|
-
* If the block count exceeds the threshold, we disable the reordering animation
|
|
46
|
-
* to avoid laginess.
|
|
47
|
-
*/
|
|
48
|
-
const BLOCK_ANIMATION_THRESHOLD = 200;
|
|
49
|
-
|
|
50
36
|
/**
|
|
51
37
|
* This hook is used to lightly mark an element as a block element. The element
|
|
52
38
|
* should be the outermost element of a block. Call this hook and pass the
|
|
@@ -96,63 +82,46 @@ function useBlockProps(props = {}, {
|
|
|
96
82
|
clientId,
|
|
97
83
|
className,
|
|
98
84
|
wrapperProps = {},
|
|
99
|
-
isAligned
|
|
100
|
-
} = (0, _element.useContext)(_blockListBlockContext.BlockListBlockContext);
|
|
101
|
-
const {
|
|
85
|
+
isAligned,
|
|
102
86
|
index,
|
|
103
87
|
mode,
|
|
104
88
|
name,
|
|
105
89
|
blockApiVersion,
|
|
106
90
|
blockTitle,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
getActiveBlockVariation
|
|
127
|
-
} = select(_blocks.store);
|
|
128
|
-
const isSelected = isBlockSelected(clientId);
|
|
129
|
-
const isPartOfMultiSelection = isBlockMultiSelected(clientId) || isAncestorMultiSelected(clientId);
|
|
130
|
-
const blockName = getBlockName(clientId);
|
|
131
|
-
const blockType = (0, _blocks.getBlockType)(blockName);
|
|
132
|
-
const attributes = getBlockAttributes(clientId);
|
|
133
|
-
const match = getActiveBlockVariation(blockName, attributes);
|
|
134
|
-
return {
|
|
135
|
-
index: getBlockIndex(clientId),
|
|
136
|
-
mode: getBlockMode(clientId),
|
|
137
|
-
name: blockName,
|
|
138
|
-
blockApiVersion: blockType?.apiVersion || 1,
|
|
139
|
-
blockTitle: match?.title || blockType?.title,
|
|
140
|
-
isPartOfSelection: isSelected || isPartOfMultiSelection,
|
|
141
|
-
adjustScrolling: isSelected || isFirstMultiSelectedBlock(clientId),
|
|
142
|
-
enableAnimation: !isTyping() && getGlobalBlockCount() <= BLOCK_ANIMATION_THRESHOLD,
|
|
143
|
-
isSubtreeDisabled: isBlockSubtreeDisabled(clientId)
|
|
144
|
-
};
|
|
145
|
-
}, [clientId]);
|
|
146
|
-
const hasOverlay = (0, _blockContentOverlay.default)(clientId);
|
|
91
|
+
isSelected,
|
|
92
|
+
isSubtreeDisabled,
|
|
93
|
+
isOutlineEnabled,
|
|
94
|
+
hasOverlay,
|
|
95
|
+
initialPosition,
|
|
96
|
+
blockEditingMode,
|
|
97
|
+
isHighlighted,
|
|
98
|
+
isMultiSelected,
|
|
99
|
+
isPartiallySelected,
|
|
100
|
+
isReusable,
|
|
101
|
+
isDragging,
|
|
102
|
+
hasChildSelected,
|
|
103
|
+
removeOutline,
|
|
104
|
+
isBlockMovingMode,
|
|
105
|
+
canInsertMovingBlock,
|
|
106
|
+
isEditingDisabled,
|
|
107
|
+
isTemporarilyEditingAsBlocks,
|
|
108
|
+
defaultClassName
|
|
109
|
+
} = (0, _element.useContext)(_privateBlockContext.PrivateBlockContext);
|
|
147
110
|
|
|
148
111
|
// translators: %s: Type of block (i.e. Text, Image etc)
|
|
149
112
|
const blockLabel = (0, _i18n.sprintf)((0, _i18n.__)('Block: %s'), blockTitle);
|
|
150
113
|
const htmlSuffix = mode === 'html' && !__unstableIsHtml ? '-visual' : '';
|
|
151
|
-
const mergedRefs = (0, _compose.useMergeRefs)([props.ref, (0, _useFocusFirstElement.useFocusFirstElement)(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
114
|
+
const mergedRefs = (0, _compose.useMergeRefs)([props.ref, (0, _useFocusFirstElement.useFocusFirstElement)({
|
|
115
|
+
clientId,
|
|
116
|
+
initialPosition
|
|
117
|
+
}), (0, _useBlockRefs.useBlockRefProvider)(clientId), (0, _useFocusHandler.useFocusHandler)(clientId), (0, _useSelectedBlockEventHandlers.useEventHandlers)({
|
|
118
|
+
clientId,
|
|
119
|
+
isSelected
|
|
120
|
+
}), (0, _useNavModeExit.useNavModeExit)(clientId), (0, _useIsHovered.useIsHovered)({
|
|
121
|
+
isEnabled: isOutlineEnabled
|
|
122
|
+
}), (0, _useIntersectionObserver.useIntersectionObserver)(), (0, _useMovingAnimation.default)({
|
|
123
|
+
triggerAnimationOnChange: index,
|
|
124
|
+
clientId
|
|
156
125
|
}), (0, _compose.useDisabled)({
|
|
157
126
|
isDisabled: !hasOverlay
|
|
158
127
|
})]);
|
|
@@ -162,7 +131,7 @@ function useBlockProps(props = {}, {
|
|
|
162
131
|
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? (0, _warning.default)(`Block type "${name}" must support API version 2 or higher to work correctly with "useBlockProps" method.`) : void 0;
|
|
163
132
|
}
|
|
164
133
|
return {
|
|
165
|
-
tabIndex: 0,
|
|
134
|
+
tabIndex: blockEditingMode === 'disabled' ? -1 : 0,
|
|
166
135
|
...wrapperProps,
|
|
167
136
|
...props,
|
|
168
137
|
ref: mergedRefs,
|
|
@@ -173,12 +142,23 @@ function useBlockProps(props = {}, {
|
|
|
173
142
|
'data-type': name,
|
|
174
143
|
'data-title': blockTitle,
|
|
175
144
|
inert: isSubtreeDisabled ? 'true' : undefined,
|
|
176
|
-
className: (0, _classnames.default)(
|
|
177
|
-
|
|
178
|
-
(0, _classnames.default)('block-editor-block-list__block', {
|
|
145
|
+
className: (0, _classnames.default)('block-editor-block-list__block', {
|
|
146
|
+
// The wp-block className is important for editor styles.
|
|
179
147
|
'wp-block': !isAligned,
|
|
180
|
-
'has-block-overlay': hasOverlay
|
|
181
|
-
|
|
148
|
+
'has-block-overlay': hasOverlay,
|
|
149
|
+
'is-selected': isSelected,
|
|
150
|
+
'is-highlighted': isHighlighted,
|
|
151
|
+
'is-multi-selected': isMultiSelected,
|
|
152
|
+
'is-partially-selected': isPartiallySelected,
|
|
153
|
+
'is-reusable': isReusable,
|
|
154
|
+
'is-dragging': isDragging,
|
|
155
|
+
'has-child-selected': hasChildSelected,
|
|
156
|
+
'remove-outline': removeOutline,
|
|
157
|
+
'is-block-moving-mode': isBlockMovingMode,
|
|
158
|
+
'can-insert-moving-block': canInsertMovingBlock,
|
|
159
|
+
'is-editing-disabled': isEditingDisabled,
|
|
160
|
+
'is-content-locked-temporarily-editing-as-blocks': isTemporarilyEditingAsBlocks
|
|
161
|
+
}, className, props.className, wrapperProps.className, defaultClassName),
|
|
182
162
|
style: {
|
|
183
163
|
...wrapperProps.style,
|
|
184
164
|
...props.style
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_blocks","_compose","_data","_warning","_useMovingAnimation","_blockListBlockContext","_useFocusFirstElement","_useIsHovered","_context","_useBlockClassNames","_useBlockDefaultClassName","_useBlockCustomClassName","_useBlockMovingModeClassNames","_useFocusHandler","_useSelectedBlockEventHandlers","_useNavModeExit","_useBlockRefs","_useIntersectionObserver","_store","_blockContentOverlay","_lockUnlock","BLOCK_ANIMATION_THRESHOLD","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","useContext","BlockListBlockContext","index","mode","name","blockApiVersion","blockTitle","isPartOfSelection","adjustScrolling","enableAnimation","isSubtreeDisabled","useSelect","select","getBlockAttributes","getBlockIndex","getBlockMode","getBlockName","isTyping","getGlobalBlockCount","isBlockSelected","isBlockMultiSelected","isAncestorMultiSelected","isFirstMultiSelectedBlock","isBlockSubtreeDisabled","unlock","blockEditorStore","getActiveBlockVariation","blocksStore","isSelected","isPartOfMultiSelection","blockName","blockType","getBlockType","attributes","match","apiVersion","title","hasOverlay","useBlockOverlayActive","blockLabel","sprintf","__","htmlSuffix","mergedRefs","useMergeRefs","ref","useFocusFirstElement","useBlockRefProvider","useFocusHandler","useEventHandlers","useNavModeExit","useIsHovered","useIntersectionObserver","useMovingAnimation","triggerAnimationOnChange","useDisabled","isDisabled","blockEditContext","useBlockEditContext","SCRIPT_DEBUG","warning","tabIndex","id","role","inert","undefined","classnames","useBlockClassNames","useBlockDefaultClassName","useBlockCustomClassName","useBlockMovingModeClassNames","style","save","getBlockProps"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__unstableGetBlockProps as getBlockProps,\n\tgetBlockType,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { BlockListBlockContext } from '../block-list-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport { useBlockEditContext } from '../../block-edit/context';\nimport { useBlockClassNames } from './use-block-class-names';\nimport { useBlockDefaultClassName } from './use-block-default-class-name';\nimport { useBlockCustomClassName } from './use-block-custom-class-name';\nimport { useBlockMovingModeClassNames } from './use-block-moving-mode-class-names';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useNavModeExit } from './use-nav-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { store as blockEditorStore } from '../../../store';\nimport useBlockOverlayActive from '../../block-content-overlay';\nimport { unlock } from '../../../lock-unlock';\n\n/**\n * If the block count exceeds the threshold, we disable the reordering animation\n * to avoid laginess.\n */\nconst BLOCK_ANIMATION_THRESHOLD = 200;\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps(\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t} = useContext( BlockListBlockContext );\n\tconst {\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisPartOfSelection,\n\t\tadjustScrolling,\n\t\tenableAnimation,\n\t\tisSubtreeDisabled,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockMode,\n\t\t\t\tgetBlockName,\n\t\t\t\tisTyping,\n\t\t\t\tgetGlobalBlockCount,\n\t\t\t\tisBlockSelected,\n\t\t\t\tisBlockMultiSelected,\n\t\t\t\tisAncestorMultiSelected,\n\t\t\t\tisFirstMultiSelectedBlock,\n\t\t\t\tisBlockSubtreeDisabled,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst { getActiveBlockVariation } = select( blocksStore );\n\t\t\tconst isSelected = isBlockSelected( clientId );\n\t\t\tconst isPartOfMultiSelection =\n\t\t\t\tisBlockMultiSelected( clientId ) ||\n\t\t\t\tisAncestorMultiSelected( clientId );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\tconst match = getActiveBlockVariation( blockName, attributes );\n\n\t\t\treturn {\n\t\t\t\tindex: getBlockIndex( clientId ),\n\t\t\t\tmode: getBlockMode( clientId ),\n\t\t\t\tname: blockName,\n\t\t\t\tblockApiVersion: blockType?.apiVersion || 1,\n\t\t\t\tblockTitle: match?.title || blockType?.title,\n\t\t\t\tisPartOfSelection: isSelected || isPartOfMultiSelection,\n\t\t\t\tadjustScrolling:\n\t\t\t\t\tisSelected || isFirstMultiSelectedBlock( clientId ),\n\t\t\t\tenableAnimation:\n\t\t\t\t\t! isTyping() &&\n\t\t\t\t\tgetGlobalBlockCount() <= BLOCK_ANIMATION_THRESHOLD,\n\t\t\t\tisSubtreeDisabled: isBlockSubtreeDisabled( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst hasOverlay = useBlockOverlayActive( clientId );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( clientId ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( clientId ),\n\t\tuseNavModeExit( clientId ),\n\t\tuseIsHovered(),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( {\n\t\t\tisSelected: isPartOfSelection,\n\t\t\tadjustScrolling,\n\t\t\tenableAnimation,\n\t\t\ttriggerAnimationOnChange: index,\n\t\t} ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\treturn {\n\t\ttabIndex: 0,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: classnames(\n\t\t\t// The wp-block className is important for editor styles.\n\t\t\tclassnames( 'block-editor-block-list__block', {\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t} ),\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tuseBlockClassNames( clientId ),\n\t\t\tuseBlockDefaultClassName( clientId ),\n\t\t\tuseBlockCustomClassName( clientId ),\n\t\t\tuseBlockMovingModeClassNames( clientId )\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;A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G/D,YAAY;IACf,GAAGJ,KAAK;IACRmD,GAAG,EAAEF,UAAU;IACfmB,EAAE,EAAG,SAASlE,QAAU,GAAG8C,UAAY,EAAC;IACxCqB,IAAI,EAAE,UAAU;IAChB,YAAY,EAAExB,UAAU;IACxB,YAAY,EAAE3C,QAAQ;IACtB,WAAW,EAAEQ,IAAI;IACjB,YAAY,EAAEE,UAAU;IACxB0D,KAAK,EAAEtD,iBAAiB,GAAG,MAAM,GAAGuD,SAAS;IAC7CpE,SAAS,EAAE,IAAAqE,mBAAU;IACpB;IACA,IAAAA,mBAAU,EAAE,gCAAgC,EAAE;MAC7C,UAAU,EAAE,CAAEnE,SAAS;MACvB,mBAAmB,EAAEsC;IACtB,CAAE,CAAC,EACHxC,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtB,IAAAsE,sCAAkB,EAAEvE,QAAS,CAAC,EAC9B,IAAAwE,kDAAwB,EAAExE,QAAS,CAAC,EACpC,IAAAyE,gDAAuB,EAAEzE,QAAS,CAAC,EACnC,IAAA0E,0DAA4B,EAAE1E,QAAS,CACxC,CAAC;IACD2E,KAAK,EAAE;MAAE,GAAGzE,YAAY,CAACyE,KAAK;MAAE,GAAG7E,KAAK,CAAC6E;IAAM;EAChD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA9E,aAAa,CAAC+E,IAAI,GAAGC,+BAAa"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_blocks","_compose","_warning","_useMovingAnimation","_privateBlockContext","_useFocusFirstElement","_useIsHovered","_context","_useFocusHandler","_useSelectedBlockEventHandlers","_useNavModeExit","_useBlockRefs","_useIntersectionObserver","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","isOutlineEnabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","removeOutline","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","isTemporarilyEditingAsBlocks","defaultClassName","useContext","PrivateBlockContext","blockLabel","sprintf","__","htmlSuffix","mergedRefs","useMergeRefs","ref","useFocusFirstElement","useBlockRefProvider","useFocusHandler","useEventHandlers","useNavModeExit","useIsHovered","isEnabled","useIntersectionObserver","useMovingAnimation","triggerAnimationOnChange","useDisabled","isDisabled","blockEditContext","useBlockEditContext","SCRIPT_DEBUG","warning","tabIndex","id","role","inert","undefined","classnames","style","save","getBlockProps"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport { useBlockEditContext } from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useNavModeExit } from './use-nav-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps(\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\tisOutlineEnabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tremoveOutline,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseNavModeExit( clientId ),\n\t\tuseIsHovered( { isEnabled: isOutlineEnabled } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: classnames(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'remove-outline': removeOutline,\n\t\t\t\t'is-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":";;;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G,CAAC,CAAC,GAAG,CAAC;IAClD,GAAGZ,YAAY;IACf,GAAGJ,KAAK;IACRqC,GAAG,EAAEF,UAAU;IACfoB,EAAE,EAAG,SAASrD,QAAU,GAAGgC,UAAY,EAAC;IACxCsB,IAAI,EAAE,UAAU;IAChB,YAAY,EAAEzB,UAAU;IACxB,YAAY,EAAE7B,QAAQ;IACtB,WAAW,EAAEM,IAAI;IACjB,YAAY,EAAEE,UAAU;IACxB+C,KAAK,EAAE7C,iBAAiB,GAAG,MAAM,GAAG8C,SAAS;IAC7CvD,SAAS,EAAE,IAAAwD,mBAAU,EACpB,gCAAgC,EAChC;MACC;MACA,UAAU,EAAE,CAAEtD,SAAS;MACvB,mBAAmB,EAAES,UAAU;MAC/B,aAAa,EAAEH,UAAU;MACzB,gBAAgB,EAAEM,aAAa;MAC/B,mBAAmB,EAAEC,eAAe;MACpC,uBAAuB,EAAEC,mBAAmB;MAC5C,aAAa,EAAEC,UAAU;MACzB,aAAa,EAAEC,UAAU;MACzB,oBAAoB,EAAEC,gBAAgB;MACtC,gBAAgB,EAAEC,aAAa;MAC/B,sBAAsB,EAAEC,iBAAiB;MACzC,yBAAyB,EAAEC,oBAAoB;MAC/C,qBAAqB,EAAEC,iBAAiB;MACxC,iDAAiD,EAChDC;IACF,CAAC,EACDxB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtByB,gBACD,CAAC;IACDgC,KAAK,EAAE;MAAE,GAAGxD,YAAY,CAACwD,KAAK;MAAE,GAAG5D,KAAK,CAAC4D;IAAM;EAChD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA7D,aAAa,CAAC8D,IAAI,GAAGC,+BAAa"}
|
|
@@ -19,33 +19,6 @@ var _store = require("../../../store");
|
|
|
19
19
|
|
|
20
20
|
/** @typedef {import('@wordpress/element').RefObject} RefObject */
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* Returns the initial position if the block needs to be focussed, `undefined`
|
|
24
|
-
* otherwise. The initial position is either 0 (start) or -1 (end).
|
|
25
|
-
*
|
|
26
|
-
* @param {string} clientId Block client ID.
|
|
27
|
-
*
|
|
28
|
-
* @return {number} The initial position, either 0 (start) or -1 (end).
|
|
29
|
-
*/
|
|
30
|
-
function useInitialPosition(clientId) {
|
|
31
|
-
return (0, _data.useSelect)(select => {
|
|
32
|
-
const {
|
|
33
|
-
getSelectedBlocksInitialCaretPosition,
|
|
34
|
-
__unstableGetEditorMode,
|
|
35
|
-
isBlockSelected
|
|
36
|
-
} = select(_store.store);
|
|
37
|
-
if (!isBlockSelected(clientId)) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (__unstableGetEditorMode() !== 'edit') {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// If there's no initial position, return 0 to focus the start.
|
|
45
|
-
return getSelectedBlocksInitialCaretPosition();
|
|
46
|
-
}, [clientId]);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
22
|
/**
|
|
50
23
|
* Transitions focus to the block or inner tabbable when the block becomes
|
|
51
24
|
* selected and an initial position is set.
|
|
@@ -54,9 +27,11 @@ function useInitialPosition(clientId) {
|
|
|
54
27
|
*
|
|
55
28
|
* @return {RefObject} React ref with the block element.
|
|
56
29
|
*/
|
|
57
|
-
function useFocusFirstElement(
|
|
30
|
+
function useFocusFirstElement({
|
|
31
|
+
clientId,
|
|
32
|
+
initialPosition
|
|
33
|
+
}) {
|
|
58
34
|
const ref = (0, _element.useRef)();
|
|
59
|
-
const initialPosition = useInitialPosition(clientId);
|
|
60
35
|
const {
|
|
61
36
|
isBlockSelected,
|
|
62
37
|
isMultiSelecting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_dom","_data","_dom2","_store","
|
|
1
|
+
{"version":3,"names":["_element","require","_dom","_data","_dom2","_store","useFocusFirstElement","clientId","initialPosition","ref","useRef","isBlockSelected","isMultiSelecting","useSelect","blockEditorStore","useEffect","undefined","current","ownerDocument","isInsideRootBlock","activeElement","textInputs","focus","tabbable","find","filter","node","isTextField","isReverse","target","length","getAttribute","focusElement","findNext","isFormElement","placeCaretAtHorizontalEdge"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-focus-first-element.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tfocus,\n\tisFormElement,\n\tisTextField,\n\tplaceCaretAtHorizontalEdge,\n} from '@wordpress/dom';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { isInsideRootBlock } from '../../../utils/dom';\nimport { store as blockEditorStore } from '../../../store';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\n/**\n * Transitions focus to the block or inner tabbable when the block becomes\n * selected and an initial position is set.\n *\n * @param {string} clientId Block client ID.\n *\n * @return {RefObject} React ref with the block element.\n */\nexport function useFocusFirstElement( { clientId, initialPosition } ) {\n\tconst ref = useRef();\n\tconst { isBlockSelected, isMultiSelecting } = useSelect( blockEditorStore );\n\n\tuseEffect( () => {\n\t\t// Check if the block is still selected at the time this effect runs.\n\t\tif ( ! isBlockSelected( clientId ) || isMultiSelecting() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( initialPosition === undefined || initialPosition === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { ownerDocument } = ref.current;\n\n\t\t// Do not focus the block if it already contains the active element.\n\t\tif ( isInsideRootBlock( ref.current, ownerDocument.activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Find all tabbables within node.\n\t\tconst textInputs = focus.tabbable\n\t\t\t.find( ref.current )\n\t\t\t.filter( ( node ) => isTextField( node ) );\n\n\t\t// If reversed (e.g. merge via backspace), use the last in the set of\n\t\t// tabbables.\n\t\tconst isReverse = -1 === initialPosition;\n\t\tconst target =\n\t\t\ttextInputs[ isReverse ? textInputs.length - 1 : 0 ] || ref.current;\n\n\t\tif ( ! isInsideRootBlock( ref.current, target ) ) {\n\t\t\tref.current.focus();\n\t\t\treturn;\n\t\t}\n\n\t\t// Check to see if element is focussable before a generic caret insert.\n\t\tif ( ! ref.current.getAttribute( 'contenteditable' ) ) {\n\t\t\tconst focusElement = focus.tabbable.findNext( ref.current );\n\t\t\t// Make sure focusElement is valid, contained in the same block, and a form field.\n\t\t\tif (\n\t\t\t\tfocusElement &&\n\t\t\t\tisInsideRootBlock( ref.current, focusElement ) &&\n\t\t\t\tisFormElement( focusElement )\n\t\t\t) {\n\t\t\t\tfocusElement.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tplaceCaretAtHorizontalEdge( target, isReverse );\n\t}, [ initialPosition, clientId ] );\n\n\treturn ref;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAhBA;AACA;AACA;;AAUA;AACA;AACA;;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,oBAAoBA,CAAE;EAAEC,QAAQ;EAAEC;AAAgB,CAAC,EAAG;EACrE,MAAMC,GAAG,GAAG,IAAAC,eAAM,EAAC,CAAC;EACpB,MAAM;IAAEC,eAAe;IAAEC;EAAiB,CAAC,GAAG,IAAAC,eAAS,EAAEC,YAAiB,CAAC;EAE3E,IAAAC,kBAAS,EAAE,MAAM;IAChB;IACA,IAAK,CAAEJ,eAAe,CAAEJ,QAAS,CAAC,IAAIK,gBAAgB,CAAC,CAAC,EAAG;MAC1D;IACD;IAEA,IAAKJ,eAAe,KAAKQ,SAAS,IAAIR,eAAe,KAAK,IAAI,EAAG;MAChE;IACD;IAEA,IAAK,CAAEC,GAAG,CAACQ,OAAO,EAAG;MACpB;IACD;IAEA,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4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useIsHovered = useIsHovered;
|
|
7
|
-
var _data = require("@wordpress/data");
|
|
8
7
|
var _compose = require("@wordpress/compose");
|
|
9
|
-
var _store = require("../../../store");
|
|
10
8
|
/**
|
|
11
9
|
* WordPress dependencies
|
|
12
10
|
*/
|
|
13
11
|
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
12
|
function listener(event) {
|
|
19
13
|
if (event.defaultPrevented) {
|
|
20
14
|
return;
|
|
@@ -24,17 +18,13 @@ function listener(event) {
|
|
|
24
18
|
event.currentTarget.classList[action]('is-hovered');
|
|
25
19
|
}
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
/*
|
|
28
22
|
* Adds `is-hovered` class when the block is hovered and in navigation or
|
|
29
23
|
* outline mode.
|
|
30
24
|
*/
|
|
31
|
-
function useIsHovered(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
getSettings
|
|
35
|
-
} = select(_store.store);
|
|
36
|
-
return getSettings().outlineMode;
|
|
37
|
-
}, []);
|
|
25
|
+
function useIsHovered({
|
|
26
|
+
isEnabled
|
|
27
|
+
}) {
|
|
38
28
|
return (0, _compose.useRefEffect)(node => {
|
|
39
29
|
if (isEnabled) {
|
|
40
30
|
node.addEventListener('mouseout', listener);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_compose","require","listener","event","defaultPrevented","action","type","preventDefault","currentTarget","classList","useIsHovered","isEnabled","useRefEffect","node","addEventListener","removeEventListener","remove"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-is-hovered.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\n\nfunction listener( event ) {\n\tif ( event.defaultPrevented ) {\n\t\treturn;\n\t}\n\n\tconst action = event.type === 'mouseover' ? 'add' : 'remove';\n\n\tevent.preventDefault();\n\tevent.currentTarget.classList[ action ]( 'is-hovered' );\n}\n\n/*\n * Adds `is-hovered` class when the block is hovered and in navigation or\n * outline mode.\n */\nexport function useIsHovered( { isEnabled } ) {\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isEnabled ) {\n\t\t\t\tnode.addEventListener( 'mouseout', listener );\n\t\t\t\tnode.addEventListener( 'mouseover', listener );\n\n\t\t\t\treturn () => {\n\t\t\t\t\tnode.removeEventListener( 'mouseout', listener );\n\t\t\t\t\tnode.removeEventListener( 'mouseover', listener );\n\n\t\t\t\t\t// Remove class in case it lingers.\n\t\t\t\t\tnode.classList.remove( 'is-hovered' );\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t[ isEnabled ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,SAASC,QAAQA,CAAEC,KAAK,EAAG;EAC1B,IAAKA,KAAK,CAACC,gBAAgB,EAAG;IAC7B;EACD;EAEA,MAAMC,MAAM,GAAGF,KAAK,CAACG,IAAI,KAAK,WAAW,GAAG,KAAK,GAAG,QAAQ;EAE5DH,KAAK,CAACI,cAAc,CAAC,CAAC;EACtBJ,KAAK,CAACK,aAAa,CAACC,SAAS,CAAEJ,MAAM,CAAE,CAAE,YAAa,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACO,SAASK,YAAYA,CAAE;EAAEC;AAAU,CAAC,EAAG;EAC7C,OAAO,IAAAC,qBAAY,EAChBC,IAAI,IAAM;IACX,IAAKF,SAAS,EAAG;MAChBE,IAAI,CAACC,gBAAgB,CAAE,UAAU,EAAEZ,QAAS,CAAC;MAC7CW,IAAI,CAACC,gBAAgB,CAAE,WAAW,EAAEZ,QAAS,CAAC;MAE9C,OAAO,MAAM;QACZW,IAAI,CAACE,mBAAmB,CAAE,UAAU,EAAEb,QAAS,CAAC;QAChDW,IAAI,CAACE,mBAAmB,CAAE,WAAW,EAAEb,QAAS,CAAC;;QAEjD;QACAW,IAAI,CAACJ,SAAS,CAACO,MAAM,CAAE,YAAa,CAAC;MACtC,CAAC;IACF;EACD,CAAC,EACD,CAAEL,SAAS,CACZ,CAAC;AACF"}
|
|
@@ -25,8 +25,10 @@ var _store = require("../../../store");
|
|
|
25
25
|
*
|
|
26
26
|
* @param {string} clientId Block client ID.
|
|
27
27
|
*/
|
|
28
|
-
function useEventHandlers(
|
|
29
|
-
|
|
28
|
+
function useEventHandlers({
|
|
29
|
+
clientId,
|
|
30
|
+
isSelected
|
|
31
|
+
}) {
|
|
30
32
|
const {
|
|
31
33
|
getBlockRootClientId,
|
|
32
34
|
getBlockIndex
|
package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_dom","require","_keycodes","_data","_compose","_store","useEventHandlers","clientId","isSelected","
|
|
1
|
+
{"version":3,"names":["_dom","require","_keycodes","_data","_compose","_store","useEventHandlers","clientId","isSelected","getBlockRootClientId","getBlockIndex","useSelect","blockEditorStore","insertDefaultBlock","removeBlock","useDispatch","useRefEffect","node","onKeyDown","event","keyCode","target","ENTER","BACKSPACE","DELETE","isTextField","preventDefault","onDragStart","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isTextField } from '@wordpress/dom';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\n\n/**\n * Adds block behaviour:\n * - Removes the block on BACKSPACE.\n * - Inserts a default block on ENTER.\n * - Disables dragging of block contents.\n *\n * @param {string} clientId Block client ID.\n */\nexport function useEventHandlers( { clientId, isSelected } ) {\n\tconst { getBlockRootClientId, getBlockIndex } =\n\t\tuseSelect( blockEditorStore );\n\tconst { insertDefaultBlock, removeBlock } = useDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! isSelected ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Interprets keydown event intent to remove or insert after block if\n\t\t\t * key event occurs on wrapper node. This can occur when the block has\n\t\t\t * no text fields of its own, particularly after initial insertion, to\n\t\t\t * allow for easy deletion and continuous writing flow to add additional\n\t\t\t * content.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event Keydown event.\n\t\t\t */\n\t\t\tfunction onKeyDown( event ) {\n\t\t\t\tconst { keyCode, target } = event;\n\n\t\t\t\tif (\n\t\t\t\t\tkeyCode !== ENTER &&\n\t\t\t\t\tkeyCode !== BACKSPACE &&\n\t\t\t\t\tkeyCode !== DELETE\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( target !== node || isTextField( target ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif ( keyCode === ENTER ) {\n\t\t\t\t\tinsertDefaultBlock(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\tgetBlockRootClientId( clientId ),\n\t\t\t\t\t\tgetBlockIndex( clientId ) + 1\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Prevents default dragging behavior within a block. To do: we must\n\t\t\t * handle this in the future and clean up the drag target.\n\t\t\t *\n\t\t\t * @param {DragEvent} event Drag event.\n\t\t\t */\n\t\t\tfunction onDragStart( event ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\t\tnode.addEventListener( 'dragstart', onDragStart );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\t\tnode.removeEventListener( 'dragstart', onDrag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ChCG,aAAa,CAAEH,QAAS,CAAC,GAAG,CAC7B,CAAC;MACF,CAAC,MAAM;QACNO,WAAW,CAAEP,QAAS,CAAC;MACxB;IACD;;IAEA;AACH;AACA;AACA;AACA;AACA;IACG,SAASoB,WAAWA,CAAER,KAAK,EAAG;MAC7BA,KAAK,CAACO,cAAc,CAAC,CAAC;IACvB;IAEAT,IAAI,CAACW,gBAAgB,CAAE,SAAS,EAAEV,SAAU,CAAC;IAC7CD,IAAI,CAACW,gBAAgB,CAAE,WAAW,EAAED,WAAY,CAAC;IAEjD,OAAO,MAAM;MACZV,IAAI,CAACY,mBAAmB,CAAE,SAAS,EAAEX,SAAU,CAAC;MAChDD,IAAI,CAACY,mBAAmB,CAAE,WAAW,EAAEF,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CACCpB,QAAQ,EACRC,UAAU,EACVC,oBAAoB,EACpBC,aAAa,EACbG,kBAAkB,EAClBC,WAAW,CAEb,CAAC;AACF"}
|
|
@@ -28,7 +28,8 @@ function useInBetweenInserter() {
|
|
|
28
28
|
getSelectedBlockClientIds,
|
|
29
29
|
getTemplateLock,
|
|
30
30
|
__unstableIsWithinBlockOverlay,
|
|
31
|
-
getBlockEditingMode
|
|
31
|
+
getBlockEditingMode,
|
|
32
|
+
getBlockName
|
|
32
33
|
} = (0, _data.useSelect)(_store.store);
|
|
33
34
|
const {
|
|
34
35
|
showInsertionPoint,
|
|
@@ -59,7 +60,7 @@ function useInBetweenInserter() {
|
|
|
59
60
|
const blockElement = !!event.target.getAttribute('data-block') ? event.target : event.target.closest('[data-block]');
|
|
60
61
|
rootClientId = blockElement.getAttribute('data-block');
|
|
61
62
|
}
|
|
62
|
-
if (getTemplateLock(rootClientId) || getBlockEditingMode(rootClientId) === 'disabled') {
|
|
63
|
+
if (getTemplateLock(rootClientId) || getBlockEditingMode(rootClientId) === 'disabled' || getBlockName(rootClientId) === 'core/block' && window.__experimentalPatternPartialSyncing) {
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
66
|
const orientation = getBlockListSettings(rootClientId)?.orientation || 'vertical';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_data","_element","_i18n","_store","_insertionPoint","useInBetweenInserter","openRef","useContext","InsertionPointOpenRef","isInBetweenInserterDisabled","useSelect","select","blockEditorStore","getSettings","isDistractionFree","__unstableGetEditorMode","getBlockListSettings","getBlockIndex","isMultiSelecting","getSelectedBlockClientIds","getTemplateLock","__unstableIsWithinBlockOverlay","getBlockEditingMode","showInsertionPoint","hideInsertionPoint","useDispatch","useRefEffect","node","onMouseMove","event","current","target","nodeType","TEXT_NODE","classList","contains","rootClientId","blockElement","getAttribute","closest","orientation","offsetTop","clientY","offsetLeft","clientX","children","Array","from","element","find","blockEl","blockElRect","getBoundingClientRect","top","isRTL","right","left","id","firstElementChild","clientId","slice","length","includes","elementRect","bottom","index","__unstableWithInserter","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-in-between-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { InsertionPointOpenRef } from '../block-tools/insertion-point';\n\nexport function useInBetweenInserter() {\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst isInBetweenInserterDisabled = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree ||\n\t\t\tselect( blockEditorStore ).__unstableGetEditorMode() === 'zoom-out',\n\t\t[]\n\t);\n\tconst {\n\t\tgetBlockListSettings,\n\t\tgetBlockIndex,\n\t\tisMultiSelecting,\n\t\tgetSelectedBlockClientIds,\n\t\tgetTemplateLock,\n\t\t__unstableIsWithinBlockOverlay,\n\t\tgetBlockEditingMode,\n\t} = useSelect( blockEditorStore );\n\tconst { showInsertionPoint, hideInsertionPoint } =\n\t\tuseDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isInBetweenInserterDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction onMouseMove( event ) {\n\t\t\t\tif ( openRef.current ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Ignore text nodes sometimes detected in FireFox.\n\t\t\t\tif ( event.target.nodeType === event.target.TEXT_NODE ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( isMultiSelecting() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains(\n\t\t\t\t\t\t'block-editor-block-list__layout'\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet rootClientId;\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains( 'is-root-container' )\n\t\t\t\t) {\n\t\t\t\t\tconst blockElement = !! event.target.getAttribute(\n\t\t\t\t\t\t'data-block'\n\t\t\t\t\t)\n\t\t\t\t\t\t? event.target\n\t\t\t\t\t\t: event.target.closest( '[data-block]' );\n\t\t\t\t\trootClientId = blockElement.getAttribute( 'data-block' );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tgetTemplateLock( rootClientId ) ||\n\t\t\t\t\tgetBlockEditingMode( rootClientId ) === 'disabled'\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst orientation =\n\t\t\t\t\tgetBlockListSettings( rootClientId )?.orientation ||\n\t\t\t\t\t'vertical';\n\t\t\t\tconst offsetTop = event.clientY;\n\t\t\t\tconst offsetLeft = event.clientX;\n\n\t\t\t\tconst children = Array.from( event.target.children );\n\t\t\t\tlet element = children.find( ( blockEl ) => {\n\t\t\t\t\tconst blockElRect = blockEl.getBoundingClientRect();\n\t\t\t\t\treturn (\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'vertical' &&\n\t\t\t\t\t\t\tblockElRect.top > offsetTop ) ||\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'horizontal' &&\n\t\t\t\t\t\t\t( isRTL()\n\t\t\t\t\t\t\t\t? blockElRect.right < offsetLeft\n\t\t\t\t\t\t\t\t: blockElRect.left > offsetLeft ) )\n\t\t\t\t\t);\n\t\t\t\t} );\n\n\t\t\t\tif ( ! element ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// The block may be in an alignment wrapper, so check the first direct\n\t\t\t\t// child if the element has no ID.\n\t\t\t\tif ( ! element.id ) {\n\t\t\t\t\telement = element.firstElementChild;\n\n\t\t\t\t\tif ( ! element ) {\n\t\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Don't show the insertion point if a parent block has an \"overlay\"\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/34012#pullrequestreview-727762337\n\t\t\t\tconst clientId = element.id.slice( 'block-'.length );\n\t\t\t\tif (\n\t\t\t\t\t! clientId ||\n\t\t\t\t\t__unstableIsWithinBlockOverlay( clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Don't show the inserter when hovering above (conflicts with\n\t\t\t\t// block toolbar) or inside selected block(s).\n\t\t\t\tif ( getSelectedBlockClientIds().includes( clientId ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst elementRect = element.getBoundingClientRect();\n\n\t\t\t\tif (\n\t\t\t\t\t( orientation === 'horizontal' &&\n\t\t\t\t\t\t( event.clientY > elementRect.bottom ||\n\t\t\t\t\t\t\tevent.clientY < elementRect.top ) ) ||\n\t\t\t\t\t( orientation === 'vertical' &&\n\t\t\t\t\t\t( event.clientX > elementRect.right ||\n\t\t\t\t\t\t\tevent.clientX < elementRect.left ) )\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst index = getBlockIndex( clientId );\n\n\t\t\t\t// Don't show the in-between inserter before the first block in\n\t\t\t\t// the list (preserves the original behaviour).\n\t\t\t\tif ( index === 0 ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tshowInsertionPoint( rootClientId, index, {\n\t\t\t\t\t__unstableWithInserter: true,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'mousemove', onMouseMove );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousemove', onMouseMove );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\topenRef,\n\t\t\tgetBlockListSettings,\n\t\t\tgetBlockIndex,\n\t\t\tisMultiSelecting,\n\t\t\tshowInsertionPoint,\n\t\t\thideInsertionPoint,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisInBetweenInserterDisabled,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIO,SAASM,oBAAoBA,CAAA,EAAG;EACtC,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EAAEC,qCAAsB,CAAC;EACnD,MAAMC,2BAA2B,GAAG,IAAAC,eAAS,EAC1CC,MAAM,IACPA,MAAM,CAAEC,YAAiB,CAAC,CAACC,WAAW,CAAC,CAAC,CAACC,iBAAiB,I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AAG;QACvD;MACD;MACA,MAAMI,WAAW,GAAGf,OAAO,CAACI,qBAAqB,CAAC,CAAC;MAEnD,IACGZ,WAAW,KAAK,YAAY,KAC3BX,KAAK,CAACa,OAAO,GAAGqB,WAAW,CAACC,MAAM,IACnCnC,KAAK,CAACa,OAAO,GAAGqB,WAAW,CAACV,GAAG,CAAE,IACjCb,WAAW,KAAK,UAAU,KACzBX,KAAK,CAACe,OAAO,GAAGmB,WAAW,CAACR,KAAK,IAClC1B,KAAK,CAACe,OAAO,GAAGmB,WAAW,CAACP,IAAI,CAAI,EACrC;QACDhC,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEA,MAAMyC,KAAK,GAAGhD,aAAa,CAAE0C,QAAS,CAAC;;MAEvC;MACA;MACA,IAAKM,KAAK,KAAK,CAAC,EAAG;QAClBzC,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEAD,kBAAkB,CAAEa,YAAY,EAAE6B,KAAK,EAAE;QACxCC,sBAAsB,EAAE;MACzB,CAAE,CAAC;IACJ;IAEAvC,IAAI,CAACwC,gBAAgB,CAAE,WAAW,EAAEvC,WAAY,CAAC;IAEjD,OAAO,MAAM;MACZD,IAAI,CAACyC,mBAAmB,CAAE,WAAW,EAAExC,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CACCtB,OAAO,EACPU,oBAAoB,EACpBC,aAAa,EACbC,gBAAgB,EAChBK,kBAAkB,EAClBC,kBAAkB,EAClBL,yBAAyB,EACzBV,2BAA2B,CAE7B,CAAC;AACF"}
|
|
1
|
+
{"version":3,"names":["_compose","require","_data","_element","_i18n","_store","_insertionPoint","useInBetweenInserter","openRef","useContext","InsertionPointOpenRef","isInBetweenInserterDisabled","useSelect","select","blockEditorStore","getSettings","isDistractionFree","__unstableGetEditorMode","getBlockListSettings","getBlockIndex","isMultiSelecting","getSelectedBlockClientIds","getTemplateLock","__unstableIsWithinBlockOverlay","getBlockEditingMode","getBlockName","showInsertionPoint","hideInsertionPoint","useDispatch","useRefEffect","node","onMouseMove","event","current","target","nodeType","TEXT_NODE","classList","contains","rootClientId","blockElement","getAttribute","closest","window","__experimentalPatternPartialSyncing","orientation","offsetTop","clientY","offsetLeft","clientX","children","Array","from","element","find","blockEl","blockElRect","getBoundingClientRect","top","isRTL","right","left","id","firstElementChild","clientId","slice","length","includes","elementRect","bottom","index","__unstableWithInserter","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-in-between-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { InsertionPointOpenRef } from '../block-tools/insertion-point';\n\nexport function useInBetweenInserter() {\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst isInBetweenInserterDisabled = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree ||\n\t\t\tselect( blockEditorStore ).__unstableGetEditorMode() === 'zoom-out',\n\t\t[]\n\t);\n\tconst {\n\t\tgetBlockListSettings,\n\t\tgetBlockIndex,\n\t\tisMultiSelecting,\n\t\tgetSelectedBlockClientIds,\n\t\tgetTemplateLock,\n\t\t__unstableIsWithinBlockOverlay,\n\t\tgetBlockEditingMode,\n\t\tgetBlockName,\n\t} = useSelect( blockEditorStore );\n\tconst { showInsertionPoint, hideInsertionPoint } =\n\t\tuseDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isInBetweenInserterDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction onMouseMove( event ) {\n\t\t\t\tif ( openRef.current ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Ignore text nodes sometimes detected in FireFox.\n\t\t\t\tif ( event.target.nodeType === event.target.TEXT_NODE ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( isMultiSelecting() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains(\n\t\t\t\t\t\t'block-editor-block-list__layout'\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet rootClientId;\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains( 'is-root-container' )\n\t\t\t\t) {\n\t\t\t\t\tconst blockElement = !! event.target.getAttribute(\n\t\t\t\t\t\t'data-block'\n\t\t\t\t\t)\n\t\t\t\t\t\t? event.target\n\t\t\t\t\t\t: event.target.closest( '[data-block]' );\n\t\t\t\t\trootClientId = blockElement.getAttribute( 'data-block' );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tgetTemplateLock( rootClientId ) ||\n\t\t\t\t\tgetBlockEditingMode( rootClientId ) === 'disabled' ||\n\t\t\t\t\t( getBlockName( rootClientId ) === 'core/block' &&\n\t\t\t\t\t\twindow.__experimentalPatternPartialSyncing )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst orientation =\n\t\t\t\t\tgetBlockListSettings( rootClientId )?.orientation ||\n\t\t\t\t\t'vertical';\n\t\t\t\tconst offsetTop = event.clientY;\n\t\t\t\tconst offsetLeft = event.clientX;\n\n\t\t\t\tconst children = Array.from( event.target.children );\n\t\t\t\tlet element = children.find( ( blockEl ) => {\n\t\t\t\t\tconst blockElRect = blockEl.getBoundingClientRect();\n\t\t\t\t\treturn (\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'vertical' &&\n\t\t\t\t\t\t\tblockElRect.top > offsetTop ) ||\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'horizontal' &&\n\t\t\t\t\t\t\t( isRTL()\n\t\t\t\t\t\t\t\t? blockElRect.right < offsetLeft\n\t\t\t\t\t\t\t\t: blockElRect.left > offsetLeft ) )\n\t\t\t\t\t);\n\t\t\t\t} );\n\n\t\t\t\tif ( ! element ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// The block may be in an alignment wrapper, so check the first direct\n\t\t\t\t// child if the element has no ID.\n\t\t\t\tif ( ! element.id ) {\n\t\t\t\t\telement = element.firstElementChild;\n\n\t\t\t\t\tif ( ! element ) {\n\t\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Don't show the insertion point if a parent block has an \"overlay\"\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/34012#pullrequestreview-727762337\n\t\t\t\tconst clientId = element.id.slice( 'block-'.length );\n\t\t\t\tif (\n\t\t\t\t\t! clientId ||\n\t\t\t\t\t__unstableIsWithinBlockOverlay( clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Don't show the inserter when hovering above (conflicts with\n\t\t\t\t// block toolbar) or inside selected block(s).\n\t\t\t\tif ( getSelectedBlockClientIds().includes( clientId ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst elementRect = element.getBoundingClientRect();\n\n\t\t\t\tif (\n\t\t\t\t\t( orientation === 'horizontal' &&\n\t\t\t\t\t\t( event.clientY > elementRect.bottom ||\n\t\t\t\t\t\t\tevent.clientY < elementRect.top ) ) ||\n\t\t\t\t\t( orientation === 'vertical' &&\n\t\t\t\t\t\t( event.clientX > elementRect.right ||\n\t\t\t\t\t\t\tevent.clientX < elementRect.left ) )\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst index = getBlockIndex( clientId );\n\n\t\t\t\t// Don't show the in-between inserter before the first block in\n\t\t\t\t// the list (preserves the original behaviour).\n\t\t\t\tif ( index === 0 ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tshowInsertionPoint( rootClientId, index, {\n\t\t\t\t\t__unstableWithInserter: true,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'mousemove', onMouseMove );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousemove', onMouseMove );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\topenRef,\n\t\t\tgetBlockListSettings,\n\t\t\tgetBlockIndex,\n\t\t\tisMultiSelecting,\n\t\t\tshowInsertionPoint,\n\t\t\thideInsertionPoint,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisInBetweenInserterDisabled,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIO,SAASM,oBAAoBA,CAAA,EAAG;EACtC,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EAAEC,qCAAsB,CAAC;EACnD,MAAMC,2BAA2B,GAAG,IAAAC,eAAS,EAC1CC,MAAM,IACPA,MAAM,CAAEC,YAAiB,CAAC,CAACC,WAAW,CAAC,CAAC,CAACC,iBAAiB,IAC1DH,MAAM,CAAEC,YAAiB,CAAC,CAACG,uBAAuB,CAAC,CAAC,KAAK,UAAU,EACpE,EACD,CAAC;EACD,MAAM;IACLC,oBAAoB;IACpBC,aAAa;IACbC,gBAAgB;IAChBC,yBAAyB;IACzBC,eAAe;IACfC,8BAA8B;IAC9BC,mBAAmB;IACnBC;EACD,CAAC,GAAG,IAAAb,eA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,WAAW,CAACC,MAAM,IACnCrC,KAAK,CAACe,OAAO,GAAGqB,WAAW,CAACV,GAAG,CAAE,IACjCb,WAAW,KAAK,UAAU,KACzBb,KAAK,CAACiB,OAAO,GAAGmB,WAAW,CAACR,KAAK,IAClC5B,KAAK,CAACiB,OAAO,GAAGmB,WAAW,CAACP,IAAI,CAAI,EACrC;QACDlC,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEA,MAAM2C,KAAK,GAAGnD,aAAa,CAAE6C,QAAS,CAAC;;MAEvC;MACA;MACA,IAAKM,KAAK,KAAK,CAAC,EAAG;QAClB3C,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEAD,kBAAkB,CAAEa,YAAY,EAAE+B,KAAK,EAAE;QACxCC,sBAAsB,EAAE;MACzB,CAAE,CAAC;IACJ;IAEAzC,IAAI,CAAC0C,gBAAgB,CAAE,WAAW,EAAEzC,WAAY,CAAC;IAEjD,OAAO,MAAM;MACZD,IAAI,CAAC2C,mBAAmB,CAAE,WAAW,EAAE1C,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CACCvB,OAAO,EACPU,oBAAoB,EACpBC,aAAa,EACbC,gBAAgB,EAChBM,kBAAkB,EAClBC,kBAAkB,EAClBN,yBAAyB,EACzBV,2BAA2B,CAE7B,CAAC;AACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _element = require("@wordpress/element");
|
|
8
|
+
var _data = require("@wordpress/data");
|
|
9
|
+
var _blockListContext = require("./block-list-context");
|
|
10
|
+
var _store = require("../../store");
|
|
11
|
+
/**
|
|
12
|
+
* WordPress dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const useScrollUponInsertion = ({
|
|
20
|
+
clientId,
|
|
21
|
+
isSelected,
|
|
22
|
+
isLayoutCalculated,
|
|
23
|
+
elementRef
|
|
24
|
+
}) => {
|
|
25
|
+
const {
|
|
26
|
+
scrollRef
|
|
27
|
+
} = (0, _blockListContext.useBlockListContext)();
|
|
28
|
+
const wasBlockJustInserted = (0, _data.useSelect)(select => !!select(_store.store).wasBlockJustInserted(clientId, 'inserter_menu'), [clientId]);
|
|
29
|
+
(0, _element.useEffect)(() => {
|
|
30
|
+
const lastScrollTo = scrollRef?.lastScrollTo.current;
|
|
31
|
+
const alreadyScrolledTo = lastScrollTo?.clientId === clientId;
|
|
32
|
+
if (alreadyScrolledTo || !isSelected || !scrollRef || !wasBlockJustInserted || !isLayoutCalculated) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
scrollRef.scrollToElement(elementRef);
|
|
36
|
+
lastScrollTo.clientId = clientId;
|
|
37
|
+
}, [isSelected, scrollRef, wasBlockJustInserted, elementRef, isLayoutCalculated, clientId]);
|
|
38
|
+
};
|
|
39
|
+
var _default = useScrollUponInsertion;
|
|
40
|
+
exports.default = _default;
|
|
41
|
+
//# sourceMappingURL=use-scroll-upon-insertion.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_blockListContext","_store","useScrollUponInsertion","clientId","isSelected","isLayoutCalculated","elementRef","scrollRef","useBlockListContext","wasBlockJustInserted","useSelect","select","blockEditorStore","useEffect","lastScrollTo","current","alreadyScrolledTo","scrollToElement","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-list/use-scroll-upon-insertion.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockListContext } from './block-list-context';\nimport { store as blockEditorStore } from '../../store';\n\nconst useScrollUponInsertion = ( {\n\tclientId,\n\tisSelected,\n\tisLayoutCalculated,\n\telementRef,\n} ) => {\n\tconst { scrollRef } = useBlockListContext();\n\tconst wasBlockJustInserted = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( blockEditorStore ).wasBlockJustInserted(\n\t\t\t\tclientId,\n\t\t\t\t'inserter_menu'\n\t\t\t),\n\t\t[ clientId ]\n\t);\n\tuseEffect( () => {\n\t\tconst lastScrollTo = scrollRef?.lastScrollTo.current;\n\t\tconst alreadyScrolledTo = lastScrollTo?.clientId === clientId;\n\t\tif (\n\t\t\talreadyScrolledTo ||\n\t\t\t! isSelected ||\n\t\t\t! scrollRef ||\n\t\t\t! wasBlockJustInserted ||\n\t\t\t! isLayoutCalculated\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tscrollRef.scrollToElement( elementRef );\n\t\tlastScrollTo.clientId = clientId;\n\t}, [\n\t\tisSelected,\n\t\tscrollRef,\n\t\twasBlockJustInserted,\n\t\telementRef,\n\t\tisLayoutCalculated,\n\t\tclientId,\n\t] );\n};\n\nexport default useScrollUponInsertion;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAMI,sBAAsB,GAAGA,CAAE;EAChCC,QAAQ;EACRC,UAAU;EACVC,kBAAkB;EAClBC;AACD,CAAC,KAAM;EACN,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,qCAAmB,EAAC,CAAC;EAC3C,MAAMC,oBAAoB,GAAG,IAAAC,eAAS,EACnCC,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEC,YAAiB,CAAC,CAACH,oBAAoB,CACjDN,QAAQ,EACR,eACD,CAAC,EACF,CAAEA,QAAQ,CACX,CAAC;EACD,IAAAU,kBAAS,EAAE,MAAM;IAChB,MAAMC,YAAY,GAAGP,SAAS,EAAEO,YAAY,CAACC,OAAO;IACpD,MAAMC,iBAAiB,GAAGF,YAAY,EAAEX,QAAQ,KAAKA,QAAQ;IAC7D,IACCa,iBAAiB,IACjB,CAAEZ,UAAU,IACZ,CAAEG,SAAS,IACX,CAAEE,oBAAoB,IACtB,CAAEJ,kBAAkB,EACnB;MACD;IACD;IACAE,SAAS,CAACU,eAAe,CAAEX,UAAW,CAAC;IACvCQ,YAAY,CAACX,QAAQ,GAAGA,QAAQ;EACjC,CAAC,EAAE,CACFC,UAAU,EACVG,SAAS,EACTE,oBAAoB,EACpBH,UAAU,EACVD,kBAAkB,EAClBF,QAAQ,CACP,CAAC;AACJ,CAAC;AAAC,IAAAe,QAAA,GAEahB,sBAAsB;AAAAiB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -8,7 +8,6 @@ exports.default = BlockLockToolbar;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
|
-
var _dom = require("@wordpress/dom");
|
|
12
11
|
var _element = require("@wordpress/element");
|
|
13
12
|
var _icons = require("@wordpress/icons");
|
|
14
13
|
var _modal = _interopRequireDefault(require("./modal"));
|
|
@@ -22,44 +21,39 @@ var _useBlockLock = _interopRequireDefault(require("./use-block-lock"));
|
|
|
22
21
|
*/
|
|
23
22
|
|
|
24
23
|
function BlockLockToolbar({
|
|
25
|
-
clientId
|
|
26
|
-
wrapperRef
|
|
24
|
+
clientId
|
|
27
25
|
}) {
|
|
28
26
|
const {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
canRemove,
|
|
32
|
-
canLock
|
|
27
|
+
canLock,
|
|
28
|
+
isLocked
|
|
33
29
|
} = (0, _useBlockLock.default)(clientId);
|
|
34
30
|
const [isModalOpen, toggleModal] = (0, _element.useReducer)(isActive => !isActive, false);
|
|
35
|
-
const
|
|
36
|
-
const isFirstRender = (0, _element.useRef)(true);
|
|
37
|
-
const shouldHideBlockLockUI = !canLock || canEdit && canMove && canRemove;
|
|
31
|
+
const hasLockButtonShown = (0, _element.useRef)(false);
|
|
38
32
|
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
33
|
+
// If the block lock button has been shown, we don't want to remove it
|
|
34
|
+
// from the toolbar until the toolbar is rendered again without it.
|
|
35
|
+
// Removing it beforehand can cause focus loss issues, such as when
|
|
36
|
+
// unlocking the block from the modal. It needs to return focus from
|
|
37
|
+
// whence it came, and to do that, we need to leave the button in the toolbar.
|
|
42
38
|
(0, _element.useEffect)(() => {
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
return;
|
|
39
|
+
if (isLocked) {
|
|
40
|
+
hasLockButtonShown.current = true;
|
|
46
41
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
sequential: false
|
|
50
|
-
}).find(element => element.tagName === 'BUTTON' && element !== lockButtonRef.current)?.focus();
|
|
51
|
-
}
|
|
52
|
-
// wrapperRef is a reference object and should be stable
|
|
53
|
-
}, [isModalOpen, shouldHideBlockLockUI, wrapperRef]);
|
|
54
|
-
if (shouldHideBlockLockUI) {
|
|
42
|
+
}, [isLocked]);
|
|
43
|
+
if (!isLocked && !hasLockButtonShown.current) {
|
|
55
44
|
return null;
|
|
56
45
|
}
|
|
46
|
+
let label = isLocked ? (0, _i18n.__)('Unlock') : (0, _i18n.__)('Lock');
|
|
47
|
+
if (!canLock && isLocked) {
|
|
48
|
+
label = (0, _i18n.__)('Locked');
|
|
49
|
+
}
|
|
57
50
|
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.ToolbarGroup, {
|
|
58
51
|
className: "block-editor-block-lock-toolbar"
|
|
59
52
|
}, (0, _react.createElement)(_components.ToolbarButton, {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
accessibleWhenDisabled: true,
|
|
54
|
+
disabled: !canLock,
|
|
55
|
+
icon: isLocked ? _icons.lock : _icons.unlock,
|
|
56
|
+
label: label,
|
|
63
57
|
onClick: toggleModal,
|
|
64
58
|
"aria-expanded": isModalOpen,
|
|
65
59
|
"aria-haspopup": "dialog"
|