@wordpress/block-editor 17.0.0 → 17.1.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 +45 -0
- package/build/autocompleters/block.cjs +1 -1
- package/build/autocompleters/block.cjs.map +1 -1
- package/build/components/alignment-control/index.cjs +1 -1
- package/build/components/alignment-control/index.cjs.map +1 -1
- package/build/components/alignment-control/ui.cjs +1 -1
- package/build/components/alignment-control/ui.cjs.map +1 -1
- package/build/components/autocomplete/index.cjs +1 -1
- package/build/components/autocomplete/index.cjs.map +1 -1
- package/build/components/background-image-control/index.cjs +19 -2
- package/build/components/background-image-control/index.cjs.map +3 -3
- package/build/components/block-alignment-control/index.cjs +1 -1
- package/build/components/block-alignment-control/index.cjs.map +1 -1
- package/build/components/block-alignment-control/ui.cjs +1 -1
- package/build/components/block-alignment-control/ui.cjs.map +1 -1
- package/build/components/block-alignment-matrix-control/index.cjs +1 -1
- package/build/components/block-alignment-matrix-control/index.cjs.map +1 -1
- package/build/components/block-allowed-blocks/allowed-blocks-control.cjs +1 -1
- package/build/components/block-allowed-blocks/allowed-blocks-control.cjs.map +1 -1
- package/build/components/block-allowed-blocks/modal.cjs +3 -2
- package/build/components/block-allowed-blocks/modal.cjs.map +4 -4
- package/build/components/block-bindings/attribute-control.cjs +1 -1
- package/build/components/block-bindings/attribute-control.cjs.map +1 -1
- package/build/components/block-bindings/source-fields-list.cjs +1 -1
- package/build/components/block-bindings/source-fields-list.cjs.map +1 -1
- package/build/components/block-breadcrumb/index.cjs +1 -1
- package/build/components/block-breadcrumb/index.cjs.map +1 -1
- package/build/components/block-canvas/index.cjs +1 -1
- package/build/components/block-canvas/index.cjs.map +1 -1
- package/build/components/block-card/index.cjs +1 -1
- package/build/components/block-card/index.cjs.map +1 -1
- package/build/components/block-compare/block-view.cjs +1 -1
- package/build/components/block-compare/block-view.cjs.map +1 -1
- package/build/components/block-compare/index.cjs +1 -1
- package/build/components/block-compare/index.cjs.map +1 -1
- package/build/components/block-context/index.cjs +1 -1
- package/build/components/block-context/index.cjs.map +1 -1
- package/build/components/block-controls/fill.cjs +1 -1
- package/build/components/block-controls/fill.cjs.map +1 -1
- package/build/components/block-controls/index.cjs +1 -1
- package/build/components/block-controls/index.cjs.map +1 -1
- package/build/components/block-controls/slot.cjs +1 -1
- package/build/components/block-controls/slot.cjs.map +1 -1
- package/build/components/block-draggable/draggable-chip.cjs +1 -1
- package/build/components/block-draggable/draggable-chip.cjs.map +1 -1
- package/build/components/block-draggable/index.cjs +1 -1
- package/build/components/block-draggable/index.cjs.map +1 -1
- package/build/components/block-edit/edit.cjs +1 -1
- package/build/components/block-edit/edit.cjs.map +2 -2
- package/build/components/block-edit/index.cjs +1 -1
- package/build/components/block-edit/index.cjs.map +1 -1
- package/build/components/block-edit/multiple-usage-warning.cjs +1 -1
- package/build/components/block-edit/multiple-usage-warning.cjs.map +1 -1
- package/build/components/block-edit-visually-button/index.cjs +1 -1
- package/build/components/block-edit-visually-button/index.cjs.map +1 -1
- package/build/components/block-full-height-alignment-control/index.cjs +1 -1
- package/build/components/block-full-height-alignment-control/index.cjs.map +1 -1
- package/build/components/block-heading-level-dropdown/heading-level-icon.cjs +1 -1
- package/build/components/block-heading-level-dropdown/heading-level-icon.cjs.map +1 -1
- package/build/components/block-heading-level-dropdown/index.cjs +1 -1
- package/build/components/block-heading-level-dropdown/index.cjs.map +1 -1
- package/build/components/block-icon/index.cjs +1 -1
- package/build/components/block-icon/index.cjs.map +1 -1
- package/build/components/block-inspector/edit-contents.cjs +1 -1
- package/build/components/block-inspector/edit-contents.cjs.map +1 -1
- package/build/components/block-inspector/index.cjs +8 -16
- package/build/components/block-inspector/index.cjs.map +3 -3
- package/build/components/block-keyboard-shortcuts/index.cjs +1 -1
- package/build/components/block-keyboard-shortcuts/index.cjs.map +1 -1
- package/build/components/block-list/block-crash-warning.cjs +1 -1
- package/build/components/block-list/block-crash-warning.cjs.map +1 -1
- package/build/components/block-list/block-html.cjs +1 -1
- package/build/components/block-list/block-html.cjs.map +1 -1
- package/build/components/block-list/block-invalid-warning.cjs +1 -1
- package/build/components/block-list/block-invalid-warning.cjs.map +1 -1
- package/build/components/block-list/block.cjs +1 -1
- package/build/components/block-list/block.cjs.map +1 -1
- package/build/components/block-list/index.cjs +1 -1
- package/build/components/block-list/index.cjs.map +1 -1
- package/build/components/block-list/layout.cjs +1 -1
- package/build/components/block-list/layout.cjs.map +1 -1
- package/build/components/block-list/subdirectory-icon.cjs +1 -1
- package/build/components/block-list/subdirectory-icon.cjs.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.cjs +17 -4
- package/build/components/block-list/use-block-props/use-is-hovered.cjs.map +2 -2
- package/build/components/block-list/zoom-out-separator.cjs +1 -1
- package/build/components/block-list/zoom-out-separator.cjs.map +1 -1
- package/build/components/block-list-appender/index.cjs +1 -1
- package/build/components/block-list-appender/index.cjs.map +1 -1
- package/build/components/block-lock/menu-item.cjs +1 -1
- package/build/components/block-lock/menu-item.cjs.map +1 -1
- package/build/components/block-lock/modal.cjs +1 -1
- package/build/components/block-lock/modal.cjs.map +1 -1
- package/build/components/block-lock/toolbar.cjs +1 -1
- package/build/components/block-lock/toolbar.cjs.map +1 -1
- package/build/components/block-manager/category.cjs +1 -1
- package/build/components/block-manager/category.cjs.map +1 -1
- package/build/components/block-manager/checklist.cjs +1 -1
- package/build/components/block-manager/checklist.cjs.map +1 -1
- package/build/components/block-manager/index.cjs +1 -1
- package/build/components/block-manager/index.cjs.map +1 -1
- package/build/components/block-mover/button.cjs +1 -1
- package/build/components/block-mover/button.cjs.map +1 -1
- package/build/components/block-mover/index.cjs +1 -1
- package/build/components/block-mover/index.cjs.map +1 -1
- package/build/components/block-navigation/dropdown.cjs +1 -1
- package/build/components/block-navigation/dropdown.cjs.map +1 -1
- package/build/components/block-parent-selector/index.cjs +1 -1
- package/build/components/block-parent-selector/index.cjs.map +1 -1
- package/build/components/block-pattern-setup/index.cjs +1 -1
- package/build/components/block-pattern-setup/index.cjs.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.cjs +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.cjs.map +1 -1
- package/build/components/block-patterns-list/index.cjs +1 -1
- package/build/components/block-patterns-list/index.cjs.map +1 -1
- package/build/components/block-patterns-paging/index.cjs +1 -1
- package/build/components/block-patterns-paging/index.cjs.map +1 -1
- package/build/components/block-popover/cover.cjs +1 -1
- package/build/components/block-popover/cover.cjs.map +1 -1
- package/build/components/block-popover/drop-zone.cjs +1 -1
- package/build/components/block-popover/drop-zone.cjs.map +1 -1
- package/build/components/block-popover/inbetween.cjs +1 -1
- package/build/components/block-popover/inbetween.cjs.map +1 -1
- package/build/components/block-popover/index.cjs +1 -1
- package/build/components/block-popover/index.cjs.map +1 -1
- package/build/components/block-preview/auto.cjs +1 -1
- package/build/components/block-preview/auto.cjs.map +1 -1
- package/build/components/block-preview/index.cjs +2 -3
- package/build/components/block-preview/index.cjs.map +3 -3
- package/build/components/block-quick-navigation/index.cjs +1 -1
- package/build/components/block-quick-navigation/index.cjs.map +1 -1
- package/build/components/block-removal-warning-modal/index.cjs +1 -1
- package/build/components/block-removal-warning-modal/index.cjs.map +1 -1
- package/build/components/block-rename/modal.cjs +1 -1
- package/build/components/block-rename/modal.cjs.map +1 -1
- package/build/components/block-rename/rename-control.cjs +1 -1
- package/build/components/block-rename/rename-control.cjs.map +1 -1
- package/build/components/block-selection-clearer/index.cjs +1 -1
- package/build/components/block-selection-clearer/index.cjs.map +1 -1
- package/build/components/block-settings-menu/block-html-convert-button.cjs +1 -1
- package/build/components/block-settings-menu/block-html-convert-button.cjs.map +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.cjs +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.cjs.map +1 -1
- package/build/components/block-settings-menu/block-parent-selector-menu-item.cjs +1 -1
- package/build/components/block-settings-menu/block-parent-selector-menu-item.cjs.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.cjs +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +1 -1
- package/build/components/block-settings-menu/index.cjs +1 -1
- package/build/components/block-settings-menu/index.cjs.map +1 -1
- package/build/components/block-settings-menu-controls/index.cjs +1 -1
- package/build/components/block-settings-menu-controls/index.cjs.map +1 -1
- package/build/components/block-styles/index.cjs +1 -1
- package/build/components/block-styles/index.cjs.map +1 -1
- package/build/components/block-styles/menu-items.cjs +1 -1
- package/build/components/block-styles/menu-items.cjs.map +1 -1
- package/build/components/block-switcher/block-styles-menu.cjs +1 -1
- package/build/components/block-switcher/block-styles-menu.cjs.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.cjs +1 -1
- package/build/components/block-switcher/block-transformations-menu.cjs.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.cjs +1 -1
- package/build/components/block-switcher/block-variation-transformations.cjs.map +1 -1
- package/build/components/block-switcher/index.cjs +3 -2
- package/build/components/block-switcher/index.cjs.map +4 -4
- package/build/components/block-switcher/pattern-transformations-menu.cjs +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.cjs.map +1 -1
- package/build/components/block-switcher/preview-block-popover.cjs +1 -1
- package/build/components/block-switcher/preview-block-popover.cjs.map +1 -1
- package/build/components/block-toolbar/block-styles-dropdown.cjs +1 -1
- package/build/components/block-toolbar/block-styles-dropdown.cjs.map +1 -1
- package/build/components/block-toolbar/block-toolbar-icon.cjs +1 -1
- package/build/components/block-toolbar/block-toolbar-icon.cjs.map +1 -1
- package/build/components/block-toolbar/change-design.cjs +1 -1
- package/build/components/block-toolbar/change-design.cjs.map +1 -1
- package/build/components/block-toolbar/edit-section-button.cjs +1 -1
- package/build/components/block-toolbar/edit-section-button.cjs.map +1 -1
- package/build/components/block-toolbar/index.cjs +1 -1
- package/build/components/block-toolbar/index.cjs.map +1 -1
- package/build/components/block-toolbar/pattern-overrides-dropdown.cjs +3 -2
- package/build/components/block-toolbar/pattern-overrides-dropdown.cjs.map +4 -4
- package/build/components/block-toolbar/switch-section-style.cjs +1 -1
- package/build/components/block-toolbar/switch-section-style.cjs.map +1 -1
- package/build/components/block-tools/block-toolbar-popover.cjs +1 -1
- package/build/components/block-tools/block-toolbar-popover.cjs.map +1 -1
- package/build/components/block-tools/empty-block-inserter.cjs +1 -1
- package/build/components/block-tools/empty-block-inserter.cjs.map +1 -1
- package/build/components/block-tools/index.cjs +1 -1
- package/build/components/block-tools/index.cjs.map +1 -1
- package/build/components/block-tools/insertion-point.cjs +1 -1
- package/build/components/block-tools/insertion-point.cjs.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserter-button.cjs +1 -1
- package/build/components/block-tools/zoom-out-mode-inserter-button.cjs.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.cjs +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.cjs.map +1 -1
- package/build/components/block-types-list/index.cjs +1 -1
- package/build/components/block-types-list/index.cjs.map +1 -1
- package/build/components/block-variation-picker/index.cjs +1 -1
- package/build/components/block-variation-picker/index.cjs.map +1 -1
- package/build/components/block-variation-transforms/index.cjs +1 -1
- package/build/components/block-variation-transforms/index.cjs.map +1 -1
- package/build/components/block-vertical-alignment-control/index.cjs +1 -1
- package/build/components/block-vertical-alignment-control/index.cjs.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.cjs +1 -1
- package/build/components/block-vertical-alignment-control/ui.cjs.map +1 -1
- package/build/components/block-visibility/constants.cjs.map +1 -1
- package/build/components/block-visibility/modal.cjs +1 -1
- package/build/components/block-visibility/modal.cjs.map +1 -1
- package/build/components/block-visibility/viewport-menu-item.cjs +1 -1
- package/build/components/block-visibility/viewport-menu-item.cjs.map +1 -1
- package/build/components/block-visibility/viewport-toolbar.cjs +1 -1
- package/build/components/block-visibility/viewport-toolbar.cjs.map +1 -1
- package/build/components/block-visibility/viewport-visibility-info.cjs +1 -1
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +1 -1
- package/build/components/border-radius-control/index.cjs +1 -1
- package/build/components/border-radius-control/index.cjs.map +1 -1
- package/build/components/border-radius-control/linked-button.cjs +1 -1
- package/build/components/border-radius-control/linked-button.cjs.map +1 -1
- package/build/components/button-block-appender/index.cjs +1 -1
- package/build/components/button-block-appender/index.cjs.map +1 -1
- package/build/components/child-layout-control/index.cjs +1 -1
- package/build/components/child-layout-control/index.cjs.map +1 -1
- package/build/components/color-palette/control.cjs +1 -1
- package/build/components/color-palette/control.cjs.map +1 -1
- package/build/components/color-palette/with-color-context.cjs +1 -1
- package/build/components/color-palette/with-color-context.cjs.map +1 -1
- package/build/components/color-style-selector/index.cjs +1 -1
- package/build/components/color-style-selector/index.cjs.map +1 -1
- package/build/components/colors/with-colors.cjs +1 -1
- package/build/components/colors/with-colors.cjs.map +1 -1
- package/build/components/colors-gradients/control.cjs +1 -1
- package/build/components/colors-gradients/control.cjs.map +1 -1
- package/build/components/colors-gradients/dropdown.cjs +1 -1
- package/build/components/colors-gradients/dropdown.cjs.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.cjs +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.cjs.map +1 -1
- package/build/components/contrast-checker/index.cjs +1 -1
- package/build/components/contrast-checker/index.cjs.map +1 -1
- package/build/components/convert-to-group-buttons/index.cjs +1 -1
- package/build/components/convert-to-group-buttons/index.cjs.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.cjs +1 -1
- package/build/components/convert-to-group-buttons/toolbar.cjs.map +1 -1
- package/build/components/copy-handler/index.cjs +1 -1
- package/build/components/copy-handler/index.cjs.map +1 -1
- package/build/components/date-format-picker/index.cjs +1 -1
- package/build/components/date-format-picker/index.cjs.map +1 -1
- package/build/components/default-block-appender/index.cjs +1 -1
- package/build/components/default-block-appender/index.cjs.map +1 -1
- package/build/components/dimension-control/index.cjs +1 -1
- package/build/components/dimension-control/index.cjs.map +1 -1
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs +1 -1
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +1 -1
- package/build/components/dimensions-tool/index.cjs +1 -1
- package/build/components/dimensions-tool/index.cjs.map +1 -1
- package/build/components/dimensions-tool/scale-tool.cjs +1 -1
- package/build/components/dimensions-tool/scale-tool.cjs.map +1 -1
- package/build/components/dimensions-tool/width-height-tool.cjs +1 -1
- package/build/components/dimensions-tool/width-height-tool.cjs.map +1 -1
- package/build/components/duotone-control/index.cjs +1 -1
- package/build/components/duotone-control/index.cjs.map +1 -1
- package/build/components/editable-text/index.cjs +1 -1
- package/build/components/editable-text/index.cjs.map +1 -1
- package/build/components/editor-styles/index.cjs +1 -1
- package/build/components/editor-styles/index.cjs.map +1 -1
- package/build/components/fit-text-size-warning/index.cjs +1 -1
- package/build/components/fit-text-size-warning/index.cjs.map +1 -1
- package/build/components/font-appearance-control/index.cjs +1 -1
- package/build/components/font-appearance-control/index.cjs.map +1 -1
- package/build/components/font-family/index.cjs +1 -1
- package/build/components/font-family/index.cjs.map +1 -1
- package/build/components/font-sizes/font-size-picker.cjs +1 -1
- package/build/components/font-sizes/font-size-picker.cjs.map +1 -1
- package/build/components/font-sizes/with-font-sizes.cjs +1 -1
- package/build/components/font-sizes/with-font-sizes.cjs.map +1 -1
- package/build/components/global-styles/advanced-panel.cjs +1 -1
- package/build/components/global-styles/advanced-panel.cjs.map +1 -1
- package/build/components/global-styles/background-panel.cjs +1 -1
- package/build/components/global-styles/background-panel.cjs.map +2 -2
- package/build/components/global-styles/border-panel.cjs +20 -43
- package/build/components/global-styles/border-panel.cjs.map +3 -3
- package/build/components/global-styles/color-gradient-dropdown-item.cjs +1 -1
- package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +1 -1
- package/build/components/global-styles/color-panel.cjs +1 -1
- package/build/components/global-styles/color-panel.cjs.map +1 -1
- package/build/components/global-styles/dimensions-panel.cjs +1 -1
- package/build/components/global-styles/dimensions-panel.cjs.map +1 -1
- package/build/components/global-styles/filters-panel.cjs +1 -1
- package/build/components/global-styles/filters-panel.cjs.map +1 -1
- package/build/components/global-styles/image-settings-panel.cjs +1 -1
- package/build/components/global-styles/image-settings-panel.cjs.map +2 -2
- package/build/components/global-styles/inheritance/index.cjs +1 -1
- package/build/components/global-styles/inheritance/index.cjs.map +1 -1
- package/build/components/global-styles/shadow-panel-components.cjs +1 -1
- package/build/components/global-styles/shadow-panel-components.cjs.map +1 -1
- package/build/components/global-styles/state-control-badges.cjs +1 -1
- package/build/components/global-styles/state-control-badges.cjs.map +1 -1
- package/build/components/global-styles/state-control.cjs +1 -1
- package/build/components/global-styles/state-control.cjs.map +1 -1
- package/build/components/global-styles/typography-panel.cjs +1 -1
- package/build/components/global-styles/typography-panel.cjs.map +1 -1
- package/build/components/grid/grid-item-movers.cjs +1 -1
- package/build/components/grid/grid-item-movers.cjs.map +1 -1
- package/build/components/grid/grid-item-resizer.cjs +1 -1
- package/build/components/grid/grid-item-resizer.cjs.map +1 -1
- package/build/components/grid/grid-visualizer.cjs +1 -1
- package/build/components/grid/grid-visualizer.cjs.map +1 -1
- package/build/components/height-control/index.cjs +1 -1
- package/build/components/height-control/index.cjs.map +1 -1
- package/build/components/html-element-control/index.cjs +1 -1
- package/build/components/html-element-control/index.cjs.map +1 -1
- package/build/components/iframe/index.cjs +1 -1
- package/build/components/iframe/index.cjs.map +2 -2
- package/build/components/image-editor/aspect-ratio-dropdown.cjs +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.cjs.map +1 -1
- package/build/components/image-editor/context.cjs +1 -1
- package/build/components/image-editor/context.cjs.map +1 -1
- package/build/components/image-editor/cropper.cjs +1 -1
- package/build/components/image-editor/cropper.cjs.map +1 -1
- package/build/components/image-editor/form-controls.cjs +1 -1
- package/build/components/image-editor/form-controls.cjs.map +1 -1
- package/build/components/image-editor/index.cjs +1 -1
- package/build/components/image-editor/index.cjs.map +1 -1
- package/build/components/image-editor/rotation-button.cjs +1 -1
- package/build/components/image-editor/rotation-button.cjs.map +1 -1
- package/build/components/image-editor/zoom-dropdown.cjs +1 -1
- package/build/components/image-editor/zoom-dropdown.cjs.map +1 -1
- package/build/components/image-size-control/index.cjs +1 -1
- package/build/components/image-size-control/index.cjs.map +1 -1
- package/build/components/inner-blocks/button-block-appender.cjs +1 -1
- package/build/components/inner-blocks/button-block-appender.cjs.map +1 -1
- package/build/components/inner-blocks/default-block-appender.cjs +1 -1
- package/build/components/inner-blocks/default-block-appender.cjs.map +1 -1
- package/build/components/inner-blocks/index.cjs +1 -1
- package/build/components/inner-blocks/index.cjs.map +1 -1
- package/build/components/inner-content/index.cjs +1 -1
- package/build/components/inner-content/index.cjs.map +1 -1
- package/build/components/inserter/block-patterns-explorer/index.cjs +1 -1
- package/build/components/inserter/block-patterns-explorer/index.cjs.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.cjs +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.cjs.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.cjs +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.cjs.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.cjs +1 -1
- package/build/components/inserter/block-patterns-tab/index.cjs.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.cjs +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.cjs.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.cjs +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.cjs.map +1 -1
- package/build/components/inserter/block-types-tab.cjs +1 -1
- package/build/components/inserter/block-types-tab.cjs.map +1 -1
- package/build/components/inserter/category-tabs/index.cjs +1 -1
- package/build/components/inserter/category-tabs/index.cjs.map +1 -1
- package/build/components/inserter/hooks/use-patterns-paging.cjs.map +1 -1
- package/build/components/inserter/index.cjs +1 -1
- package/build/components/inserter/index.cjs.map +1 -1
- package/build/components/inserter/library.cjs +1 -1
- package/build/components/inserter/library.cjs.map +1 -1
- package/build/components/inserter/media-tab/media-list.cjs +1 -1
- package/build/components/inserter/media-tab/media-list.cjs.map +1 -1
- package/build/components/inserter/media-tab/media-panel.cjs +1 -1
- package/build/components/inserter/media-tab/media-panel.cjs.map +1 -1
- package/build/components/inserter/media-tab/media-preview.cjs +1 -1
- package/build/components/inserter/media-tab/media-preview.cjs.map +1 -1
- package/build/components/inserter/media-tab/media-tab.cjs +1 -1
- package/build/components/inserter/media-tab/media-tab.cjs.map +1 -1
- package/build/components/inserter/media-tab/utils.cjs +1 -1
- package/build/components/inserter/media-tab/utils.cjs.map +1 -1
- package/build/components/inserter/menu.cjs +2 -2
- package/build/components/inserter/menu.cjs.map +3 -3
- package/build/components/inserter/mobile-tab-navigation.cjs +1 -1
- package/build/components/inserter/mobile-tab-navigation.cjs.map +1 -1
- package/build/components/inserter/no-results.cjs +1 -1
- package/build/components/inserter/no-results.cjs.map +1 -1
- package/build/components/inserter/panel.cjs +1 -1
- package/build/components/inserter/panel.cjs.map +1 -1
- package/build/components/inserter/preview-panel.cjs +1 -1
- package/build/components/inserter/preview-panel.cjs.map +1 -1
- package/build/components/inserter/quick-inserter.cjs +1 -1
- package/build/components/inserter/quick-inserter.cjs.map +1 -1
- package/build/components/inserter/search-results.cjs +1 -1
- package/build/components/inserter/search-results.cjs.map +1 -1
- package/build/components/inserter/tips.cjs +1 -1
- package/build/components/inserter/tips.cjs.map +1 -1
- package/build/components/inserter-draggable-blocks/index.cjs +1 -1
- package/build/components/inserter-draggable-blocks/index.cjs.map +2 -2
- package/build/components/inserter-list-item/index.cjs +1 -1
- package/build/components/inserter-list-item/index.cjs.map +1 -1
- package/build/components/inserter-listbox/group.cjs +1 -1
- package/build/components/inserter-listbox/group.cjs.map +1 -1
- package/build/components/inserter-listbox/index.cjs +1 -1
- package/build/components/inserter-listbox/index.cjs.map +1 -1
- package/build/components/inserter-listbox/item.cjs +1 -1
- package/build/components/inserter-listbox/item.cjs.map +1 -1
- package/build/components/inserter-listbox/row.cjs +1 -1
- package/build/components/inserter-listbox/row.cjs.map +1 -1
- package/build/components/inspector-controls/block-support-slot-container.cjs +1 -1
- package/build/components/inspector-controls/block-support-slot-container.cjs.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.cjs +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.cjs.map +1 -1
- package/build/components/inspector-controls/fill.cjs +1 -1
- package/build/components/inspector-controls/fill.cjs.map +1 -1
- package/build/components/inspector-controls/groups.cjs +3 -1
- package/build/components/inspector-controls/groups.cjs.map +2 -2
- package/build/components/inspector-controls/index.cjs +1 -1
- package/build/components/inspector-controls/index.cjs.map +1 -1
- package/build/components/inspector-controls/last-item.cjs +1 -1
- package/build/components/inspector-controls/last-item.cjs.map +1 -1
- package/build/components/inspector-controls/list-view-content-popover.cjs +1 -1
- package/build/components/inspector-controls/list-view-content-popover.cjs.map +1 -1
- package/build/components/inspector-controls/slot.cjs +1 -1
- package/build/components/inspector-controls/slot.cjs.map +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.cjs +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.cjs.map +1 -1
- package/build/components/inspector-controls-tabs/content-tab.cjs +3 -4
- package/build/components/inspector-controls-tabs/content-tab.cjs.map +3 -3
- package/build/components/inspector-controls-tabs/index.cjs +1 -1
- package/build/components/inspector-controls-tabs/index.cjs.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.cjs +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.cjs.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab.cjs +1 -1
- package/build/components/inspector-controls-tabs/settings-tab.cjs.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.cjs +2 -4
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +3 -3
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs +1 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs.map +2 -2
- package/build/components/inspector-popover-header/index.cjs +6 -5
- package/build/components/inspector-popover-header/index.cjs.map +4 -4
- package/build/components/justify-content-control/index.cjs +1 -1
- package/build/components/justify-content-control/index.cjs.map +1 -1
- package/build/components/justify-content-control/ui.cjs +1 -1
- package/build/components/justify-content-control/ui.cjs.map +1 -1
- package/build/components/letter-spacing-control/index.cjs +1 -1
- package/build/components/letter-spacing-control/index.cjs.map +1 -1
- package/build/components/line-height-control/index.cjs +1 -1
- package/build/components/line-height-control/index.cjs.map +1 -1
- package/build/components/link-control/index.cjs +1 -1
- package/build/components/link-control/index.cjs.map +3 -3
- package/build/components/link-control/link-preview.cjs +1 -1
- package/build/components/link-control/link-preview.cjs.map +1 -1
- package/build/components/link-control/search-create-button.cjs +1 -1
- package/build/components/link-control/search-create-button.cjs.map +1 -1
- package/build/components/link-control/search-input.cjs +1 -1
- package/build/components/link-control/search-input.cjs.map +2 -2
- package/build/components/link-control/search-item.cjs +1 -1
- package/build/components/link-control/search-item.cjs.map +1 -1
- package/build/components/link-control/search-results.cjs +1 -1
- package/build/components/link-control/search-results.cjs.map +1 -1
- package/build/components/link-control/settings-drawer.cjs +1 -1
- package/build/components/link-control/settings-drawer.cjs.map +1 -1
- package/build/components/link-control/settings.cjs +1 -1
- package/build/components/link-control/settings.cjs.map +1 -1
- package/build/components/link-picker/link-picker.cjs +1 -1
- package/build/components/link-picker/link-picker.cjs.map +1 -1
- package/build/components/link-picker/link-preview.cjs +1 -1
- package/build/components/link-picker/link-preview.cjs.map +1 -1
- package/build/components/list-view/appender.cjs +1 -1
- package/build/components/list-view/appender.cjs.map +1 -1
- package/build/components/list-view/aria-referenced-text.cjs +1 -1
- package/build/components/list-view/aria-referenced-text.cjs.map +1 -1
- package/build/components/list-view/block-contents.cjs +1 -1
- package/build/components/list-view/block-contents.cjs.map +1 -1
- package/build/components/list-view/block-select-button.cjs +10 -2
- package/build/components/list-view/block-select-button.cjs.map +3 -3
- package/build/components/list-view/block.cjs +3 -2
- package/build/components/list-view/block.cjs.map +3 -3
- package/build/components/list-view/branch.cjs +1 -1
- package/build/components/list-view/branch.cjs.map +1 -1
- package/build/components/list-view/drop-indicator.cjs +1 -1
- package/build/components/list-view/drop-indicator.cjs.map +1 -1
- package/build/components/list-view/expander.cjs +1 -1
- package/build/components/list-view/expander.cjs.map +1 -1
- package/build/components/list-view/index.cjs +1 -1
- package/build/components/list-view/index.cjs.map +1 -1
- package/build/components/list-view/leaf.cjs +1 -1
- package/build/components/list-view/leaf.cjs.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.cjs.map +1 -1
- package/build/components/media-placeholder/index.cjs +1 -1
- package/build/components/media-placeholder/index.cjs.map +1 -1
- package/build/components/media-replace-flow/index.cjs +5 -2
- package/build/components/media-replace-flow/index.cjs.map +3 -3
- package/build/components/multi-selection-inspector/index.cjs +1 -1
- package/build/components/multi-selection-inspector/index.cjs.map +1 -1
- package/build/components/navigable-toolbar/index.cjs +4 -1
- package/build/components/navigable-toolbar/index.cjs.map +3 -3
- package/build/components/observe-typing/index.cjs +1 -1
- package/build/components/observe-typing/index.cjs.map +1 -1
- package/build/components/panel-color-settings/index.cjs +1 -1
- package/build/components/panel-color-settings/index.cjs.map +1 -1
- package/build/components/plain-text/index.cjs +1 -1
- package/build/components/plain-text/index.cjs.map +1 -1
- package/build/components/preset-input-control/custom-value-controls.cjs +1 -1
- package/build/components/preset-input-control/custom-value-controls.cjs.map +1 -1
- package/build/components/preset-input-control/index.cjs +1 -1
- package/build/components/preset-input-control/index.cjs.map +1 -1
- package/build/components/provider/block-refs-provider.cjs +1 -1
- package/build/components/provider/block-refs-provider.cjs.map +1 -1
- package/build/components/provider/index.cjs +21 -4
- package/build/components/provider/index.cjs.map +3 -3
- package/build/components/provider/with-registry-provider.cjs +1 -1
- package/build/components/provider/with-registry-provider.cjs.map +1 -1
- package/build/components/publish-date-time-picker/index.cjs +1 -1
- package/build/components/publish-date-time-picker/index.cjs.map +1 -1
- package/build/components/recursion-provider/index.cjs +1 -1
- package/build/components/recursion-provider/index.cjs.map +1 -1
- package/build/components/resizable-box-popover/index.cjs +1 -1
- package/build/components/resizable-box-popover/index.cjs.map +1 -1
- package/build/components/resolution-tool/index.cjs +1 -1
- package/build/components/resolution-tool/index.cjs.map +1 -1
- package/build/components/responsive-block-control/index.cjs +1 -1
- package/build/components/responsive-block-control/index.cjs.map +1 -1
- package/build/components/responsive-block-control/label.cjs +1 -1
- package/build/components/responsive-block-control/label.cjs.map +1 -1
- package/build/components/rich-text/content.cjs +1 -1
- package/build/components/rich-text/content.cjs.map +1 -1
- package/build/components/rich-text/event-listeners/enter.cjs +23 -11
- package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/index.cjs +0 -2
- package/build/components/rich-text/event-listeners/index.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-rules.cjs +4 -2
- package/build/components/rich-text/event-listeners/input-rules.cjs.map +2 -2
- package/build/components/rich-text/format-edit.cjs +1 -1
- package/build/components/rich-text/format-edit.cjs.map +1 -1
- package/build/components/rich-text/format-toolbar/index.cjs +1 -1
- package/build/components/rich-text/format-toolbar/index.cjs.map +1 -1
- package/build/components/rich-text/format-toolbar-container.cjs +1 -1
- package/build/components/rich-text/format-toolbar-container.cjs.map +1 -1
- package/build/components/rich-text/get-rich-text-values.cjs +1 -1
- package/build/components/rich-text/get-rich-text-values.cjs.map +1 -1
- package/build/components/rich-text/index.cjs +1 -1
- package/build/components/rich-text/index.cjs.map +1 -1
- package/build/components/rich-text/multiline.cjs +1 -1
- package/build/components/rich-text/multiline.cjs.map +1 -1
- package/build/components/rich-text/toolbar-button.cjs +1 -1
- package/build/components/rich-text/toolbar-button.cjs.map +1 -1
- package/build/components/rich-text/utils.cjs +1 -1
- package/build/components/rich-text/utils.cjs.map +1 -1
- package/build/components/rich-text/with-deprecations.cjs +1 -1
- package/build/components/rich-text/with-deprecations.cjs.map +1 -1
- package/build/components/skip-to-selected-block/index.cjs +1 -1
- package/build/components/skip-to-selected-block/index.cjs.map +1 -1
- package/build/components/spacing-sizes-control/index.cjs +1 -1
- package/build/components/spacing-sizes-control/index.cjs.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/axial.cjs +1 -1
- package/build/components/spacing-sizes-control/input-controls/axial.cjs.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/separated.cjs +1 -1
- package/build/components/spacing-sizes-control/input-controls/separated.cjs.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/single.cjs +1 -1
- package/build/components/spacing-sizes-control/input-controls/single.cjs.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.cjs +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.cjs.map +1 -1
- package/build/components/spacing-sizes-control/linked-button.cjs +1 -1
- package/build/components/spacing-sizes-control/linked-button.cjs.map +1 -1
- package/build/components/tabbed-sidebar/index.cjs +1 -1
- package/build/components/tabbed-sidebar/index.cjs.map +1 -1
- package/build/components/text-alignment-control/index.cjs +1 -1
- package/build/components/text-alignment-control/index.cjs.map +1 -1
- package/build/components/text-decoration-control/index.cjs +1 -1
- package/build/components/text-decoration-control/index.cjs.map +1 -1
- package/build/components/text-indent-control/index.cjs +1 -1
- package/build/components/text-indent-control/index.cjs.map +1 -1
- package/build/components/text-transform-control/index.cjs +1 -1
- package/build/components/text-transform-control/index.cjs.map +1 -1
- package/build/components/typewriter/index.cjs +1 -1
- package/build/components/typewriter/index.cjs.map +1 -1
- package/build/components/unit-control/index.cjs +1 -1
- package/build/components/unit-control/index.cjs.map +1 -1
- package/build/components/url-input/button.cjs +1 -1
- package/build/components/url-input/button.cjs.map +1 -1
- package/build/components/url-input/index.cjs +1 -1
- package/build/components/url-input/index.cjs.map +1 -1
- package/build/components/url-popover/image-url-input-ui.cjs +1 -1
- package/build/components/url-popover/image-url-input-ui.cjs.map +1 -1
- package/build/components/url-popover/index.cjs +1 -1
- package/build/components/url-popover/index.cjs.map +1 -1
- package/build/components/url-popover/link-editor.cjs +1 -1
- package/build/components/url-popover/link-editor.cjs.map +1 -1
- package/build/components/url-popover/link-viewer-url.cjs +1 -1
- package/build/components/url-popover/link-viewer-url.cjs.map +1 -1
- package/build/components/url-popover/link-viewer.cjs +1 -1
- package/build/components/url-popover/link-viewer.cjs.map +1 -1
- package/build/components/use-block-drop-zone/index.cjs.map +1 -1
- package/build/components/warning/index.cjs +1 -1
- package/build/components/warning/index.cjs.map +1 -1
- package/build/components/writing-flow/index.cjs +6 -1
- package/build/components/writing-flow/index.cjs.map +4 -4
- package/build/components/writing-flow/use-arrow-nav.cjs.map +1 -1
- package/build/components/writing-flow/use-input.cjs +12 -2
- package/build/components/writing-flow/use-input.cjs.map +2 -2
- package/build/components/writing-flow/use-tab-nav.cjs +85 -42
- package/build/components/writing-flow/use-tab-nav.cjs.map +4 -4
- package/build/components/{rich-text/event-listeners/undo-automatic-change.cjs → writing-flow/use-undo-automatic-change.cjs} +18 -15
- package/build/components/writing-flow/use-undo-automatic-change.cjs.map +7 -0
- package/build/components/writing-mode-control/index.cjs +1 -1
- package/build/components/writing-mode-control/index.cjs.map +1 -1
- package/build/hooks/align.cjs +1 -1
- package/build/hooks/align.cjs.map +1 -1
- package/build/hooks/allowed-blocks.cjs +1 -1
- package/build/hooks/allowed-blocks.cjs.map +1 -1
- package/build/hooks/anchor.cjs +1 -1
- package/build/hooks/anchor.cjs.map +1 -1
- package/build/hooks/auto-inspector-controls.cjs +1 -1
- package/build/hooks/auto-inspector-controls.cjs.map +1 -1
- package/build/hooks/background.cjs +1 -1
- package/build/hooks/background.cjs.map +1 -1
- package/build/hooks/block-bindings.cjs +1 -1
- package/build/hooks/block-bindings.cjs.map +1 -1
- package/build/hooks/block-hooks.cjs +1 -1
- package/build/hooks/block-hooks.cjs.map +1 -1
- package/build/hooks/block-style-variation.cjs +1 -1
- package/build/hooks/block-style-variation.cjs.map +1 -1
- package/build/hooks/border.cjs +3 -47
- package/build/hooks/border.cjs.map +3 -3
- package/build/hooks/custom-class-name.cjs +1 -1
- package/build/hooks/custom-class-name.cjs.map +1 -1
- package/build/hooks/custom-css.cjs +1 -1
- package/build/hooks/custom-css.cjs.map +1 -1
- package/build/hooks/dimensions.cjs +1 -1
- package/build/hooks/dimensions.cjs.map +1 -1
- package/build/hooks/duotone.cjs +1 -1
- package/build/hooks/duotone.cjs.map +1 -1
- package/build/hooks/elements.cjs +1 -1
- package/build/hooks/elements.cjs.map +1 -1
- package/build/hooks/fit-text.cjs +1 -1
- package/build/hooks/fit-text.cjs.map +1 -1
- package/build/hooks/font-size.cjs +1 -1
- package/build/hooks/font-size.cjs.map +1 -1
- package/build/hooks/generate-fields-from-attributes.cjs.map +1 -1
- package/build/hooks/grid-visualizer.cjs +1 -1
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/index.cjs +0 -2
- package/build/hooks/index.cjs.map +3 -3
- package/build/hooks/layout-child.cjs +1 -1
- package/build/hooks/layout-child.cjs.map +1 -1
- package/build/hooks/layout.cjs +1 -1
- package/build/hooks/layout.cjs.map +1 -1
- package/build/hooks/line-height.cjs +1 -1
- package/build/hooks/line-height.cjs.map +1 -1
- package/build/hooks/list-view.cjs +1 -1
- package/build/hooks/list-view.cjs.map +1 -1
- package/build/hooks/position.cjs +2 -2
- package/build/hooks/position.cjs.map +3 -3
- package/build/hooks/spacing-visualizer.cjs +1 -1
- package/build/hooks/spacing-visualizer.cjs.map +1 -1
- package/build/hooks/states.cjs +1 -1
- package/build/hooks/states.cjs.map +1 -1
- package/build/hooks/style.cjs +3 -3
- package/build/hooks/style.cjs.map +3 -3
- package/build/hooks/text-align.cjs +1 -1
- package/build/hooks/text-align.cjs.map +1 -1
- package/build/hooks/typography.cjs +1 -1
- package/build/hooks/typography.cjs.map +1 -1
- package/build/hooks/utils.cjs +1 -1
- package/build/hooks/utils.cjs.map +1 -1
- package/build/layouts/constrained.cjs +1 -1
- package/build/layouts/constrained.cjs.map +1 -1
- package/build/layouts/flex.cjs +4 -1
- package/build/layouts/flex.cjs.map +3 -3
- package/build/layouts/grid.cjs +1 -1
- package/build/layouts/grid.cjs.map +1 -1
- package/build/store/actions.cjs +12 -9
- package/build/store/actions.cjs.map +3 -3
- package/build-module/autocompleters/block.mjs +1 -1
- package/build-module/autocompleters/block.mjs.map +1 -1
- package/build-module/components/alignment-control/index.mjs +1 -1
- package/build-module/components/alignment-control/index.mjs.map +1 -1
- package/build-module/components/alignment-control/ui.mjs +1 -1
- package/build-module/components/alignment-control/ui.mjs.map +1 -1
- package/build-module/components/autocomplete/index.mjs +1 -1
- package/build-module/components/autocomplete/index.mjs.map +1 -1
- package/build-module/components/background-image-control/index.mjs +19 -2
- package/build-module/components/background-image-control/index.mjs.map +3 -3
- package/build-module/components/block-alignment-control/index.mjs +1 -1
- package/build-module/components/block-alignment-control/index.mjs.map +1 -1
- package/build-module/components/block-alignment-control/ui.mjs +1 -1
- package/build-module/components/block-alignment-control/ui.mjs.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.mjs +1 -1
- package/build-module/components/block-alignment-matrix-control/index.mjs.map +1 -1
- package/build-module/components/block-allowed-blocks/allowed-blocks-control.mjs +1 -1
- package/build-module/components/block-allowed-blocks/allowed-blocks-control.mjs.map +1 -1
- package/build-module/components/block-allowed-blocks/modal.mjs +3 -3
- package/build-module/components/block-allowed-blocks/modal.mjs.map +3 -3
- package/build-module/components/block-bindings/attribute-control.mjs +1 -1
- package/build-module/components/block-bindings/attribute-control.mjs.map +1 -1
- package/build-module/components/block-bindings/source-fields-list.mjs +1 -1
- package/build-module/components/block-bindings/source-fields-list.mjs.map +1 -1
- package/build-module/components/block-breadcrumb/index.mjs +1 -1
- package/build-module/components/block-breadcrumb/index.mjs.map +1 -1
- package/build-module/components/block-canvas/index.mjs +1 -1
- package/build-module/components/block-canvas/index.mjs.map +1 -1
- package/build-module/components/block-card/index.mjs +1 -1
- package/build-module/components/block-card/index.mjs.map +1 -1
- package/build-module/components/block-compare/block-view.mjs +1 -1
- package/build-module/components/block-compare/block-view.mjs.map +1 -1
- package/build-module/components/block-compare/index.mjs +1 -1
- package/build-module/components/block-compare/index.mjs.map +1 -1
- package/build-module/components/block-context/index.mjs +1 -1
- package/build-module/components/block-context/index.mjs.map +1 -1
- package/build-module/components/block-controls/fill.mjs +1 -1
- package/build-module/components/block-controls/fill.mjs.map +1 -1
- package/build-module/components/block-controls/index.mjs +1 -1
- package/build-module/components/block-controls/index.mjs.map +1 -1
- package/build-module/components/block-controls/slot.mjs +1 -1
- package/build-module/components/block-controls/slot.mjs.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.mjs +1 -1
- package/build-module/components/block-draggable/draggable-chip.mjs.map +1 -1
- package/build-module/components/block-draggable/index.mjs +1 -1
- package/build-module/components/block-draggable/index.mjs.map +1 -1
- package/build-module/components/block-edit/edit.mjs +1 -1
- package/build-module/components/block-edit/edit.mjs.map +2 -2
- package/build-module/components/block-edit/index.mjs +1 -1
- package/build-module/components/block-edit/index.mjs.map +1 -1
- package/build-module/components/block-edit/multiple-usage-warning.mjs +1 -1
- package/build-module/components/block-edit/multiple-usage-warning.mjs.map +1 -1
- package/build-module/components/block-edit-visually-button/index.mjs +1 -1
- package/build-module/components/block-edit-visually-button/index.mjs.map +1 -1
- package/build-module/components/block-full-height-alignment-control/index.mjs +1 -1
- package/build-module/components/block-full-height-alignment-control/index.mjs.map +1 -1
- package/build-module/components/block-heading-level-dropdown/heading-level-icon.mjs +1 -1
- package/build-module/components/block-heading-level-dropdown/heading-level-icon.mjs.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.mjs +1 -1
- package/build-module/components/block-heading-level-dropdown/index.mjs.map +1 -1
- package/build-module/components/block-icon/index.mjs +1 -1
- package/build-module/components/block-icon/index.mjs.map +1 -1
- package/build-module/components/block-inspector/edit-contents.mjs +1 -1
- package/build-module/components/block-inspector/edit-contents.mjs.map +1 -1
- package/build-module/components/block-inspector/index.mjs +8 -16
- package/build-module/components/block-inspector/index.mjs.map +3 -3
- package/build-module/components/block-keyboard-shortcuts/index.mjs +1 -1
- package/build-module/components/block-keyboard-shortcuts/index.mjs.map +1 -1
- package/build-module/components/block-list/block-crash-warning.mjs +1 -1
- package/build-module/components/block-list/block-crash-warning.mjs.map +1 -1
- package/build-module/components/block-list/block-html.mjs +1 -1
- package/build-module/components/block-list/block-html.mjs.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.mjs +1 -1
- package/build-module/components/block-list/block-invalid-warning.mjs.map +1 -1
- package/build-module/components/block-list/block.mjs +1 -1
- package/build-module/components/block-list/block.mjs.map +1 -1
- package/build-module/components/block-list/index.mjs +1 -1
- package/build-module/components/block-list/index.mjs.map +1 -1
- package/build-module/components/block-list/layout.mjs +1 -1
- package/build-module/components/block-list/layout.mjs.map +1 -1
- package/build-module/components/block-list/subdirectory-icon.mjs +1 -1
- package/build-module/components/block-list/subdirectory-icon.mjs.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.mjs +17 -4
- package/build-module/components/block-list/use-block-props/use-is-hovered.mjs.map +2 -2
- package/build-module/components/block-list/zoom-out-separator.mjs +1 -1
- package/build-module/components/block-list/zoom-out-separator.mjs.map +1 -1
- package/build-module/components/block-list-appender/index.mjs +1 -1
- package/build-module/components/block-list-appender/index.mjs.map +1 -1
- package/build-module/components/block-lock/menu-item.mjs +1 -1
- package/build-module/components/block-lock/menu-item.mjs.map +1 -1
- package/build-module/components/block-lock/modal.mjs +1 -1
- package/build-module/components/block-lock/modal.mjs.map +1 -1
- package/build-module/components/block-lock/toolbar.mjs +1 -1
- package/build-module/components/block-lock/toolbar.mjs.map +1 -1
- package/build-module/components/block-manager/category.mjs +1 -1
- package/build-module/components/block-manager/category.mjs.map +1 -1
- package/build-module/components/block-manager/checklist.mjs +1 -1
- package/build-module/components/block-manager/checklist.mjs.map +1 -1
- package/build-module/components/block-manager/index.mjs +1 -1
- package/build-module/components/block-manager/index.mjs.map +1 -1
- package/build-module/components/block-mover/button.mjs +1 -1
- package/build-module/components/block-mover/button.mjs.map +1 -1
- package/build-module/components/block-mover/index.mjs +1 -1
- package/build-module/components/block-mover/index.mjs.map +1 -1
- package/build-module/components/block-navigation/dropdown.mjs +1 -1
- package/build-module/components/block-navigation/dropdown.mjs.map +1 -1
- package/build-module/components/block-parent-selector/index.mjs +1 -1
- package/build-module/components/block-parent-selector/index.mjs.map +1 -1
- package/build-module/components/block-pattern-setup/index.mjs +1 -1
- package/build-module/components/block-pattern-setup/index.mjs.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.mjs +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.mjs.map +1 -1
- package/build-module/components/block-patterns-list/index.mjs +1 -1
- package/build-module/components/block-patterns-list/index.mjs.map +1 -1
- package/build-module/components/block-patterns-paging/index.mjs +1 -1
- package/build-module/components/block-patterns-paging/index.mjs.map +1 -1
- package/build-module/components/block-popover/cover.mjs +1 -1
- package/build-module/components/block-popover/cover.mjs.map +1 -1
- package/build-module/components/block-popover/drop-zone.mjs +1 -1
- package/build-module/components/block-popover/drop-zone.mjs.map +1 -1
- package/build-module/components/block-popover/inbetween.mjs +1 -1
- package/build-module/components/block-popover/inbetween.mjs.map +1 -1
- package/build-module/components/block-popover/index.mjs +1 -1
- package/build-module/components/block-popover/index.mjs.map +1 -1
- package/build-module/components/block-preview/auto.mjs +1 -1
- package/build-module/components/block-preview/auto.mjs.map +1 -1
- package/build-module/components/block-preview/index.mjs +2 -3
- package/build-module/components/block-preview/index.mjs.map +3 -3
- package/build-module/components/block-quick-navigation/index.mjs +1 -1
- package/build-module/components/block-quick-navigation/index.mjs.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.mjs +1 -1
- package/build-module/components/block-removal-warning-modal/index.mjs.map +1 -1
- package/build-module/components/block-rename/modal.mjs +1 -1
- package/build-module/components/block-rename/modal.mjs.map +1 -1
- package/build-module/components/block-rename/rename-control.mjs +1 -1
- package/build-module/components/block-rename/rename-control.mjs.map +1 -1
- package/build-module/components/block-selection-clearer/index.mjs +1 -1
- package/build-module/components/block-selection-clearer/index.mjs.map +1 -1
- package/build-module/components/block-settings-menu/block-html-convert-button.mjs +1 -1
- package/build-module/components/block-settings-menu/block-html-convert-button.mjs.map +1 -1
- package/build-module/components/block-settings-menu/block-mode-toggle.mjs +1 -1
- package/build-module/components/block-settings-menu/block-mode-toggle.mjs.map +1 -1
- package/build-module/components/block-settings-menu/block-parent-selector-menu-item.mjs +1 -1
- package/build-module/components/block-settings-menu/block-parent-selector-menu-item.mjs.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +1 -1
- package/build-module/components/block-settings-menu/index.mjs +1 -1
- package/build-module/components/block-settings-menu/index.mjs.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.mjs +1 -1
- package/build-module/components/block-settings-menu-controls/index.mjs.map +1 -1
- package/build-module/components/block-styles/index.mjs +1 -1
- package/build-module/components/block-styles/index.mjs.map +1 -1
- package/build-module/components/block-styles/menu-items.mjs +1 -1
- package/build-module/components/block-styles/menu-items.mjs.map +1 -1
- package/build-module/components/block-switcher/block-styles-menu.mjs +1 -1
- package/build-module/components/block-switcher/block-styles-menu.mjs.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.mjs +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.mjs.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.mjs +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.mjs.map +1 -1
- package/build-module/components/block-switcher/index.mjs +3 -3
- package/build-module/components/block-switcher/index.mjs.map +3 -3
- package/build-module/components/block-switcher/pattern-transformations-menu.mjs +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.mjs.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.mjs +1 -1
- package/build-module/components/block-switcher/preview-block-popover.mjs.map +1 -1
- package/build-module/components/block-toolbar/block-styles-dropdown.mjs +1 -1
- package/build-module/components/block-toolbar/block-styles-dropdown.mjs.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs +1 -1
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +1 -1
- package/build-module/components/block-toolbar/change-design.mjs +1 -1
- package/build-module/components/block-toolbar/change-design.mjs.map +1 -1
- package/build-module/components/block-toolbar/edit-section-button.mjs +1 -1
- package/build-module/components/block-toolbar/edit-section-button.mjs.map +1 -1
- package/build-module/components/block-toolbar/index.mjs +1 -1
- package/build-module/components/block-toolbar/index.mjs.map +1 -1
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs +4 -7
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs.map +3 -3
- package/build-module/components/block-toolbar/switch-section-style.mjs +1 -1
- package/build-module/components/block-toolbar/switch-section-style.mjs.map +1 -1
- package/build-module/components/block-tools/block-toolbar-popover.mjs +1 -1
- package/build-module/components/block-tools/block-toolbar-popover.mjs.map +1 -1
- package/build-module/components/block-tools/empty-block-inserter.mjs +1 -1
- package/build-module/components/block-tools/empty-block-inserter.mjs.map +1 -1
- package/build-module/components/block-tools/index.mjs +1 -1
- package/build-module/components/block-tools/index.mjs.map +1 -1
- package/build-module/components/block-tools/insertion-point.mjs +1 -1
- package/build-module/components/block-tools/insertion-point.mjs.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.mjs +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.mjs.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.mjs +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.mjs.map +1 -1
- package/build-module/components/block-types-list/index.mjs +1 -1
- package/build-module/components/block-types-list/index.mjs.map +1 -1
- package/build-module/components/block-variation-picker/index.mjs +1 -1
- package/build-module/components/block-variation-picker/index.mjs.map +1 -1
- package/build-module/components/block-variation-transforms/index.mjs +1 -1
- package/build-module/components/block-variation-transforms/index.mjs.map +1 -1
- package/build-module/components/block-vertical-alignment-control/index.mjs +1 -1
- package/build-module/components/block-vertical-alignment-control/index.mjs.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.mjs +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.mjs.map +1 -1
- package/build-module/components/block-visibility/constants.mjs.map +1 -1
- package/build-module/components/block-visibility/modal.mjs +1 -1
- package/build-module/components/block-visibility/modal.mjs.map +1 -1
- package/build-module/components/block-visibility/viewport-menu-item.mjs +1 -1
- package/build-module/components/block-visibility/viewport-menu-item.mjs.map +1 -1
- package/build-module/components/block-visibility/viewport-toolbar.mjs +1 -1
- package/build-module/components/block-visibility/viewport-toolbar.mjs.map +1 -1
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +1 -1
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +1 -1
- package/build-module/components/border-radius-control/index.mjs +1 -1
- package/build-module/components/border-radius-control/index.mjs.map +1 -1
- package/build-module/components/border-radius-control/linked-button.mjs +1 -1
- package/build-module/components/border-radius-control/linked-button.mjs.map +1 -1
- package/build-module/components/button-block-appender/index.mjs +1 -1
- package/build-module/components/button-block-appender/index.mjs.map +1 -1
- package/build-module/components/child-layout-control/index.mjs +1 -1
- package/build-module/components/child-layout-control/index.mjs.map +1 -1
- package/build-module/components/color-palette/control.mjs +1 -1
- package/build-module/components/color-palette/control.mjs.map +1 -1
- package/build-module/components/color-palette/with-color-context.mjs +1 -1
- package/build-module/components/color-palette/with-color-context.mjs.map +1 -1
- package/build-module/components/color-style-selector/index.mjs +1 -1
- package/build-module/components/color-style-selector/index.mjs.map +1 -1
- package/build-module/components/colors/with-colors.mjs +1 -1
- package/build-module/components/colors/with-colors.mjs.map +1 -1
- package/build-module/components/colors-gradients/control.mjs +1 -1
- package/build-module/components/colors-gradients/control.mjs.map +1 -1
- package/build-module/components/colors-gradients/dropdown.mjs +1 -1
- package/build-module/components/colors-gradients/dropdown.mjs.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.mjs +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.mjs.map +1 -1
- package/build-module/components/contrast-checker/index.mjs +1 -1
- package/build-module/components/contrast-checker/index.mjs.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.mjs +1 -1
- package/build-module/components/convert-to-group-buttons/index.mjs.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.mjs +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.mjs.map +1 -1
- package/build-module/components/copy-handler/index.mjs +1 -1
- package/build-module/components/copy-handler/index.mjs.map +1 -1
- package/build-module/components/date-format-picker/index.mjs +1 -1
- package/build-module/components/date-format-picker/index.mjs.map +1 -1
- package/build-module/components/default-block-appender/index.mjs +1 -1
- package/build-module/components/default-block-appender/index.mjs.map +1 -1
- package/build-module/components/dimension-control/index.mjs +1 -1
- package/build-module/components/dimension-control/index.mjs.map +1 -1
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +1 -1
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +1 -1
- package/build-module/components/dimensions-tool/index.mjs +1 -1
- package/build-module/components/dimensions-tool/index.mjs.map +1 -1
- package/build-module/components/dimensions-tool/scale-tool.mjs +1 -1
- package/build-module/components/dimensions-tool/scale-tool.mjs.map +1 -1
- package/build-module/components/dimensions-tool/width-height-tool.mjs +1 -1
- package/build-module/components/dimensions-tool/width-height-tool.mjs.map +1 -1
- package/build-module/components/duotone-control/index.mjs +1 -1
- package/build-module/components/duotone-control/index.mjs.map +1 -1
- package/build-module/components/editable-text/index.mjs +1 -1
- package/build-module/components/editable-text/index.mjs.map +1 -1
- package/build-module/components/editor-styles/index.mjs +1 -1
- package/build-module/components/editor-styles/index.mjs.map +1 -1
- package/build-module/components/fit-text-size-warning/index.mjs +1 -1
- package/build-module/components/fit-text-size-warning/index.mjs.map +1 -1
- package/build-module/components/font-appearance-control/index.mjs +1 -1
- package/build-module/components/font-appearance-control/index.mjs.map +1 -1
- package/build-module/components/font-family/index.mjs +1 -1
- package/build-module/components/font-family/index.mjs.map +1 -1
- package/build-module/components/font-sizes/font-size-picker.mjs +1 -1
- package/build-module/components/font-sizes/font-size-picker.mjs.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.mjs +1 -1
- package/build-module/components/font-sizes/with-font-sizes.mjs.map +1 -1
- package/build-module/components/global-styles/advanced-panel.mjs +1 -1
- package/build-module/components/global-styles/advanced-panel.mjs.map +1 -1
- package/build-module/components/global-styles/background-panel.mjs +1 -1
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +20 -43
- package/build-module/components/global-styles/border-panel.mjs.map +3 -3
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +1 -1
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +1 -1
- package/build-module/components/global-styles/color-panel.mjs +1 -1
- package/build-module/components/global-styles/color-panel.mjs.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.mjs +1 -1
- package/build-module/components/global-styles/dimensions-panel.mjs.map +1 -1
- package/build-module/components/global-styles/filters-panel.mjs +1 -1
- package/build-module/components/global-styles/filters-panel.mjs.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.mjs +1 -1
- package/build-module/components/global-styles/image-settings-panel.mjs.map +2 -2
- package/build-module/components/global-styles/inheritance/index.mjs +1 -1
- package/build-module/components/global-styles/inheritance/index.mjs.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.mjs +1 -1
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +1 -1
- package/build-module/components/global-styles/state-control-badges.mjs +1 -1
- package/build-module/components/global-styles/state-control-badges.mjs.map +1 -1
- package/build-module/components/global-styles/state-control.mjs +1 -1
- package/build-module/components/global-styles/state-control.mjs.map +1 -1
- package/build-module/components/global-styles/typography-panel.mjs +1 -1
- package/build-module/components/global-styles/typography-panel.mjs.map +1 -1
- package/build-module/components/grid/grid-item-movers.mjs +1 -1
- package/build-module/components/grid/grid-item-movers.mjs.map +1 -1
- package/build-module/components/grid/grid-item-resizer.mjs +1 -1
- package/build-module/components/grid/grid-item-resizer.mjs.map +1 -1
- package/build-module/components/grid/grid-visualizer.mjs +1 -1
- package/build-module/components/grid/grid-visualizer.mjs.map +1 -1
- package/build-module/components/height-control/index.mjs +1 -1
- package/build-module/components/height-control/index.mjs.map +1 -1
- package/build-module/components/html-element-control/index.mjs +1 -1
- package/build-module/components/html-element-control/index.mjs.map +1 -1
- package/build-module/components/iframe/index.mjs +1 -1
- package/build-module/components/iframe/index.mjs.map +2 -2
- package/build-module/components/image-editor/aspect-ratio-dropdown.mjs +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.mjs.map +1 -1
- package/build-module/components/image-editor/context.mjs +1 -1
- package/build-module/components/image-editor/context.mjs.map +1 -1
- package/build-module/components/image-editor/cropper.mjs +1 -1
- package/build-module/components/image-editor/cropper.mjs.map +1 -1
- package/build-module/components/image-editor/form-controls.mjs +1 -1
- package/build-module/components/image-editor/form-controls.mjs.map +1 -1
- package/build-module/components/image-editor/index.mjs +1 -1
- package/build-module/components/image-editor/index.mjs.map +1 -1
- package/build-module/components/image-editor/rotation-button.mjs +1 -1
- package/build-module/components/image-editor/rotation-button.mjs.map +1 -1
- package/build-module/components/image-editor/zoom-dropdown.mjs +1 -1
- package/build-module/components/image-editor/zoom-dropdown.mjs.map +1 -1
- package/build-module/components/image-size-control/index.mjs +1 -1
- package/build-module/components/image-size-control/index.mjs.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.mjs +1 -1
- package/build-module/components/inner-blocks/button-block-appender.mjs.map +1 -1
- package/build-module/components/inner-blocks/default-block-appender.mjs +1 -1
- package/build-module/components/inner-blocks/default-block-appender.mjs.map +1 -1
- package/build-module/components/inner-blocks/index.mjs +1 -1
- package/build-module/components/inner-blocks/index.mjs.map +1 -1
- package/build-module/components/inner-content/index.mjs +1 -1
- package/build-module/components/inner-content/index.mjs.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.mjs +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.mjs.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.mjs +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.mjs.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.mjs +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.mjs.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.mjs +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.mjs.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.mjs +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.mjs.map +1 -1
- package/build-module/components/inserter/block-types-tab.mjs +1 -1
- package/build-module/components/inserter/block-types-tab.mjs.map +1 -1
- package/build-module/components/inserter/category-tabs/index.mjs +1 -1
- package/build-module/components/inserter/category-tabs/index.mjs.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-paging.mjs.map +1 -1
- package/build-module/components/inserter/index.mjs +1 -1
- package/build-module/components/inserter/index.mjs.map +1 -1
- package/build-module/components/inserter/library.mjs +1 -1
- package/build-module/components/inserter/library.mjs.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.mjs +1 -1
- package/build-module/components/inserter/media-tab/media-list.mjs.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.mjs +1 -1
- package/build-module/components/inserter/media-tab/media-panel.mjs.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.mjs +1 -1
- package/build-module/components/inserter/media-tab/media-preview.mjs.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.mjs +1 -1
- package/build-module/components/inserter/media-tab/media-tab.mjs.map +1 -1
- package/build-module/components/inserter/media-tab/utils.mjs +1 -1
- package/build-module/components/inserter/media-tab/utils.mjs.map +1 -1
- package/build-module/components/inserter/menu.mjs +2 -2
- package/build-module/components/inserter/menu.mjs.map +3 -3
- package/build-module/components/inserter/mobile-tab-navigation.mjs +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.mjs.map +1 -1
- package/build-module/components/inserter/no-results.mjs +1 -1
- package/build-module/components/inserter/no-results.mjs.map +1 -1
- package/build-module/components/inserter/panel.mjs +1 -1
- package/build-module/components/inserter/panel.mjs.map +1 -1
- package/build-module/components/inserter/preview-panel.mjs +1 -1
- package/build-module/components/inserter/preview-panel.mjs.map +1 -1
- package/build-module/components/inserter/quick-inserter.mjs +1 -1
- package/build-module/components/inserter/quick-inserter.mjs.map +1 -1
- package/build-module/components/inserter/search-results.mjs +1 -1
- package/build-module/components/inserter/search-results.mjs.map +1 -1
- package/build-module/components/inserter/tips.mjs +1 -1
- package/build-module/components/inserter/tips.mjs.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.mjs +1 -1
- package/build-module/components/inserter-draggable-blocks/index.mjs.map +2 -2
- package/build-module/components/inserter-list-item/index.mjs +1 -1
- package/build-module/components/inserter-list-item/index.mjs.map +1 -1
- package/build-module/components/inserter-listbox/group.mjs +1 -1
- package/build-module/components/inserter-listbox/group.mjs.map +1 -1
- package/build-module/components/inserter-listbox/index.mjs +1 -1
- package/build-module/components/inserter-listbox/index.mjs.map +1 -1
- package/build-module/components/inserter-listbox/item.mjs +1 -1
- package/build-module/components/inserter-listbox/item.mjs.map +1 -1
- package/build-module/components/inserter-listbox/row.mjs +1 -1
- package/build-module/components/inserter-listbox/row.mjs.map +1 -1
- package/build-module/components/inspector-controls/block-support-slot-container.mjs +1 -1
- package/build-module/components/inspector-controls/block-support-slot-container.mjs.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.mjs +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.mjs.map +1 -1
- package/build-module/components/inspector-controls/fill.mjs +1 -1
- package/build-module/components/inspector-controls/fill.mjs.map +1 -1
- package/build-module/components/inspector-controls/groups.mjs +3 -1
- package/build-module/components/inspector-controls/groups.mjs.map +2 -2
- package/build-module/components/inspector-controls/index.mjs +1 -1
- package/build-module/components/inspector-controls/index.mjs.map +1 -1
- package/build-module/components/inspector-controls/last-item.mjs +1 -1
- package/build-module/components/inspector-controls/last-item.mjs.map +1 -1
- package/build-module/components/inspector-controls/list-view-content-popover.mjs +1 -1
- package/build-module/components/inspector-controls/list-view-content-popover.mjs.map +1 -1
- package/build-module/components/inspector-controls/slot.mjs +1 -1
- package/build-module/components/inspector-controls/slot.mjs.map +1 -1
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.mjs +1 -1
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.mjs.map +1 -1
- package/build-module/components/inspector-controls-tabs/content-tab.mjs +4 -5
- package/build-module/components/inspector-controls-tabs/content-tab.mjs.map +3 -3
- package/build-module/components/inspector-controls-tabs/index.mjs +1 -1
- package/build-module/components/inspector-controls-tabs/index.mjs.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.mjs +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.mjs.map +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab.mjs +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab.mjs.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +2 -4
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +3 -3
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs +1 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs.map +2 -2
- package/build-module/components/inspector-popover-header/index.mjs +7 -8
- package/build-module/components/inspector-popover-header/index.mjs.map +3 -3
- package/build-module/components/justify-content-control/index.mjs +1 -1
- package/build-module/components/justify-content-control/index.mjs.map +1 -1
- package/build-module/components/justify-content-control/ui.mjs +1 -1
- package/build-module/components/justify-content-control/ui.mjs.map +1 -1
- package/build-module/components/letter-spacing-control/index.mjs +1 -1
- package/build-module/components/letter-spacing-control/index.mjs.map +1 -1
- package/build-module/components/line-height-control/index.mjs +1 -1
- package/build-module/components/line-height-control/index.mjs.map +1 -1
- package/build-module/components/link-control/index.mjs +1 -1
- package/build-module/components/link-control/index.mjs.map +3 -3
- package/build-module/components/link-control/link-preview.mjs +1 -1
- package/build-module/components/link-control/link-preview.mjs.map +1 -1
- package/build-module/components/link-control/search-create-button.mjs +1 -1
- package/build-module/components/link-control/search-create-button.mjs.map +1 -1
- package/build-module/components/link-control/search-input.mjs +1 -1
- package/build-module/components/link-control/search-input.mjs.map +2 -2
- package/build-module/components/link-control/search-item.mjs +1 -1
- package/build-module/components/link-control/search-item.mjs.map +1 -1
- package/build-module/components/link-control/search-results.mjs +1 -1
- package/build-module/components/link-control/search-results.mjs.map +1 -1
- package/build-module/components/link-control/settings-drawer.mjs +1 -1
- package/build-module/components/link-control/settings-drawer.mjs.map +1 -1
- package/build-module/components/link-control/settings.mjs +1 -1
- package/build-module/components/link-control/settings.mjs.map +1 -1
- package/build-module/components/link-picker/link-picker.mjs +1 -1
- package/build-module/components/link-picker/link-picker.mjs.map +1 -1
- package/build-module/components/link-picker/link-preview.mjs +1 -1
- package/build-module/components/link-picker/link-preview.mjs.map +1 -1
- package/build-module/components/list-view/appender.mjs +1 -1
- package/build-module/components/list-view/appender.mjs.map +1 -1
- package/build-module/components/list-view/aria-referenced-text.mjs +1 -1
- package/build-module/components/list-view/aria-referenced-text.mjs.map +1 -1
- package/build-module/components/list-view/block-contents.mjs +1 -1
- package/build-module/components/list-view/block-contents.mjs.map +1 -1
- package/build-module/components/list-view/block-select-button.mjs +10 -2
- package/build-module/components/list-view/block-select-button.mjs.map +3 -3
- package/build-module/components/list-view/block.mjs +3 -2
- package/build-module/components/list-view/block.mjs.map +3 -3
- package/build-module/components/list-view/branch.mjs +1 -1
- package/build-module/components/list-view/branch.mjs.map +1 -1
- package/build-module/components/list-view/drop-indicator.mjs +1 -1
- package/build-module/components/list-view/drop-indicator.mjs.map +1 -1
- package/build-module/components/list-view/expander.mjs +1 -1
- package/build-module/components/list-view/expander.mjs.map +1 -1
- package/build-module/components/list-view/index.mjs +1 -1
- package/build-module/components/list-view/index.mjs.map +1 -1
- package/build-module/components/list-view/leaf.mjs +1 -1
- package/build-module/components/list-view/leaf.mjs.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.mjs.map +1 -1
- package/build-module/components/media-placeholder/index.mjs +1 -1
- package/build-module/components/media-placeholder/index.mjs.map +1 -1
- package/build-module/components/media-replace-flow/index.mjs +5 -2
- package/build-module/components/media-replace-flow/index.mjs.map +3 -3
- package/build-module/components/multi-selection-inspector/index.mjs +1 -1
- package/build-module/components/multi-selection-inspector/index.mjs.map +1 -1
- package/build-module/components/navigable-toolbar/index.mjs +4 -1
- package/build-module/components/navigable-toolbar/index.mjs.map +3 -3
- package/build-module/components/observe-typing/index.mjs +1 -1
- package/build-module/components/observe-typing/index.mjs.map +1 -1
- package/build-module/components/panel-color-settings/index.mjs +1 -1
- package/build-module/components/panel-color-settings/index.mjs.map +1 -1
- package/build-module/components/plain-text/index.mjs +1 -1
- package/build-module/components/plain-text/index.mjs.map +1 -1
- package/build-module/components/preset-input-control/custom-value-controls.mjs +1 -1
- package/build-module/components/preset-input-control/custom-value-controls.mjs.map +1 -1
- package/build-module/components/preset-input-control/index.mjs +1 -1
- package/build-module/components/preset-input-control/index.mjs.map +1 -1
- package/build-module/components/provider/block-refs-provider.mjs +1 -1
- package/build-module/components/provider/block-refs-provider.mjs.map +1 -1
- package/build-module/components/provider/index.mjs +21 -4
- package/build-module/components/provider/index.mjs.map +3 -3
- package/build-module/components/provider/with-registry-provider.mjs +1 -1
- package/build-module/components/provider/with-registry-provider.mjs.map +1 -1
- package/build-module/components/publish-date-time-picker/index.mjs +1 -1
- package/build-module/components/publish-date-time-picker/index.mjs.map +1 -1
- package/build-module/components/recursion-provider/index.mjs +1 -1
- package/build-module/components/recursion-provider/index.mjs.map +1 -1
- package/build-module/components/resizable-box-popover/index.mjs +1 -1
- package/build-module/components/resizable-box-popover/index.mjs.map +1 -1
- package/build-module/components/resolution-tool/index.mjs +1 -1
- package/build-module/components/resolution-tool/index.mjs.map +1 -1
- package/build-module/components/responsive-block-control/index.mjs +1 -1
- package/build-module/components/responsive-block-control/index.mjs.map +1 -1
- package/build-module/components/responsive-block-control/label.mjs +1 -1
- package/build-module/components/responsive-block-control/label.mjs.map +1 -1
- package/build-module/components/rich-text/content.mjs +1 -1
- package/build-module/components/rich-text/content.mjs.map +1 -1
- package/build-module/components/rich-text/event-listeners/enter.mjs +23 -11
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/index.mjs +0 -2
- package/build-module/components/rich-text/event-listeners/index.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs +4 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/format-edit.mjs +1 -1
- package/build-module/components/rich-text/format-edit.mjs.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.mjs +1 -1
- package/build-module/components/rich-text/format-toolbar/index.mjs.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.mjs +1 -1
- package/build-module/components/rich-text/format-toolbar-container.mjs.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.mjs +1 -1
- package/build-module/components/rich-text/get-rich-text-values.mjs.map +1 -1
- package/build-module/components/rich-text/index.mjs +1 -1
- package/build-module/components/rich-text/index.mjs.map +1 -1
- package/build-module/components/rich-text/multiline.mjs +1 -1
- package/build-module/components/rich-text/multiline.mjs.map +1 -1
- package/build-module/components/rich-text/toolbar-button.mjs +1 -1
- package/build-module/components/rich-text/toolbar-button.mjs.map +1 -1
- package/build-module/components/rich-text/utils.mjs +1 -1
- package/build-module/components/rich-text/utils.mjs.map +1 -1
- package/build-module/components/rich-text/with-deprecations.mjs +1 -1
- package/build-module/components/rich-text/with-deprecations.mjs.map +1 -1
- package/build-module/components/skip-to-selected-block/index.mjs +1 -1
- package/build-module/components/skip-to-selected-block/index.mjs.map +1 -1
- package/build-module/components/spacing-sizes-control/index.mjs +1 -1
- package/build-module/components/spacing-sizes-control/index.mjs.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.mjs +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.mjs.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/separated.mjs +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/separated.mjs.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/single.mjs +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/single.mjs.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.mjs +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.mjs.map +1 -1
- package/build-module/components/spacing-sizes-control/linked-button.mjs +1 -1
- package/build-module/components/spacing-sizes-control/linked-button.mjs.map +1 -1
- package/build-module/components/tabbed-sidebar/index.mjs +1 -1
- package/build-module/components/tabbed-sidebar/index.mjs.map +1 -1
- package/build-module/components/text-alignment-control/index.mjs +1 -1
- package/build-module/components/text-alignment-control/index.mjs.map +1 -1
- package/build-module/components/text-decoration-control/index.mjs +1 -1
- package/build-module/components/text-decoration-control/index.mjs.map +1 -1
- package/build-module/components/text-indent-control/index.mjs +1 -1
- package/build-module/components/text-indent-control/index.mjs.map +1 -1
- package/build-module/components/text-transform-control/index.mjs +1 -1
- package/build-module/components/text-transform-control/index.mjs.map +1 -1
- package/build-module/components/typewriter/index.mjs +1 -1
- package/build-module/components/typewriter/index.mjs.map +1 -1
- package/build-module/components/unit-control/index.mjs +1 -1
- package/build-module/components/unit-control/index.mjs.map +1 -1
- package/build-module/components/url-input/button.mjs +1 -1
- package/build-module/components/url-input/button.mjs.map +1 -1
- package/build-module/components/url-input/index.mjs +1 -1
- package/build-module/components/url-input/index.mjs.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.mjs +1 -1
- package/build-module/components/url-popover/image-url-input-ui.mjs.map +1 -1
- package/build-module/components/url-popover/index.mjs +1 -1
- package/build-module/components/url-popover/index.mjs.map +1 -1
- package/build-module/components/url-popover/link-editor.mjs +1 -1
- package/build-module/components/url-popover/link-editor.mjs.map +1 -1
- package/build-module/components/url-popover/link-viewer-url.mjs +1 -1
- package/build-module/components/url-popover/link-viewer-url.mjs.map +1 -1
- package/build-module/components/url-popover/link-viewer.mjs +1 -1
- package/build-module/components/url-popover/link-viewer.mjs.map +1 -1
- package/build-module/components/use-block-drop-zone/index.mjs.map +1 -1
- package/build-module/components/warning/index.mjs +1 -1
- package/build-module/components/warning/index.mjs.map +1 -1
- package/build-module/components/writing-flow/index.mjs +6 -1
- package/build-module/components/writing-flow/index.mjs.map +3 -3
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +1 -1
- package/build-module/components/writing-flow/use-input.mjs +12 -2
- package/build-module/components/writing-flow/use-input.mjs.map +2 -2
- package/build-module/components/writing-flow/use-tab-nav.mjs +87 -44
- package/build-module/components/writing-flow/use-tab-nav.mjs.map +4 -4
- package/build-module/components/writing-flow/use-undo-automatic-change.mjs +36 -0
- package/build-module/components/writing-flow/use-undo-automatic-change.mjs.map +7 -0
- package/build-module/components/writing-mode-control/index.mjs +1 -1
- package/build-module/components/writing-mode-control/index.mjs.map +1 -1
- package/build-module/hooks/align.mjs +1 -1
- package/build-module/hooks/align.mjs.map +1 -1
- package/build-module/hooks/allowed-blocks.mjs +1 -1
- package/build-module/hooks/allowed-blocks.mjs.map +1 -1
- package/build-module/hooks/anchor.mjs +1 -1
- package/build-module/hooks/anchor.mjs.map +1 -1
- package/build-module/hooks/auto-inspector-controls.mjs +1 -1
- package/build-module/hooks/auto-inspector-controls.mjs.map +1 -1
- package/build-module/hooks/background.mjs +1 -1
- package/build-module/hooks/background.mjs.map +1 -1
- package/build-module/hooks/block-bindings.mjs +1 -1
- package/build-module/hooks/block-bindings.mjs.map +1 -1
- package/build-module/hooks/block-hooks.mjs +1 -1
- package/build-module/hooks/block-hooks.mjs.map +1 -1
- package/build-module/hooks/block-style-variation.mjs +1 -1
- package/build-module/hooks/block-style-variation.mjs.map +1 -1
- package/build-module/hooks/border.mjs +2 -46
- package/build-module/hooks/border.mjs.map +3 -3
- package/build-module/hooks/custom-class-name.mjs +1 -1
- package/build-module/hooks/custom-class-name.mjs.map +1 -1
- package/build-module/hooks/custom-css.mjs +1 -1
- package/build-module/hooks/custom-css.mjs.map +1 -1
- package/build-module/hooks/dimensions.mjs +1 -1
- package/build-module/hooks/dimensions.mjs.map +1 -1
- package/build-module/hooks/duotone.mjs +1 -1
- package/build-module/hooks/duotone.mjs.map +1 -1
- package/build-module/hooks/elements.mjs +1 -1
- package/build-module/hooks/elements.mjs.map +1 -1
- package/build-module/hooks/fit-text.mjs +1 -1
- package/build-module/hooks/fit-text.mjs.map +1 -1
- package/build-module/hooks/font-size.mjs +1 -1
- package/build-module/hooks/font-size.mjs.map +1 -1
- package/build-module/hooks/generate-fields-from-attributes.mjs.map +1 -1
- package/build-module/hooks/grid-visualizer.mjs +1 -1
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/index.mjs +0 -2
- package/build-module/hooks/index.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +1 -1
- package/build-module/hooks/layout-child.mjs.map +1 -1
- package/build-module/hooks/layout.mjs +1 -1
- package/build-module/hooks/layout.mjs.map +1 -1
- package/build-module/hooks/line-height.mjs +1 -1
- package/build-module/hooks/line-height.mjs.map +1 -1
- package/build-module/hooks/list-view.mjs +1 -1
- package/build-module/hooks/list-view.mjs.map +1 -1
- package/build-module/hooks/position.mjs +2 -2
- package/build-module/hooks/position.mjs.map +3 -3
- package/build-module/hooks/spacing-visualizer.mjs +1 -1
- package/build-module/hooks/spacing-visualizer.mjs.map +1 -1
- package/build-module/hooks/states.mjs +1 -1
- package/build-module/hooks/states.mjs.map +1 -1
- package/build-module/hooks/style.mjs +4 -3
- package/build-module/hooks/style.mjs.map +3 -3
- package/build-module/hooks/text-align.mjs +1 -1
- package/build-module/hooks/text-align.mjs.map +1 -1
- package/build-module/hooks/typography.mjs +1 -1
- package/build-module/hooks/typography.mjs.map +1 -1
- package/build-module/hooks/utils.mjs +1 -1
- package/build-module/hooks/utils.mjs.map +1 -1
- package/build-module/layouts/constrained.mjs +1 -1
- package/build-module/layouts/constrained.mjs.map +1 -1
- package/build-module/layouts/flex.mjs +4 -1
- package/build-module/layouts/flex.mjs.map +3 -3
- package/build-module/layouts/grid.mjs +1 -1
- package/build-module/layouts/grid.mjs.map +1 -1
- package/build-module/store/actions.mjs +12 -9
- package/build-module/store/actions.mjs.map +2 -2
- package/build-style/content-rtl.css +14 -19
- package/build-style/content.css +14 -19
- package/build-style/style-rtl.css +100 -233
- package/build-style/style.css +100 -233
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/build-types/components/block-visibility/constants.d.ts +1 -1
- package/package.json +42 -44
- package/src/autocompleters/test/block.js +1 -0
- package/src/components/alignment-control/test/__snapshots__/{index.js.snap → index.jsdom.test.jsx.snap} +34 -16
- package/src/components/alignment-control/test/{index.js → index.jsdom.test.jsx} +2 -1
- package/src/components/background-image-control/README.md +1 -1
- package/src/components/background-image-control/{index.js → index.jsx} +32 -1
- package/src/components/background-image-control/style.scss +5 -3
- package/src/components/background-image-control/test/{index.js → index.jsdom.test.js} +1 -0
- package/src/components/block-alignment-control/test/__snapshots__/{index.js.snap → index.jsdom.test.jsx.snap} +68 -13
- package/src/components/block-alignment-control/test/{index.js → index.jsdom.test.jsx} +2 -1
- package/src/components/block-allowed-blocks/{modal.js → modal.jsx} +3 -3
- package/src/components/block-bindings/test/{use-block-bindings-utils.js → use-block-bindings-utils.jsdom.test.js} +2 -1
- package/src/components/block-breadcrumb/test/__snapshots__/{index.js.snap → index.jsdom.test.jsx.snap} +2 -2
- package/src/components/block-breadcrumb/test/{index.js → index.jsdom.test.jsx} +1 -0
- package/src/components/block-compare/test/__snapshots__/{block-view.js.snap → block-view.jsdom.test.jsx.snap} +2 -2
- package/src/components/block-compare/test/{block-view.js → block-view.jsdom.test.jsx} +1 -0
- package/src/components/block-controls/test/{index.js → index.jsdom.test.jsx} +1 -0
- package/src/components/block-edit/{edit.js → edit.jsx} +1 -1
- package/src/components/block-edit/test/{edit.js → edit.jsdom.test.jsx} +1 -0
- package/src/components/block-icon/content.scss +0 -6
- package/src/components/block-icon/style.scss +0 -6
- package/src/components/block-icon/test/__snapshots__/{index.js.snap → index.jsdom.test.jsx.snap} +6 -2
- package/src/components/block-inspector/{index.js → index.jsx} +8 -13
- package/src/components/block-list/content.scss +4 -1
- package/src/components/block-list/use-block-props/use-is-hovered.js +24 -5
- package/src/components/block-manager/style.scss +2 -0
- package/src/components/block-mover/test/mover-description.js +1 -0
- package/src/components/block-preview/{index.js → index.jsx} +1 -2
- package/src/components/block-preview/test/{index.js → index.jsdom.test.jsx} +10 -6
- package/src/components/block-selection-clearer/test/{index.js → index.jsdom.test.jsx} +24 -19
- package/src/components/block-settings-menu/test/{block-mode-toggle.js → block-mode-toggle.jsdom.test.jsx} +5 -1
- package/src/components/block-styles/test/utils.js +1 -0
- package/src/components/block-switcher/{index.js → index.jsx} +3 -3
- package/src/components/block-switcher/test/{index.js → index.jsdom.test.jsx} +8 -4
- package/src/components/block-switcher/test/use-transformed.patterns.js +1 -0
- package/src/components/block-switcher/test/utils.js +1 -0
- package/src/components/block-title/test/{index.js → index.jsdom.test.jsx} +7 -3
- package/src/components/block-toolbar/{pattern-overrides-dropdown.js → pattern-overrides-dropdown.jsx} +3 -6
- package/src/components/block-toolbar/style.scss +1 -1
- package/src/components/block-toolbar/test/{block-toolbar-icon.js → block-toolbar-icon.jsdom.test.jsx} +25 -21
- package/src/components/block-variation-picker/content.scss +5 -3
- package/src/components/block-vertical-alignment-control/test/__snapshots__/{index.js.snap → index.jsdom.test.jsx.snap} +55 -11
- package/src/components/block-vertical-alignment-control/test/{index.js → index.jsdom.test.jsx} +2 -1
- package/src/components/block-visibility/constants.ts +1 -1
- package/src/components/block-visibility/test/{use-block-visibility.js → use-block-visibility.jsdom.test.js} +6 -5
- package/src/components/block-visibility/test/utils.js +2 -1
- package/src/components/border-radius-control/test/{index.js → index.jsdom.test.jsx} +8 -1
- package/src/components/border-radius-control/test/utils.js +1 -0
- package/src/components/button-block-appender/content.scss +1 -1
- package/src/components/child-layout-control/test/{index.js → index.jsdom.test.jsx} +18 -15
- package/src/components/color-palette/test/{control.js → control.jsdom.test.jsx} +15 -4
- package/src/components/colors/test/utils.js +1 -0
- package/src/components/colors/test/{with-colors.js → with-colors.jsdom.test.jsx} +4 -3
- package/src/components/colors-gradients/test/{control.js → control.jsdom.test.jsx} +8 -3
- package/src/components/contrast-checker/test/{index.js → index.jsdom.test.jsx} +2 -1
- package/src/components/default-block-appender/test/__snapshots__/{index.js.snap → index.jsdom.test.jsx.snap} +4 -4
- package/src/components/default-block-appender/test/{index.js → index.jsdom.test.jsx} +8 -7
- package/src/components/dimensions-tool/test/{index.js → index.jsdom.test.jsx} +27 -22
- package/src/components/dimensions-tool/test/utils.js +1 -0
- package/src/components/duotone-control/test/{index.js → index.jsdom.test.jsx} +6 -3
- package/src/components/font-sizes/test/fluid-utils.js +1 -0
- package/src/components/font-sizes/test/utils.js +1 -0
- package/src/components/global-styles/{background-panel.js → background-panel.jsx} +2 -2
- package/src/components/global-styles/{border-panel.js → border-panel.jsx} +17 -40
- package/src/components/global-styles/{image-settings-panel.js → image-settings-panel.jsx} +1 -1
- package/src/components/global-styles/inheritance/test/{index.js → index.jsdom.test.jsx} +5 -2
- package/src/components/global-styles/test/{background-panel.js → background-panel.jsdom.test.jsx} +11 -6
- package/src/components/global-styles/test/{border-panel.js → border-panel.jsdom.test.jsx} +113 -13
- package/src/components/global-styles/test/{color-panel.js → color-panel.jsdom.test.jsx} +5 -0
- package/src/components/global-styles/test/{dimensions-panel.js → dimensions-panel.jsdom.test.jsx} +14 -14
- package/src/components/global-styles/test/{filters-panel.js → filters-panel.jsdom.test.jsx} +7 -4
- package/src/components/global-styles/test/{inherited-value-context-core.js → inherited-value-context-core.jsdom.test.js} +11 -10
- package/src/components/global-styles/test/{inherited-value-context.js → inherited-value-context.jsdom.test.jsx} +19 -18
- package/src/components/global-styles/test/{state-control-badges.js → state-control-badges.jsdom.test.jsx} +3 -2
- package/src/components/global-styles/test/{typography-panel-core.js → typography-panel-core.jsdom.test.jsx} +5 -2
- package/src/components/global-styles/test/{typography-panel.js → typography-panel.jsdom.test.jsx} +18 -13
- package/src/components/global-styles/test/typography-utils.js +1 -0
- package/src/components/global-styles/test/utils.js +1 -0
- package/src/components/grid/style.scss +0 -10
- package/src/components/iframe/{index.js → index.jsx} +3 -3
- package/src/components/image-editor/test/index.js +1 -0
- package/src/components/image-size-control/test/{index.js → index.jsdom.test.jsx} +8 -3
- package/src/components/inner-blocks/test/__snapshots__/index.jsdom.test.jsx.snap +15 -0
- package/src/components/inner-blocks/test/{index.js → index.jsdom.test.jsx} +2 -0
- package/src/components/inner-content/test/{index.js → index.jsdom.test.jsx} +1 -0
- package/src/components/inserter/hooks/use-patterns-paging.js +1 -1
- package/src/components/inserter/media-tab/test/{hooks.js → hooks.jsdom.test.js} +12 -11
- package/src/components/inserter/media-tab/test/{media-panel.js → media-panel.jsdom.test.jsx} +15 -12
- package/src/components/inserter/{menu.js → menu.jsx} +1 -1
- package/src/components/inserter/style.scss +2 -6
- package/src/components/inserter/test/get-appender-label.js +12 -11
- package/src/components/inserter/test/search-items.js +1 -0
- package/src/components/inserter-draggable-blocks/{index.js → index.jsx} +1 -1
- package/src/components/inserter-list-item/style.scss +1 -0
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/{content-tab.js → content-tab.jsx} +7 -14
- package/src/components/inspector-controls-tabs/{styles-tab.js → styles-tab.jsx} +1 -4
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -8
- package/src/components/inspector-popover-header/{index.js → index.jsx} +6 -7
- package/src/components/line-height-control/test/{index.js → index.jsdom.test.jsx} +3 -0
- package/src/components/link-control/{index.js → index.jsx} +3 -0
- package/src/components/link-control/{search-input.js → search-input.jsx} +1 -1
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/{index.js → index.jsdom.test.jsx} +52 -42
- package/src/components/link-control/test/is-url-like.js +1 -0
- package/src/components/link-control/test/{url-normalization.test.js → url-normalization.jsdom.test.jsx} +21 -20
- package/src/components/link-picker/test/{index.js → index.jsdom.test.jsx} +31 -30
- package/src/components/list-view/{block-select-button.js → block-select-button.jsx} +6 -1
- package/src/components/list-view/{block.js → block.jsx} +6 -4
- package/src/components/list-view/style.scss +55 -35
- package/src/components/list-view/test/use-list-view-drop-zone.js +1 -0
- package/src/components/list-view/test/utils.js +1 -0
- package/src/components/list-view/use-list-view-drop-zone.js +1 -1
- package/src/components/media-placeholder/test/get-computed-accept-attribute.js +1 -0
- package/src/components/media-placeholder/test/{index.js → index.jsdom.test.jsx} +8 -2
- package/src/components/media-replace-flow/{index.js → index.jsx} +6 -1
- package/src/components/media-replace-flow/test/{index.js → index.jsdom.test.jsx} +3 -0
- package/src/components/navigable-toolbar/{index.js → index.jsx} +4 -0
- package/src/components/navigable-toolbar/test/index.browser.test.js +50 -0
- package/src/components/panel-color-settings/test/{index.js → index.jsdom.test.jsx} +3 -0
- package/src/components/preset-input-control/test/{index.js → index.jsdom.test.jsx} +8 -2
- package/src/components/preset-input-control/test/utils.js +1 -0
- package/src/components/provider/{index.js → index.jsx} +38 -0
- package/src/components/provider/test/{experimental-provider.js → experimental-provider.jsdom.test.jsx} +3 -2
- package/src/components/provider/test/{use-block-sync.js → use-block-sync.jsdom.test.jsx} +45 -44
- package/src/components/recursion-provider/test/{index.js → index.jsdom.test.jsx} +1 -0
- package/src/components/responsive-block-control/style.scss +1 -0
- package/src/components/responsive-block-control/test/{index.js → index.jsdom.test.jsx} +6 -3
- package/src/components/rich-text/content.scss +6 -0
- package/src/components/rich-text/event-listeners/enter.js +29 -14
- package/src/components/rich-text/event-listeners/index.js +0 -2
- package/src/components/rich-text/event-listeners/input-rules.js +7 -2
- package/src/components/spacing-sizes-control/test/{index.js → index.jsdom.test.jsx} +23 -20
- package/src/components/spacing-sizes-control/test/utils.js +1 -0
- package/src/components/url-input/test/{button.js → button.jsdom.test.jsx} +4 -1
- package/src/components/url-input/test/fixtures/validated-input-control-deprecation.js +2 -0
- package/src/components/url-input/test/{index.js → index.jsdom.test.jsx} +23 -13
- package/src/components/use-block-display-information/test/{index.js → index.jsdom.test.jsx} +14 -10
- package/src/components/use-block-drop-zone/index.js +2 -2
- package/src/components/use-block-drop-zone/test/index.js +1 -0
- package/src/components/use-on-block-drop/test/index.js +28 -31
- package/src/components/warning/test/__snapshots__/{index.js.snap → index.jsdom.test.jsx.snap} +2 -2
- package/src/components/warning/test/{index.js → index.jsdom.test.jsx} +1 -0
- package/src/components/writing-flow/{index.js → index.jsx} +5 -0
- package/src/components/writing-flow/style.scss +48 -0
- package/src/components/writing-flow/test/{index.js → index.jsdom.test.js} +1 -0
- package/src/components/writing-flow/use-arrow-nav.js +2 -2
- package/src/components/writing-flow/use-input.js +29 -2
- package/src/components/writing-flow/{use-tab-nav.js → use-tab-nav.jsx} +155 -70
- package/src/components/writing-flow/use-undo-automatic-change.js +40 -0
- package/src/elements/test/{index.js → index.jsdom.test.js} +1 -0
- package/src/hooks/block-hooks.scss +0 -9
- package/src/hooks/{border.js → border.jsx} +0 -53
- package/src/hooks/generate-fields-from-attributes.js +1 -1
- package/src/hooks/{grid-visualizer.js → grid-visualizer.jsx} +1 -1
- package/src/hooks/index.js +0 -2
- package/src/hooks/{position.js → position.jsx} +1 -1
- package/src/hooks/{style.js → style.jsx} +3 -2
- package/src/hooks/test/{align.js → align.jsdom.test.jsx} +1 -0
- package/src/hooks/test/allowed-blocks.js +1 -0
- package/src/hooks/test/{anchor.js → anchor.jsdom.test.js} +1 -0
- package/src/hooks/test/{auto-inspector-controls.js → auto-inspector-controls.jsdom.test.js} +1 -0
- package/src/hooks/test/{background.js → background.jsdom.test.jsx} +5 -2
- package/src/hooks/test/{block-style-state.js → block-style-state.jsdom.test.js} +4 -3
- package/src/hooks/test/{cross-origin-isolation.js → cross-origin-isolation.jsdom.test.js} +18 -25
- package/src/hooks/test/{custom-class-name.js → custom-class-name.jsdom.test.jsx} +1 -0
- package/src/hooks/test/{dimensions.js → dimensions.jsdom.test.js} +1 -0
- package/src/hooks/test/{duotone.js → duotone.jsdom.test.js} +1 -0
- package/src/hooks/test/{font-size.js → font-size.jsdom.test.js} +1 -0
- package/src/hooks/test/gap.js +1 -0
- package/src/hooks/test/generate-fields-from-attributes.js +1 -0
- package/src/hooks/test/generated-class-name.js +1 -0
- package/src/hooks/test/{inherited-value-wiring.js → inherited-value-wiring.jsdom.test.jsx} +49 -51
- package/src/hooks/test/{layout-child.js → layout-child.jsdom.test.js} +1 -0
- package/src/hooks/test/{layout.js → layout.jsdom.test.js} +1 -0
- package/src/hooks/test/metadata.js +1 -0
- package/src/hooks/test/preset-round-trip.js +2 -0
- package/src/hooks/test/{settings.js → settings.jsx} +1 -0
- package/src/hooks/test/state-utils.js +1 -0
- package/src/hooks/test/{style.js → style.jsdom.test.jsx} +1 -0
- package/src/hooks/test/{text-align.js → text-align.jsdom.test.jsx} +1 -0
- package/src/hooks/test/{use-typography-props.js → use-typography-props.jsdom.test.js} +1 -0
- package/src/hooks/test/{utils.js → utils.jsdom.test.js} +1 -0
- package/src/layouts/{flex.js → flex.jsx} +7 -0
- package/src/layouts/test/{constrained.js → constrained.jsdom.test.jsx} +6 -3
- package/src/layouts/test/{flex.js → flex.jsdom.test.jsx} +52 -2
- package/src/layouts/test/{flow.js → flow.jsdom.test.js} +1 -0
- package/src/layouts/test/{grid.js → grid.jsdom.test.jsx} +5 -2
- package/src/layouts/test/utils.js +1 -0
- package/src/store/actions.js +14 -12
- package/src/store/test/{actions.js → actions.jsdom.test.js} +50 -49
- package/src/store/test/array.js +1 -0
- package/src/store/test/get-block-settings.js +1 -0
- package/src/store/test/performance.js +2 -1
- package/src/store/test/private-actions.js +1 -0
- package/src/store/test/private-selectors.js +13 -3
- package/src/store/test/reducer.js +37 -8
- package/src/store/test/{registry-selectors.js → registry-selectors.jsdom.test.js} +9 -0
- package/src/store/test/{selectors.js → selectors.jsdom.test.jsx} +13 -3
- package/src/style.scss +1 -1
- package/src/utils/test/block-bindings.js +1 -0
- package/src/utils/test/color-values.js +1 -0
- package/src/utils/test/{dom.js → dom.jsdom.test.jsx} +38 -43
- package/src/utils/test/format-font-style.js +1 -0
- package/src/utils/test/format-font-weight.js +1 -0
- package/src/utils/test/get-font-styles-and-weights.js +1 -0
- package/src/utils/test/math.js +1 -0
- package/src/utils/test/object.js +1 -0
- package/src/utils/test/pasting.js +1 -0
- package/src/utils/test/selection.js +1 -0
- package/src/utils/test/sorting.js +1 -0
- package/src/utils/test/transform-styles.js +2 -1
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +0 -7
- package/build/hooks/block-fields/fields-dropdown-menu.cjs +0 -67
- package/build/hooks/block-fields/fields-dropdown-menu.cjs.map +0 -7
- package/build/hooks/block-fields/index.cjs +0 -238
- package/build/hooks/block-fields/index.cjs.map +0 -7
- package/build/hooks/block-fields/link/index.cjs +0 -174
- package/build/hooks/block-fields/link/index.cjs.map +0 -7
- package/build/hooks/block-fields/media/index.cjs +0 -262
- package/build/hooks/block-fields/media/index.cjs.map +0 -7
- package/build/hooks/block-fields/rich-text/index.cjs +0 -146
- package/build/hooks/block-fields/rich-text/index.cjs.map +0 -7
- package/build/hooks/block-fields/use-inspector-popover-placement.cjs +0 -41
- package/build/hooks/block-fields/use-inspector-popover-placement.cjs.map +0 -7
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +0 -33
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +0 -7
- package/build-module/hooks/block-fields/fields-dropdown-menu.mjs +0 -46
- package/build-module/hooks/block-fields/fields-dropdown-menu.mjs.map +0 -7
- package/build-module/hooks/block-fields/index.mjs +0 -210
- package/build-module/hooks/block-fields/index.mjs.map +0 -7
- package/build-module/hooks/block-fields/link/index.mjs +0 -141
- package/build-module/hooks/block-fields/link/index.mjs.map +0 -7
- package/build-module/hooks/block-fields/media/index.mjs +0 -241
- package/build-module/hooks/block-fields/media/index.mjs.map +0 -7
- package/build-module/hooks/block-fields/rich-text/index.mjs +0 -115
- package/build-module/hooks/block-fields/rich-text/index.mjs.map +0 -7
- package/build-module/hooks/block-fields/use-inspector-popover-placement.mjs +0 -16
- package/build-module/hooks/block-fields/use-inspector-popover-placement.mjs.map +0 -7
- package/src/components/color-palette/test/__snapshots__/control.js.snap +0 -143
- package/src/components/inner-blocks/test/__snapshots__/index.js.snap +0 -15
- package/src/components/rich-text/event-listeners/undo-automatic-change.js +0 -39
- package/src/hooks/block-fields/fields-dropdown-menu.js +0 -47
- package/src/hooks/block-fields/index.js +0 -302
- package/src/hooks/block-fields/link/index.js +0 -155
- package/src/hooks/block-fields/link/styles.scss +0 -18
- package/src/hooks/block-fields/media/index.js +0 -269
- package/src/hooks/block-fields/media/styles.scss +0 -77
- package/src/hooks/block-fields/rich-text/index.js +0 -123
- package/src/hooks/block-fields/rich-text/styles.scss +0 -24
- package/src/hooks/block-fields/styles.scss +0 -33
- package/src/hooks/block-fields/use-inspector-popover-placement.js +0 -16
- /package/src/autocompleters/{block.js → block.jsx} +0 -0
- /package/src/components/alignment-control/{index.js → index.jsx} +0 -0
- /package/src/components/alignment-control/{ui.js → ui.jsx} +0 -0
- /package/src/components/autocomplete/{index.js → index.jsx} +0 -0
- /package/src/components/block-alignment-control/{index.js → index.jsx} +0 -0
- /package/src/components/block-alignment-control/{ui.js → ui.jsx} +0 -0
- /package/src/components/block-alignment-matrix-control/{index.js → index.jsx} +0 -0
- /package/src/components/block-allowed-blocks/{allowed-blocks-control.js → allowed-blocks-control.jsx} +0 -0
- /package/src/components/block-bindings/{attribute-control.js → attribute-control.jsx} +0 -0
- /package/src/components/block-bindings/{source-fields-list.js → source-fields-list.jsx} +0 -0
- /package/src/components/block-breadcrumb/{index.js → index.jsx} +0 -0
- /package/src/components/block-canvas/{index.js → index.jsx} +0 -0
- /package/src/components/block-card/{index.js → index.jsx} +0 -0
- /package/src/components/block-compare/{block-view.js → block-view.jsx} +0 -0
- /package/src/components/block-compare/{index.js → index.jsx} +0 -0
- /package/src/components/block-context/{index.js → index.jsx} +0 -0
- /package/src/components/block-controls/{fill.js → fill.jsx} +0 -0
- /package/src/components/block-controls/{index.js → index.jsx} +0 -0
- /package/src/components/block-controls/{slot.js → slot.jsx} +0 -0
- /package/src/components/block-draggable/{draggable-chip.js → draggable-chip.jsx} +0 -0
- /package/src/components/block-draggable/{index.js → index.jsx} +0 -0
- /package/src/components/block-edit/{index.js → index.jsx} +0 -0
- /package/src/components/block-edit/{multiple-usage-warning.js → multiple-usage-warning.jsx} +0 -0
- /package/src/components/block-edit-visually-button/{index.js → index.jsx} +0 -0
- /package/src/components/block-full-height-alignment-control/{index.js → index.jsx} +0 -0
- /package/src/components/block-heading-level-dropdown/{heading-level-icon.js → heading-level-icon.jsx} +0 -0
- /package/src/components/block-heading-level-dropdown/{index.js → index.jsx} +0 -0
- /package/src/components/block-icon/{index.js → index.jsx} +0 -0
- /package/src/components/block-icon/test/{index.js → index.jsdom.test.jsx} +0 -0
- /package/src/components/block-inspector/{edit-contents.js → edit-contents.jsx} +0 -0
- /package/src/components/block-keyboard-shortcuts/{index.js → index.jsx} +0 -0
- /package/src/components/block-list/{block-crash-warning.js → block-crash-warning.jsx} +0 -0
- /package/src/components/block-list/{block-html.js → block-html.jsx} +0 -0
- /package/src/components/block-list/{block-invalid-warning.js → block-invalid-warning.jsx} +0 -0
- /package/src/components/block-list/{block.js → block.jsx} +0 -0
- /package/src/components/block-list/{index.js → index.jsx} +0 -0
- /package/src/components/block-list/{layout.js → layout.jsx} +0 -0
- /package/src/components/block-list/{subdirectory-icon.js → subdirectory-icon.jsx} +0 -0
- /package/src/components/block-list/{zoom-out-separator.js → zoom-out-separator.jsx} +0 -0
- /package/src/components/block-list-appender/{index.js → index.jsx} +0 -0
- /package/src/components/block-lock/{menu-item.js → menu-item.jsx} +0 -0
- /package/src/components/block-lock/{modal.js → modal.jsx} +0 -0
- /package/src/components/block-lock/{toolbar.js → toolbar.jsx} +0 -0
- /package/src/components/block-manager/{category.js → category.jsx} +0 -0
- /package/src/components/block-manager/{checklist.js → checklist.jsx} +0 -0
- /package/src/components/block-manager/{index.js → index.jsx} +0 -0
- /package/src/components/block-mover/{button.js → button.jsx} +0 -0
- /package/src/components/block-mover/{index.js → index.jsx} +0 -0
- /package/src/components/block-navigation/{dropdown.js → dropdown.jsx} +0 -0
- /package/src/components/block-parent-selector/{index.js → index.jsx} +0 -0
- /package/src/components/block-pattern-setup/{index.js → index.jsx} +0 -0
- /package/src/components/block-pattern-setup/{setup-toolbar.js → setup-toolbar.jsx} +0 -0
- /package/src/components/block-patterns-list/{index.js → index.jsx} +0 -0
- /package/src/components/block-patterns-paging/{index.js → index.jsx} +0 -0
- /package/src/components/block-popover/{cover.js → cover.jsx} +0 -0
- /package/src/components/block-popover/{drop-zone.js → drop-zone.jsx} +0 -0
- /package/src/components/block-popover/{inbetween.js → inbetween.jsx} +0 -0
- /package/src/components/block-popover/{index.js → index.jsx} +0 -0
- /package/src/components/block-preview/{auto.js → auto.jsx} +0 -0
- /package/src/components/block-quick-navigation/{index.js → index.jsx} +0 -0
- /package/src/components/block-removal-warning-modal/{index.js → index.jsx} +0 -0
- /package/src/components/block-rename/{modal.js → modal.jsx} +0 -0
- /package/src/components/block-rename/{rename-control.js → rename-control.jsx} +0 -0
- /package/src/components/block-selection-clearer/{index.js → index.jsx} +0 -0
- /package/src/components/block-settings-menu/{block-html-convert-button.js → block-html-convert-button.jsx} +0 -0
- /package/src/components/block-settings-menu/{block-mode-toggle.js → block-mode-toggle.jsx} +0 -0
- /package/src/components/block-settings-menu/{block-parent-selector-menu-item.js → block-parent-selector-menu-item.jsx} +0 -0
- /package/src/components/block-settings-menu/{block-settings-dropdown.js → block-settings-dropdown.jsx} +0 -0
- /package/src/components/block-settings-menu/{index.js → index.jsx} +0 -0
- /package/src/components/block-settings-menu-controls/{index.js → index.jsx} +0 -0
- /package/src/components/block-styles/{index.js → index.jsx} +0 -0
- /package/src/components/block-styles/{menu-items.js → menu-items.jsx} +0 -0
- /package/src/components/block-switcher/{block-styles-menu.js → block-styles-menu.jsx} +0 -0
- /package/src/components/block-switcher/{block-transformations-menu.js → block-transformations-menu.jsx} +0 -0
- /package/src/components/block-switcher/{block-variation-transformations.js → block-variation-transformations.jsx} +0 -0
- /package/src/components/block-switcher/{pattern-transformations-menu.js → pattern-transformations-menu.jsx} +0 -0
- /package/src/components/block-switcher/{preview-block-popover.js → preview-block-popover.jsx} +0 -0
- /package/src/components/block-toolbar/{block-styles-dropdown.js → block-styles-dropdown.jsx} +0 -0
- /package/src/components/block-toolbar/{block-toolbar-icon.js → block-toolbar-icon.jsx} +0 -0
- /package/src/components/block-toolbar/{change-design.js → change-design.jsx} +0 -0
- /package/src/components/block-toolbar/{edit-section-button.js → edit-section-button.jsx} +0 -0
- /package/src/components/block-toolbar/{index.js → index.jsx} +0 -0
- /package/src/components/block-toolbar/{switch-section-style.js → switch-section-style.jsx} +0 -0
- /package/src/components/block-tools/{block-toolbar-popover.js → block-toolbar-popover.jsx} +0 -0
- /package/src/components/block-tools/{empty-block-inserter.js → empty-block-inserter.jsx} +0 -0
- /package/src/components/block-tools/{index.js → index.jsx} +0 -0
- /package/src/components/block-tools/{insertion-point.js → insertion-point.jsx} +0 -0
- /package/src/components/block-tools/{zoom-out-mode-inserter-button.js → zoom-out-mode-inserter-button.jsx} +0 -0
- /package/src/components/block-tools/{zoom-out-mode-inserters.js → zoom-out-mode-inserters.jsx} +0 -0
- /package/src/components/block-types-list/{index.js → index.jsx} +0 -0
- /package/src/components/block-variation-picker/{index.js → index.jsx} +0 -0
- /package/src/components/block-variation-transforms/{index.js → index.jsx} +0 -0
- /package/src/components/block-vertical-alignment-control/{index.js → index.jsx} +0 -0
- /package/src/components/block-vertical-alignment-control/{ui.js → ui.jsx} +0 -0
- /package/src/components/block-visibility/{modal.js → modal.jsx} +0 -0
- /package/src/components/block-visibility/{viewport-menu-item.js → viewport-menu-item.jsx} +0 -0
- /package/src/components/block-visibility/{viewport-toolbar.js → viewport-toolbar.jsx} +0 -0
- /package/src/components/block-visibility/{viewport-visibility-info.js → viewport-visibility-info.jsx} +0 -0
- /package/src/components/border-radius-control/{index.js → index.jsx} +0 -0
- /package/src/components/border-radius-control/{linked-button.js → linked-button.jsx} +0 -0
- /package/src/components/button-block-appender/{index.js → index.jsx} +0 -0
- /package/src/components/child-layout-control/{index.js → index.jsx} +0 -0
- /package/src/components/color-palette/{control.js → control.jsx} +0 -0
- /package/src/components/color-palette/{with-color-context.js → with-color-context.jsx} +0 -0
- /package/src/components/color-style-selector/{index.js → index.jsx} +0 -0
- /package/src/components/colors/{with-colors.js → with-colors.jsx} +0 -0
- /package/src/components/colors-gradients/{control.js → control.jsx} +0 -0
- /package/src/components/colors-gradients/{dropdown.js → dropdown.jsx} +0 -0
- /package/src/components/colors-gradients/{panel-color-gradient-settings.js → panel-color-gradient-settings.jsx} +0 -0
- /package/src/components/contrast-checker/{index.js → index.jsx} +0 -0
- /package/src/components/convert-to-group-buttons/{index.js → index.jsx} +0 -0
- /package/src/components/convert-to-group-buttons/{toolbar.js → toolbar.jsx} +0 -0
- /package/src/components/copy-handler/{index.js → index.jsx} +0 -0
- /package/src/components/date-format-picker/{index.js → index.jsx} +0 -0
- /package/src/components/default-block-appender/{index.js → index.jsx} +0 -0
- /package/src/components/dimension-control/{index.js → index.jsx} +0 -0
- /package/src/components/dimensions-tool/{aspect-ratio-tool.js → aspect-ratio-tool.jsx} +0 -0
- /package/src/components/dimensions-tool/{index.js → index.jsx} +0 -0
- /package/src/components/dimensions-tool/{scale-tool.js → scale-tool.jsx} +0 -0
- /package/src/components/dimensions-tool/{width-height-tool.js → width-height-tool.jsx} +0 -0
- /package/src/components/duotone-control/{index.js → index.jsx} +0 -0
- /package/src/components/editable-text/{index.js → index.jsx} +0 -0
- /package/src/components/editor-styles/{index.js → index.jsx} +0 -0
- /package/src/components/fit-text-size-warning/{index.js → index.jsx} +0 -0
- /package/src/components/font-appearance-control/{index.js → index.jsx} +0 -0
- /package/src/components/font-family/{index.js → index.jsx} +0 -0
- /package/src/components/font-sizes/{font-size-picker.js → font-size-picker.jsx} +0 -0
- /package/src/components/font-sizes/{with-font-sizes.js → with-font-sizes.jsx} +0 -0
- /package/src/components/global-styles/{advanced-panel.js → advanced-panel.jsx} +0 -0
- /package/src/components/global-styles/{color-gradient-dropdown-item.js → color-gradient-dropdown-item.jsx} +0 -0
- /package/src/components/global-styles/{color-panel.js → color-panel.jsx} +0 -0
- /package/src/components/global-styles/{dimensions-panel.js → dimensions-panel.jsx} +0 -0
- /package/src/components/global-styles/{filters-panel.js → filters-panel.jsx} +0 -0
- /package/src/components/global-styles/inheritance/{index.js → index.jsx} +0 -0
- /package/src/components/global-styles/{shadow-panel-components.js → shadow-panel-components.jsx} +0 -0
- /package/src/components/global-styles/{state-control-badges.js → state-control-badges.jsx} +0 -0
- /package/src/components/global-styles/{state-control.js → state-control.jsx} +0 -0
- /package/src/components/global-styles/{typography-panel.js → typography-panel.jsx} +0 -0
- /package/src/components/grid/{grid-item-movers.js → grid-item-movers.jsx} +0 -0
- /package/src/components/grid/{grid-item-resizer.js → grid-item-resizer.jsx} +0 -0
- /package/src/components/grid/{grid-visualizer.js → grid-visualizer.jsx} +0 -0
- /package/src/components/height-control/{index.js → index.jsx} +0 -0
- /package/src/components/html-element-control/{index.js → index.jsx} +0 -0
- /package/src/components/image-editor/{aspect-ratio-dropdown.js → aspect-ratio-dropdown.jsx} +0 -0
- /package/src/components/image-editor/{context.js → context.jsx} +0 -0
- /package/src/components/image-editor/{cropper.js → cropper.jsx} +0 -0
- /package/src/components/image-editor/{form-controls.js → form-controls.jsx} +0 -0
- /package/src/components/image-editor/{index.js → index.jsx} +0 -0
- /package/src/components/image-editor/{rotation-button.js → rotation-button.jsx} +0 -0
- /package/src/components/image-editor/{zoom-dropdown.js → zoom-dropdown.jsx} +0 -0
- /package/src/components/image-size-control/{index.js → index.jsx} +0 -0
- /package/src/components/inner-blocks/{button-block-appender.js → button-block-appender.jsx} +0 -0
- /package/src/components/inner-blocks/{default-block-appender.js → default-block-appender.jsx} +0 -0
- /package/src/components/inner-blocks/{index.js → index.jsx} +0 -0
- /package/src/components/inner-content/{index.js → index.jsx} +0 -0
- /package/src/components/inserter/block-patterns-explorer/{index.js → index.jsx} +0 -0
- /package/src/components/inserter/block-patterns-explorer/{pattern-explorer-sidebar.js → pattern-explorer-sidebar.jsx} +0 -0
- /package/src/components/inserter/block-patterns-explorer/{pattern-list.js → pattern-list.jsx} +0 -0
- /package/src/components/inserter/block-patterns-tab/{index.js → index.jsx} +0 -0
- /package/src/components/inserter/block-patterns-tab/{pattern-category-previews.js → pattern-category-previews.jsx} +0 -0
- /package/src/components/inserter/block-patterns-tab/{patterns-filter.js → patterns-filter.jsx} +0 -0
- /package/src/components/inserter/{block-types-tab.js → block-types-tab.jsx} +0 -0
- /package/src/components/inserter/category-tabs/{index.js → index.jsx} +0 -0
- /package/src/components/inserter/{index.js → index.jsx} +0 -0
- /package/src/components/inserter/{library.js → library.jsx} +0 -0
- /package/src/components/inserter/media-tab/{media-list.js → media-list.jsx} +0 -0
- /package/src/components/inserter/media-tab/{media-panel.js → media-panel.jsx} +0 -0
- /package/src/components/inserter/media-tab/{media-preview.js → media-preview.jsx} +0 -0
- /package/src/components/inserter/media-tab/{media-tab.js → media-tab.jsx} +0 -0
- /package/src/components/inserter/media-tab/{utils.js → utils.jsx} +0 -0
- /package/src/components/inserter/{mobile-tab-navigation.js → mobile-tab-navigation.jsx} +0 -0
- /package/src/components/inserter/{no-results.js → no-results.jsx} +0 -0
- /package/src/components/inserter/{panel.js → panel.jsx} +0 -0
- /package/src/components/inserter/{preview-panel.js → preview-panel.jsx} +0 -0
- /package/src/components/inserter/{quick-inserter.js → quick-inserter.jsx} +0 -0
- /package/src/components/inserter/{search-results.js → search-results.jsx} +0 -0
- /package/src/components/inserter/{tips.js → tips.jsx} +0 -0
- /package/src/components/inserter-list-item/{index.js → index.jsx} +0 -0
- /package/src/components/inserter-listbox/{group.js → group.jsx} +0 -0
- /package/src/components/inserter-listbox/{index.js → index.jsx} +0 -0
- /package/src/components/inserter-listbox/{item.js → item.jsx} +0 -0
- /package/src/components/inserter-listbox/{row.js → row.jsx} +0 -0
- /package/src/components/inspector-controls/{block-support-slot-container.js → block-support-slot-container.jsx} +0 -0
- /package/src/components/inspector-controls/{block-support-tools-panel.js → block-support-tools-panel.jsx} +0 -0
- /package/src/components/inspector-controls/{fill.js → fill.jsx} +0 -0
- /package/src/components/inspector-controls/{index.js → index.jsx} +0 -0
- /package/src/components/inspector-controls/{last-item.js → last-item.jsx} +0 -0
- /package/src/components/inspector-controls/{list-view-content-popover.js → list-view-content-popover.jsx} +0 -0
- /package/src/components/inspector-controls/{slot.js → slot.jsx} +0 -0
- /package/src/components/inspector-controls-tabs/{advanced-controls-panel.js → advanced-controls-panel.jsx} +0 -0
- /package/src/components/inspector-controls-tabs/{index.js → index.jsx} +0 -0
- /package/src/components/inspector-controls-tabs/{position-controls-panel.js → position-controls-panel.jsx} +0 -0
- /package/src/components/inspector-controls-tabs/{settings-tab.js → settings-tab.jsx} +0 -0
- /package/src/components/justify-content-control/{index.js → index.jsx} +0 -0
- /package/src/components/justify-content-control/{ui.js → ui.jsx} +0 -0
- /package/src/components/letter-spacing-control/{index.js → index.jsx} +0 -0
- /package/src/components/line-height-control/{index.js → index.jsx} +0 -0
- /package/src/components/link-control/{link-preview.js → link-preview.jsx} +0 -0
- /package/src/components/link-control/{search-create-button.js → search-create-button.jsx} +0 -0
- /package/src/components/link-control/{search-item.js → search-item.jsx} +0 -0
- /package/src/components/link-control/{search-results.js → search-results.jsx} +0 -0
- /package/src/components/link-control/{settings-drawer.js → settings-drawer.jsx} +0 -0
- /package/src/components/link-control/{settings.js → settings.jsx} +0 -0
- /package/src/components/link-picker/{link-picker.js → link-picker.jsx} +0 -0
- /package/src/components/link-picker/{link-preview.js → link-preview.jsx} +0 -0
- /package/src/components/list-view/{appender.js → appender.jsx} +0 -0
- /package/src/components/list-view/{aria-referenced-text.js → aria-referenced-text.jsx} +0 -0
- /package/src/components/list-view/{block-contents.js → block-contents.jsx} +0 -0
- /package/src/components/list-view/{branch.js → branch.jsx} +0 -0
- /package/src/components/list-view/{drop-indicator.js → drop-indicator.jsx} +0 -0
- /package/src/components/list-view/{expander.js → expander.jsx} +0 -0
- /package/src/components/list-view/{index.js → index.jsx} +0 -0
- /package/src/components/list-view/{leaf.js → leaf.jsx} +0 -0
- /package/src/components/media-placeholder/{index.js → index.jsx} +0 -0
- /package/src/components/multi-selection-inspector/{index.js → index.jsx} +0 -0
- /package/src/components/observe-typing/{index.js → index.jsx} +0 -0
- /package/src/components/panel-color-settings/{index.js → index.jsx} +0 -0
- /package/src/components/plain-text/{index.js → index.jsx} +0 -0
- /package/src/components/preset-input-control/{custom-value-controls.js → custom-value-controls.jsx} +0 -0
- /package/src/components/preset-input-control/{index.js → index.jsx} +0 -0
- /package/src/components/provider/{block-refs-provider.js → block-refs-provider.jsx} +0 -0
- /package/src/components/provider/{with-registry-provider.js → with-registry-provider.jsx} +0 -0
- /package/src/components/publish-date-time-picker/{index.js → index.jsx} +0 -0
- /package/src/components/recursion-provider/{index.js → index.jsx} +0 -0
- /package/src/components/resizable-box-popover/{index.js → index.jsx} +0 -0
- /package/src/components/resolution-tool/{index.js → index.jsx} +0 -0
- /package/src/components/responsive-block-control/{index.js → index.jsx} +0 -0
- /package/src/components/responsive-block-control/{label.js → label.jsx} +0 -0
- /package/src/components/rich-text/{content.js → content.jsx} +0 -0
- /package/src/components/rich-text/{format-edit.js → format-edit.jsx} +0 -0
- /package/src/components/rich-text/format-toolbar/{index.js → index.jsx} +0 -0
- /package/src/components/rich-text/{format-toolbar-container.js → format-toolbar-container.jsx} +0 -0
- /package/src/components/rich-text/{get-rich-text-values.js → get-rich-text-values.jsx} +0 -0
- /package/src/components/rich-text/{index.js → index.jsx} +0 -0
- /package/src/components/rich-text/{multiline.js → multiline.jsx} +0 -0
- /package/src/components/rich-text/{toolbar-button.js → toolbar-button.jsx} +0 -0
- /package/src/components/rich-text/{utils.js → utils.jsx} +0 -0
- /package/src/components/rich-text/{with-deprecations.js → with-deprecations.jsx} +0 -0
- /package/src/components/skip-to-selected-block/{index.js → index.jsx} +0 -0
- /package/src/components/spacing-sizes-control/{index.js → index.jsx} +0 -0
- /package/src/components/spacing-sizes-control/input-controls/{axial.js → axial.jsx} +0 -0
- /package/src/components/spacing-sizes-control/input-controls/{separated.js → separated.jsx} +0 -0
- /package/src/components/spacing-sizes-control/input-controls/{single.js → single.jsx} +0 -0
- /package/src/components/spacing-sizes-control/input-controls/{spacing-input-control.js → spacing-input-control.jsx} +0 -0
- /package/src/components/spacing-sizes-control/{linked-button.js → linked-button.jsx} +0 -0
- /package/src/components/tabbed-sidebar/{index.js → index.jsx} +0 -0
- /package/src/components/text-alignment-control/{index.js → index.jsx} +0 -0
- /package/src/components/text-decoration-control/{index.js → index.jsx} +0 -0
- /package/src/components/text-indent-control/{index.js → index.jsx} +0 -0
- /package/src/components/text-transform-control/{index.js → index.jsx} +0 -0
- /package/src/components/typewriter/{index.js → index.jsx} +0 -0
- /package/src/components/unit-control/{index.js → index.jsx} +0 -0
- /package/src/components/url-input/{button.js → button.jsx} +0 -0
- /package/src/components/url-input/{index.js → index.jsx} +0 -0
- /package/src/components/url-popover/{image-url-input-ui.js → image-url-input-ui.jsx} +0 -0
- /package/src/components/url-popover/{index.js → index.jsx} +0 -0
- /package/src/components/url-popover/{link-editor.js → link-editor.jsx} +0 -0
- /package/src/components/url-popover/{link-viewer-url.js → link-viewer-url.jsx} +0 -0
- /package/src/components/url-popover/{link-viewer.js → link-viewer.jsx} +0 -0
- /package/src/components/warning/{index.js → index.jsx} +0 -0
- /package/src/components/writing-mode-control/{index.js → index.jsx} +0 -0
- /package/src/hooks/{align.js → align.jsx} +0 -0
- /package/src/hooks/{allowed-blocks.js → allowed-blocks.jsx} +0 -0
- /package/src/hooks/{anchor.js → anchor.jsx} +0 -0
- /package/src/hooks/{auto-inspector-controls.js → auto-inspector-controls.jsx} +0 -0
- /package/src/hooks/{background.js → background.jsx} +0 -0
- /package/src/hooks/{block-bindings.js → block-bindings.jsx} +0 -0
- /package/src/hooks/{block-hooks.js → block-hooks.jsx} +0 -0
- /package/src/hooks/{block-style-variation.js → block-style-variation.jsx} +0 -0
- /package/src/hooks/{custom-class-name.js → custom-class-name.jsx} +0 -0
- /package/src/hooks/{custom-css.js → custom-css.jsx} +0 -0
- /package/src/hooks/{dimensions.js → dimensions.jsx} +0 -0
- /package/src/hooks/{duotone.js → duotone.jsx} +0 -0
- /package/src/hooks/{elements.js → elements.jsx} +0 -0
- /package/src/hooks/{fit-text.js → fit-text.jsx} +0 -0
- /package/src/hooks/{font-size.js → font-size.jsx} +0 -0
- /package/src/hooks/{layout-child.js → layout-child.jsx} +0 -0
- /package/src/hooks/{layout.js → layout.jsx} +0 -0
- /package/src/hooks/{line-height.js → line-height.jsx} +0 -0
- /package/src/hooks/{list-view.js → list-view.jsx} +0 -0
- /package/src/hooks/{spacing-visualizer.js → spacing-visualizer.jsx} +0 -0
- /package/src/hooks/{states.js → states.jsx} +0 -0
- /package/src/hooks/{text-align.js → text-align.jsx} +0 -0
- /package/src/hooks/{typography.js → typography.jsx} +0 -0
- /package/src/hooks/{utils.js → utils.jsx} +0 -0
- /package/src/layouts/{constrained.js → constrained.jsx} +0 -0
- /package/src/layouts/{grid.js → grid.jsx} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/writing-flow/use-arrow-nav.js"],
|
|
4
|
-
"sourcesContent": ["import {\n\tcomputeCaretRect,\n\tfocus,\n\tisHorizontalEdge,\n\tisVerticalEdge,\n\tplaceCaretAtHorizontalEdge,\n\tplaceCaretAtVerticalEdge,\n\tisRTL,\n\tisFormElement,\n} from '@wordpress/dom';\nimport { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tgetBlockClientId,\n\tgetSelectionEditableElement,\n\tisInSameBlock,\n} from '../../utils/dom';\nimport { store as blockEditorStore } from '../../store';\nimport { setContentEditableWrapper } from './utils';\n\n/**\n * Returns true if the element should consider edge navigation upon a keyboard\n * event of the given directional key code, or false otherwise.\n *\n * @param {Element} element HTML element to test.\n * @param {number} keyCode KeyboardEvent keyCode to test.\n * @param {boolean} hasModifier Whether a modifier is pressed.\n *\n * @return {boolean} Whether element should consider edge navigation.\n */\nexport function isNavigationCandidate( element, keyCode, hasModifier ) {\n\tconst isVertical = keyCode === UP || keyCode === DOWN;\n\tconst { tagName } = element;\n\tconst elementType = element.getAttribute( 'type' );\n\n\t// Native inputs should not navigate vertically, unless they are simple types that don't need up/down arrow keys.\n\tif ( isVertical && ! hasModifier ) {\n\t\tif ( tagName === 'INPUT' ) {\n\t\t\tconst verticalInputTypes = [\n\t\t\t\t'date',\n\t\t\t\t'datetime-local',\n\t\t\t\t'month',\n\t\t\t\t'number',\n\t\t\t\t'range',\n\t\t\t\t'time',\n\t\t\t\t'week',\n\t\t\t];\n\t\t\treturn ! verticalInputTypes.includes( elementType );\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Native inputs should not navigate horizontally, unless they are simple types that don't need left/right arrow keys.\n\tif ( tagName === 'INPUT' ) {\n\t\tconst simpleInputTypes = [\n\t\t\t'button',\n\t\t\t'checkbox',\n\t\t\t'number',\n\t\t\t'color',\n\t\t\t'file',\n\t\t\t'image',\n\t\t\t'radio',\n\t\t\t'reset',\n\t\t\t'submit',\n\t\t];\n\t\treturn simpleInputTypes.includes( elementType );\n\t}\n\n\t// Native textareas should not navigate horizontally.\n\treturn tagName !== 'TEXTAREA';\n}\n\n/**\n * Returns the optimal tab target from the given focused element in the desired\n * direction. A preference is made toward text fields, falling back to the block\n * focus stop if no other candidates exist for the block.\n *\n * @param {Element} target Currently focused text field.\n * @param {boolean} isReverse True if considering as the first field.\n * @param {Element} containerElement Element containing all blocks.\n * @param {boolean} onlyVertical Whether to only consider tabbable elements\n * that are visually above or under the\n * target.\n *\n * @return {?Element} Optimal tab target, if one exists.\n */\nexport function getClosestTabbable(\n\ttarget,\n\tisReverse,\n\tcontainerElement,\n\tonlyVertical\n) {\n\t// Since the current focus target is not guaranteed to be a text field, find\n\t// all focusables. Tabbability is considered later.\n\tlet focusableNodes = focus.focusable.find( containerElement );\n\n\tif ( isReverse ) {\n\t\tfocusableNodes.reverse();\n\t}\n\n\t// Consider as candidates those focusables after the current target. It's\n\t// assumed this can only be reached if the target is focusable (on its\n\t// keydown event), so no need to verify it exists in the set.\n\tfocusableNodes = focusableNodes.slice(\n\t\tfocusableNodes.indexOf( target ) + 1\n\t);\n\n\tlet targetRect;\n\n\tif ( onlyVertical ) {\n\t\ttargetRect = target.getBoundingClientRect();\n\t}\n\n\tfunction isTabCandidate( node ) {\n\t\t// Skip if there's only one child that is content editable (and thus a\n\t\t// better candidate).\n\t\tif (\n\t\t\tnode.children.length === 1 &&\n\t\t\tisInSameBlock( node, node.firstElementChild ) &&\n\t\t\tnode.firstElementChild.getAttribute( 'contenteditable' ) === 'true'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Wrappers that merge with the text flow dissolve into it: their\n\t\t// content is the better candidate. Any other container is a\n\t\t// boundary the caret stops on.\n\t\tconst blockType = getBlockType( node.getAttribute( 'data-type' ) );\n\t\tif (\n\t\t\tnode.contentEditable !== 'true' &&\n\t\t\tgetBlockClientId( node ) &&\n\t\t\tblockType &&\n\t\t\t( blockType.merge ||\n\t\t\t\thasBlockSupport( blockType, '__experimentalOnMerge' ) ) &&\n\t\t\tfocus.focusable\n\t\t\t\t.find( node )\n\t\t\t\t// Exclude form elements for now because primary+a cannot be\n\t\t\t\t// used to select the parent element.\n\t\t\t\t.filter( ( element ) => ! isFormElement( element ) ).length !==\n\t\t\t\t0\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Not a candidate if the node is not tabbable.\n\t\tif ( ! focus.tabbable.isTabbableIndex( node ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Skip focusable elements such as links within content editable\n\t\t// nodes: nodes whose closest editable host is an editable element\n\t\t// within a block. When an editable root (e.g. the canvas wrapper)\n\t\t// is the editing host, everything within it is content editable,\n\t\t// but focusables like block wrappers are not text content.\n\t\tif (\n\t\t\tnode.isContentEditable &&\n\t\t\tnode.contentEditable !== 'true' &&\n\t\t\tgetBlockClientId( node.closest( '[contenteditable=\"true\"]' ) )\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( onlyVertical ) {\n\t\t\tconst nodeRect = node.getBoundingClientRect();\n\n\t\t\tif (\n\t\t\t\tnodeRect.left >= targetRect.right ||\n\t\t\t\tnodeRect.right <= targetRect.left\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn focusableNodes.find( isTabCandidate );\n}\n\nexport default function useArrowNav() {\n\tconst {\n\t\tgetMultiSelectedBlocksStartClientId,\n\t\tgetMultiSelectedBlocksEndClientId,\n\t\tgetNextBlockClientId,\n\t\tgetPreviousBlockClientId,\n\t\tgetSelectedBlockClientId,\n\t\tgetSelectionStart,\n\t\tgetSettings,\n\t\thasMultiSelection,\n\t\t__unstableIsFullySelected,\n\t} = useSelect( blockEditorStore );\n\tconst { selectBlock, multiSelect } = useDispatch( blockEditorStore );\n\treturn useRefEffect( ( node ) => {\n\t\t// Here a DOMRect is stored while moving the caret vertically so\n\t\t// vertical position of the start position can be restored. This is to\n\t\t// recreate browser behaviour across blocks.\n\t\tlet verticalRect;\n\n\t\tfunction onMouseDown() {\n\t\t\tverticalRect = null;\n\t\t}\n\n\t\tfunction isClosestTabbableABlock( target, isReverse ) {\n\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\ttarget,\n\t\t\t\tisReverse,\n\t\t\t\tnode\n\t\t\t);\n\t\t\treturn closestTabbable && getBlockClientId( closestTabbable );\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\t// Abort if navigation has already been handled (e.g. RichText\n\t\t\t// inline boundaries).\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { keyCode, shiftKey, ctrlKey, altKey, metaKey } = event;\n\t\t\t// When the wrapper is contentEditable and holds focus (the\n\t\t\t// selected block supports `editableRoot`), the event targets the\n\t\t\t// wrapper; resolve the editable element containing the selection.\n\t\t\tconst target =\n\t\t\t\t( event.target === node &&\n\t\t\t\t\tgetSelectionEditableElement(\n\t\t\t\t\t\tnode.ownerDocument.defaultView.getSelection(),\n\t\t\t\t\t\tnode\n\t\t\t\t\t) ) ||\n\t\t\t\tevent.target;\n\t\t\tconst isUp = keyCode === UP;\n\t\t\tconst isDown = keyCode === DOWN;\n\t\t\tconst isLeft = keyCode === LEFT;\n\t\t\tconst isRight = keyCode === RIGHT;\n\t\t\tconst isReverse = isUp || isLeft;\n\t\t\tconst isHorizontal = isLeft || isRight;\n\t\t\tconst isVertical = isUp || isDown;\n\t\t\tconst isNav = isHorizontal || isVertical;\n\t\t\tconst hasModifier = shiftKey || ctrlKey || altKey || metaKey;\n\t\t\tconst isNavEdge = isVertical ? isVerticalEdge : isHorizontalEdge;\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\tif ( ! isNav ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// In preview mode, navigation is handled by useSelectableBlocksNav.\n\t\t\tif ( getSettings().isPreviewMode ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If there is a multi-selection, the arrow keys should collapse the\n\t\t\t// selection to the start or end of the selection.\n\t\t\tif ( hasMultiSelection() ) {\n\t\t\t\tif ( shiftKey ) {\n\t\t\t\t\t// A fully selected multi-selection has no native\n\t\t\t\t\t// selection to extend (use-multi-selection cleared it),\n\t\t\t\t\t// so grow or shrink it by one block at the focus end.\n\t\t\t\t\t// Only without a usable native selection: a selection\n\t\t\t\t\t// that is fully selected because it resolves to a\n\t\t\t\t\t// nesting ancestor keeps its native selection, which\n\t\t\t\t\t// the browser extends natively (and the observer\n\t\t\t\t\t// promotes to the common level).\n\t\t\t\t\tconst selection = defaultView.getSelection();\n\t\t\t\t\tif (\n\t\t\t\t\t\t__unstableIsFullySelected() &&\n\t\t\t\t\t\t( ! selection.rangeCount || selection.isCollapsed )\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst anchorClientId =\n\t\t\t\t\t\t\tgetMultiSelectedBlocksStartClientId();\n\t\t\t\t\t\tconst focusClientId =\n\t\t\t\t\t\t\tgetMultiSelectedBlocksEndClientId();\n\t\t\t\t\t\tconst nextClientId = isReverse\n\t\t\t\t\t\t\t? getPreviousBlockClientId( focusClientId )\n\t\t\t\t\t\t\t: getNextBlockClientId( focusClientId );\n\n\t\t\t\t\t\tif ( nextClientId ) {\n\t\t\t\t\t\t\tmultiSelect( anchorClientId, nextClientId );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle if we have a full selection (not a native partial\n\t\t\t\t// selection).\n\t\t\t\tif ( ! __unstableIsFullySelected() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif ( isReverse ) {\n\t\t\t\t\tselectBlock( getMultiSelectedBlocksStartClientId() );\n\t\t\t\t} else {\n\t\t\t\t\tselectBlock( getMultiSelectedBlocksEndClientId(), -1 );\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// A block selected without a text selection within it (e.g. an\n\t\t\t// image or spacer) has no native selection to extend: start a\n\t\t\t// block multi-selection with the adjacent block.\n\t\t\tif (\n\t\t\t\tshiftKey &&\n\t\t\t\tgetSelectedBlockClientId() &&\n\t\t\t\t! getSelectionStart().attributeKey\n\t\t\t) {\n\t\t\t\tconst selectedClientId = getSelectedBlockClientId();\n\t\t\t\tconst nextClientId = isReverse\n\t\t\t\t\t? getPreviousBlockClientId( selectedClientId )\n\t\t\t\t\t: getNextBlockClientId( selectedClientId );\n\n\t\t\t\tif ( nextClientId ) {\n\t\t\t\t\tmultiSelect( selectedClientId, nextClientId );\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Abort if our current target is not a candidate for navigation\n\t\t\t// (e.g. preserve native input behaviors).\n\t\t\tif ( ! isNavigationCandidate( target, keyCode, hasModifier ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// When presing any key other than up or down, the initial vertical\n\t\t\t// position must ALWAYS be reset. The vertical position is saved so\n\t\t\t// it can be restored as well as possible on sebsequent vertical\n\t\t\t// arrow key presses. It may not always be possible to restore the\n\t\t\t// exact same position (such as at an empty line), so it wouldn't be\n\t\t\t// good to compute the position right before any vertical arrow key\n\t\t\t// press.\n\t\t\tif ( ! isVertical ) {\n\t\t\t\tverticalRect = null;\n\t\t\t} else if ( ! verticalRect ) {\n\t\t\t\tverticalRect = computeCaretRect( defaultView );\n\t\t\t}\n\n\t\t\t// In the case of RTL scripts, right means previous and left means\n\t\t\t// next, which is the exact reverse of LTR.\n\t\t\tconst isReverseDir = isRTL( target ) ? ! isReverse : isReverse;\n\t\t\tconst { keepCaretInsideBlock } = getSettings();\n\n\t\t\tif ( shiftKey ) {\n\t\t\t\tif ( isNavEdge( target, isReverse ) ) {\n\t\t\t\t\tif ( isClosestTabbableABlock( target, isReverse ) ) {\n\t\t\t\t\t\tsetContentEditableWrapper( node, true );\n\t\t\t\t\t} else if ( node.contentEditable === 'true' ) {\n\t\t\t\t\t\t// There is no block to extend the selection into.\n\t\t\t\t\t\t// Within an editable wrapper the selection could\n\t\t\t\t\t\t// natively escape into surrounding editable elements\n\t\t\t\t\t\t// (e.g. the post title), so keep it inside the block\n\t\t\t\t\t\t// by extending it to the block's edge.\n\t\t\t\t\t\tconst selection = defaultView.getSelection();\n\t\t\t\t\t\tselection.extend(\n\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\tisReverse ? 0 : target.childNodes.length\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tisVertical &&\n\t\t\t\tisVerticalEdge( target, isReverse ) &&\n\t\t\t\t// When Alt is pressed, only intercept if the caret is also at\n\t\t\t\t// the horizontal edge.\n\t\t\t\t( altKey ? isHorizontalEdge( target, isReverseDir ) : true ) &&\n\t\t\t\t! keepCaretInsideBlock\n\t\t\t) {\n\t\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\t\ttarget,\n\t\t\t\t\tisReverse,\n\t\t\t\t\tnode,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\n\t\t\t\tif ( closestTabbable ) {\n\t\t\t\t\tplaceCaretAtVerticalEdge(\n\t\t\t\t\t\tclosestTabbable,\n\t\t\t\t\t\t// When Alt is pressed, place the caret at the furthest\n\t\t\t\t\t\t// horizontal edge and the furthest vertical edge.\n\t\t\t\t\t\taltKey ? ! isReverse : isReverse,\n\t\t\t\t\t\taltKey ? undefined : verticalRect\n\t\t\t\t\t);\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tisHorizontal &&\n\t\t\t\tdefaultView.getSelection().isCollapsed &&\n\t\t\t\tisHorizontalEdge( target, isReverseDir ) &&\n\t\t\t\t! keepCaretInsideBlock\n\t\t\t) {\n\t\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\t\ttarget,\n\t\t\t\t\tisReverseDir,\n\t\t\t\t\tnode\n\t\t\t\t);\n\t\t\t\tplaceCaretAtHorizontalEdge( closestTabbable, isReverse );\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n"],
|
|
4
|
+
"sourcesContent": ["import {\n\tcomputeCaretRect,\n\tfocus,\n\tisHorizontalEdge,\n\tisVerticalEdge,\n\tplaceCaretAtHorizontalEdge,\n\tplaceCaretAtVerticalEdge,\n\tisRTL,\n\tisFormElement,\n} from '@wordpress/dom';\nimport { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tgetBlockClientId,\n\tgetSelectionEditableElement,\n\tisInSameBlock,\n} from '../../utils/dom';\nimport { store as blockEditorStore } from '../../store';\nimport { setContentEditableWrapper } from './utils';\n\n/**\n * Returns true if the element should consider edge navigation upon a keyboard\n * event of the given directional key code, or false otherwise.\n *\n * @param {Element} element HTML element to test.\n * @param {number} keyCode KeyboardEvent keyCode to test.\n * @param {boolean} hasModifier Whether a modifier is pressed.\n *\n * @return {boolean} Whether element should consider edge navigation.\n */\nexport function isNavigationCandidate( element, keyCode, hasModifier ) {\n\tconst isVertical = keyCode === UP || keyCode === DOWN;\n\tconst { tagName } = element;\n\tconst elementType = element.getAttribute( 'type' );\n\n\t// Native inputs should not navigate vertically, unless they are simple types that don't need up/down arrow keys.\n\tif ( isVertical && ! hasModifier ) {\n\t\tif ( tagName === 'INPUT' ) {\n\t\t\tconst verticalInputTypes = [\n\t\t\t\t'date',\n\t\t\t\t'datetime-local',\n\t\t\t\t'month',\n\t\t\t\t'number',\n\t\t\t\t'range',\n\t\t\t\t'time',\n\t\t\t\t'week',\n\t\t\t];\n\t\t\treturn ! verticalInputTypes.includes( elementType );\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Native inputs should not navigate horizontally, unless they are simple types that don't need left/right arrow keys.\n\tif ( tagName === 'INPUT' ) {\n\t\tconst simpleInputTypes = [\n\t\t\t'button',\n\t\t\t'checkbox',\n\t\t\t'number',\n\t\t\t'color',\n\t\t\t'file',\n\t\t\t'image',\n\t\t\t'radio',\n\t\t\t'reset',\n\t\t\t'submit',\n\t\t];\n\t\treturn simpleInputTypes.includes( elementType );\n\t}\n\n\t// Native textareas should not navigate horizontally.\n\treturn tagName !== 'TEXTAREA';\n}\n\n/**\n * Returns the optimal tab target from the given focused element in the desired\n * direction. A preference is made toward text fields, falling back to the block\n * focus stop if no other candidates exist for the block.\n *\n * @param {Element} target Currently focused text field.\n * @param {boolean} isReverse True if considering as the first field.\n * @param {Element} containerElement Element containing all blocks.\n * @param {boolean} onlyVertical Whether to only consider tabbable elements\n * that are visually above or under the\n * target.\n *\n * @return {?Element} Optimal tab target, if one exists.\n */\nexport function getClosestTabbable(\n\ttarget,\n\tisReverse,\n\tcontainerElement,\n\tonlyVertical\n) {\n\t// Since the current focus target is not guaranteed to be a text field, find\n\t// all focusables. Tabbability is considered later.\n\tlet focusableNodes = focus.focusable.find( containerElement );\n\n\tif ( isReverse ) {\n\t\tfocusableNodes.reverse();\n\t}\n\n\t// Consider as candidates those focusables after the current target. It's\n\t// assumed this can only be reached if the target is focusable (on its\n\t// keydown event), so no need to verify it exists in the set.\n\tfocusableNodes = focusableNodes.slice(\n\t\tfocusableNodes.indexOf( target ) + 1\n\t);\n\n\tlet targetRect;\n\n\tif ( onlyVertical ) {\n\t\ttargetRect = target.getBoundingClientRect();\n\t}\n\n\tfunction isTabCandidate( node ) {\n\t\t// Skip if there's only one child that is content editable (and thus a\n\t\t// better candidate).\n\t\tif (\n\t\t\tnode.children.length === 1 &&\n\t\t\tisInSameBlock( node, node.firstElementChild ) &&\n\t\t\tnode.firstElementChild.getAttribute( 'contenteditable' ) === 'true'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Wrappers that merge with the text flow dissolve into it: their\n\t\t// content is the better candidate. Any other container is a\n\t\t// boundary the caret stops on.\n\t\tconst blockType = getBlockType( node.getAttribute( 'data-type' ) );\n\t\tif (\n\t\t\tnode.contentEditable !== 'true' &&\n\t\t\tgetBlockClientId( node ) &&\n\t\t\tblockType &&\n\t\t\t( blockType.merge ||\n\t\t\t\thasBlockSupport( blockType, '__experimentalOnMerge' ) ) &&\n\t\t\tfocus.focusable\n\t\t\t\t.find( node )\n\t\t\t\t// Exclude form elements for now because primary+a cannot be\n\t\t\t\t// used to select the parent element.\n\t\t\t\t.filter( ( element ) => ! isFormElement( element ) ).length !==\n\t\t\t\t0\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Not a candidate if the node is not tabbable.\n\t\tif ( ! focus.tabbable.isTabbableIndex( node ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Skip focusable elements such as links within content editable\n\t\t// nodes: nodes whose closest editable host is an editable element\n\t\t// within a block. When an editable root (e.g. the canvas wrapper)\n\t\t// is the editing host, everything within it is content editable,\n\t\t// but focusables like block wrappers are not text content.\n\t\tif (\n\t\t\tnode.isContentEditable &&\n\t\t\tnode.contentEditable !== 'true' &&\n\t\t\tgetBlockClientId( node.closest( '[contenteditable=\"true\"]' ) )\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( onlyVertical ) {\n\t\t\tconst nodeRect = node.getBoundingClientRect();\n\n\t\t\tif (\n\t\t\t\tnodeRect.left >= targetRect.right ||\n\t\t\t\tnodeRect.right <= targetRect.left\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn focusableNodes.find( isTabCandidate );\n}\n\nexport default function useArrowNav() {\n\tconst {\n\t\tgetMultiSelectedBlocksStartClientId,\n\t\tgetMultiSelectedBlocksEndClientId,\n\t\tgetNextBlockClientId,\n\t\tgetPreviousBlockClientId,\n\t\tgetSelectedBlockClientId,\n\t\tgetSelectionStart,\n\t\tgetSettings,\n\t\thasMultiSelection,\n\t\t__unstableIsFullySelected,\n\t} = useSelect( blockEditorStore );\n\tconst { selectBlock, multiSelect } = useDispatch( blockEditorStore );\n\treturn useRefEffect( ( node ) => {\n\t\t// Here a DOMRect is stored while moving the caret vertically so\n\t\t// vertical position of the start position can be restored. This is to\n\t\t// recreate browser behaviour across blocks.\n\t\tlet verticalRect;\n\n\t\tfunction onMouseDown() {\n\t\t\tverticalRect = null;\n\t\t}\n\n\t\tfunction isClosestTabbableABlock( target, isReverse ) {\n\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\ttarget,\n\t\t\t\tisReverse,\n\t\t\t\tnode\n\t\t\t);\n\t\t\treturn closestTabbable && getBlockClientId( closestTabbable );\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\t// Abort if navigation has already been handled (e.g. RichText\n\t\t\t// inline boundaries).\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { keyCode, shiftKey, ctrlKey, altKey, metaKey } = event;\n\t\t\t// When the wrapper is contentEditable and holds focus (the\n\t\t\t// selected block supports `editableRoot`), the event targets the\n\t\t\t// wrapper; resolve the editable element containing the selection.\n\t\t\tconst target =\n\t\t\t\t( event.target === node &&\n\t\t\t\t\tgetSelectionEditableElement(\n\t\t\t\t\t\tnode.ownerDocument.defaultView.getSelection(),\n\t\t\t\t\t\tnode\n\t\t\t\t\t) ) ||\n\t\t\t\tevent.target;\n\t\t\tconst isUp = keyCode === UP;\n\t\t\tconst isDown = keyCode === DOWN;\n\t\t\tconst isLeft = keyCode === LEFT;\n\t\t\tconst isRight = keyCode === RIGHT;\n\t\t\tconst isReverse = isUp || isLeft;\n\t\t\tconst isHorizontal = isLeft || isRight;\n\t\t\tconst isVertical = isUp || isDown;\n\t\t\tconst isNav = isHorizontal || isVertical;\n\t\t\tconst hasModifier = shiftKey || ctrlKey || altKey || metaKey;\n\t\t\tconst isNavEdge = isVertical ? isVerticalEdge : isHorizontalEdge;\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\tif ( ! isNav ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// In preview mode, navigation is handled by useSelectableBlocksNav.\n\t\t\tif ( getSettings().isPreviewMode ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If there is a multi-selection, the arrow keys should collapse the\n\t\t\t// selection to the start or end of the selection.\n\t\t\tif ( hasMultiSelection() ) {\n\t\t\t\tif ( shiftKey ) {\n\t\t\t\t\t// A fully selected multi-selection has no native\n\t\t\t\t\t// selection to extend (use-multi-selection cleared it),\n\t\t\t\t\t// so grow or shrink it by one block at the focus end.\n\t\t\t\t\t// Only without a usable native selection: a selection\n\t\t\t\t\t// that is fully selected because it resolves to a\n\t\t\t\t\t// nesting ancestor keeps its native selection, which\n\t\t\t\t\t// the browser extends natively (and the observer\n\t\t\t\t\t// promotes to the common level).\n\t\t\t\t\tconst selection = defaultView.getSelection();\n\t\t\t\t\tif (\n\t\t\t\t\t\t__unstableIsFullySelected() &&\n\t\t\t\t\t\t( ! selection.rangeCount || selection.isCollapsed )\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst anchorClientId =\n\t\t\t\t\t\t\tgetMultiSelectedBlocksStartClientId();\n\t\t\t\t\t\tconst focusClientId =\n\t\t\t\t\t\t\tgetMultiSelectedBlocksEndClientId();\n\t\t\t\t\t\tconst nextClientId = isReverse\n\t\t\t\t\t\t\t? getPreviousBlockClientId( focusClientId )\n\t\t\t\t\t\t\t: getNextBlockClientId( focusClientId );\n\n\t\t\t\t\t\tif ( nextClientId ) {\n\t\t\t\t\t\t\tmultiSelect( anchorClientId, nextClientId );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle if we have a full selection (not a native partial\n\t\t\t\t// selection).\n\t\t\t\tif ( ! __unstableIsFullySelected() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif ( isReverse ) {\n\t\t\t\t\tselectBlock( getMultiSelectedBlocksStartClientId() );\n\t\t\t\t} else {\n\t\t\t\t\tselectBlock( getMultiSelectedBlocksEndClientId(), -1 );\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// A block selected without a text selection within it (e.g. an\n\t\t\t// image or spacer) has no native selection to extend: start a\n\t\t\t// block multi-selection with the adjacent block.\n\t\t\tif (\n\t\t\t\tshiftKey &&\n\t\t\t\tgetSelectedBlockClientId() &&\n\t\t\t\t! getSelectionStart().attributeKey\n\t\t\t) {\n\t\t\t\tconst selectedClientId = getSelectedBlockClientId();\n\t\t\t\tconst nextClientId = isReverse\n\t\t\t\t\t? getPreviousBlockClientId( selectedClientId )\n\t\t\t\t\t: getNextBlockClientId( selectedClientId );\n\n\t\t\t\tif ( nextClientId ) {\n\t\t\t\t\tmultiSelect( selectedClientId, nextClientId );\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Abort if our current target is not a candidate for navigation\n\t\t\t// (e.g. preserve native input behaviors).\n\t\t\tif ( ! isNavigationCandidate( target, keyCode, hasModifier ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// When pressing any key other than up or down, the initial vertical\n\t\t\t// position must ALWAYS be reset. The vertical position is saved so\n\t\t\t// it can be restored as well as possible on subsequent vertical\n\t\t\t// arrow key presses. It may not always be possible to restore the\n\t\t\t// exact same position (such as at an empty line), so it wouldn't be\n\t\t\t// good to compute the position right before any vertical arrow key\n\t\t\t// press.\n\t\t\tif ( ! isVertical ) {\n\t\t\t\tverticalRect = null;\n\t\t\t} else if ( ! verticalRect ) {\n\t\t\t\tverticalRect = computeCaretRect( defaultView );\n\t\t\t}\n\n\t\t\t// In the case of RTL scripts, right means previous and left means\n\t\t\t// next, which is the exact reverse of LTR.\n\t\t\tconst isReverseDir = isRTL( target ) ? ! isReverse : isReverse;\n\t\t\tconst { keepCaretInsideBlock } = getSettings();\n\n\t\t\tif ( shiftKey ) {\n\t\t\t\tif ( isNavEdge( target, isReverse ) ) {\n\t\t\t\t\tif ( isClosestTabbableABlock( target, isReverse ) ) {\n\t\t\t\t\t\tsetContentEditableWrapper( node, true );\n\t\t\t\t\t} else if ( node.contentEditable === 'true' ) {\n\t\t\t\t\t\t// There is no block to extend the selection into.\n\t\t\t\t\t\t// Within an editable wrapper the selection could\n\t\t\t\t\t\t// natively escape into surrounding editable elements\n\t\t\t\t\t\t// (e.g. the post title), so keep it inside the block\n\t\t\t\t\t\t// by extending it to the block's edge.\n\t\t\t\t\t\tconst selection = defaultView.getSelection();\n\t\t\t\t\t\tselection.extend(\n\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\tisReverse ? 0 : target.childNodes.length\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tisVertical &&\n\t\t\t\tisVerticalEdge( target, isReverse ) &&\n\t\t\t\t// When Alt is pressed, only intercept if the caret is also at\n\t\t\t\t// the horizontal edge.\n\t\t\t\t( altKey ? isHorizontalEdge( target, isReverseDir ) : true ) &&\n\t\t\t\t! keepCaretInsideBlock\n\t\t\t) {\n\t\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\t\ttarget,\n\t\t\t\t\tisReverse,\n\t\t\t\t\tnode,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\n\t\t\t\tif ( closestTabbable ) {\n\t\t\t\t\tplaceCaretAtVerticalEdge(\n\t\t\t\t\t\tclosestTabbable,\n\t\t\t\t\t\t// When Alt is pressed, place the caret at the furthest\n\t\t\t\t\t\t// horizontal edge and the furthest vertical edge.\n\t\t\t\t\t\taltKey ? ! isReverse : isReverse,\n\t\t\t\t\t\taltKey ? undefined : verticalRect\n\t\t\t\t\t);\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tisHorizontal &&\n\t\t\t\tdefaultView.getSelection().isCollapsed &&\n\t\t\t\tisHorizontalEdge( target, isReverseDir ) &&\n\t\t\t\t! keepCaretInsideBlock\n\t\t\t) {\n\t\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\t\ttarget,\n\t\t\t\t\tisReverseDir,\n\t\t\t\t\tnode\n\t\t\t\t);\n\t\t\t\tplaceCaretAtHorizontalEdge( closestTabbable, isReverse );\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n"],
|
|
5
5
|
"mappings": "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",
|
|
6
6
|
"names": ["import_dom", "blockEditorStore"]
|
|
7
7
|
}
|
|
@@ -61,6 +61,12 @@ function useInput() {
|
|
|
61
61
|
} = (0, import_data.useDispatch)(import_store.store);
|
|
62
62
|
return (0, import_compose.useRefEffect)((node) => {
|
|
63
63
|
function onBeforeInput(event) {
|
|
64
|
+
if (event.inputType === "insertParagraph" && !event.defaultPrevented && !hasMultiSelection()) {
|
|
65
|
+
onKeyDown(event);
|
|
66
|
+
if (event.defaultPrevented) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
64
70
|
if (node.contentEditable !== "true") {
|
|
65
71
|
return;
|
|
66
72
|
}
|
|
@@ -78,11 +84,15 @@ function useInput() {
|
|
|
78
84
|
return;
|
|
79
85
|
}
|
|
80
86
|
if (!hasMultiSelection()) {
|
|
81
|
-
if (event.keyCode === import_keycodes.ENTER) {
|
|
82
|
-
if (event.shiftKey
|
|
87
|
+
if (event.keyCode === import_keycodes.ENTER || event.inputType === "insertParagraph") {
|
|
88
|
+
if (event.shiftKey || // Editables are handled on beforeinput.
|
|
89
|
+
event.type === "keydown" && event.target.ownerDocument.activeElement.isContentEditable) {
|
|
83
90
|
return;
|
|
84
91
|
}
|
|
85
92
|
const clientId = getSelectedBlockClientId();
|
|
93
|
+
if (!clientId) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
86
96
|
const blockName = getBlockName(clientId);
|
|
87
97
|
const selectionStart = getSelectionStart();
|
|
88
98
|
const selectionEnd = getSelectionEnd();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/writing-flow/use-input.js"],
|
|
4
|
-
"sourcesContent": ["import { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport {\n\tcreateBlock,\n\tgetDefaultBlockName,\n\thasBlockSupport,\n\tgetBlockTransforms,\n\tfindTransform,\n} from '@wordpress/blocks';\nimport { store as blockEditorStore } from '../../store';\nimport { setContentEditableWrapper } from './utils';\nimport { getBlockClientId, getSelectionEditableElement } from '../../utils/dom';\n\n/**\n * Handles input for selections across blocks.\n */\nexport default function useInput() {\n\tconst {\n\t\t__unstableIsFullySelected,\n\t\tgetSelectedBlockClientIds,\n\t\tgetSelectedBlockClientId,\n\t\t__unstableIsSelectionMergeable,\n\t\thasMultiSelection,\n\t\tgetBlockName,\n\t\tcanInsertBlockType,\n\t\tgetBlockRootClientId,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\tgetBlockAttributes,\n\t\tgetNextBlockClientId,\n\t\tgetBlockOrder,\n\t\tgetBlockEditingMode,\n\t\tgetBlockListSettings,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\treplaceBlocks,\n\t\t__unstableSplitSelection,\n\t\tremoveBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t\t__unstableMarkAutomaticChange,\n\t\tinsertAfterBlock,\n\t\tinsertBlock,\n\t\tselectBlock,\n\t} = useDispatch( blockEditorStore );\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction onBeforeInput( event ) {\n\t\t\t// If writing flow is editable, never allow the browser to alter\n\t\t\t// the DOM outside of an editable element within a block. This\n\t\t\t// will cause React errors (and the DOM should only be altered in\n\t\t\t// a controlled fashion). The wrapper can be contentEditable with\n\t\t\t// a single selection when the selected block supports\n\t\t\t// `editableRoot`; in that case edits within the block's editable\n\t\t\t// element are handled by its rich text instance.\n\t\t\tif ( node.contentEditable !== 'true' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hasMultiSelection() ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst selection = node.ownerDocument.defaultView.getSelection();\n\n\t\t\tif ( ! getSelectionEditableElement( selection, node ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\t\tif ( event.shiftKey ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\tconst selectionStart = getSelectionStart();\n\t\t\t\t\tconst selectionEnd = getSelectionEnd();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectionStart.attributeKey ===\n\t\t\t\t\t\tselectionEnd.attributeKey\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst selectedAttributeValue =\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )[\n\t\t\t\t\t\t\t\tselectionStart.attributeKey\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\tconst transforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t\t\t\t( { type } ) => type === 'enter'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\t\t\ttransforms,\n\t\t\t\t\t\t\t( item ) => {\n\t\t\t\t\t\t\t\treturn item.regExp.test(\n\t\t\t\t\t\t\t\t\tselectedAttributeValue\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( transformation ) {\n\t\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\ttransformation.transform( {\n\t\t\t\t\t\t\t\t\tcontent: selectedAttributeValue,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t__unstableMarkAutomaticChange();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\t\t\tconst { activeElement } = event.target.ownerDocument;\n\n\t\t\t\t\t// Ensure template is not locked.\n\t\t\t\t\tif (\n\t\t\t\t\t\t! __unstableIsFullySelected() &&\n\t\t\t\t\t\t( canInsertBlockType(\n\t\t\t\t\t\t\tgetDefaultBlockName(),\n\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t) ||\n\t\t\t\t\t\t\tcanInsertBlockType( blockName, rootClientId ) ) &&\n\t\t\t\t\t\t( hasBlockSupport( blockName, 'splitting', false ) ||\n\t\t\t\t\t\t\tevent.__deprecatedOnSplit )\n\t\t\t\t\t) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t// Handle Enter only on the block wrapper itself or\n\t\t\t\t\t\t// an editable element within the block, which may be\n\t\t\t\t\t\t// nested within the wrapper (e.g. Site Title). Other\n\t\t\t\t\t\t// focusable elements (an embed's URL field, an\n\t\t\t\t\t\t// appender button) keep their native Enter behavior.\n\t\t\t\t\t\t( activeElement.getAttribute( 'data-block' ) ===\n\t\t\t\t\t\t\tclientId ||\n\t\t\t\t\t\t\tactiveElement.isContentEditable ) &&\n\t\t\t\t\t\tgetBlockClientId( activeElement ) === clientId\n\t\t\t\t\t) {\n\t\t\t\t\t\t// The default block depends on context: containers\n\t\t\t\t\t\t// such as the gallery define their own default\n\t\t\t\t\t\t// block, which is what insertAfterBlock inserts.\n\t\t\t\t\t\tconst { defaultBlock: directInsertBlock } =\n\t\t\t\t\t\t\t( rootClientId &&\n\t\t\t\t\t\t\t\tgetBlockListSettings( rootClientId ) ) ||\n\t\t\t\t\t\t\t{};\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tdirectInsertBlock?.name ??\n\t\t\t\t\t\t\t\t\tgetDefaultBlockName(),\n\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tinsertAfterBlock( clientId );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Descend into an empty container by inserting\n\t\t\t\t\t\t\t// its default block, the same block an appender\n\t\t\t\t\t\t\t// or ghost would insert.\n\t\t\t\t\t\t\tif ( ! getBlockOrder( clientId ).length ) {\n\t\t\t\t\t\t\t\tconst { defaultBlock } =\n\t\t\t\t\t\t\t\t\tgetBlockListSettings( clientId ) ?? {};\n\t\t\t\t\t\t\t\tconst name =\n\t\t\t\t\t\t\t\t\tdefaultBlock?.name ?? getDefaultBlockName();\n\n\t\t\t\t\t\t\t\tif ( canInsertBlockType( name, clientId ) ) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tinsertBlock(\n\t\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\tdefaultBlock?.attributes\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\tclientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction getNextClientId( id ) {\n\t\t\t\t\t\t\t\tlet nextClientId = null;\n\n\t\t\t\t\t\t\t\twhile (\n\t\t\t\t\t\t\t\t\ttypeof id === 'string' &&\n\t\t\t\t\t\t\t\t\t! ( nextClientId =\n\t\t\t\t\t\t\t\t\t\tgetNextBlockClientId( id ) )\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tid = getBlockRootClientId( id );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn nextClientId;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet nextClientId =\n\t\t\t\t\t\t\t\tgetBlockOrder( clientId )[ 0 ] ??\n\t\t\t\t\t\t\t\tgetNextClientId( clientId );\n\n\t\t\t\t\t\t\twhile (\n\t\t\t\t\t\t\t\tnextClientId &&\n\t\t\t\t\t\t\t\tgetBlockEditingMode( nextClientId ) ===\n\t\t\t\t\t\t\t\t\t'disabled'\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnextClientId = getNextClientId( nextClientId );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( nextClientId ) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t// An initial position of `true` is an\n\t\t\t\t\t\t\t\t// internal sentinel: it focuses the block\n\t\t\t\t\t\t\t\t// wrapper instead of a text field within\n\t\t\t\t\t\t\t\t// it. See useFocusFirstElement.\n\t\t\t\t\t\t\t\tselectBlock( nextClientId, true );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tsetContentEditableWrapper( node, false );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tgetSelectedBlockClientIds(),\n\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\t\tevent.keyCode === DELETE\n\t\t\t) {\n\t\t\t\tsetContentEditableWrapper( node, false );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\tremoveBlocks( getSelectedBlockClientIds() );\n\t\t\t\t} else if ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t// If key.length is longer than 1, it's a control key that doesn't\n\t\t\t\t// input anything.\n\t\t\t\tevent.key.length === 1 &&\n\t\t\t\t! ( event.metaKey || event.ctrlKey )\n\t\t\t) {\n\t\t\t\tsetContentEditableWrapper( node, false );\n\t\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\t\tnode.ownerDocument.defaultView\n\t\t\t\t\t\t.getSelection()\n\t\t\t\t\t\t.removeAllRanges();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onCompositionStart( event ) {\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetContentEditableWrapper( node, false );\n\n\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t__unstableDeleteSelection();\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\tnode.ownerDocument.defaultView.getSelection().removeAllRanges();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'beforeinput', onBeforeInput );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'compositionstart', onCompositionStart );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'beforeinput', onBeforeInput );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'compositionstart', onCompositionStart );\n\t\t};\n\t}, [] );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuC;AACvC,qBAA6B;AAC7B,sBAAyC;AACzC,oBAMO;AACP,mBAA0C;AAC1C,mBAA0C;AAC1C,iBAA8D;AAK/C,SAAR,WAA4B;AAClC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,uBAAW,aAAAA,KAAiB;AAChC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,yBAAa,aAAAA,KAAiB;AAElC,aAAO,6BAAc,CAAE,SAAU;AAChC,aAAS,cAAe,OAAQ;
|
|
4
|
+
"sourcesContent": ["import { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport {\n\tcreateBlock,\n\tgetDefaultBlockName,\n\thasBlockSupport,\n\tgetBlockTransforms,\n\tfindTransform,\n} from '@wordpress/blocks';\nimport { store as blockEditorStore } from '../../store';\nimport { setContentEditableWrapper } from './utils';\nimport { getBlockClientId, getSelectionEditableElement } from '../../utils/dom';\n\n/**\n * Handles input for selections across blocks.\n */\nexport default function useInput() {\n\tconst {\n\t\t__unstableIsFullySelected,\n\t\tgetSelectedBlockClientIds,\n\t\tgetSelectedBlockClientId,\n\t\t__unstableIsSelectionMergeable,\n\t\thasMultiSelection,\n\t\tgetBlockName,\n\t\tcanInsertBlockType,\n\t\tgetBlockRootClientId,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\tgetBlockAttributes,\n\t\tgetNextBlockClientId,\n\t\tgetBlockOrder,\n\t\tgetBlockEditingMode,\n\t\tgetBlockListSettings,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\treplaceBlocks,\n\t\t__unstableSplitSelection,\n\t\tremoveBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t\t__unstableMarkAutomaticChange,\n\t\tinsertAfterBlock,\n\t\tinsertBlock,\n\t\tselectBlock,\n\t} = useDispatch( blockEditorStore );\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction onBeforeInput( event ) {\n\t\t\t// Enter in an editable is handled here instead of on keydown:\n\t\t\t// moving focus while the keydown is still being handled leaves\n\t\t\t// the iOS keyboard's auto-capitalization stale.\n\t\t\tif (\n\t\t\t\tevent.inputType === 'insertParagraph' &&\n\t\t\t\t! event.defaultPrevented &&\n\t\t\t\t! hasMultiSelection()\n\t\t\t) {\n\t\t\t\tonKeyDown( event );\n\t\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If writing flow is editable, never allow the browser to alter\n\t\t\t// the DOM outside of an editable element within a block. This\n\t\t\t// will cause React errors (and the DOM should only be altered in\n\t\t\t// a controlled fashion). The wrapper can be contentEditable with\n\t\t\t// a single selection when the selected block supports\n\t\t\t// `editableRoot`; in that case edits within the block's editable\n\t\t\t// element are handled by its rich text instance.\n\t\t\tif ( node.contentEditable !== 'true' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hasMultiSelection() ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst selection = node.ownerDocument.defaultView.getSelection();\n\n\t\t\tif ( ! getSelectionEditableElement( selection, node ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\tif (\n\t\t\t\t\tevent.keyCode === ENTER ||\n\t\t\t\t\tevent.inputType === 'insertParagraph'\n\t\t\t\t) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.shiftKey ||\n\t\t\t\t\t\t// Editables are handled on beforeinput.\n\t\t\t\t\t\t( event.type === 'keydown' &&\n\t\t\t\t\t\t\tevent.target.ownerDocument.activeElement\n\t\t\t\t\t\t\t\t.isContentEditable )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\t\t\tif ( ! clientId ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\tconst selectionStart = getSelectionStart();\n\t\t\t\t\tconst selectionEnd = getSelectionEnd();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectionStart.attributeKey ===\n\t\t\t\t\t\tselectionEnd.attributeKey\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst selectedAttributeValue =\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )[\n\t\t\t\t\t\t\t\tselectionStart.attributeKey\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\tconst transforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t\t\t\t( { type } ) => type === 'enter'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\t\t\ttransforms,\n\t\t\t\t\t\t\t( item ) => {\n\t\t\t\t\t\t\t\treturn item.regExp.test(\n\t\t\t\t\t\t\t\t\tselectedAttributeValue\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( transformation ) {\n\t\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\ttransformation.transform( {\n\t\t\t\t\t\t\t\t\tcontent: selectedAttributeValue,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t__unstableMarkAutomaticChange();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\t\t\tconst { activeElement } = event.target.ownerDocument;\n\n\t\t\t\t\t// Ensure template is not locked.\n\t\t\t\t\tif (\n\t\t\t\t\t\t! __unstableIsFullySelected() &&\n\t\t\t\t\t\t( canInsertBlockType(\n\t\t\t\t\t\t\tgetDefaultBlockName(),\n\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t) ||\n\t\t\t\t\t\t\tcanInsertBlockType( blockName, rootClientId ) ) &&\n\t\t\t\t\t\t( hasBlockSupport( blockName, 'splitting', false ) ||\n\t\t\t\t\t\t\tevent.__deprecatedOnSplit )\n\t\t\t\t\t) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t// Handle Enter only on the block wrapper itself or\n\t\t\t\t\t\t// an editable element within the block, which may be\n\t\t\t\t\t\t// nested within the wrapper (e.g. Site Title). Other\n\t\t\t\t\t\t// focusable elements (an embed's URL field, an\n\t\t\t\t\t\t// appender button) keep their native Enter behavior.\n\t\t\t\t\t\t( activeElement.getAttribute( 'data-block' ) ===\n\t\t\t\t\t\t\tclientId ||\n\t\t\t\t\t\t\tactiveElement.isContentEditable ) &&\n\t\t\t\t\t\tgetBlockClientId( activeElement ) === clientId\n\t\t\t\t\t) {\n\t\t\t\t\t\t// The default block depends on context: containers\n\t\t\t\t\t\t// such as the gallery define their own default\n\t\t\t\t\t\t// block, which is what insertAfterBlock inserts.\n\t\t\t\t\t\tconst { defaultBlock: directInsertBlock } =\n\t\t\t\t\t\t\t( rootClientId &&\n\t\t\t\t\t\t\t\tgetBlockListSettings( rootClientId ) ) ||\n\t\t\t\t\t\t\t{};\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tdirectInsertBlock?.name ??\n\t\t\t\t\t\t\t\t\tgetDefaultBlockName(),\n\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tinsertAfterBlock( clientId );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Descend into an empty container by inserting\n\t\t\t\t\t\t\t// its default block, the same block an appender\n\t\t\t\t\t\t\t// or ghost would insert.\n\t\t\t\t\t\t\tif ( ! getBlockOrder( clientId ).length ) {\n\t\t\t\t\t\t\t\tconst { defaultBlock } =\n\t\t\t\t\t\t\t\t\tgetBlockListSettings( clientId ) ?? {};\n\t\t\t\t\t\t\t\tconst name =\n\t\t\t\t\t\t\t\t\tdefaultBlock?.name ?? getDefaultBlockName();\n\n\t\t\t\t\t\t\t\tif ( canInsertBlockType( name, clientId ) ) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tinsertBlock(\n\t\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\tdefaultBlock?.attributes\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\tclientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction getNextClientId( id ) {\n\t\t\t\t\t\t\t\tlet nextClientId = null;\n\n\t\t\t\t\t\t\t\twhile (\n\t\t\t\t\t\t\t\t\ttypeof id === 'string' &&\n\t\t\t\t\t\t\t\t\t! ( nextClientId =\n\t\t\t\t\t\t\t\t\t\tgetNextBlockClientId( id ) )\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tid = getBlockRootClientId( id );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn nextClientId;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet nextClientId =\n\t\t\t\t\t\t\t\tgetBlockOrder( clientId )[ 0 ] ??\n\t\t\t\t\t\t\t\tgetNextClientId( clientId );\n\n\t\t\t\t\t\t\twhile (\n\t\t\t\t\t\t\t\tnextClientId &&\n\t\t\t\t\t\t\t\tgetBlockEditingMode( nextClientId ) ===\n\t\t\t\t\t\t\t\t\t'disabled'\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnextClientId = getNextClientId( nextClientId );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( nextClientId ) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t// An initial position of `true` is an\n\t\t\t\t\t\t\t\t// internal sentinel: it focuses the block\n\t\t\t\t\t\t\t\t// wrapper instead of a text field within\n\t\t\t\t\t\t\t\t// it. See useFocusFirstElement.\n\t\t\t\t\t\t\t\tselectBlock( nextClientId, true );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tsetContentEditableWrapper( node, false );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tgetSelectedBlockClientIds(),\n\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\t\tevent.keyCode === DELETE\n\t\t\t) {\n\t\t\t\tsetContentEditableWrapper( node, false );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\tremoveBlocks( getSelectedBlockClientIds() );\n\t\t\t\t} else if ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t// If key.length is longer than 1, it's a control key that doesn't\n\t\t\t\t// input anything.\n\t\t\t\tevent.key.length === 1 &&\n\t\t\t\t! ( event.metaKey || event.ctrlKey )\n\t\t\t) {\n\t\t\t\tsetContentEditableWrapper( node, false );\n\t\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\t\tnode.ownerDocument.defaultView\n\t\t\t\t\t\t.getSelection()\n\t\t\t\t\t\t.removeAllRanges();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onCompositionStart( event ) {\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetContentEditableWrapper( node, false );\n\n\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t__unstableDeleteSelection();\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\tnode.ownerDocument.defaultView.getSelection().removeAllRanges();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'beforeinput', onBeforeInput );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'compositionstart', onCompositionStart );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'beforeinput', onBeforeInput );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'compositionstart', onCompositionStart );\n\t\t};\n\t}, [] );\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["blockEditorStore", "getNextClientId", "nextClientId"]
|
|
7
7
|
}
|
|
@@ -17,7 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// packages/block-editor/src/components/writing-flow/use-tab-nav.
|
|
20
|
+
// packages/block-editor/src/components/writing-flow/use-tab-nav.jsx
|
|
21
21
|
var use_tab_nav_exports = {};
|
|
22
22
|
__export(use_tab_nav_exports, {
|
|
23
23
|
default: () => useTabNav
|
|
@@ -25,6 +25,7 @@ __export(use_tab_nav_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(use_tab_nav_exports);
|
|
26
26
|
var import_dom = require("@wordpress/dom");
|
|
27
27
|
var import_keycodes = require("@wordpress/keycodes");
|
|
28
|
+
var import_i18n = require("@wordpress/i18n");
|
|
28
29
|
var import_data = require("@wordpress/data");
|
|
29
30
|
var import_compose = require("@wordpress/compose");
|
|
30
31
|
var import_element = require("@wordpress/element");
|
|
@@ -32,6 +33,13 @@ var import_store = require("../../store/index.cjs");
|
|
|
32
33
|
var import_dom2 = require("../../utils/dom.cjs");
|
|
33
34
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
34
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var PREVENT_SCROLL_ON_FOCUS = {
|
|
37
|
+
position: "absolute",
|
|
38
|
+
inset: 0,
|
|
39
|
+
pointerEvents: "none",
|
|
40
|
+
outline: "none"
|
|
41
|
+
};
|
|
42
|
+
var ENTRY_KEYS = ["Enter", " ", "F2", "Escape"];
|
|
35
43
|
function useTabNav() {
|
|
36
44
|
const containerRef = (
|
|
37
45
|
/** @type {typeof useRef<HTMLElement>} */
|
|
@@ -39,6 +47,10 @@ function useTabNav() {
|
|
|
39
47
|
);
|
|
40
48
|
const focusCaptureBeforeRef = (0, import_element.useRef)();
|
|
41
49
|
const focusCaptureAfterRef = (0, import_element.useRef)();
|
|
50
|
+
const hintId = (0, import_compose.useInstanceId)(
|
|
51
|
+
useTabNav,
|
|
52
|
+
"block-editor-writing-flow__canvas-stop-hint"
|
|
53
|
+
);
|
|
42
54
|
const {
|
|
43
55
|
hasMultiSelection,
|
|
44
56
|
getSelectedBlockClientId,
|
|
@@ -46,15 +58,14 @@ function useTabNav() {
|
|
|
46
58
|
getBlockOrder,
|
|
47
59
|
getLastFocus,
|
|
48
60
|
getSectionRootClientId,
|
|
61
|
+
getEditedContentOnlySection,
|
|
49
62
|
isZoomOut
|
|
50
63
|
} = (0, import_lock_unlock.unlock)((0, import_data.useSelect)(import_store.store));
|
|
51
64
|
const { setLastFocus } = (0, import_lock_unlock.unlock)((0, import_data.useDispatch)(import_store.store));
|
|
52
65
|
const noCaptureRef = (0, import_element.useRef)();
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
noCaptureRef.current = null;
|
|
57
|
-
} else if (hasMultiSelection()) {
|
|
66
|
+
function enterCanvas() {
|
|
67
|
+
containerRef.current.ownerDocument.defaultView.focus();
|
|
68
|
+
if (hasMultiSelection()) {
|
|
58
69
|
containerRef.current.focus();
|
|
59
70
|
} else if (getSelectedBlockClientId()) {
|
|
60
71
|
if (getLastFocus()?.current) {
|
|
@@ -72,34 +83,76 @@ function useTabNav() {
|
|
|
72
83
|
} else if (sectionRootClientId) {
|
|
73
84
|
containerRef.current.querySelector(`[data-block="${sectionRootClientId}"]`).focus();
|
|
74
85
|
} else {
|
|
75
|
-
|
|
86
|
+
containerRef.current.focus();
|
|
76
87
|
}
|
|
77
88
|
} else {
|
|
78
|
-
const isBefore = (
|
|
79
|
-
// eslint-disable-next-line no-bitwise
|
|
80
|
-
event.target.compareDocumentPosition(canvasElement) & event.target.DOCUMENT_POSITION_FOLLOWING
|
|
81
|
-
);
|
|
82
89
|
const tabbables = import_dom.focus.tabbable.find(containerRef.current);
|
|
83
90
|
if (tabbables.length) {
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
tabbables[0].focus();
|
|
92
|
+
} else {
|
|
93
|
+
containerRef.current.focus();
|
|
86
94
|
}
|
|
87
95
|
}
|
|
88
96
|
}
|
|
97
|
+
function onStopKeyDown(event) {
|
|
98
|
+
if (event.defaultPrevented || event.ctrlKey || event.metaKey || event.altKey) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const { key } = event;
|
|
102
|
+
if (!event.shiftKey && ENTRY_KEYS.includes(key)) {
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
enterCanvas();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (key === "Tab" && !event.shiftKey) {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
import_dom.focus.tabbable.findNext(focusCaptureAfterRef.current)?.focus();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function onStopFocus() {
|
|
113
|
+
if (noCaptureRef.current) {
|
|
114
|
+
noCaptureRef.current = null;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
enterCanvas();
|
|
118
|
+
}
|
|
89
119
|
const before = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
120
|
"div",
|
|
91
121
|
{
|
|
92
122
|
ref: focusCaptureBeforeRef,
|
|
93
123
|
tabIndex: "0",
|
|
94
|
-
|
|
124
|
+
role: "button",
|
|
125
|
+
"aria-label": (0, import_i18n.__)("Editor canvas"),
|
|
126
|
+
"aria-describedby": hintId,
|
|
127
|
+
className: "block-editor-writing-flow__canvas-stop",
|
|
128
|
+
style: PREVENT_SCROLL_ON_FOCUS,
|
|
129
|
+
onFocus: onStopFocus,
|
|
130
|
+
onKeyDown: onStopKeyDown,
|
|
131
|
+
onClick: enterCanvas,
|
|
132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
className: "block-editor-writing-flow__canvas-stop-hint",
|
|
136
|
+
id: hintId,
|
|
137
|
+
children: (0, import_i18n.__)("Press Enter to edit the document")
|
|
138
|
+
}
|
|
139
|
+
)
|
|
95
140
|
}
|
|
96
141
|
);
|
|
142
|
+
function onFocusCapture() {
|
|
143
|
+
if (noCaptureRef.current) {
|
|
144
|
+
noCaptureRef.current = null;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
enterCanvas();
|
|
148
|
+
}
|
|
97
149
|
const after = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
98
150
|
"div",
|
|
99
151
|
{
|
|
100
152
|
ref: focusCaptureAfterRef,
|
|
101
153
|
tabIndex: "0",
|
|
102
|
-
onFocus: onFocusCapture
|
|
154
|
+
onFocus: onFocusCapture,
|
|
155
|
+
style: PREVENT_SCROLL_ON_FOCUS
|
|
103
156
|
}
|
|
104
157
|
);
|
|
105
158
|
const ref = (0, import_compose.useRefEffect)((node) => {
|
|
@@ -107,6 +160,17 @@ function useTabNav() {
|
|
|
107
160
|
if (event.defaultPrevented) {
|
|
108
161
|
return;
|
|
109
162
|
}
|
|
163
|
+
if (event.key === "Escape" && !event.shiftKey && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
164
|
+
if (getEditedContentOnlySection()) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (focusCaptureBeforeRef.current) {
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
noCaptureRef.current = true;
|
|
170
|
+
focusCaptureBeforeRef.current.focus();
|
|
171
|
+
}
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
110
174
|
if (event.keyCode !== import_keycodes.TAB) {
|
|
111
175
|
return;
|
|
112
176
|
}
|
|
@@ -128,43 +192,22 @@ function useTabNav() {
|
|
|
128
192
|
}
|
|
129
193
|
const next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef;
|
|
130
194
|
noCaptureRef.current = true;
|
|
131
|
-
next.current.focus(
|
|
195
|
+
next.current.focus();
|
|
132
196
|
}
|
|
133
197
|
function onFocusOut(event) {
|
|
134
198
|
if (!node.contains(event.relatedTarget)) {
|
|
135
199
|
setLastFocus({ current: event.target });
|
|
136
200
|
}
|
|
137
|
-
const { ownerDocument
|
|
138
|
-
if (!event.relatedTarget && event.target.hasAttribute("data-block") &&
|
|
201
|
+
const { ownerDocument } = node;
|
|
202
|
+
if (!event.relatedTarget && event.target.hasAttribute("data-block") && ownerDocument.activeElement === ownerDocument.body && getBlockCount() === 0) {
|
|
139
203
|
node.focus();
|
|
140
204
|
}
|
|
141
205
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
if (event.target?.getAttribute("role") === "region") {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (containerRef.current === event.target) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
const isShift = event.shiftKey;
|
|
153
|
-
const direction = isShift ? "findPrevious" : "findNext";
|
|
154
|
-
const target = import_dom.focus.tabbable[direction](event.target);
|
|
155
|
-
if (target === focusCaptureBeforeRef.current || target === focusCaptureAfterRef.current) {
|
|
156
|
-
event.preventDefault();
|
|
157
|
-
target.focus({ preventScroll: true });
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
const { ownerDocument } = node;
|
|
161
|
-
const { defaultView } = ownerDocument;
|
|
162
|
-
defaultView.addEventListener("keydown", preventScrollOnTab);
|
|
163
|
-
node.addEventListener("keydown", onKeyDown);
|
|
206
|
+
const onKeyDownOutsideIME = (0, import_keycodes.withIgnoreIMEEvents)(onKeyDown);
|
|
207
|
+
node.addEventListener("keydown", onKeyDownOutsideIME);
|
|
164
208
|
node.addEventListener("focusout", onFocusOut);
|
|
165
209
|
return () => {
|
|
166
|
-
|
|
167
|
-
node.removeEventListener("keydown", onKeyDown);
|
|
210
|
+
node.removeEventListener("keydown", onKeyDownOutsideIME);
|
|
168
211
|
node.removeEventListener("focusout", onFocusOut);
|
|
169
212
|
};
|
|
170
213
|
}, []);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/writing-flow/use-tab-nav.
|
|
4
|
-
"sourcesContent": ["import { focus, isFormElement } from '@wordpress/dom';\nimport { TAB } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '../../store';\nimport { isInSameBlock, isInsideRootBlock } from '../../utils/dom';\nimport { unlock } from '../../lock-unlock';\n\nexport default function useTabNav() {\n\tconst containerRef = /** @type {typeof useRef<HTMLElement>} */ ( useRef )();\n\tconst focusCaptureBeforeRef = useRef();\n\tconst focusCaptureAfterRef = useRef();\n\n\tconst {\n\t\thasMultiSelection,\n\t\tgetSelectedBlockClientId,\n\t\tgetBlockCount,\n\t\tgetBlockOrder,\n\t\tgetLastFocus,\n\t\tgetSectionRootClientId,\n\t\tisZoomOut,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { setLastFocus } = unlock( useDispatch( blockEditorStore ) );\n\n\t// Reference that holds the a flag for enabling or disabling\n\t// capturing on the focus capture elements.\n\tconst noCaptureRef = useRef();\n\n\tfunction onFocusCapture( event ) {\n\t\tconst canvasElement =\n\t\t\tcontainerRef.current.ownerDocument === event.target.ownerDocument\n\t\t\t\t? containerRef.current\n\t\t\t\t: containerRef.current.ownerDocument.defaultView.frameElement;\n\n\t\t// Do not capture incoming focus if set by us in WritingFlow.\n\t\tif ( noCaptureRef.current ) {\n\t\t\tnoCaptureRef.current = null;\n\t\t} else if ( hasMultiSelection() ) {\n\t\t\tcontainerRef.current.focus();\n\t\t} else if ( getSelectedBlockClientId() ) {\n\t\t\tif ( getLastFocus()?.current ) {\n\t\t\t\tgetLastFocus().current.focus();\n\t\t\t} else {\n\t\t\t\t// Handles when the last focus has not been set yet, or has been cleared by new blocks being added via the inserter.\n\t\t\t\tcontainerRef.current\n\t\t\t\t\t.querySelector(\n\t\t\t\t\t\t`[data-block=\"${ getSelectedBlockClientId() }\"]`\n\t\t\t\t\t)\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t}\n\t\t// In \"compose\" mode without a selected ID, we want to place focus on the section root when tabbing to the canvas.\n\t\telse if ( isZoomOut() ) {\n\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\t\t\tconst sectionBlocks = getBlockOrder( sectionRootClientId );\n\n\t\t\t// If we have section within the section root, focus the first one.\n\t\t\tif ( sectionBlocks.length ) {\n\t\t\t\tcontainerRef.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionBlocks[ 0 ] }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t\t// If we don't have any section blocks, focus the section root.\n\t\t\telse if ( sectionRootClientId ) {\n\t\t\t\tcontainerRef.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionRootClientId }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t} else {\n\t\t\t\t// If we don't have any section root, focus the canvas.\n\t\t\t\tcanvasElement.focus();\n\t\t\t}\n\t\t} else {\n\t\t\tconst isBefore =\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tevent.target.compareDocumentPosition( canvasElement ) &\n\t\t\t\tevent.target.DOCUMENT_POSITION_FOLLOWING;\n\t\t\tconst tabbables = focus.tabbable.find( containerRef.current );\n\t\t\tif ( tabbables.length ) {\n\t\t\t\tconst next = isBefore\n\t\t\t\t\t? tabbables[ 0 ]\n\t\t\t\t\t: tabbables[ tabbables.length - 1 ];\n\t\t\t\tnext.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst before = (\n\t\t<div\n\t\t\tref={ focusCaptureBeforeRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t/>\n\t);\n\n\tconst after = (\n\t\t<div\n\t\t\tref={ focusCaptureAfterRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t/>\n\t);\n\n\tconst ref = useRefEffect( ( node ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// In Edit mode, Tab should focus the first tabbable element after\n\t\t\t// the content, which is normally the sidebar (with block controls)\n\t\t\t// and Shift+Tab should focus the first tabbable element before the\n\t\t\t// content, which is normally the block toolbar.\n\t\t\t// Arrow keys can be used, and Tab and arrow keys can be used in\n\t\t\t// Navigation mode (press Esc), to navigate through blocks.\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Bails in case the focus capture elements aren’t present. They\n\t\t\t\t// may be omitted to avoid silent tab stops in preview mode.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/pull/59317\n\t\t\t\t! focusCaptureAfterRef.current ||\n\t\t\t\t! focusCaptureBeforeRef.current\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { target, shiftKey: isShift } = event;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst nextTabbable = focus.tabbable[ direction ]( target );\n\n\t\t\t// We want to constrain the tabbing to the block and its child blocks.\n\t\t\t// If the preceding form element is within a different block,\n\t\t\t// such as two sibling image blocks in the placeholder state,\n\t\t\t// we want shift + tab from the first form element to move to the image\n\t\t\t// block toolbar and not the previous image block's form element.\n\t\t\tconst currentBlock = target.closest( '[data-block]' );\n\t\t\tconst isElementPartOfSelectedBlock =\n\t\t\t\tcurrentBlock &&\n\t\t\t\tnextTabbable &&\n\t\t\t\t( isInSameBlock( currentBlock, nextTabbable ) ||\n\t\t\t\t\tisInsideRootBlock( currentBlock, nextTabbable ) );\n\n\t\t\t// Allow tabbing from the block wrapper to a form element,\n\t\t\t// and between form elements rendered in a block and its child blocks,\n\t\t\t// such as inside a placeholder. Form elements are generally\n\t\t\t// meant to be UI rather than part of the content. Ideally\n\t\t\t// these are not rendered in the content and perhaps in the\n\t\t\t// future they can be rendered in an iframe or shadow DOM.\n\t\t\tif (\n\t\t\t\tisFormElement( nextTabbable ) &&\n\t\t\t\tisElementPartOfSelectedBlock\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef;\n\n\t\t\t// Disable focus capturing on the focus capture element, so it\n\t\t\t// doesn't refocus this block and so it allows default behaviour\n\t\t\t// (moving focus to the next tabbable element).\n\t\t\tnoCaptureRef.current = true;\n\n\t\t\t// Focusing the focus capture element, which is located above and\n\t\t\t// below the editor, should not scroll the page all the way up or\n\t\t\t// down.\n\t\t\tnext.current.focus( { preventScroll: true } );\n\t\t}\n\n\t\tfunction onFocusOut( event ) {\n\t\t\t// `focusout` also fires when focus moves between elements within the\n\t\t\t// canvas, but only the element focus left the canvas from is of\n\t\t\t// interest. `contains` is false for a null `relatedTarget`, which is\n\t\t\t// what focus moving to another document reports.\n\t\t\tif ( ! node.contains( event.relatedTarget ) ) {\n\t\t\t\tsetLastFocus( { current: event.target } );\n\t\t\t}\n\n\t\t\tconst { ownerDocument } = node;\n\n\t\t\t// If focus disappears due to there being no blocks, move focus to\n\t\t\t// the writing flow wrapper.\n\t\t\tif (\n\t\t\t\t! event.relatedTarget &&\n\t\t\t\tevent.target.hasAttribute( 'data-block' ) &&\n\t\t\t\townerDocument.activeElement === ownerDocument.body &&\n\t\t\t\tgetBlockCount() === 0\n\t\t\t) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t}\n\n\t\t// When tabbing back to an element in block list, this event handler prevents scrolling if the\n\t\t// focus capture divs (before/after) are outside of the viewport. (For example shift+tab back to a paragraph\n\t\t// when focus is on a sidebar element. This prevents the scrollable writing area from jumping either to the\n\t\t// top or bottom of the document.\n\t\t//\n\t\t// Note that it isn't possible to disable scrolling in the onFocus event. We need to intercept this\n\t\t// earlier in the keypress handler, and call focus( { preventScroll: true } ) instead.\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus#parameters\n\t\tfunction preventScrollOnTab( event ) {\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.target?.getAttribute( 'role' ) === 'region' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( containerRef.current === event.target ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isShift = event.shiftKey;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst target = focus.tabbable[ direction ]( event.target );\n\t\t\t// Only do something when the next tabbable is a focus capture div (before/after)\n\t\t\tif (\n\t\t\t\ttarget === focusCaptureBeforeRef.current ||\n\t\t\t\ttarget === focusCaptureAfterRef.current\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttarget.focus( { preventScroll: true } );\n\t\t\t}\n\t\t}\n\n\t\tconst { ownerDocument } = node;\n\t\tconst { defaultView } = ownerDocument;\n\t\tdefaultView.addEventListener( 'keydown', preventScrollOnTab );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'focusout', onFocusOut );\n\t\treturn () => {\n\t\t\tdefaultView.removeEventListener( 'keydown', preventScrollOnTab );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'focusout', onFocusOut );\n\t\t};\n\t}, [] );\n\n\tconst mergedRefs = useMergeRefs( [ containerRef, ref ] );\n\n\treturn [ before, mergedRefs, after ];\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAqC;AACrC,
|
|
6
|
-
"names": ["import_dom", "blockEditorStore"
|
|
3
|
+
"sources": ["../../../src/components/writing-flow/use-tab-nav.jsx"],
|
|
4
|
+
"sourcesContent": ["import { focus, isFormElement } from '@wordpress/dom';\nimport { TAB, withIgnoreIMEEvents } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect, useMergeRefs, useInstanceId } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '../../store';\nimport { isInSameBlock, isInsideRootBlock } from '../../utils/dom';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Spans the element over the canvas, so it is always at least partially in\n * view and focussing it never scrolls the content. Fixed positioning would\n * achieve that too, but makes Safari composite the scrollable canvas on a\n * layer sized to the whole document instead of the visible pane.\n */\nconst PREVENT_SCROLL_ON_FOCUS = {\n\tposition: 'absolute',\n\tinset: 0,\n\tpointerEvents: 'none',\n\toutline: 'none',\n};\n\n// Keys that move focus from the canvas stop into the canvas.\nconst ENTRY_KEYS = [ 'Enter', ' ', 'F2', 'Escape' ];\n\nexport default function useTabNav() {\n\tconst containerRef = /** @type {typeof useRef<HTMLElement>} */ ( useRef )();\n\tconst focusCaptureBeforeRef = useRef();\n\tconst focusCaptureAfterRef = useRef();\n\tconst hintId = useInstanceId(\n\t\tuseTabNav,\n\t\t'block-editor-writing-flow__canvas-stop-hint'\n\t);\n\n\tconst {\n\t\thasMultiSelection,\n\t\tgetSelectedBlockClientId,\n\t\tgetBlockCount,\n\t\tgetBlockOrder,\n\t\tgetLastFocus,\n\t\tgetSectionRootClientId,\n\t\tgetEditedContentOnlySection,\n\t\tisZoomOut,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { setLastFocus } = unlock( useDispatch( blockEditorStore ) );\n\n\t// Reference that holds the a flag for enabling or disabling\n\t// capturing on the focus capture elements.\n\tconst noCaptureRef = useRef();\n\n\t// The canvas is a single stop in the page's tab order, and going in is\n\t// an explicit action on it. Focus returns to the place it last left the\n\t// canvas from.\n\tfunction enterCanvas() {\n\t\t// Focus the canvas window first. The stop is in the parent document,\n\t\t// and when Firefox focuses an element in another document, it does\n\t\t// not move window focus, so the caret would be restored but key\n\t\t// presses would keep going to the parent page.\n\t\tcontainerRef.current.ownerDocument.defaultView.focus();\n\n\t\tif ( hasMultiSelection() ) {\n\t\t\tcontainerRef.current.focus();\n\t\t} else if ( getSelectedBlockClientId() ) {\n\t\t\tif ( getLastFocus()?.current ) {\n\t\t\t\tgetLastFocus().current.focus();\n\t\t\t} else {\n\t\t\t\t// Handles when the last focus has not been set yet, or has been cleared by new blocks being added via the inserter.\n\t\t\t\tcontainerRef.current\n\t\t\t\t\t.querySelector(\n\t\t\t\t\t\t`[data-block=\"${ getSelectedBlockClientId() }\"]`\n\t\t\t\t\t)\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t}\n\t\t// In \"compose\" mode without a selected ID, we want to place focus on the section root when tabbing to the canvas.\n\t\telse if ( isZoomOut() ) {\n\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\t\t\tconst sectionBlocks = getBlockOrder( sectionRootClientId );\n\n\t\t\t// If we have section within the section root, focus the first one.\n\t\t\tif ( sectionBlocks.length ) {\n\t\t\t\tcontainerRef.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionBlocks[ 0 ] }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t\t// If we don't have any section blocks, focus the section root.\n\t\t\telse if ( sectionRootClientId ) {\n\t\t\t\tcontainerRef.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionRootClientId }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t} else {\n\t\t\t\t// If we don't have any section root, focus the canvas.\n\t\t\t\tcontainerRef.current.focus();\n\t\t\t}\n\t\t} else {\n\t\t\tconst tabbables = focus.tabbable.find( containerRef.current );\n\t\t\tif ( tabbables.length ) {\n\t\t\t\ttabbables[ 0 ].focus();\n\t\t\t} else {\n\t\t\t\t// Nothing in the canvas is tabbable. Entering still enters:\n\t\t\t\t// keys go to the canvas, and a block can be selected with\n\t\t\t\t// the arrow keys or a click.\n\t\t\t\tcontainerRef.current.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction onStopKeyDown( event ) {\n\t\tif (\n\t\t\tevent.defaultPrevented ||\n\t\t\tevent.ctrlKey ||\n\t\t\tevent.metaKey ||\n\t\t\tevent.altKey\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { key } = event;\n\n\t\tif ( ! event.shiftKey && ENTRY_KEYS.includes( key ) ) {\n\t\t\tevent.preventDefault();\n\t\t\tenterCanvas();\n\t\t\treturn;\n\t\t}\n\n\t\t// Shift+Tab leaves the canvas on its own, because the stop is the\n\t\t// first element before it. Plain Tab would move into the content,\n\t\t// so move focus to the first tabbable element past the canvas.\n\t\tif ( key === 'Tab' && ! event.shiftKey ) {\n\t\t\tevent.preventDefault();\n\t\t\tfocus.tabbable.findNext( focusCaptureAfterRef.current )?.focus();\n\t\t}\n\t}\n\n\t// Focus arriving on the stop engages the canvas right away, like a\n\t// text field that starts editing when focused. Only Escape parks\n\t// focus on the stop, giving Tab traction again: from a parked stop,\n\t// Tab moves to the interface around the canvas, not the content.\n\tfunction onStopFocus() {\n\t\tif ( noCaptureRef.current ) {\n\t\t\tnoCaptureRef.current = null;\n\t\t\treturn;\n\t\t}\n\t\tenterCanvas();\n\t}\n\n\tconst before = (\n\t\t<div\n\t\t\tref={ focusCaptureBeforeRef }\n\t\t\ttabIndex=\"0\"\n\t\t\trole=\"button\"\n\t\t\taria-label={ __( 'Editor canvas' ) }\n\t\t\taria-describedby={ hintId }\n\t\t\tclassName=\"block-editor-writing-flow__canvas-stop\"\n\t\t\tstyle={ PREVENT_SCROLL_ON_FOCUS }\n\t\t\tonFocus={ onStopFocus }\n\t\t\tonKeyDown={ onStopKeyDown }\n\t\t\t// Assistive technology activates a button with a click event,\n\t\t\t// not a key press. Pointer clicks pass through the element, so\n\t\t\t// a click can only come from such an activation.\n\t\t\tonClick={ enterCanvas }\n\t\t>\n\t\t\t{ /* The hint is also the button's description for assistive\n\t\t\t technology. Content hidden with `display: none` still\n\t\t\t works for `aria-describedby`. */ }\n\t\t\t<div\n\t\t\t\tclassName=\"block-editor-writing-flow__canvas-stop-hint\"\n\t\t\t\tid={ hintId }\n\t\t\t>\n\t\t\t\t{ __( 'Press Enter to edit the document' ) }\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\t// Focus landing on the element after the canvas enters it, the same\n\t// as focus landing on the stop before it.\n\tfunction onFocusCapture() {\n\t\t// Do not act on focus set by the tab handler below, which moves\n\t\t// focus here so that the default behaviour (moving focus to the\n\t\t// next tabbable element) continues from this element.\n\t\tif ( noCaptureRef.current ) {\n\t\t\tnoCaptureRef.current = null;\n\t\t\treturn;\n\t\t}\n\t\tenterCanvas();\n\t}\n\n\tconst after = (\n\t\t<div\n\t\t\tref={ focusCaptureAfterRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t\tstyle={ PREVENT_SCROLL_ON_FOCUS }\n\t\t/>\n\t);\n\n\tconst ref = useRefEffect( ( node ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Escape steps out of the canvas onto its stop. Everything with\n\t\t\t// a stronger claim on the key runs first: handlers deeper in\n\t\t\t// the tree, capture handlers, and listeners registered earlier\n\t\t\t// on this node, like the automatic change undo. If the key is\n\t\t\t// still unclaimed here, nothing else wants it.\n\t\t\tif (\n\t\t\t\tevent.key === 'Escape' &&\n\t\t\t\t! event.shiftKey &&\n\t\t\t\t! event.ctrlKey &&\n\t\t\t\t! event.metaKey &&\n\t\t\t\t! event.altKey\n\t\t\t) {\n\t\t\t\t// While a content-only section is being edited, Escape first\n\t\t\t\t// stops editing it. That handler lives in the parent\n\t\t\t\t// document and runs after this one, so leave the key to it.\n\t\t\t\tif ( getEditedContentOnlySection() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( focusCaptureBeforeRef.current ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// Park on the stop instead of engaging the canvas,\n\t\t\t\t\t// which is what focus arriving on it normally does.\n\t\t\t\t\tnoCaptureRef.current = true;\n\t\t\t\t\tfocusCaptureBeforeRef.current.focus();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// In Edit mode, Tab should focus the first tabbable element after\n\t\t\t// the content, which is normally the sidebar (with block controls)\n\t\t\t// and Shift+Tab should focus the first tabbable element before the\n\t\t\t// content, which is normally the block toolbar.\n\t\t\t// Arrow keys can be used to navigate through blocks.\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Bails in case the focus capture elements aren’t present. They\n\t\t\t\t// may be omitted to avoid silent tab stops in preview mode.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/pull/59317\n\t\t\t\t! focusCaptureAfterRef.current ||\n\t\t\t\t! focusCaptureBeforeRef.current\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { target, shiftKey: isShift } = event;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst nextTabbable = focus.tabbable[ direction ]( target );\n\n\t\t\t// We want to constrain the tabbing to the block and its child blocks.\n\t\t\t// If the preceding form element is within a different block,\n\t\t\t// such as two sibling image blocks in the placeholder state,\n\t\t\t// we want shift + tab from the first form element to move to the image\n\t\t\t// block toolbar and not the previous image block's form element.\n\t\t\tconst currentBlock = target.closest( '[data-block]' );\n\t\t\tconst isElementPartOfSelectedBlock =\n\t\t\t\tcurrentBlock &&\n\t\t\t\tnextTabbable &&\n\t\t\t\t( isInSameBlock( currentBlock, nextTabbable ) ||\n\t\t\t\t\tisInsideRootBlock( currentBlock, nextTabbable ) );\n\n\t\t\t// Allow tabbing from the block wrapper to a form element,\n\t\t\t// and between form elements rendered in a block and its child blocks,\n\t\t\t// such as inside a placeholder. Form elements are generally\n\t\t\t// meant to be UI rather than part of the content. Ideally\n\t\t\t// these are not rendered in the content and perhaps in the\n\t\t\t// future they can be rendered in an iframe or shadow DOM.\n\t\t\tif (\n\t\t\t\tisFormElement( nextTabbable ) &&\n\t\t\t\tisElementPartOfSelectedBlock\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef;\n\n\t\t\t// Disable the focus forwarding on the focus capture element, so\n\t\t\t// it allows default behaviour (moving focus to the next tabbable\n\t\t\t// element).\n\t\t\tnoCaptureRef.current = true;\n\n\t\t\tnext.current.focus();\n\t\t}\n\n\t\tfunction onFocusOut( event ) {\n\t\t\t// `focusout` also fires when focus moves between elements within the\n\t\t\t// canvas, but only the element focus left the canvas from is of\n\t\t\t// interest. `contains` is false for a null `relatedTarget`, which is\n\t\t\t// what focus moving to another document reports.\n\t\t\tif ( ! node.contains( event.relatedTarget ) ) {\n\t\t\t\tsetLastFocus( { current: event.target } );\n\t\t\t}\n\n\t\t\tconst { ownerDocument } = node;\n\n\t\t\t// If focus disappears due to there being no blocks, move focus to\n\t\t\t// the writing flow wrapper.\n\t\t\tif (\n\t\t\t\t! event.relatedTarget &&\n\t\t\t\tevent.target.hasAttribute( 'data-block' ) &&\n\t\t\t\townerDocument.activeElement === ownerDocument.body &&\n\t\t\t\tgetBlockCount() === 0\n\t\t\t) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t}\n\n\t\t// During an IME composition, Escape and Tab control the input\n\t\t// method, not the editor.\n\t\tconst onKeyDownOutsideIME = withIgnoreIMEEvents( onKeyDown );\n\n\t\tnode.addEventListener( 'keydown', onKeyDownOutsideIME );\n\t\tnode.addEventListener( 'focusout', onFocusOut );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'keydown', onKeyDownOutsideIME );\n\t\t\tnode.removeEventListener( 'focusout', onFocusOut );\n\t\t};\n\t}, [] );\n\n\tconst mergedRefs = useMergeRefs( [ containerRef, ref ] );\n\n\treturn [ before, mergedRefs, after ];\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["import_dom", "blockEditorStore"]
|
|
7
7
|
}
|
|
@@ -17,18 +17,18 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// packages/block-editor/src/components/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
default: () =>
|
|
20
|
+
// packages/block-editor/src/components/writing-flow/use-undo-automatic-change.js
|
|
21
|
+
var use_undo_automatic_change_exports = {};
|
|
22
|
+
__export(use_undo_automatic_change_exports, {
|
|
23
|
+
default: () => useUndoAutomaticChange
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(use_undo_automatic_change_exports);
|
|
26
26
|
var import_keycodes = require("@wordpress/keycodes");
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
var import_data = require("@wordpress/data");
|
|
28
|
+
var import_compose = require("@wordpress/compose");
|
|
29
|
+
var import_store = require("../../store/index.cjs");
|
|
30
|
+
function useUndoAutomaticChange() {
|
|
31
|
+
const { didAutomaticChange, getSettings } = (0, import_data.useSelect)(import_store.store);
|
|
32
32
|
function onKeyDown(event) {
|
|
33
33
|
const { keyCode } = event;
|
|
34
34
|
if (event.defaultPrevented) {
|
|
@@ -37,8 +37,6 @@ var undo_automatic_change_default = (props) => (element) => {
|
|
|
37
37
|
if (keyCode !== import_keycodes.BACKSPACE && keyCode !== import_keycodes.ESCAPE) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
const { registry } = props.current;
|
|
41
|
-
const { didAutomaticChange, getSettings } = registry.select(import_store.store);
|
|
42
40
|
const { __experimentalUndo } = getSettings();
|
|
43
41
|
if (!__experimentalUndo) {
|
|
44
42
|
return;
|
|
@@ -49,6 +47,11 @@ var undo_automatic_change_default = (props) => (element) => {
|
|
|
49
47
|
event.preventDefault();
|
|
50
48
|
__experimentalUndo();
|
|
51
49
|
}
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
return (0, import_compose.useRefEffect)((element) => {
|
|
51
|
+
element.addEventListener("keydown", onKeyDown);
|
|
52
|
+
return () => {
|
|
53
|
+
element.removeEventListener("keydown", onKeyDown);
|
|
54
|
+
};
|
|
55
|
+
}, []);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=use-undo-automatic-change.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/writing-flow/use-undo-automatic-change.js"],
|
|
4
|
+
"sourcesContent": ["import { BACKSPACE, ESCAPE } from '@wordpress/keycodes';\nimport { useSelect } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function useUndoAutomaticChange() {\n\tconst { didAutomaticChange, getSettings } = useSelect( blockEditorStore );\n\n\tfunction onKeyDown( event ) {\n\t\tconst { keyCode } = event;\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( keyCode !== BACKSPACE && keyCode !== ESCAPE ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { __experimentalUndo } = getSettings();\n\n\t\tif ( ! __experimentalUndo ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! didAutomaticChange() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\t__experimentalUndo();\n\t}\n\n\treturn useRefEffect( ( element ) => {\n\t\telement.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\telement.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAkC;AAClC,kBAA0B;AAC1B,qBAA6B;AAC7B,mBAA0C;AAE3B,SAAR,yBAA0C;AAChD,QAAM,EAAE,oBAAoB,YAAY,QAAI,uBAAW,aAAAA,KAAiB;AAExE,WAAS,UAAW,OAAQ;AAC3B,UAAM,EAAE,QAAQ,IAAI;AAEpB,QAAK,MAAM,kBAAmB;AAC7B;AAAA,IACD;AAEA,QAAK,YAAY,6BAAa,YAAY,wBAAS;AAClD;AAAA,IACD;AAEA,UAAM,EAAE,mBAAmB,IAAI,YAAY;AAE3C,QAAK,CAAE,oBAAqB;AAC3B;AAAA,IACD;AAEA,QAAK,CAAE,mBAAmB,GAAI;AAC7B;AAAA,IACD;AAEA,UAAM,eAAe;AACrB,uBAAmB;AAAA,EACpB;AAEA,aAAO,6BAAc,CAAE,YAAa;AACnC,YAAQ,iBAAkB,WAAW,SAAU;AAC/C,WAAO,MAAM;AACZ,cAAQ,oBAAqB,WAAW,SAAU;AAAA,IACnD;AAAA,EACD,GAAG,CAAC,CAAE;AACP;",
|
|
6
|
+
"names": ["blockEditorStore"]
|
|
7
|
+
}
|
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
|
-
// packages/block-editor/src/components/writing-mode-control/index.
|
|
30
|
+
// packages/block-editor/src/components/writing-mode-control/index.jsx
|
|
31
31
|
var writing_mode_control_exports = {};
|
|
32
32
|
__export(writing_mode_control_exports, {
|
|
33
33
|
default: () => WritingModeControl
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/writing-mode-control/index.
|
|
3
|
+
"sources": ["../../../src/components/writing-mode-control/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import clsx from 'clsx';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { textHorizontal, textVertical } from '@wordpress/icons';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\n\nconst WRITING_MODES = [\n\t{\n\t\tlabel: __( 'Horizontal' ),\n\t\tvalue: 'horizontal-tb',\n\t\ticon: textHorizontal,\n\t},\n\t{\n\t\tlabel: __( 'Vertical' ),\n\t\tvalue: isRTL() ? 'vertical-lr' : 'vertical-rl',\n\t\ticon: textVertical,\n\t},\n];\n\n/**\n * Control to facilitate writing mode selections.\n *\n * @param {Object} props Component props.\n * @param {string} props.className Class name to add to the control.\n * @param {string} props.value Currently selected writing mode.\n * @param {Function} props.onChange Handles change in the writing mode selection.\n *\n * @return {Element} Writing Mode control.\n */\nexport default function WritingModeControl( { className, value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\tisDeselectable\n\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\tclassName={ clsx( 'block-editor-writing-mode-control', className ) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\tonChange( newValue === value ? undefined : newValue );\n\t\t\t} }\n\t\t>\n\t\t\t{ WRITING_MODES.map( ( option ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\ticon={ option.icon }\n\t\t\t\t\t\tlabel={ option.label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,kBAA0B;AAC1B,mBAA6C;AAC7C,wBAGO;AAsCF;AApCL,IAAM,gBAAgB;AAAA,EACrB;AAAA,IACC,WAAO,gBAAI,YAAa;AAAA,IACxB,OAAO;AAAA,IACP,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,WAAO,gBAAI,UAAW;AAAA,IACtB,WAAO,mBAAM,IAAI,gBAAgB;AAAA,IACjC,MAAM;AAAA,EACP;AACD;AAYe,SAAR,mBAAqC,EAAE,WAAW,OAAO,SAAS,GAAI;AAC5E,SACC;AAAA,IAAC,kBAAAA;AAAA,IAAA;AAAA,MACA,gBAAc;AAAA,MACd,WAAQ,gBAAI,aAAc;AAAA,MAC1B,eAAY,YAAAC,SAAM,qCAAqC,SAAU;AAAA,MACjE;AAAA,MACA,UAAW,CAAE,aAAc;AAC1B,iBAAU,aAAa,QAAQ,SAAY,QAAS;AAAA,MACrD;AAAA,MAEE,wBAAc,IAAK,CAAE,WAAY;AAClC,eACC;AAAA,UAAC,kBAAAC;AAAA,UAAA;AAAA,YAEA,OAAQ,OAAO;AAAA,YACf,MAAO,OAAO;AAAA,YACd,OAAQ,OAAO;AAAA;AAAA,UAHT,OAAO;AAAA,QAId;AAAA,MAEF,CAAE;AAAA;AAAA,EACH;AAEF;",
|
|
6
6
|
"names": ["ToggleGroupControl", "clsx", "ToggleGroupControlOptionIcon"]
|
package/build/hooks/align.cjs
CHANGED
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
|
-
// packages/block-editor/src/hooks/align.
|
|
30
|
+
// packages/block-editor/src/hooks/align.jsx
|
|
31
31
|
var align_exports = {};
|
|
32
32
|
__export(align_exports, {
|
|
33
33
|
addAssignedAlign: () => addAssignedAlign,
|