@wordpress/block-editor 7.0.4 → 8.0.3
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 +11 -0
- package/README.md +31 -0
- package/build/components/alignment-control/ui.js +12 -11
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/autocomplete/index.js +5 -4
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/block-actions/index.js +12 -8
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +21 -17
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +9 -4
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +6 -4
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +4 -3
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-caption/index.native.js +34 -29
- package/build/components/block-caption/index.native.js.map +1 -1
- package/build/components/block-card/index.js +8 -6
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-compare/block-view.js +9 -8
- package/build/components/block-compare/block-view.js.map +1 -1
- package/build/components/block-compare/index.js +9 -7
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-content-overlay/index.js +7 -6
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-context/index.js +5 -4
- package/build/components/block-context/index.js.map +1 -1
- package/build/components/block-controls/fill.js +7 -6
- package/build/components/block-controls/fill.js.map +1 -1
- package/build/components/block-controls/slot.js +5 -4
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-controls/slot.native.js +5 -4
- package/build/components/block-controls/slot.native.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.js +5 -4
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-draggable/index.js +13 -11
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-edit/context.js +1 -1
- package/build/components/block-full-height-alignment-control/index.js +7 -6
- package/build/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build/components/block-icon/index.js +12 -6
- package/build/components/block-icon/index.js.map +1 -1
- package/build/components/block-icon/index.native.js +8 -6
- package/build/components/block-icon/index.native.js.map +1 -1
- package/build/components/block-inspector/index.js +24 -15
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-html.js +4 -3
- package/build/components/block-list/block-html.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.js +28 -20
- package/build/components/block-list/block-invalid-warning.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.native.js +5 -4
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +6 -5
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js +11 -9
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.js +40 -33
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +35 -29
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +14 -12
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js +23 -18
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/insertion-point.native.js +4 -3
- package/build/components/block-list/insertion-point.native.js.map +1 -1
- package/build/components/block-list/layout.js +8 -6
- package/build/components/block-list/layout.js.map +1 -1
- package/build/components/block-list/subdirectory-icon.js +13 -10
- package/build/components/block-list/subdirectory-icon.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +5 -3
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.native.js +2 -1
- package/build/components/block-list/use-block-props/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-refs.js +2 -2
- package/build/components/block-list/use-block-props/use-multi-selection.js +30 -14
- package/build/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
- package/build/components/block-list-appender/index.js +16 -13
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-list-appender/index.native.js +14 -11
- package/build/components/block-list-appender/index.native.js.map +1 -1
- package/build/components/block-media-update-progress/index.native.js +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +46 -42
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/index.js +4 -3
- package/build/components/block-mobile-toolbar/index.js.map +1 -1
- package/build/components/block-mobile-toolbar/index.native.js +33 -25
- package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build/components/block-mover/button.js +8 -7
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +15 -13
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +23 -20
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-mover/mover-description.native.js +10 -7
- package/build/components/block-mover/mover-description.native.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +26 -22
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +26 -22
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +46 -39
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-list/index.js +45 -47
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-preview/auto.js +5 -4
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +8 -7
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-preview/live.js +4 -3
- package/build/components/block-preview/live.js.map +1 -1
- package/build/components/block-selection-clearer/index.js +1 -1
- package/build/components/block-settings/button.native.js +10 -7
- package/build/components/block-settings/button.native.js.map +1 -1
- package/build/components/block-settings/container.native.js +12 -8
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings/index.native.js +4 -2
- package/build/components/block-settings/index.native.js.map +1 -1
- package/build/components/block-settings-menu/block-convert-button.js +7 -5
- package/build/components/block-settings-menu/block-convert-button.js.map +1 -1
- package/build/components/block-settings-menu/block-html-convert-button.js +14 -10
- package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.js +25 -19
- package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +96 -68
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js +5 -4
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +8 -6
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +20 -17
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +6 -4
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-styles/preview.native.js +9 -8
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-switcher/block-styles-menu.js +5 -4
- package/build/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +7 -6
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js +9 -8
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-switcher/index.js +42 -34
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +22 -18
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +4 -3
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +1 -1
- package/build/components/block-switcher/utils.js +2 -1
- package/build/components/block-switcher/utils.js.map +1 -1
- package/build/components/block-title/index.js +4 -3
- package/build/components/block-title/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +4 -3
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/utils.js +13 -11
- package/build/components/block-toolbar/utils.js.map +1 -1
- package/build/components/block-tools/back-compat.js +8 -5
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +6 -5
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/block-popover.js +15 -13
- package/build/components/block-tools/block-popover.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +6 -5
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +6 -5
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +12 -10
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-types-list/index.js +9 -8
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +19 -15
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-picker/index.js +9 -8
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +9 -7
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +22 -15
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +9 -7
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/all-input-control.js +6 -5
- package/build/components/border-radius-control/all-input-control.js.map +1 -1
- package/build/components/border-radius-control/index.js +5 -4
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +16 -11
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +5 -4
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/border-radius-control/utils.js +10 -5
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/border-style-control/index.js +5 -4
- package/build/components/border-style-control/index.js.map +1 -1
- package/build/components/button-block-appender/index.js +15 -13
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/button-block-appender/index.native.js +28 -24
- package/build/components/button-block-appender/index.native.js.map +1 -1
- package/build/components/caption/index.native.js +44 -41
- package/build/components/caption/index.native.js.map +1 -1
- package/build/components/color-palette/control.js +6 -5
- package/build/components/color-palette/control.js.map +1 -1
- package/build/components/color-style-selector/index.js +43 -34
- package/build/components/color-style-selector/index.js.map +1 -1
- package/build/components/colors/color-panel.js +21 -18
- package/build/components/colors/color-panel.js.map +1 -1
- package/build/components/colors/index.js +10 -8
- package/build/components/colors/index.js.map +1 -1
- package/build/components/colors/utils.js +7 -4
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +17 -6
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +21 -59
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +110 -30
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js +28 -24
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build/components/contrast-checker/index.js +18 -15
- package/build/components/contrast-checker/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +9 -8
- package/build/components/convert-to-group-buttons/index.js.map +1 -1
- package/build/components/copy-handler/index.js +6 -5
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/default-block-appender/index.js +10 -8
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/default-block-appender/index.native.js +10 -8
- package/build/components/default-block-appender/index.native.js.map +1 -1
- package/build/components/default-style-picker/index.js +14 -10
- package/build/components/default-style-picker/index.js.map +1 -1
- package/build/components/duotone-control/index.js +20 -14
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/editable-text/index.js +6 -5
- package/build/components/editable-text/index.js.map +1 -1
- package/build/components/editor-styles/index.js +4 -3
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/floating-toolbar/index.native.js +8 -7
- package/build/components/floating-toolbar/index.native.js.map +1 -1
- package/build/components/font-appearance-control/index.js +53 -34
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +12 -10
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/index.js +6 -6
- package/build/components/font-sizes/index.native.js +6 -6
- package/build/components/font-sizes/utils.js +2 -2
- package/build/components/font-sizes/with-font-sizes.js +11 -5
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/gradients/use-gradient.js +7 -6
- package/build/components/gradients/use-gradient.js.map +1 -1
- package/build/components/iframe/index.js +29 -23
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +90 -82
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/image-editor/constants.js +1 -1
- package/build/components/image-editor/context.js +11 -10
- package/build/components/image-editor/context.js.map +1 -1
- package/build/components/image-editor/cropper.js +9 -8
- package/build/components/image-editor/cropper.js.map +1 -1
- package/build/components/image-editor/index.js +10 -9
- package/build/components/image-editor/index.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +12 -11
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/image-editor/use-transform-image.js +6 -5
- package/build/components/image-editor/use-transform-image.js.map +1 -1
- package/build/components/image-editor/zoom-dropdown.js +13 -10
- package/build/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build/components/image-size-control/index.js +12 -11
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.js +217 -197
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +113 -111
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +8 -7
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/default-block-appender.js +9 -7
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +9 -6
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +8 -5
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js +64 -0
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/patterns-list.js +114 -0
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/sidebar.js +82 -0
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
- package/build/components/inserter/block-patterns-tab.js +92 -57
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +9 -7
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +9 -8
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js +9 -10
- package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +6 -5
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +11 -9
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/index.js +36 -28
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +46 -37
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/library.js +12 -11
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/menu.js +12 -11
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js +31 -27
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/panel.js +6 -5
- package/build/components/inserter/panel.js.map +1 -1
- package/build/components/inserter/pattern-panel.js +25 -15
- package/build/components/inserter/pattern-panel.js.map +1 -1
- package/build/components/inserter/preview-panel.js +4 -3
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +7 -6
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.js +18 -13
- package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +6 -5
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/search-items.js +23 -7
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +15 -14
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/search-results.native.js +11 -10
- package/build/components/inserter/search-results.native.js.map +1 -1
- package/build/components/inserter/tabs.js +7 -6
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter/tabs.native.js +55 -37
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter/utils.native.js +10 -8
- package/build/components/inserter/utils.native.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +12 -10
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-list-item/index.js +79 -73
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inserter-listbox/index.js +8 -7
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +7 -6
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inspector-controls/block-support-slot-container.js +5 -4
- package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +8 -6
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +5 -4
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +6 -5
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/groups.js +3 -1
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls/slot.js +7 -6
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls/slot.native.js +5 -4
- package/build/components/inspector-controls/slot.native.js.map +1 -1
- package/build/components/justify-content-control/ui.js +10 -8
- package/build/components/justify-content-control/ui.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +13 -9
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/line-height-control/index.js +5 -4
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/line-height-control/index.native.js +5 -4
- package/build/components/line-height-control/index.native.js.map +1 -1
- package/build/components/line-height-control/utils.js +1 -1
- package/build/components/link-control/index.js +107 -52
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/link-preview.js +24 -10
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-create-button.js +9 -7
- package/build/components/link-control/search-create-button.js.map +1 -1
- package/build/components/link-control/search-input.js +31 -21
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-item.js +10 -9
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +15 -14
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +7 -5
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +5 -4
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/link-control/viewer-slot.js +1 -1
- package/build/components/list-view/appender.js +27 -23
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/block-contents.js +32 -28
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +18 -17
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +122 -83
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +92 -73
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +5 -4
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/expander.js +4 -3
- package/build/components/list-view/expander.js.map +1 -1
- package/build/components/list-view/index.js +47 -23
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +12 -11
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/list-item.js +8 -7
- package/build/components/list-view/list-item.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +8 -58
- package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build/components/media-placeholder/index.js +86 -68
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +5 -4
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +85 -72
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/check.js +5 -4
- package/build/components/media-upload/check.js.map +1 -1
- package/build/components/media-upload/index.native.js +1 -1
- package/build/components/media-upload-progress/index.native.js +1 -1
- package/build/components/multi-selection-inspector/index.js +4 -3
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +8 -7
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/observe-typing/index.js +5 -4
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/panel-color-settings/index.js +16 -12
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/plain-text/index.js +6 -4
- package/build/components/plain-text/index.js.map +1 -1
- package/build/components/preview-options/index.js +8 -7
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/block-refs-provider.js +5 -4
- package/build/components/provider/block-refs-provider.js.map +1 -1
- package/build/components/provider/use-block-sync.js +8 -7
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +7 -5
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/responsive-block-control/label.js +6 -5
- package/build/components/responsive-block-control/label.js.map +1 -1
- package/build/components/rich-text/embed-handler-picker.native.js +8 -5
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build/components/rich-text/file-paste-handler.js +6 -3
- package/build/components/rich-text/file-paste-handler.js.map +1 -1
- package/build/components/rich-text/format-edit.js +36 -9
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +20 -10
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +6 -4
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/index.js +45 -41
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +145 -122
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/input-event.js +5 -4
- package/build/components/rich-text/input-event.js.map +1 -1
- package/build/components/rich-text/shortcut.js +6 -5
- package/build/components/rich-text/shortcut.js.map +1 -1
- package/build/components/rich-text/split-value.js +10 -8
- package/build/components/rich-text/split-value.js.map +1 -1
- package/build/components/rich-text/toolbar-button.js +7 -6
- package/build/components/rich-text/toolbar-button.js.map +1 -1
- package/build/components/rich-text/use-caret-in-format.js +4 -3
- package/build/components/rich-text/use-caret-in-format.js.map +1 -1
- package/build/components/rich-text/use-enter.js +6 -3
- package/build/components/rich-text/use-enter.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +13 -10
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +15 -9
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-mark-persistent.js +5 -4
- package/build/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +28 -4
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/rich-text/utils.js +9 -7
- package/build/components/rich-text/utils.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +4 -3
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/text-decoration-control/index.js +5 -4
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +5 -4
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/tool-selector/index.js +16 -13
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/typewriter/index.js +10 -7
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/ungroup-button/index.native.js +12 -9
- package/build/components/ungroup-button/index.native.js.map +1 -1
- package/build/components/unit-control/index.js +5 -4
- package/build/components/unit-control/index.js.map +1 -1
- package/build/components/url-input/index.js +23 -13
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-input/index.native.js +8 -6
- package/build/components/url-input/index.native.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +12 -11
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/index.js +9 -8
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/url-popover/link-editor.js +8 -7
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/url-popover/link-viewer-url.js +6 -5
- package/build/components/url-popover/link-viewer-url.js.map +1 -1
- package/build/components/url-popover/link-viewer.js +9 -8
- package/build/components/url-popover/link-viewer.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +9 -8
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +17 -13
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-no-recursive-renders/index.js +10 -6
- package/build/components/use-no-recursive-renders/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +2 -2
- package/build/components/use-setting/index.js +48 -9
- package/build/components/use-setting/index.js.map +1 -1
- package/build/components/warning/index.js +7 -6
- package/build/components/warning/index.js.map +1 -1
- package/build/components/warning/index.native.js +10 -9
- package/build/components/warning/index.native.js.map +1 -1
- package/build/components/writing-flow/index.js +6 -5
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-arrow-nav.js +2 -2
- package/build/hooks/align.js +12 -7
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/border.js +9 -7
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color-panel.js +9 -7
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color.js +4 -3
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +4 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +29 -15
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-appearance.js +60 -14
- package/build/hooks/font-appearance.js.map +1 -1
- package/build/hooks/font-family.js +62 -32
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +57 -13
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/gap.js +10 -8
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/index.js +16 -8
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +16 -8
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.js +16 -13
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/letter-spacing.js +50 -11
- package/build/hooks/letter-spacing.js.map +1 -1
- package/build/hooks/line-height.js +51 -12
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/margin.js +11 -9
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +11 -9
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +9 -5
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/text-decoration.js +48 -10
- package/build/hooks/text-decoration.js.map +1 -1
- package/build/hooks/text-transform.js +48 -10
- package/build/hooks/text-transform.js.map +1 -1
- package/build/hooks/typography.js +111 -10
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +3 -2
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-border-props.js +5 -4
- package/build/hooks/use-border-props.js.map +1 -1
- package/build/hooks/use-cached-truthy.js +29 -0
- package/build/hooks/use-cached-truthy.js.map +1 -0
- package/build/index.js +21 -14
- package/build/index.js.map +1 -1
- package/build/layouts/flex.js +172 -52
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +10 -8
- package/build/layouts/flow.js.map +1 -1
- package/build/layouts/index.js +2 -1
- package/build/layouts/index.js.map +1 -1
- package/build/layouts/utils.js +2 -1
- package/build/layouts/utils.js.map +1 -1
- package/build/store/actions.js +486 -369
- package/build/store/actions.js.map +1 -1
- package/build/store/array.js +2 -1
- package/build/store/array.js.map +1 -1
- package/build/store/index.js +6 -6
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +145 -69
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +259 -172
- package/build/store/selectors.js.map +1 -1
- package/build/utils/block-variation-transforms.js +4 -3
- package/build/utils/block-variation-transforms.js.map +1 -1
- package/build/utils/dom.js +1 -1
- package/build/utils/get-paste-event-data.js +10 -6
- package/build/utils/get-paste-event-data.js.map +1 -1
- package/build/utils/index.js +4 -4
- package/build/utils/math.js +2 -1
- package/build/utils/math.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +6 -3
- package/build/utils/parse-css-unit-to-px.js.map +1 -1
- package/build/utils/transform-styles/index.js +8 -6
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build/utils/transform-styles/transforms/wrap.js +31 -28
- package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +12 -11
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/autocomplete/index.js +4 -3
- package/build-module/components/autocomplete/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +12 -8
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +21 -17
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +9 -4
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +6 -4
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +4 -3
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-caption/index.native.js +34 -29
- package/build-module/components/block-caption/index.native.js.map +1 -1
- package/build-module/components/block-card/index.js +8 -6
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-compare/block-view.js +9 -8
- package/build-module/components/block-compare/block-view.js.map +1 -1
- package/build-module/components/block-compare/index.js +9 -7
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-content-overlay/index.js +7 -6
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-context/index.js +5 -4
- package/build-module/components/block-context/index.js.map +1 -1
- package/build-module/components/block-controls/fill.js +7 -6
- package/build-module/components/block-controls/fill.js.map +1 -1
- package/build-module/components/block-controls/slot.js +5 -4
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-controls/slot.native.js +5 -4
- package/build-module/components/block-controls/slot.native.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +5 -4
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-draggable/index.js +13 -11
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-full-height-alignment-control/index.js +7 -6
- package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build-module/components/block-icon/index.js +11 -5
- package/build-module/components/block-icon/index.js.map +1 -1
- package/build-module/components/block-icon/index.native.js +8 -6
- package/build-module/components/block-icon/index.native.js.map +1 -1
- package/build-module/components/block-inspector/index.js +20 -13
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-html.js +4 -3
- package/build-module/components/block-list/block-html.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.js +27 -19
- package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.native.js +5 -4
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +6 -5
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-selection-button.native.js +11 -9
- package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
- package/build-module/components/block-list/block.js +40 -33
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +35 -29
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +13 -11
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +22 -17
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/insertion-point.native.js +4 -3
- package/build-module/components/block-list/insertion-point.native.js.map +1 -1
- package/build-module/components/block-list/layout.js +5 -4
- package/build-module/components/block-list/layout.js.map +1 -1
- package/build-module/components/block-list/subdirectory-icon.js +13 -10
- package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +5 -3
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.native.js +2 -1
- package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-multi-selection.js +30 -14
- package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +16 -13
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.native.js +14 -11
- package/build-module/components/block-list-appender/index.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +46 -42
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/index.js +4 -3
- package/build-module/components/block-mobile-toolbar/index.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js +33 -25
- package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-mover/button.js +7 -6
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +15 -13
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +22 -19
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-mover/mover-description.native.js +10 -7
- package/build-module/components/block-mover/mover-description.native.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +26 -22
- package/build-module/components/block-navigation/dropdown.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +26 -22
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +46 -39
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +45 -45
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +5 -4
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +8 -7
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-preview/live.js +4 -3
- package/build-module/components/block-preview/live.js.map +1 -1
- package/build-module/components/block-settings/button.native.js +10 -7
- package/build-module/components/block-settings/button.native.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +13 -9
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-convert-button.js +7 -5
- package/build-module/components/block-settings-menu/block-convert-button.js.map +1 -1
- package/build-module/components/block-settings-menu/block-html-convert-button.js +14 -10
- package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
- package/build-module/components/block-settings-menu/block-mode-toggle.js +25 -19
- package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +98 -70
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +5 -4
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +8 -6
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +20 -17
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +6 -4
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +9 -8
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-switcher/block-styles-menu.js +5 -4
- package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +7 -6
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js +9 -8
- package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build-module/components/block-switcher/index.js +41 -33
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +22 -18
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +4 -3
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-switcher/utils.js +2 -1
- package/build-module/components/block-switcher/utils.js.map +1 -1
- package/build-module/components/block-title/index.js +4 -3
- package/build-module/components/block-title/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +4 -3
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/utils.js +13 -11
- package/build-module/components/block-toolbar/utils.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +4 -3
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +6 -5
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/block-popover.js +15 -13
- package/build-module/components/block-tools/block-popover.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +6 -5
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +6 -5
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +11 -9
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-types-list/index.js +9 -8
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +19 -15
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +9 -8
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +9 -7
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +22 -15
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +9 -7
- package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build-module/components/border-radius-control/all-input-control.js +6 -5
- package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +5 -4
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +16 -11
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +5 -4
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js +8 -3
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/border-style-control/index.js +5 -4
- package/build-module/components/border-style-control/index.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +15 -13
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/button-block-appender/index.native.js +28 -24
- package/build-module/components/button-block-appender/index.native.js.map +1 -1
- package/build-module/components/caption/index.native.js +44 -41
- package/build-module/components/caption/index.native.js.map +1 -1
- package/build-module/components/color-palette/control.js +6 -5
- package/build-module/components/color-palette/control.js.map +1 -1
- package/build-module/components/color-style-selector/index.js +43 -34
- package/build-module/components/color-style-selector/index.js.map +1 -1
- package/build-module/components/colors/color-panel.js +21 -18
- package/build-module/components/colors/color-panel.js.map +1 -1
- package/build-module/components/colors/utils.js +6 -3
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +17 -6
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +25 -65
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +111 -30
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +28 -24
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build-module/components/contrast-checker/index.js +18 -15
- package/build-module/components/contrast-checker/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +9 -8
- package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
- package/build-module/components/copy-handler/index.js +4 -3
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +10 -8
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.native.js +10 -8
- package/build-module/components/default-block-appender/index.native.js.map +1 -1
- package/build-module/components/default-style-picker/index.js +14 -10
- package/build-module/components/default-style-picker/index.js.map +1 -1
- package/build-module/components/duotone-control/index.js +20 -14
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/editable-text/index.js +6 -5
- package/build-module/components/editable-text/index.js.map +1 -1
- package/build-module/components/editor-styles/index.js +4 -3
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/floating-toolbar/index.native.js +8 -7
- package/build-module/components/floating-toolbar/index.native.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +49 -34
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +12 -10
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +11 -5
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/gradients/use-gradient.js +5 -4
- package/build-module/components/gradients/use-gradient.js.map +1 -1
- package/build-module/components/iframe/index.js +29 -23
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +90 -82
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/image-editor/context.js +11 -10
- package/build-module/components/image-editor/context.js.map +1 -1
- package/build-module/components/image-editor/cropper.js +9 -8
- package/build-module/components/image-editor/cropper.js.map +1 -1
- package/build-module/components/image-editor/index.js +9 -8
- package/build-module/components/image-editor/index.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +12 -11
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/image-editor/use-transform-image.js +6 -5
- package/build-module/components/image-editor/use-transform-image.js.map +1 -1
- package/build-module/components/image-editor/zoom-dropdown.js +13 -10
- package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build-module/components/image-size-control/index.js +12 -11
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.js +3 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.js +8 -7
- package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/default-block-appender.js +9 -7
- package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +9 -6
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +8 -5
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js +52 -0
- package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +95 -0
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js +73 -0
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab.js +93 -58
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +9 -7
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +9 -8
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +9 -10
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +6 -5
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +11 -9
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/index.js +36 -28
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +46 -37
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/library.js +12 -11
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/menu.js +12 -11
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/menu.native.js +31 -27
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/panel.js +6 -5
- package/build-module/components/inserter/panel.js.map +1 -1
- package/build-module/components/inserter/pattern-panel.js +27 -18
- package/build-module/components/inserter/pattern-panel.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +4 -3
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +7 -6
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.js +18 -13
- package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +6 -5
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/inserter/search-items.js +23 -7
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.js +15 -14
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/search-results.native.js +11 -10
- package/build-module/components/inserter/search-results.native.js.map +1 -1
- package/build-module/components/inserter/tabs.js +7 -6
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +55 -37
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inserter/utils.native.js +10 -8
- package/build-module/components/inserter/utils.native.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +12 -10
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +75 -69
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inserter-listbox/index.js +4 -3
- package/build-module/components/inserter-listbox/index.js.map +1 -1
- package/build-module/components/inserter-listbox/item.js +7 -6
- package/build-module/components/inserter-listbox/item.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-slot-container.js +5 -4
- package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +8 -6
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +5 -4
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +6 -5
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +3 -1
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +7 -6
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls/slot.native.js +5 -4
- package/build-module/components/inspector-controls/slot.native.js.map +1 -1
- package/build-module/components/justify-content-control/ui.js +10 -8
- package/build-module/components/justify-content-control/ui.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +13 -9
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js +5 -4
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.native.js +5 -4
- package/build-module/components/line-height-control/index.native.js.map +1 -1
- package/build-module/components/link-control/index.js +107 -53
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +24 -11
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-create-button.js +9 -7
- package/build-module/components/link-control/search-create-button.js.map +1 -1
- package/build-module/components/link-control/search-input.js +30 -21
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/search-item.js +10 -9
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +15 -14
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +7 -5
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +4 -3
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/appender.js +27 -23
- package/build-module/components/list-view/appender.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +32 -28
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +18 -17
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +121 -83
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +92 -73
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +5 -4
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/expander.js +4 -3
- package/build-module/components/list-view/expander.js.map +1 -1
- package/build-module/components/list-view/index.js +49 -25
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +12 -11
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/list-item.js +8 -7
- package/build-module/components/list-view/list-item.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +8 -58
- package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +86 -68
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +5 -4
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +85 -72
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/check.js +5 -4
- package/build-module/components/media-upload/check.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +4 -3
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +8 -7
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/observe-typing/index.js +4 -3
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/panel-color-settings/index.js +16 -12
- package/build-module/components/panel-color-settings/index.js.map +1 -1
- package/build-module/components/plain-text/index.js +6 -4
- package/build-module/components/plain-text/index.js.map +1 -1
- package/build-module/components/preview-options/index.js +8 -7
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/block-refs-provider.js +4 -3
- package/build-module/components/provider/block-refs-provider.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +8 -7
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +7 -5
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/responsive-block-control/label.js +6 -5
- package/build-module/components/responsive-block-control/label.js.map +1 -1
- package/build-module/components/rich-text/embed-handler-picker.native.js +8 -5
- package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build-module/components/rich-text/file-paste-handler.js +6 -3
- package/build-module/components/rich-text/file-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/format-edit.js +36 -10
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +20 -10
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +6 -4
- package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build-module/components/rich-text/index.js +44 -40
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +145 -122
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/input-event.js +5 -4
- package/build-module/components/rich-text/input-event.js.map +1 -1
- package/build-module/components/rich-text/shortcut.js +6 -5
- package/build-module/components/rich-text/shortcut.js.map +1 -1
- package/build-module/components/rich-text/split-value.js +10 -8
- package/build-module/components/rich-text/split-value.js.map +1 -1
- package/build-module/components/rich-text/toolbar-button.js +7 -6
- package/build-module/components/rich-text/toolbar-button.js.map +1 -1
- package/build-module/components/rich-text/use-caret-in-format.js +4 -3
- package/build-module/components/rich-text/use-caret-in-format.js.map +1 -1
- package/build-module/components/rich-text/use-enter.js +6 -3
- package/build-module/components/rich-text/use-enter.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +13 -10
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +15 -9
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js +5 -4
- package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +28 -4
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/utils.js +7 -5
- package/build-module/components/rich-text/utils.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +4 -3
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/text-decoration-control/index.js +5 -4
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +5 -4
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/tool-selector/index.js +16 -13
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/typewriter/index.js +9 -6
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/ungroup-button/index.native.js +12 -9
- package/build-module/components/ungroup-button/index.native.js.map +1 -1
- package/build-module/components/unit-control/index.js +5 -4
- package/build-module/components/unit-control/index.js.map +1 -1
- package/build-module/components/url-input/index.js +23 -13
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-input/index.native.js +8 -6
- package/build-module/components/url-input/index.native.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +12 -11
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/index.js +9 -8
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +8 -7
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/url-popover/link-viewer-url.js +6 -5
- package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
- package/build-module/components/url-popover/link-viewer.js +9 -8
- package/build-module/components/url-popover/link-viewer.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +8 -7
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +17 -13
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-no-recursive-renders/index.js +10 -6
- package/build-module/components/use-no-recursive-renders/index.js.map +1 -1
- package/build-module/components/use-setting/index.js +48 -9
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/components/warning/index.js +7 -6
- package/build-module/components/warning/index.js.map +1 -1
- package/build-module/components/warning/index.native.js +10 -9
- package/build-module/components/warning/index.native.js.map +1 -1
- package/build-module/components/writing-flow/index.js +5 -4
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/hooks/align.js +9 -4
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/border.js +8 -6
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color-panel.js +9 -7
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/dimensions.js +2 -1
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +29 -15
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-appearance.js +54 -12
- package/build-module/hooks/font-appearance.js.map +1 -1
- package/build-module/hooks/font-family.js +57 -31
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +52 -12
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/gap.js +9 -7
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout.js +16 -13
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/letter-spacing.js +45 -10
- package/build-module/hooks/letter-spacing.js.map +1 -1
- package/build-module/hooks/line-height.js +46 -11
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/margin.js +10 -8
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +10 -8
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +7 -3
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/text-decoration.js +43 -9
- package/build-module/hooks/text-decoration.js.map +1 -1
- package/build-module/hooks/text-transform.js +43 -9
- package/build-module/hooks/text-transform.js.map +1 -1
- package/build-module/hooks/typography.js +119 -18
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/typography.native.js +2 -1
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-border-props.js +5 -4
- package/build-module/hooks/use-border-props.js.map +1 -1
- package/build-module/hooks/use-cached-truthy.js +21 -0
- package/build-module/hooks/use-cached-truthy.js.map +1 -0
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/flex.js +176 -56
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +10 -8
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/layouts/index.js +2 -1
- package/build-module/layouts/index.js.map +1 -1
- package/build-module/layouts/utils.js +2 -1
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/store/actions.js +410 -320
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/array.js +2 -1
- package/build-module/store/array.js.map +1 -1
- package/build-module/store/index.js +1 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +129 -54
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +197 -117
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/block-variation-transforms.js +4 -3
- package/build-module/utils/block-variation-transforms.js.map +1 -1
- package/build-module/utils/get-paste-event-data.js +10 -6
- package/build-module/utils/get-paste-event-data.js.map +1 -1
- package/build-module/utils/math.js +2 -1
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +5 -2
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +8 -6
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-module/utils/transform-styles/transforms/wrap.js +28 -25
- package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-style/style-rtl.css +160 -57
- package/build-style/style.css +160 -57
- package/package.json +27 -28
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +0 -2
- package/src/components/alignment-control/ui.js +1 -4
- package/src/components/block-draggable/style.scss +19 -4
- package/src/components/block-icon/index.js +4 -1
- package/src/components/block-inspector/index.js +5 -0
- package/src/components/block-list/index.native.js +1 -1
- package/src/components/block-list/use-block-props/use-multi-selection.js +27 -7
- package/src/components/block-navigation/dropdown.js +0 -1
- package/src/components/block-patterns-list/index.js +1 -8
- package/src/components/block-patterns-list/style.scss +22 -12
- package/src/components/block-settings/container.native.js +7 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +19 -7
- package/src/components/block-styles/preview.native.js +2 -2
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +1 -1
- package/src/components/color-palette/test/__snapshots__/control.js.snap +88 -63
- package/src/components/colors-gradients/control.js +19 -62
- package/src/components/colors-gradients/panel-color-gradient-settings.js +76 -6
- package/src/components/colors-gradients/style.scss +3 -14
- package/src/components/colors-gradients/test/control.js +0 -16
- package/src/components/duotone-control/index.js +6 -0
- package/src/components/duotone-control/style.scss +27 -12
- package/src/components/font-appearance-control/index.js +22 -14
- package/src/components/iframe/index.js +1 -1
- package/src/components/index.js +3 -4
- package/src/components/index.native.js +1 -4
- package/src/components/inner-blocks/index.js +4 -4
- package/src/components/inner-blocks/index.native.js +7 -4
- package/src/components/inserter/block-patterns-explorer/explorer.js +50 -0
- package/src/components/inserter/block-patterns-explorer/patterns-list.js +122 -0
- package/src/components/inserter/block-patterns-explorer/sidebar.js +73 -0
- package/src/components/inserter/block-patterns-tab.js +107 -80
- package/src/components/inserter/hooks/use-block-type-impressions.native.js +14 -21
- package/src/components/inserter/pattern-panel.js +33 -16
- package/src/components/inserter/style.scss +64 -1
- package/src/components/inserter/test/block-types-tab.native.js +1 -1
- package/src/components/inserter/test/fixtures/index.native.js +12 -0
- package/src/components/inspector-controls/groups.js +4 -0
- package/src/components/letter-spacing-control/index.js +12 -6
- package/src/components/link-control/README.md +7 -0
- package/src/components/link-control/index.js +99 -34
- package/src/components/link-control/link-preview.js +21 -9
- package/src/components/link-control/search-input.js +9 -3
- package/src/components/link-control/style.scss +32 -16
- package/src/components/link-control/test/index.js +179 -4
- package/src/components/list-view/block.js +67 -23
- package/src/components/list-view/branch.js +113 -91
- package/src/components/list-view/index.js +58 -19
- package/src/components/list-view/leaf.js +1 -1
- package/src/components/list-view/style.scss +14 -3
- package/src/components/list-view/use-list-view-client-ids.js +7 -66
- package/src/components/rich-text/embed-handler-picker.native.js +1 -0
- package/src/components/rich-text/format-edit.js +36 -2
- package/src/components/rich-text/format-toolbar/index.js +3 -0
- package/src/components/rich-text/use-paste-handler.js +22 -0
- package/src/components/url-input/index.js +14 -4
- package/src/components/use-setting/index.js +49 -11
- package/src/hooks/border.js +8 -11
- package/src/hooks/color-panel.js +1 -0
- package/src/hooks/duotone.js +21 -7
- package/src/hooks/font-appearance.js +38 -7
- package/src/hooks/font-family.js +29 -13
- package/src/hooks/font-size.js +42 -6
- package/src/hooks/index.js +1 -0
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/layout.scss +3 -1
- package/src/hooks/letter-spacing.js +35 -7
- package/src/hooks/line-height.js +37 -9
- package/src/hooks/margin.js +1 -1
- package/src/hooks/padding.js +1 -1
- package/src/hooks/text-decoration.js +34 -6
- package/src/hooks/text-transform.js +34 -6
- package/src/hooks/typography.js +165 -15
- package/src/hooks/typography.scss +16 -0
- package/src/hooks/use-cached-truthy.js +20 -0
- package/src/index.js +1 -0
- package/src/layouts/flex.js +155 -41
- package/src/store/actions.js +223 -391
- package/src/store/index.js +1 -2
- package/src/store/reducer.js +36 -18
- package/src/store/selectors.js +52 -47
- package/src/store/test/actions.js +395 -694
- package/src/store/test/selectors.js +79 -21
- package/src/style.scss +1 -1
- package/src/utils/test/parse-css-unit-to-px.js +127 -167
- package/build/components/text-decoration-and-transform/index.js +0 -39
- package/build/components/text-decoration-and-transform/index.js.map +0 -1
- package/build/store/controls.js +0 -44
- package/build/store/controls.js.map +0 -1
- package/build-module/components/text-decoration-and-transform/index.js +0 -30
- package/build-module/components/text-decoration-and-transform/index.js.map +0 -1
- package/build-module/store/controls.js +0 -32
- package/build-module/store/controls.js.map +0 -1
- package/src/components/text-decoration-and-transform/index.js +0 -36
- package/src/components/text-decoration-and-transform/style.scss +0 -3
- package/src/store/controls.js +0 -39
package/build/store/actions.js
CHANGED
|
@@ -5,59 +5,54 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.updateBlockAttributes = updateBlockAttributes;
|
|
13
|
-
exports.updateBlock = updateBlock;
|
|
14
|
-
exports.selectBlock = selectBlock;
|
|
15
|
-
exports.selectPreviousBlock = selectPreviousBlock;
|
|
16
|
-
exports.selectNextBlock = selectNextBlock;
|
|
17
|
-
exports.startMultiSelect = startMultiSelect;
|
|
18
|
-
exports.stopMultiSelect = stopMultiSelect;
|
|
19
|
-
exports.multiSelect = multiSelect;
|
|
8
|
+
exports.__unstableMarkAutomaticChange = void 0;
|
|
9
|
+
exports.__unstableMarkLastChangeAsPersistent = __unstableMarkLastChangeAsPersistent;
|
|
10
|
+
exports.__unstableMarkNextChangeAsNotPersistent = __unstableMarkNextChangeAsNotPersistent;
|
|
11
|
+
exports.__unstableSaveReusableBlock = __unstableSaveReusableBlock;
|
|
20
12
|
exports.clearSelectedBlock = clearSelectedBlock;
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.moveBlockToPosition = moveBlockToPosition;
|
|
26
|
-
exports.insertBlock = insertBlock;
|
|
27
|
-
exports.insertBlocks = insertBlocks;
|
|
28
|
-
exports.showInsertionPoint = showInsertionPoint;
|
|
13
|
+
exports.duplicateBlocks = void 0;
|
|
14
|
+
exports.enterFormattedText = enterFormattedText;
|
|
15
|
+
exports.exitFormattedText = exitFormattedText;
|
|
16
|
+
exports.flashBlock = void 0;
|
|
29
17
|
exports.hideInsertionPoint = hideInsertionPoint;
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
18
|
+
exports.insertBeforeBlock = exports.insertAfterBlock = void 0;
|
|
19
|
+
exports.insertBlock = insertBlock;
|
|
20
|
+
exports.insertBlocks = void 0;
|
|
21
|
+
exports.insertDefaultBlock = insertDefaultBlock;
|
|
22
|
+
exports.mergeBlocks = void 0;
|
|
23
|
+
exports.moveBlockToPosition = moveBlockToPosition;
|
|
24
|
+
exports.multiSelect = exports.moveBlocksUp = exports.moveBlocksToPosition = exports.moveBlocksDown = void 0;
|
|
25
|
+
exports.receiveBlocks = receiveBlocks;
|
|
34
26
|
exports.removeBlock = removeBlock;
|
|
27
|
+
exports.removeBlocks = void 0;
|
|
28
|
+
exports.replaceBlock = replaceBlock;
|
|
29
|
+
exports.replaceBlocks = void 0;
|
|
35
30
|
exports.replaceInnerBlocks = replaceInnerBlocks;
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
31
|
+
exports.resetBlocks = void 0;
|
|
32
|
+
exports.resetSelection = resetSelection;
|
|
33
|
+
exports.selectBlock = selectBlock;
|
|
34
|
+
exports.selectPreviousBlock = exports.selectNextBlock = void 0;
|
|
35
|
+
exports.selectionChange = selectionChange;
|
|
36
|
+
exports.setBlockMovingClientId = void 0;
|
|
37
|
+
exports.setHasControlledInnerBlocks = setHasControlledInnerBlocks;
|
|
38
|
+
exports.setNavigationMode = void 0;
|
|
39
|
+
exports.setTemplateValidity = setTemplateValidity;
|
|
40
|
+
exports.showInsertionPoint = showInsertionPoint;
|
|
39
41
|
exports.startDraggingBlocks = startDraggingBlocks;
|
|
42
|
+
exports.startMultiSelect = startMultiSelect;
|
|
43
|
+
exports.startTyping = startTyping;
|
|
40
44
|
exports.stopDraggingBlocks = stopDraggingBlocks;
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
+
exports.stopMultiSelect = stopMultiSelect;
|
|
46
|
+
exports.stopTyping = stopTyping;
|
|
47
|
+
exports.synchronizeTemplate = void 0;
|
|
48
|
+
exports.toggleBlockHighlight = toggleBlockHighlight;
|
|
49
|
+
exports.toggleBlockMode = toggleBlockMode;
|
|
50
|
+
exports.toggleSelection = toggleSelection;
|
|
51
|
+
exports.updateBlock = updateBlock;
|
|
52
|
+
exports.updateBlockAttributes = updateBlockAttributes;
|
|
45
53
|
exports.updateBlockListSettings = updateBlockListSettings;
|
|
46
54
|
exports.updateSettings = updateSettings;
|
|
47
|
-
exports.
|
|
48
|
-
exports.__unstableMarkLastChangeAsPersistent = __unstableMarkLastChangeAsPersistent;
|
|
49
|
-
exports.__unstableMarkNextChangeAsNotPersistent = __unstableMarkNextChangeAsNotPersistent;
|
|
50
|
-
exports.__unstableMarkAutomaticChange = __unstableMarkAutomaticChange;
|
|
51
|
-
exports.__unstableMarkAutomaticChangeFinal = __unstableMarkAutomaticChangeFinal;
|
|
52
|
-
exports.setNavigationMode = setNavigationMode;
|
|
53
|
-
exports.setBlockMovingClientId = setBlockMovingClientId;
|
|
54
|
-
exports.duplicateBlocks = duplicateBlocks;
|
|
55
|
-
exports.insertBeforeBlock = insertBeforeBlock;
|
|
56
|
-
exports.insertAfterBlock = insertAfterBlock;
|
|
57
|
-
exports.toggleBlockHighlight = toggleBlockHighlight;
|
|
58
|
-
exports.flashBlock = flashBlock;
|
|
59
|
-
exports.setHasControlledInnerBlocks = setHasControlledInnerBlocks;
|
|
60
|
-
exports.moveBlocksUp = exports.moveBlocksDown = void 0;
|
|
55
|
+
exports.validateBlocksToTemplate = void 0;
|
|
61
56
|
|
|
62
57
|
var _lodash = require("lodash");
|
|
63
58
|
|
|
@@ -67,16 +62,10 @@ var _a11y = require("@wordpress/a11y");
|
|
|
67
62
|
|
|
68
63
|
var _i18n = require("@wordpress/i18n");
|
|
69
64
|
|
|
70
|
-
var _data = require("@wordpress/data");
|
|
71
|
-
|
|
72
65
|
var _richText = require("@wordpress/rich-text");
|
|
73
66
|
|
|
74
67
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
75
68
|
|
|
76
|
-
var _controls = require("../store/controls");
|
|
77
|
-
|
|
78
|
-
var _constants = require("./constants");
|
|
79
|
-
|
|
80
69
|
/**
|
|
81
70
|
* External dependencies
|
|
82
71
|
*/
|
|
@@ -86,49 +75,55 @@ var _constants = require("./constants");
|
|
|
86
75
|
*/
|
|
87
76
|
|
|
88
77
|
/**
|
|
89
|
-
*
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Generator which will yield a default block insert action if there
|
|
94
|
-
* are no other blocks at the root of the editor. This generator should be used
|
|
78
|
+
* Action which will insert a default block insert action if there
|
|
79
|
+
* are no other blocks at the root of the editor. This action should be used
|
|
95
80
|
* in actions which may result in no blocks remaining in the editor (removal,
|
|
96
81
|
* replacement, etc).
|
|
97
82
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
83
|
+
const ensureDefaultBlock = () => _ref => {
|
|
84
|
+
let {
|
|
85
|
+
select,
|
|
86
|
+
dispatch
|
|
87
|
+
} = _ref;
|
|
88
|
+
// To avoid a focus loss when removing the last block, assure there is
|
|
100
89
|
// always a default block if the last of the blocks have been removed.
|
|
90
|
+
const count = select.getBlockCount();
|
|
101
91
|
|
|
102
|
-
if (count
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
// prevent it from being lost though.
|
|
92
|
+
if (count > 0) {
|
|
93
|
+
return;
|
|
94
|
+
} // If there's an custom appender, don't insert default block.
|
|
95
|
+
// We have to remember to manually move the focus elsewhere to
|
|
96
|
+
// prevent it from being lost though.
|
|
108
97
|
|
|
109
|
-
if (__unstableHasCustomAppender) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
98
|
|
|
113
|
-
|
|
99
|
+
const {
|
|
100
|
+
__unstableHasCustomAppender
|
|
101
|
+
} = select.getSettings();
|
|
102
|
+
|
|
103
|
+
if (__unstableHasCustomAppender) {
|
|
104
|
+
return;
|
|
114
105
|
}
|
|
115
|
-
|
|
106
|
+
|
|
107
|
+
dispatch.insertDefaultBlock();
|
|
108
|
+
};
|
|
116
109
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* content reflected as an edit in state.
|
|
110
|
+
* Action that resets blocks state to the specified array of blocks, taking precedence
|
|
111
|
+
* over any other content reflected as an edit in state.
|
|
120
112
|
*
|
|
121
113
|
* @param {Array} blocks Array of blocks.
|
|
122
114
|
*/
|
|
123
115
|
|
|
124
116
|
|
|
125
|
-
|
|
126
|
-
|
|
117
|
+
const resetBlocks = blocks => _ref2 => {
|
|
118
|
+
let {
|
|
119
|
+
dispatch
|
|
120
|
+
} = _ref2;
|
|
121
|
+
dispatch({
|
|
127
122
|
type: 'RESET_BLOCKS',
|
|
128
123
|
blocks
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
}
|
|
124
|
+
});
|
|
125
|
+
dispatch(validateBlocksToTemplate(blocks));
|
|
126
|
+
};
|
|
132
127
|
/**
|
|
133
128
|
* Block validity is a function of blocks state (at the point of a
|
|
134
129
|
* reset) and the template setting. As a compromise to its placement
|
|
@@ -139,20 +134,26 @@ function* resetBlocks(blocks) {
|
|
|
139
134
|
*/
|
|
140
135
|
|
|
141
136
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
137
|
+
exports.resetBlocks = resetBlocks;
|
|
138
|
+
|
|
139
|
+
const validateBlocksToTemplate = blocks => _ref3 => {
|
|
140
|
+
let {
|
|
141
|
+
select,
|
|
142
|
+
dispatch
|
|
143
|
+
} = _ref3;
|
|
144
|
+
const template = select.getTemplate();
|
|
145
|
+
const templateLock = select.getTemplateLock(); // Unlocked templates are considered always valid because they act
|
|
145
146
|
// as default values only.
|
|
146
147
|
|
|
147
148
|
const isBlocksValidToTemplate = !template || templateLock !== 'all' || (0, _blocks.doBlocksMatchTemplate)(blocks, template); // Update if validity has changed.
|
|
148
149
|
|
|
149
|
-
const isValidTemplate =
|
|
150
|
+
const isValidTemplate = select.isValidTemplate();
|
|
150
151
|
|
|
151
152
|
if (isBlocksValidToTemplate !== isValidTemplate) {
|
|
152
|
-
|
|
153
|
+
dispatch.setTemplateValidity(isBlocksValidToTemplate);
|
|
153
154
|
return isBlocksValidToTemplate;
|
|
154
155
|
}
|
|
155
|
-
}
|
|
156
|
+
};
|
|
156
157
|
/**
|
|
157
158
|
* A block selection object.
|
|
158
159
|
*
|
|
@@ -178,6 +179,8 @@ function* validateBlocksToTemplate(blocks) {
|
|
|
178
179
|
*/
|
|
179
180
|
|
|
180
181
|
|
|
182
|
+
exports.validateBlocksToTemplate = validateBlocksToTemplate;
|
|
183
|
+
|
|
181
184
|
function resetSelection(selectionStart, selectionEnd, initialPosition) {
|
|
182
185
|
/* eslint-enable jsdoc/valid-types */
|
|
183
186
|
return {
|
|
@@ -211,8 +214,7 @@ function receiveBlocks(blocks) {
|
|
|
211
214
|
};
|
|
212
215
|
}
|
|
213
216
|
/**
|
|
214
|
-
*
|
|
215
|
-
* attributes with the specified client IDs have been updated.
|
|
217
|
+
* Action that updates attributes of multiple blocks with the specified client IDs.
|
|
216
218
|
*
|
|
217
219
|
* @param {string|string[]} clientIds Block client IDs.
|
|
218
220
|
* @param {Object} attributes Block attributes to be merged. Should be keyed by clientIds if
|
|
@@ -222,7 +224,8 @@ function receiveBlocks(blocks) {
|
|
|
222
224
|
*/
|
|
223
225
|
|
|
224
226
|
|
|
225
|
-
function updateBlockAttributes(clientIds, attributes
|
|
227
|
+
function updateBlockAttributes(clientIds, attributes) {
|
|
228
|
+
let uniqueByBlock = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
226
229
|
return {
|
|
227
230
|
type: 'UPDATE_BLOCK_ATTRIBUTES',
|
|
228
231
|
clientIds: (0, _lodash.castArray)(clientIds),
|
|
@@ -231,8 +234,7 @@ function updateBlockAttributes(clientIds, attributes, uniqueByBlock = false) {
|
|
|
231
234
|
};
|
|
232
235
|
}
|
|
233
236
|
/**
|
|
234
|
-
*
|
|
235
|
-
* specified client ID has been updated.
|
|
237
|
+
* Action that updates the block with the specified client ID.
|
|
236
238
|
*
|
|
237
239
|
* @param {string} clientId Block client ID.
|
|
238
240
|
* @param {Object} updates Block attributes to be merged.
|
|
@@ -264,7 +266,9 @@ function updateBlock(clientId, updates) {
|
|
|
264
266
|
*/
|
|
265
267
|
|
|
266
268
|
|
|
267
|
-
function selectBlock(clientId
|
|
269
|
+
function selectBlock(clientId) {
|
|
270
|
+
let initialPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
271
|
+
|
|
268
272
|
/* eslint-enable jsdoc/valid-types */
|
|
269
273
|
return {
|
|
270
274
|
type: 'SELECT_BLOCK',
|
|
@@ -280,14 +284,17 @@ function selectBlock(clientId, initialPosition = 0) {
|
|
|
280
284
|
*/
|
|
281
285
|
|
|
282
286
|
|
|
283
|
-
|
|
284
|
-
|
|
287
|
+
const selectPreviousBlock = clientId => _ref4 => {
|
|
288
|
+
let {
|
|
289
|
+
select,
|
|
290
|
+
dispatch
|
|
291
|
+
} = _ref4;
|
|
292
|
+
const previousBlockClientId = select.getPreviousBlockClientId(clientId);
|
|
285
293
|
|
|
286
294
|
if (previousBlockClientId) {
|
|
287
|
-
|
|
288
|
-
return [previousBlockClientId];
|
|
295
|
+
dispatch.selectBlock(previousBlockClientId, -1);
|
|
289
296
|
}
|
|
290
|
-
}
|
|
297
|
+
};
|
|
291
298
|
/**
|
|
292
299
|
* Yields action objects used in signalling that the block following the given
|
|
293
300
|
* clientId should be selected.
|
|
@@ -296,28 +303,35 @@ function* selectPreviousBlock(clientId) {
|
|
|
296
303
|
*/
|
|
297
304
|
|
|
298
305
|
|
|
299
|
-
|
|
300
|
-
|
|
306
|
+
exports.selectPreviousBlock = selectPreviousBlock;
|
|
307
|
+
|
|
308
|
+
const selectNextBlock = clientId => _ref5 => {
|
|
309
|
+
let {
|
|
310
|
+
select,
|
|
311
|
+
dispatch
|
|
312
|
+
} = _ref5;
|
|
313
|
+
const nextBlockClientId = select.getNextBlockClientId(clientId);
|
|
301
314
|
|
|
302
315
|
if (nextBlockClientId) {
|
|
303
|
-
|
|
304
|
-
return [nextBlockClientId];
|
|
316
|
+
dispatch.selectBlock(nextBlockClientId);
|
|
305
317
|
}
|
|
306
|
-
}
|
|
318
|
+
};
|
|
307
319
|
/**
|
|
308
|
-
*
|
|
320
|
+
* Action that starts block multi-selection.
|
|
309
321
|
*
|
|
310
322
|
* @return {Object} Action object.
|
|
311
323
|
*/
|
|
312
324
|
|
|
313
325
|
|
|
326
|
+
exports.selectNextBlock = selectNextBlock;
|
|
327
|
+
|
|
314
328
|
function startMultiSelect() {
|
|
315
329
|
return {
|
|
316
330
|
type: 'START_MULTI_SELECT'
|
|
317
331
|
};
|
|
318
332
|
}
|
|
319
333
|
/**
|
|
320
|
-
*
|
|
334
|
+
* Action that stops block multi-selection.
|
|
321
335
|
*
|
|
322
336
|
* @return {Object} Action object.
|
|
323
337
|
*/
|
|
@@ -329,45 +343,51 @@ function stopMultiSelect() {
|
|
|
329
343
|
};
|
|
330
344
|
}
|
|
331
345
|
/**
|
|
332
|
-
*
|
|
346
|
+
* Action that changes block multi-selection.
|
|
333
347
|
*
|
|
334
348
|
* @param {string} start First block of the multi selection.
|
|
335
349
|
* @param {string} end Last block of the multiselection.
|
|
336
350
|
*/
|
|
337
351
|
|
|
338
352
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
353
|
+
const multiSelect = (start, end) => _ref6 => {
|
|
354
|
+
let {
|
|
355
|
+
select,
|
|
356
|
+
dispatch
|
|
357
|
+
} = _ref6;
|
|
358
|
+
const startBlockRootClientId = select.getBlockRootClientId(start);
|
|
359
|
+
const endBlockRootClientId = select.getBlockRootClientId(end); // Only allow block multi-selections at the same level.
|
|
342
360
|
|
|
343
361
|
if (startBlockRootClientId !== endBlockRootClientId) {
|
|
344
362
|
return;
|
|
345
363
|
}
|
|
346
364
|
|
|
347
|
-
|
|
365
|
+
dispatch({
|
|
348
366
|
type: 'MULTI_SELECT',
|
|
349
367
|
start,
|
|
350
368
|
end
|
|
351
|
-
};
|
|
352
|
-
const blockCount =
|
|
369
|
+
});
|
|
370
|
+
const blockCount = select.getSelectedBlockCount();
|
|
353
371
|
(0, _a11y.speak)((0, _i18n.sprintf)(
|
|
354
372
|
/* translators: %s: number of selected blocks */
|
|
355
373
|
(0, _i18n._n)('%s block selected.', '%s blocks selected.', blockCount), blockCount), 'assertive');
|
|
356
|
-
}
|
|
374
|
+
};
|
|
357
375
|
/**
|
|
358
|
-
*
|
|
376
|
+
* Action that clears the block selection.
|
|
359
377
|
*
|
|
360
378
|
* @return {Object} Action object.
|
|
361
379
|
*/
|
|
362
380
|
|
|
363
381
|
|
|
382
|
+
exports.multiSelect = multiSelect;
|
|
383
|
+
|
|
364
384
|
function clearSelectedBlock() {
|
|
365
385
|
return {
|
|
366
386
|
type: 'CLEAR_SELECTED_BLOCK'
|
|
367
387
|
};
|
|
368
388
|
}
|
|
369
389
|
/**
|
|
370
|
-
*
|
|
390
|
+
* Action that enables or disables block selection.
|
|
371
391
|
*
|
|
372
392
|
* @param {boolean} [isSelectionEnabled=true] Whether block selection should
|
|
373
393
|
* be enabled.
|
|
@@ -376,7 +396,8 @@ function clearSelectedBlock() {
|
|
|
376
396
|
*/
|
|
377
397
|
|
|
378
398
|
|
|
379
|
-
function toggleSelection(
|
|
399
|
+
function toggleSelection() {
|
|
400
|
+
let isSelectionEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
380
401
|
return {
|
|
381
402
|
type: 'TOGGLE_SELECTION',
|
|
382
403
|
isSelectionEnabled
|
|
@@ -420,8 +441,7 @@ function getBlocksWithDefaultStylesApplied(blocks, blockEditorSettings) {
|
|
|
420
441
|
/* eslint-disable jsdoc/valid-types */
|
|
421
442
|
|
|
422
443
|
/**
|
|
423
|
-
*
|
|
424
|
-
* one or more replacement blocks.
|
|
444
|
+
* Action that replaces given blocks with one or more replacement blocks.
|
|
425
445
|
*
|
|
426
446
|
* @param {(string|string[])} clientIds Block client ID(s) to replace.
|
|
427
447
|
* @param {(Object|Object[])} blocks Replacement block(s).
|
|
@@ -429,39 +449,47 @@ function getBlocksWithDefaultStylesApplied(blocks, blockEditorSettings) {
|
|
|
429
449
|
* @param {0|-1|null} initialPosition Index of caret after in the selected block after the operation.
|
|
430
450
|
* @param {?Object} meta Optional Meta values to be passed to the action object.
|
|
431
451
|
*
|
|
432
|
-
* @
|
|
452
|
+
* @return {Object} Action object.
|
|
433
453
|
*/
|
|
434
454
|
|
|
435
455
|
|
|
436
|
-
function
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
456
|
+
const replaceBlocks = function (clientIds, blocks, indexToSelect) {
|
|
457
|
+
let initialPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
458
|
+
let meta = arguments.length > 4 ? arguments[4] : undefined;
|
|
459
|
+
return _ref7 => {
|
|
460
|
+
let {
|
|
461
|
+
select,
|
|
462
|
+
dispatch
|
|
463
|
+
} = _ref7;
|
|
441
464
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
465
|
+
/* eslint-enable jsdoc/valid-types */
|
|
466
|
+
clientIds = (0, _lodash.castArray)(clientIds);
|
|
467
|
+
blocks = getBlocksWithDefaultStylesApplied((0, _lodash.castArray)(blocks), select.getSettings());
|
|
468
|
+
const rootClientId = select.getBlockRootClientId((0, _lodash.first)(clientIds)); // Replace is valid if the new blocks can be inserted in the root block.
|
|
445
469
|
|
|
446
|
-
|
|
447
|
-
|
|
470
|
+
for (let index = 0; index < blocks.length; index++) {
|
|
471
|
+
const block = blocks[index];
|
|
472
|
+
const canInsertBlock = select.canInsertBlockType(block.name, rootClientId);
|
|
473
|
+
|
|
474
|
+
if (!canInsertBlock) {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
448
477
|
}
|
|
449
|
-
}
|
|
450
478
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
479
|
+
dispatch({
|
|
480
|
+
type: 'REPLACE_BLOCKS',
|
|
481
|
+
clientIds,
|
|
482
|
+
blocks,
|
|
483
|
+
time: Date.now(),
|
|
484
|
+
indexToSelect,
|
|
485
|
+
initialPosition,
|
|
486
|
+
meta
|
|
487
|
+
});
|
|
488
|
+
dispatch(ensureDefaultBlock());
|
|
459
489
|
};
|
|
460
|
-
|
|
461
|
-
}
|
|
490
|
+
};
|
|
462
491
|
/**
|
|
463
|
-
*
|
|
464
|
-
* with one or more replacement blocks.
|
|
492
|
+
* Action that replaces a single block with one or more replacement blocks.
|
|
465
493
|
*
|
|
466
494
|
* @param {(string|string[])} clientId Block client ID to replace.
|
|
467
495
|
* @param {(Object|Object[])} block Replacement block(s).
|
|
@@ -470,6 +498,8 @@ function* replaceBlocks(clientIds, blocks, indexToSelect, initialPosition = 0, m
|
|
|
470
498
|
*/
|
|
471
499
|
|
|
472
500
|
|
|
501
|
+
exports.replaceBlocks = replaceBlocks;
|
|
502
|
+
|
|
473
503
|
function replaceBlock(clientId, block) {
|
|
474
504
|
return replaceBlocks(clientId, block);
|
|
475
505
|
}
|
|
@@ -483,91 +513,99 @@ function replaceBlock(clientId, block) {
|
|
|
483
513
|
*/
|
|
484
514
|
|
|
485
515
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
516
|
+
const createOnMove = type => (clientIds, rootClientId) => _ref8 => {
|
|
517
|
+
let {
|
|
518
|
+
select,
|
|
519
|
+
dispatch
|
|
520
|
+
} = _ref8;
|
|
521
|
+
// If one of the blocks is locked or the parent is locked, we cannot move any block.
|
|
522
|
+
const canMoveBlocks = select.canMoveBlocks(clientIds, rootClientId);
|
|
489
523
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
524
|
+
if (!canMoveBlocks) {
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
493
527
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
528
|
+
dispatch({
|
|
529
|
+
type,
|
|
530
|
+
clientIds: (0, _lodash.castArray)(clientIds),
|
|
531
|
+
rootClientId
|
|
532
|
+
});
|
|
533
|
+
};
|
|
501
534
|
|
|
502
535
|
const moveBlocksDown = createOnMove('MOVE_BLOCKS_DOWN');
|
|
503
536
|
exports.moveBlocksDown = moveBlocksDown;
|
|
504
537
|
const moveBlocksUp = createOnMove('MOVE_BLOCKS_UP');
|
|
505
538
|
/**
|
|
506
|
-
*
|
|
507
|
-
* a new position.
|
|
539
|
+
* Action that moves given blocks to a new position.
|
|
508
540
|
*
|
|
509
541
|
* @param {?string} clientIds The client IDs of the blocks.
|
|
510
542
|
* @param {?string} fromRootClientId Root client ID source.
|
|
511
543
|
* @param {?string} toRootClientId Root client ID destination.
|
|
512
544
|
* @param {number} index The index to move the blocks to.
|
|
513
|
-
*
|
|
514
|
-
* @yield {Object} Action object.
|
|
515
545
|
*/
|
|
516
546
|
|
|
517
547
|
exports.moveBlocksUp = moveBlocksUp;
|
|
518
548
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
549
|
+
const moveBlocksToPosition = function (clientIds) {
|
|
550
|
+
let fromRootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
551
|
+
let toRootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
552
|
+
let index = arguments.length > 3 ? arguments[3] : undefined;
|
|
553
|
+
return _ref9 => {
|
|
554
|
+
let {
|
|
555
|
+
select,
|
|
556
|
+
dispatch
|
|
557
|
+
} = _ref9;
|
|
558
|
+
const canMoveBlocks = select.canMoveBlocks(clientIds, fromRootClientId); // If one of the blocks is locked or the parent is locked, we cannot move any block.
|
|
522
559
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
560
|
+
if (!canMoveBlocks) {
|
|
561
|
+
return;
|
|
562
|
+
} // If moving inside the same root block the move is always possible.
|
|
526
563
|
|
|
527
|
-
const action = {
|
|
528
|
-
type: 'MOVE_BLOCKS_TO_POSITION',
|
|
529
|
-
fromRootClientId,
|
|
530
|
-
toRootClientId,
|
|
531
|
-
clientIds,
|
|
532
|
-
index
|
|
533
|
-
}; // If moving inside the same root block the move is always possible.
|
|
534
564
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
} // If we're moving to another block, it means we're deleting blocks from
|
|
539
|
-
// the original block, so we need to check if removing is possible.
|
|
565
|
+
if (fromRootClientId !== toRootClientId) {
|
|
566
|
+
const canRemoveBlocks = select.canRemoveBlocks(clientIds, fromRootClientId); // If we're moving to another block, it means we're deleting blocks from
|
|
567
|
+
// the original block, so we need to check if removing is possible.
|
|
540
568
|
|
|
569
|
+
if (!canRemoveBlocks) {
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
541
572
|
|
|
542
|
-
|
|
543
|
-
return;
|
|
544
|
-
}
|
|
573
|
+
const canInsertBlocks = select.canInsertBlocks(clientIds, toRootClientId); // If moving to other parent block, the move is possible if we can insert a block of the same type inside the new parent block.
|
|
545
574
|
|
|
546
|
-
|
|
575
|
+
if (!canInsertBlocks) {
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
547
579
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
580
|
+
dispatch({
|
|
581
|
+
type: 'MOVE_BLOCKS_TO_POSITION',
|
|
582
|
+
fromRootClientId,
|
|
583
|
+
toRootClientId,
|
|
584
|
+
clientIds,
|
|
585
|
+
index
|
|
586
|
+
});
|
|
587
|
+
};
|
|
588
|
+
};
|
|
552
589
|
/**
|
|
553
|
-
*
|
|
554
|
-
* new position.
|
|
590
|
+
* Action that moves given block to a new position.
|
|
555
591
|
*
|
|
556
592
|
* @param {?string} clientId The client ID of the block.
|
|
557
593
|
* @param {?string} fromRootClientId Root client ID source.
|
|
558
594
|
* @param {?string} toRootClientId Root client ID destination.
|
|
559
595
|
* @param {number} index The index to move the block to.
|
|
560
|
-
*
|
|
561
|
-
* @yield {Object} Action object.
|
|
562
596
|
*/
|
|
563
597
|
|
|
564
598
|
|
|
565
|
-
|
|
566
|
-
|
|
599
|
+
exports.moveBlocksToPosition = moveBlocksToPosition;
|
|
600
|
+
|
|
601
|
+
function moveBlockToPosition(clientId) {
|
|
602
|
+
let fromRootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
603
|
+
let toRootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
604
|
+
let index = arguments.length > 3 ? arguments[3] : undefined;
|
|
605
|
+
return moveBlocksToPosition([clientId], fromRootClientId, toRootClientId, index);
|
|
567
606
|
}
|
|
568
607
|
/**
|
|
569
|
-
*
|
|
570
|
-
* inserted, optionally at a specific index respective a root block list.
|
|
608
|
+
* Action that inserts a single block, optionally at a specific index respective a root block list.
|
|
571
609
|
*
|
|
572
610
|
* @param {Object} block Block object to insert.
|
|
573
611
|
* @param {?number} index Index at which block should be inserted.
|
|
@@ -579,14 +617,13 @@ function* moveBlockToPosition(clientId, fromRootClientId = '', toRootClientId =
|
|
|
579
617
|
*/
|
|
580
618
|
|
|
581
619
|
|
|
582
|
-
function insertBlock(block, index, rootClientId, updateSelection
|
|
620
|
+
function insertBlock(block, index, rootClientId, updateSelection, meta) {
|
|
583
621
|
return insertBlocks([block], index, rootClientId, updateSelection, 0, meta);
|
|
584
622
|
}
|
|
585
623
|
/* eslint-disable jsdoc/valid-types */
|
|
586
624
|
|
|
587
625
|
/**
|
|
588
|
-
*
|
|
589
|
-
* be inserted, optionally at a specific index respective a root block list.
|
|
626
|
+
* Action that inserts an array of blocks, optionally at a specific index respective a root block list.
|
|
590
627
|
*
|
|
591
628
|
* @param {Object[]} blocks Block objects to insert.
|
|
592
629
|
* @param {?number} index Index at which block should be inserted.
|
|
@@ -598,45 +635,54 @@ function insertBlock(block, index, rootClientId, updateSelection = true, meta) {
|
|
|
598
635
|
*/
|
|
599
636
|
|
|
600
637
|
|
|
601
|
-
function
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
638
|
+
const insertBlocks = function (blocks, index, rootClientId) {
|
|
639
|
+
let updateSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
640
|
+
let initialPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
641
|
+
let meta = arguments.length > 5 ? arguments[5] : undefined;
|
|
642
|
+
return _ref10 => {
|
|
643
|
+
let {
|
|
644
|
+
select,
|
|
645
|
+
dispatch
|
|
646
|
+
} = _ref10;
|
|
647
|
+
|
|
648
|
+
/* eslint-enable jsdoc/valid-types */
|
|
649
|
+
if ((0, _lodash.isObject)(initialPosition)) {
|
|
650
|
+
meta = initialPosition;
|
|
651
|
+
initialPosition = 0;
|
|
652
|
+
(0, _deprecated.default)("meta argument in wp.data.dispatch('core/block-editor')", {
|
|
653
|
+
since: '10.1',
|
|
654
|
+
plugin: 'Gutenberg',
|
|
655
|
+
hint: 'The meta argument is now the 6th argument of the function'
|
|
656
|
+
});
|
|
657
|
+
}
|
|
612
658
|
|
|
613
|
-
|
|
614
|
-
|
|
659
|
+
blocks = getBlocksWithDefaultStylesApplied((0, _lodash.castArray)(blocks), select.getSettings());
|
|
660
|
+
const allowedBlocks = [];
|
|
615
661
|
|
|
616
|
-
|
|
617
|
-
|
|
662
|
+
for (const block of blocks) {
|
|
663
|
+
const isValid = select.canInsertBlockType(block.name, rootClientId);
|
|
618
664
|
|
|
619
|
-
|
|
620
|
-
|
|
665
|
+
if (isValid) {
|
|
666
|
+
allowedBlocks.push(block);
|
|
667
|
+
}
|
|
621
668
|
}
|
|
622
|
-
}
|
|
623
669
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
670
|
+
if (allowedBlocks.length) {
|
|
671
|
+
dispatch({
|
|
672
|
+
type: 'INSERT_BLOCKS',
|
|
673
|
+
blocks: allowedBlocks,
|
|
674
|
+
index,
|
|
675
|
+
rootClientId,
|
|
676
|
+
time: Date.now(),
|
|
677
|
+
updateSelection,
|
|
678
|
+
initialPosition: updateSelection ? initialPosition : null,
|
|
679
|
+
meta
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
};
|
|
637
684
|
/**
|
|
638
|
-
*
|
|
639
|
-
* be shown.
|
|
685
|
+
* Action that shows the insertion point.
|
|
640
686
|
*
|
|
641
687
|
* @param {?string} rootClientId Optional root client ID of block list on
|
|
642
688
|
* which to insert.
|
|
@@ -647,7 +693,11 @@ function* insertBlocks(blocks, index, rootClientId, updateSelection = true, init
|
|
|
647
693
|
*/
|
|
648
694
|
|
|
649
695
|
|
|
650
|
-
|
|
696
|
+
exports.insertBlocks = insertBlocks;
|
|
697
|
+
|
|
698
|
+
function showInsertionPoint(rootClientId, index) {
|
|
699
|
+
let __unstableOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
700
|
+
|
|
651
701
|
const {
|
|
652
702
|
__unstableWithInserter
|
|
653
703
|
} = __unstableOptions;
|
|
@@ -659,7 +709,7 @@ function showInsertionPoint(rootClientId, index, __unstableOptions = {}) {
|
|
|
659
709
|
};
|
|
660
710
|
}
|
|
661
711
|
/**
|
|
662
|
-
*
|
|
712
|
+
* Action that hides the insertion point.
|
|
663
713
|
*
|
|
664
714
|
* @return {Object} Action object.
|
|
665
715
|
*/
|
|
@@ -671,7 +721,7 @@ function hideInsertionPoint() {
|
|
|
671
721
|
};
|
|
672
722
|
}
|
|
673
723
|
/**
|
|
674
|
-
*
|
|
724
|
+
* Action that resets the template validity.
|
|
675
725
|
*
|
|
676
726
|
* @param {boolean} isValid template validity flag.
|
|
677
727
|
*
|
|
@@ -686,51 +736,61 @@ function setTemplateValidity(isValid) {
|
|
|
686
736
|
};
|
|
687
737
|
}
|
|
688
738
|
/**
|
|
689
|
-
*
|
|
739
|
+
* Action that synchronizes the template with the list of blocks.
|
|
690
740
|
*
|
|
691
741
|
* @return {Object} Action object.
|
|
692
742
|
*/
|
|
693
743
|
|
|
694
744
|
|
|
695
|
-
|
|
696
|
-
|
|
745
|
+
const synchronizeTemplate = () => _ref11 => {
|
|
746
|
+
let {
|
|
747
|
+
select,
|
|
748
|
+
dispatch
|
|
749
|
+
} = _ref11;
|
|
750
|
+
dispatch({
|
|
697
751
|
type: 'SYNCHRONIZE_TEMPLATE'
|
|
698
|
-
};
|
|
699
|
-
const blocks =
|
|
700
|
-
const template =
|
|
752
|
+
});
|
|
753
|
+
const blocks = select.getBlocks();
|
|
754
|
+
const template = select.getTemplate();
|
|
701
755
|
const updatedBlockList = (0, _blocks.synchronizeBlocksWithTemplate)(blocks, template);
|
|
702
|
-
|
|
703
|
-
}
|
|
756
|
+
dispatch.resetBlocks(updatedBlockList);
|
|
757
|
+
};
|
|
704
758
|
/**
|
|
705
|
-
*
|
|
759
|
+
* Action that merges two blocks.
|
|
706
760
|
*
|
|
707
761
|
* @param {string} firstBlockClientId Client ID of the first block to merge.
|
|
708
762
|
* @param {string} secondBlockClientId Client ID of the second block to merge.
|
|
709
763
|
*/
|
|
710
764
|
|
|
711
765
|
|
|
712
|
-
|
|
766
|
+
exports.synchronizeTemplate = synchronizeTemplate;
|
|
767
|
+
|
|
768
|
+
const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 => {
|
|
769
|
+
let {
|
|
770
|
+
select,
|
|
771
|
+
dispatch
|
|
772
|
+
} = _ref12;
|
|
713
773
|
const blocks = [firstBlockClientId, secondBlockClientId];
|
|
714
|
-
|
|
774
|
+
dispatch({
|
|
715
775
|
type: 'MERGE_BLOCKS',
|
|
716
776
|
blocks
|
|
717
|
-
};
|
|
777
|
+
});
|
|
718
778
|
const [clientIdA, clientIdB] = blocks;
|
|
719
|
-
const blockA =
|
|
779
|
+
const blockA = select.getBlock(clientIdA);
|
|
720
780
|
const blockAType = (0, _blocks.getBlockType)(blockA.name); // Only focus the previous block if it's not mergeable
|
|
721
781
|
|
|
722
782
|
if (blockAType && !blockAType.merge) {
|
|
723
|
-
|
|
783
|
+
dispatch.selectBlock(blockA.clientId);
|
|
724
784
|
return;
|
|
725
785
|
}
|
|
726
786
|
|
|
727
|
-
const blockB =
|
|
787
|
+
const blockB = select.getBlock(clientIdB);
|
|
728
788
|
const blockBType = (0, _blocks.getBlockType)(blockB.name);
|
|
729
789
|
const {
|
|
730
790
|
clientId,
|
|
731
791
|
attributeKey,
|
|
732
792
|
offset
|
|
733
|
-
} =
|
|
793
|
+
} = select.getSelectionStart();
|
|
734
794
|
const selectedBlockType = clientId === clientIdA ? blockAType : blockBType;
|
|
735
795
|
const attributeDefinition = selectedBlockType.attributes[attributeKey];
|
|
736
796
|
const canRestoreTextSelection = (clientId === clientIdA || clientId === clientIdB) && attributeKey !== undefined && offset !== undefined && // We cannot restore text selection if the RichText identifier
|
|
@@ -808,16 +868,16 @@ function* mergeBlocks(firstBlockClientId, secondBlockClientId) {
|
|
|
808
868
|
preserveWhiteSpace
|
|
809
869
|
});
|
|
810
870
|
updatedAttributes[newAttributeKey] = newHtml;
|
|
811
|
-
|
|
871
|
+
dispatch.selectionChange(blockA.clientId, newAttributeKey, newOffset, newOffset);
|
|
812
872
|
}
|
|
813
873
|
|
|
814
|
-
|
|
874
|
+
dispatch.replaceBlocks([blockA.clientId, blockB.clientId], [{ ...blockA,
|
|
815
875
|
attributes: { ...blockA.attributes,
|
|
816
876
|
...updatedAttributes
|
|
817
877
|
}
|
|
818
878
|
}, ...blocksWithTheSameType.slice(1)], 0 // If we don't pass the `indexToSelect` it will default to the last block.
|
|
819
879
|
);
|
|
820
|
-
}
|
|
880
|
+
};
|
|
821
881
|
/**
|
|
822
882
|
* Yields action objects used in signalling that the blocks corresponding to
|
|
823
883
|
* the set of specified client IDs are to be removed.
|
|
@@ -828,36 +888,41 @@ function* mergeBlocks(firstBlockClientId, secondBlockClientId) {
|
|
|
828
888
|
*/
|
|
829
889
|
|
|
830
890
|
|
|
831
|
-
|
|
832
|
-
if (!clientIds || !clientIds.length) {
|
|
833
|
-
return;
|
|
834
|
-
}
|
|
891
|
+
exports.mergeBlocks = mergeBlocks;
|
|
835
892
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
893
|
+
const removeBlocks = function (clientIds) {
|
|
894
|
+
let selectPrevious = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
895
|
+
return _ref13 => {
|
|
896
|
+
let {
|
|
897
|
+
select,
|
|
898
|
+
dispatch
|
|
899
|
+
} = _ref13;
|
|
839
900
|
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
901
|
+
if (!clientIds || !clientIds.length) {
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
843
904
|
|
|
844
|
-
|
|
905
|
+
clientIds = (0, _lodash.castArray)(clientIds);
|
|
906
|
+
const rootClientId = select.getBlockRootClientId(clientIds[0]);
|
|
907
|
+
const canRemoveBlocks = select.canRemoveBlocks(clientIds, rootClientId);
|
|
845
908
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
previousBlockId = yield _data.controls.select(_constants.STORE_NAME, 'getPreviousBlockClientId', clientIds[0]);
|
|
850
|
-
}
|
|
909
|
+
if (!canRemoveBlocks) {
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
851
912
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
}; // To avoid a focus loss when removing the last block, assure there is
|
|
856
|
-
// always a default block if the last of the blocks have been removed.
|
|
913
|
+
if (selectPrevious) {
|
|
914
|
+
dispatch.selectPreviousBlock(clientIds[0]);
|
|
915
|
+
}
|
|
857
916
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
917
|
+
dispatch({
|
|
918
|
+
type: 'REMOVE_BLOCKS',
|
|
919
|
+
clientIds
|
|
920
|
+
}); // To avoid a focus loss when removing the last block, assure there is
|
|
921
|
+
// always a default block if the last of the blocks have been removed.
|
|
922
|
+
|
|
923
|
+
dispatch(ensureDefaultBlock());
|
|
924
|
+
};
|
|
925
|
+
};
|
|
861
926
|
/**
|
|
862
927
|
* Returns an action object used in signalling that the block with the
|
|
863
928
|
* specified client ID is to be removed.
|
|
@@ -870,6 +935,8 @@ function* removeBlocks(clientIds, selectPrevious = true) {
|
|
|
870
935
|
*/
|
|
871
936
|
|
|
872
937
|
|
|
938
|
+
exports.removeBlocks = removeBlocks;
|
|
939
|
+
|
|
873
940
|
function removeBlock(clientId, selectPrevious) {
|
|
874
941
|
return removeBlocks([clientId], selectPrevious);
|
|
875
942
|
}
|
|
@@ -887,7 +954,10 @@ function removeBlock(clientId, selectPrevious) {
|
|
|
887
954
|
*/
|
|
888
955
|
|
|
889
956
|
|
|
890
|
-
function replaceInnerBlocks(rootClientId, blocks
|
|
957
|
+
function replaceInnerBlocks(rootClientId, blocks) {
|
|
958
|
+
let updateSelection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
959
|
+
let initialPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
960
|
+
|
|
891
961
|
/* eslint-enable jsdoc/valid-types */
|
|
892
962
|
return {
|
|
893
963
|
type: 'REPLACE_INNER_BLOCKS',
|
|
@@ -947,7 +1017,8 @@ function stopTyping() {
|
|
|
947
1017
|
*/
|
|
948
1018
|
|
|
949
1019
|
|
|
950
|
-
function startDraggingBlocks(
|
|
1020
|
+
function startDraggingBlocks() {
|
|
1021
|
+
let clientIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
951
1022
|
return {
|
|
952
1023
|
type: 'START_DRAGGING_BLOCKS',
|
|
953
1024
|
clientIds
|
|
@@ -990,8 +1061,7 @@ function exitFormattedText() {
|
|
|
990
1061
|
};
|
|
991
1062
|
}
|
|
992
1063
|
/**
|
|
993
|
-
*
|
|
994
|
-
* position.
|
|
1064
|
+
* Action that changes the position of the user caret.
|
|
995
1065
|
*
|
|
996
1066
|
* @param {string} clientId The selected block client ID.
|
|
997
1067
|
* @param {string} attributeKey The selected block attribute key.
|
|
@@ -1012,8 +1082,7 @@ function selectionChange(clientId, attributeKey, startOffset, endOffset) {
|
|
|
1012
1082
|
};
|
|
1013
1083
|
}
|
|
1014
1084
|
/**
|
|
1015
|
-
*
|
|
1016
|
-
* type should be added to the block list.
|
|
1085
|
+
* Action that adds a new block of the default type to the block list.
|
|
1017
1086
|
*
|
|
1018
1087
|
* @param {?Object} attributes Optional attributes of the block to assign.
|
|
1019
1088
|
* @param {?string} rootClientId Optional root client ID of block list on which
|
|
@@ -1036,7 +1105,7 @@ function insertDefaultBlock(attributes, rootClientId, index) {
|
|
|
1036
1105
|
return insertBlock(block, index, rootClientId);
|
|
1037
1106
|
}
|
|
1038
1107
|
/**
|
|
1039
|
-
*
|
|
1108
|
+
* Action that changes the nested settings of a given block.
|
|
1040
1109
|
*
|
|
1041
1110
|
* @param {string} clientId Client ID of the block whose nested setting are
|
|
1042
1111
|
* being received.
|
|
@@ -1054,7 +1123,7 @@ function updateBlockListSettings(clientId, settings) {
|
|
|
1054
1123
|
};
|
|
1055
1124
|
}
|
|
1056
1125
|
/**
|
|
1057
|
-
*
|
|
1126
|
+
* Action that updates the block editor settings.
|
|
1058
1127
|
*
|
|
1059
1128
|
* @param {Object} settings Updated settings
|
|
1060
1129
|
*
|
|
@@ -1069,7 +1138,7 @@ function updateSettings(settings) {
|
|
|
1069
1138
|
};
|
|
1070
1139
|
}
|
|
1071
1140
|
/**
|
|
1072
|
-
*
|
|
1141
|
+
* Action that signals that a temporary reusable block has been saved
|
|
1073
1142
|
* in order to switch its temporary id with the real id.
|
|
1074
1143
|
*
|
|
1075
1144
|
* @param {string} id Reusable block's id.
|
|
@@ -1087,7 +1156,7 @@ function __unstableSaveReusableBlock(id, updatedId) {
|
|
|
1087
1156
|
};
|
|
1088
1157
|
}
|
|
1089
1158
|
/**
|
|
1090
|
-
*
|
|
1159
|
+
* Action that marks the last block change explicitly as persistent.
|
|
1091
1160
|
*
|
|
1092
1161
|
* @return {Object} Action object.
|
|
1093
1162
|
*/
|
|
@@ -1099,7 +1168,7 @@ function __unstableMarkLastChangeAsPersistent() {
|
|
|
1099
1168
|
};
|
|
1100
1169
|
}
|
|
1101
1170
|
/**
|
|
1102
|
-
*
|
|
1171
|
+
* Action that signals that the next block change should be marked explicitly as not persistent.
|
|
1103
1172
|
*
|
|
1104
1173
|
* @return {Object} Action object.
|
|
1105
1174
|
*/
|
|
@@ -1111,151 +1180,198 @@ function __unstableMarkNextChangeAsNotPersistent() {
|
|
|
1111
1180
|
};
|
|
1112
1181
|
}
|
|
1113
1182
|
/**
|
|
1114
|
-
*
|
|
1115
|
-
*
|
|
1116
|
-
*
|
|
1117
|
-
*
|
|
1118
|
-
* it is recommended to be called at the next idle period to ensure all
|
|
1183
|
+
* Action that marks the last block change as an automatic change, meaning it was not
|
|
1184
|
+
* performed by the user, and can be undone using the `Escape` and `Backspace` keys.
|
|
1185
|
+
* This action must be called after the change was made, and any actions that are a
|
|
1186
|
+
* consequence of it, so it is recommended to be called at the next idle period to ensure all
|
|
1119
1187
|
* selection changes have been recorded.
|
|
1120
1188
|
*/
|
|
1121
1189
|
|
|
1122
1190
|
|
|
1123
|
-
|
|
1124
|
-
|
|
1191
|
+
const __unstableMarkAutomaticChange = () => _ref14 => {
|
|
1192
|
+
let {
|
|
1193
|
+
dispatch
|
|
1194
|
+
} = _ref14;
|
|
1195
|
+
dispatch({
|
|
1125
1196
|
type: 'MARK_AUTOMATIC_CHANGE'
|
|
1126
|
-
};
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
}
|
|
1197
|
+
});
|
|
1198
|
+
const {
|
|
1199
|
+
requestIdleCallback = cb => setTimeout(cb, 100)
|
|
1200
|
+
} = window;
|
|
1201
|
+
requestIdleCallback(() => {
|
|
1202
|
+
dispatch({
|
|
1203
|
+
type: 'MARK_AUTOMATIC_CHANGE_FINAL'
|
|
1204
|
+
});
|
|
1205
|
+
});
|
|
1206
|
+
};
|
|
1135
1207
|
/**
|
|
1136
|
-
*
|
|
1208
|
+
* Action that enables or disables the navigation mode.
|
|
1137
1209
|
*
|
|
1138
1210
|
* @param {string} isNavigationMode Enable/Disable navigation mode.
|
|
1139
1211
|
*/
|
|
1140
1212
|
|
|
1141
1213
|
|
|
1142
|
-
|
|
1143
|
-
yield {
|
|
1144
|
-
type: 'SET_NAVIGATION_MODE',
|
|
1145
|
-
isNavigationMode
|
|
1146
|
-
};
|
|
1214
|
+
exports.__unstableMarkAutomaticChange = __unstableMarkAutomaticChange;
|
|
1147
1215
|
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
}
|
|
1216
|
+
const setNavigationMode = function () {
|
|
1217
|
+
let isNavigationMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
1218
|
+
return _ref15 => {
|
|
1219
|
+
let {
|
|
1220
|
+
dispatch
|
|
1221
|
+
} = _ref15;
|
|
1222
|
+
dispatch({
|
|
1223
|
+
type: 'SET_NAVIGATION_MODE',
|
|
1224
|
+
isNavigationMode
|
|
1225
|
+
});
|
|
1226
|
+
|
|
1227
|
+
if (isNavigationMode) {
|
|
1228
|
+
(0, _a11y.speak)((0, _i18n.__)('You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.'));
|
|
1229
|
+
} else {
|
|
1230
|
+
(0, _a11y.speak)((0, _i18n.__)('You are currently in edit mode. To return to the navigation mode, press Escape.'));
|
|
1231
|
+
}
|
|
1232
|
+
};
|
|
1233
|
+
};
|
|
1154
1234
|
/**
|
|
1155
|
-
*
|
|
1235
|
+
* Action that enables or disables the block moving mode.
|
|
1156
1236
|
*
|
|
1157
1237
|
* @param {string|null} hasBlockMovingClientId Enable/Disable block moving mode.
|
|
1158
1238
|
*/
|
|
1159
1239
|
|
|
1160
1240
|
|
|
1161
|
-
|
|
1162
|
-
yield {
|
|
1163
|
-
type: 'SET_BLOCK_MOVING_MODE',
|
|
1164
|
-
hasBlockMovingClientId
|
|
1165
|
-
};
|
|
1241
|
+
exports.setNavigationMode = setNavigationMode;
|
|
1166
1242
|
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1243
|
+
const setBlockMovingClientId = function () {
|
|
1244
|
+
let hasBlockMovingClientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
1245
|
+
return _ref16 => {
|
|
1246
|
+
let {
|
|
1247
|
+
dispatch
|
|
1248
|
+
} = _ref16;
|
|
1249
|
+
dispatch({
|
|
1250
|
+
type: 'SET_BLOCK_MOVING_MODE',
|
|
1251
|
+
hasBlockMovingClientId
|
|
1252
|
+
});
|
|
1253
|
+
|
|
1254
|
+
if (hasBlockMovingClientId) {
|
|
1255
|
+
(0, _a11y.speak)((0, _i18n.__)('Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block.'));
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1258
|
+
};
|
|
1171
1259
|
/**
|
|
1172
|
-
*
|
|
1260
|
+
* Action that duplicates a list of blocks.
|
|
1173
1261
|
*
|
|
1174
1262
|
* @param {string[]} clientIds
|
|
1175
1263
|
* @param {boolean} updateSelection
|
|
1176
1264
|
*/
|
|
1177
1265
|
|
|
1178
1266
|
|
|
1179
|
-
|
|
1180
|
-
if (!clientIds && !clientIds.length) {
|
|
1181
|
-
return;
|
|
1182
|
-
}
|
|
1267
|
+
exports.setBlockMovingClientId = setBlockMovingClientId;
|
|
1183
1268
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1269
|
+
const duplicateBlocks = function (clientIds) {
|
|
1270
|
+
let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
1271
|
+
return _ref17 => {
|
|
1272
|
+
let {
|
|
1273
|
+
select,
|
|
1274
|
+
dispatch
|
|
1275
|
+
} = _ref17;
|
|
1186
1276
|
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1277
|
+
if (!clientIds || !clientIds.length) {
|
|
1278
|
+
return;
|
|
1279
|
+
} // Return early if blocks don't exist.
|
|
1190
1280
|
|
|
1191
|
-
const blockNames = blocks.map(block => block.name); // Return early if blocks don't support multiple usage.
|
|
1192
1281
|
|
|
1193
|
-
|
|
1194
|
-
return;
|
|
1195
|
-
}
|
|
1282
|
+
const blocks = select.getBlocksByClientId(clientIds);
|
|
1196
1283
|
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1284
|
+
if ((0, _lodash.some)(blocks, block => !block)) {
|
|
1285
|
+
return;
|
|
1286
|
+
} // Return early if blocks don't support multiple usage.
|
|
1200
1287
|
|
|
1201
|
-
if (clonedBlocks.length > 1 && updateSelection) {
|
|
1202
|
-
yield multiSelect((0, _lodash.first)(clonedBlocks).clientId, (0, _lodash.last)(clonedBlocks).clientId);
|
|
1203
|
-
}
|
|
1204
1288
|
|
|
1205
|
-
|
|
1206
|
-
|
|
1289
|
+
const blockNames = blocks.map(block => block.name);
|
|
1290
|
+
|
|
1291
|
+
if (blockNames.some(blockName => !(0, _blocks.hasBlockSupport)(blockName, 'multiple', true))) {
|
|
1292
|
+
return;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
const rootClientId = select.getBlockRootClientId(clientIds[0]);
|
|
1296
|
+
const lastSelectedIndex = select.getBlockIndex((0, _lodash.last)((0, _lodash.castArray)(clientIds)), rootClientId);
|
|
1297
|
+
const clonedBlocks = blocks.map(block => (0, _blocks.__experimentalCloneSanitizedBlock)(block));
|
|
1298
|
+
dispatch.insertBlocks(clonedBlocks, lastSelectedIndex + 1, rootClientId, updateSelection);
|
|
1299
|
+
|
|
1300
|
+
if (clonedBlocks.length > 1 && updateSelection) {
|
|
1301
|
+
dispatch.multiSelect((0, _lodash.first)(clonedBlocks).clientId, (0, _lodash.last)(clonedBlocks).clientId);
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
return clonedBlocks.map(block => block.clientId);
|
|
1305
|
+
};
|
|
1306
|
+
};
|
|
1207
1307
|
/**
|
|
1208
|
-
*
|
|
1308
|
+
* Action that inserts an empty block before a given block.
|
|
1209
1309
|
*
|
|
1210
1310
|
* @param {string} clientId
|
|
1211
1311
|
*/
|
|
1212
1312
|
|
|
1213
1313
|
|
|
1214
|
-
|
|
1314
|
+
exports.duplicateBlocks = duplicateBlocks;
|
|
1315
|
+
|
|
1316
|
+
const insertBeforeBlock = clientId => _ref18 => {
|
|
1317
|
+
let {
|
|
1318
|
+
select,
|
|
1319
|
+
dispatch
|
|
1320
|
+
} = _ref18;
|
|
1321
|
+
|
|
1215
1322
|
if (!clientId) {
|
|
1216
1323
|
return;
|
|
1217
1324
|
}
|
|
1218
1325
|
|
|
1219
|
-
const rootClientId =
|
|
1220
|
-
const isLocked =
|
|
1326
|
+
const rootClientId = select.getBlockRootClientId(clientId);
|
|
1327
|
+
const isLocked = select.getTemplateLock(rootClientId);
|
|
1221
1328
|
|
|
1222
1329
|
if (isLocked) {
|
|
1223
1330
|
return;
|
|
1224
1331
|
}
|
|
1225
1332
|
|
|
1226
|
-
const firstSelectedIndex =
|
|
1227
|
-
return
|
|
1228
|
-
}
|
|
1333
|
+
const firstSelectedIndex = select.getBlockIndex(clientId, rootClientId);
|
|
1334
|
+
return dispatch.insertDefaultBlock({}, rootClientId, firstSelectedIndex);
|
|
1335
|
+
};
|
|
1229
1336
|
/**
|
|
1230
|
-
*
|
|
1337
|
+
* Action that inserts an empty block after a given block.
|
|
1231
1338
|
*
|
|
1232
1339
|
* @param {string} clientId
|
|
1233
1340
|
*/
|
|
1234
1341
|
|
|
1235
1342
|
|
|
1236
|
-
|
|
1343
|
+
exports.insertBeforeBlock = insertBeforeBlock;
|
|
1344
|
+
|
|
1345
|
+
const insertAfterBlock = clientId => _ref19 => {
|
|
1346
|
+
let {
|
|
1347
|
+
select,
|
|
1348
|
+
dispatch
|
|
1349
|
+
} = _ref19;
|
|
1350
|
+
|
|
1237
1351
|
if (!clientId) {
|
|
1238
1352
|
return;
|
|
1239
1353
|
}
|
|
1240
1354
|
|
|
1241
|
-
const rootClientId =
|
|
1242
|
-
const isLocked =
|
|
1355
|
+
const rootClientId = select.getBlockRootClientId(clientId);
|
|
1356
|
+
const isLocked = select.getTemplateLock(rootClientId);
|
|
1243
1357
|
|
|
1244
1358
|
if (isLocked) {
|
|
1245
1359
|
return;
|
|
1246
1360
|
}
|
|
1247
1361
|
|
|
1248
|
-
const firstSelectedIndex =
|
|
1249
|
-
return
|
|
1250
|
-
}
|
|
1362
|
+
const firstSelectedIndex = select.getBlockIndex(clientId, rootClientId);
|
|
1363
|
+
return dispatch.insertDefaultBlock({}, rootClientId, firstSelectedIndex + 1);
|
|
1364
|
+
};
|
|
1251
1365
|
/**
|
|
1252
|
-
*
|
|
1366
|
+
* Action that toggles the highlighted block state.
|
|
1253
1367
|
*
|
|
1254
1368
|
* @param {string} clientId The block's clientId.
|
|
1255
1369
|
* @param {boolean} isHighlighted The highlight state.
|
|
1256
1370
|
*/
|
|
1257
1371
|
|
|
1258
1372
|
|
|
1373
|
+
exports.insertAfterBlock = insertAfterBlock;
|
|
1374
|
+
|
|
1259
1375
|
function toggleBlockHighlight(clientId, isHighlighted) {
|
|
1260
1376
|
return {
|
|
1261
1377
|
type: 'TOGGLE_BLOCK_HIGHLIGHT',
|
|
@@ -1264,29 +1380,30 @@ function toggleBlockHighlight(clientId, isHighlighted) {
|
|
|
1264
1380
|
};
|
|
1265
1381
|
}
|
|
1266
1382
|
/**
|
|
1267
|
-
*
|
|
1268
|
-
* given clientId should appear to "flash" by rhythmically highlighting it.
|
|
1383
|
+
* Action that "flashes" the block with a given `clientId` by rhythmically highlighting it.
|
|
1269
1384
|
*
|
|
1270
1385
|
* @param {string} clientId Target block client ID.
|
|
1271
1386
|
*/
|
|
1272
1387
|
|
|
1273
1388
|
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
}
|
|
1389
|
+
const flashBlock = clientId => async _ref20 => {
|
|
1390
|
+
let {
|
|
1391
|
+
dispatch
|
|
1392
|
+
} = _ref20;
|
|
1393
|
+
dispatch(toggleBlockHighlight(clientId, true));
|
|
1394
|
+
await new Promise(resolve => setTimeout(resolve, 150));
|
|
1395
|
+
dispatch(toggleBlockHighlight(clientId, false));
|
|
1396
|
+
};
|
|
1282
1397
|
/**
|
|
1283
|
-
*
|
|
1398
|
+
* Action that sets whether a block has controlled inner blocks.
|
|
1284
1399
|
*
|
|
1285
1400
|
* @param {string} clientId The block's clientId.
|
|
1286
1401
|
* @param {boolean} hasControlledInnerBlocks True if the block's inner blocks are controlled.
|
|
1287
1402
|
*/
|
|
1288
1403
|
|
|
1289
1404
|
|
|
1405
|
+
exports.flashBlock = flashBlock;
|
|
1406
|
+
|
|
1290
1407
|
function setHasControlledInnerBlocks(clientId, hasControlledInnerBlocks) {
|
|
1291
1408
|
return {
|
|
1292
1409
|
type: 'SET_HAS_CONTROLLED_INNER_BLOCKS',
|