@wordpress/block-editor 12.6.0 → 12.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +44 -2
- package/build/autocompleters/block.js +9 -24
- package/build/autocompleters/block.js.map +1 -1
- package/build/autocompleters/link.js +3 -14
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/alignment-control/index.js +6 -10
- package/build/components/alignment-control/index.js.map +1 -1
- package/build/components/alignment-control/ui.js +3 -11
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/autocomplete/index.js +8 -22
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/block-actions/index.js +3 -26
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/constants.js +1 -3
- package/build/components/block-alignment-control/constants.js.map +1 -1
- package/build/components/block-alignment-control/index.js +6 -10
- package/build/components/block-alignment-control/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +7 -16
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +5 -13
- package/build/components/block-alignment-control/ui.native.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +10 -18
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +1 -8
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +2 -15
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-caption/index.native.js +7 -16
- package/build/components/block-caption/index.native.js.map +1 -1
- package/build/components/block-card/index.js +5 -17
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-compare/block-view.js +1 -4
- package/build/components/block-compare/block-view.js.map +1 -1
- package/build/components/block-compare/index.js +4 -12
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-content-overlay/index.js +1 -3
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-context/index.js +3 -5
- package/build/components/block-context/index.js.map +1 -1
- package/build/components/block-controls/fill.js +3 -8
- package/build/components/block-controls/fill.js.map +1 -1
- package/build/components/block-controls/groups.js +1 -2
- package/build/components/block-controls/groups.js.map +1 -1
- package/build/components/block-controls/hook.js +1 -11
- package/build/components/block-controls/hook.js.map +1 -1
- package/build/components/block-controls/index.js +3 -9
- package/build/components/block-controls/index.js.map +1 -1
- package/build/components/block-controls/slot.js +3 -14
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-controls/slot.native.js +5 -12
- package/build/components/block-controls/slot.native.js.map +1 -1
- package/build/components/block-controls/use-has-block-controls.js +43 -0
- package/build/components/block-controls/use-has-block-controls.js.map +1 -0
- package/build/components/block-draggable/draggable-chip.js +2 -9
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.native.js +2 -9
- package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
- package/build/components/block-draggable/dropping-insertion-point.native.js +2 -23
- package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
- package/build/components/block-draggable/index.js +3 -15
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +7 -56
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.js +9 -13
- package/build/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.native.js +2 -14
- package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
- package/build/components/block-edit/context.js +1 -3
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/edit.js +13 -23
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-edit/edit.native.js +4 -14
- package/build/components/block-edit/edit.native.js.map +1 -1
- package/build/components/block-edit/index.js +5 -8
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-edit-visually-button/index.js +1 -8
- package/build/components/block-edit-visually-button/index.js.map +1 -1
- package/build/components/block-editing-mode/index.js +3 -12
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-full-height-alignment-control/index.js +1 -6
- package/build/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/heading-level-icon.js +2 -6
- package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.js +4 -10
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.native.js +2 -8
- package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build/components/block-icon/index.js +2 -10
- package/build/components/block-icon/index.js.map +1 -1
- package/build/components/block-icon/index.native.js +1 -10
- package/build/components/block-icon/index.native.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +5 -13
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-inspector/index.js +11 -46
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-inspector/useBlockInspectorAnimationSettings.js +7 -10
- package/build/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
- package/build/components/block-list/block-crash-boundary.js +1 -7
- package/build/components/block-list/block-crash-boundary.js.map +1 -1
- package/build/components/block-list/block-crash-warning.js +1 -7
- package/build/components/block-list/block-crash-warning.js.map +1 -1
- package/build/components/block-list/block-html.js +7 -15
- package/build/components/block-list/block-html.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.js +3 -16
- package/build/components/block-list/block-invalid-warning.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.native.js +4 -16
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block-list-block-context.js +1 -2
- package/build/components/block-list/block-list-block-context.js.map +1 -1
- package/build/components/block-list/block-list-context.native.js +10 -25
- package/build/components/block-list/block-list-context.native.js.map +1 -1
- package/build/components/block-list/block-list-item-cell.native.js +1 -8
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +5 -18
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +2 -9
- package/build/components/block-list/block-outline.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js +2 -21
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.js +39 -80
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +40 -71
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/grid-item.native.js +1 -6
- package/build/components/block-list/grid-item.native.js.map +1 -1
- package/build/components/block-list/index.js +11 -32
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js +18 -49
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/insertion-point.native.js +1 -9
- package/build/components/block-list/insertion-point.native.js.map +1 -1
- package/build/components/block-list/layout.js +3 -13
- package/build/components/block-list/layout.js.map +1 -1
- package/build/components/block-list/subdirectory-icon.js +3 -6
- package/build/components/block-list/subdirectory-icon.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +10 -35
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.native.js +5 -5
- package/build/components/block-list/use-block-props/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js +2 -8
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -8
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -6
- package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js +3 -10
- package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-refs.js +9 -18
- package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +13 -27
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-handler.js +6 -14
- package/build/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
- package/build/components/block-list/use-block-props/use-intersection-observer.js +1 -4
- package/build/components/block-list/use-block-props/use-intersection-observer.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +4 -8
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-block-props/use-nav-mode-exit.js +2 -6
- package/build/components/block-list/use-block-props/use-nav-mode-exit.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +2 -15
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +15 -37
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list-appender/index.js +12 -32
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-list-appender/index.native.js +1 -14
- package/build/components/block-list-appender/index.native.js.map +1 -1
- package/build/components/block-lock/index.js +0 -5
- package/build/components/block-lock/index.js.map +1 -1
- package/build/components/block-lock/menu-item.js +1 -10
- package/build/components/block-lock/menu-item.js.map +1 -1
- package/build/components/block-lock/modal.js +10 -22
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-lock/toolbar.js +6 -16
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-lock/use-block-lock.js +0 -3
- package/build/components/block-lock/use-block-lock.js.map +1 -1
- package/build/components/block-media-update-progress/index.native.js +9 -64
- package/build/components/block-media-update-progress/index.native.js.map +1 -1
- package/build/components/block-mover/button.js +1 -23
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +4 -18
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +3 -21
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-mover/mover-description.js +41 -63
- package/build/components/block-mover/mover-description.js.map +1 -1
- package/build/components/block-mover/mover-description.native.js +1 -20
- package/build/components/block-mover/mover-description.native.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +6 -17
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-parent-selector/index.js +11 -43
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/constants.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +3 -23
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +1 -9
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-pattern-setup/use-patterns-setup.js +1 -6
- package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build/components/block-patterns-list/index.js +3 -17
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/drop-zone.js +1 -12
- package/build/components/block-popover/drop-zone.js.map +1 -1
- package/build/components/block-popover/inbetween.js +16 -33
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +15 -26
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-popover/use-popover-scroll.js +2 -7
- package/build/components/block-popover/use-popover-scroll.js.map +1 -1
- package/build/components/block-preview/auto.js +15 -19
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +8 -24
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +2 -13
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +5 -15
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-selection-clearer/index.js +2 -11
- package/build/components/block-selection-clearer/index.js.map +1 -1
- package/build/components/block-settings/button.native.js +3 -10
- package/build/components/block-settings/button.native.js.map +1 -1
- package/build/components/block-settings/container.native.js +3 -9
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings/index.native.js +0 -5
- package/build/components/block-settings/index.native.js.map +1 -1
- package/build/components/block-settings-menu/block-convert-button.js +1 -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 +0 -9
- package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.js +1 -13
- package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +16 -53
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-menu-first-item.js +1 -2
- package/build/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
- package/build/components/block-settings-menu/index.js +1 -6
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +13 -22
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +2 -20
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +1 -17
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-styles/menu-items.js +1 -9
- package/build/components/block-styles/menu-items.js.map +1 -1
- package/build/components/block-styles/preview-panel.js +5 -8
- package/build/components/block-styles/preview-panel.js.map +1 -1
- package/build/components/block-styles/preview.native.js +3 -19
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-styles/use-styles-for-block.js +1 -15
- package/build/components/block-styles/use-styles-for-block.js.map +1 -1
- package/build/components/block-styles/utils.js +3 -16
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-switcher/block-styles-menu.js +1 -6
- package/build/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +4 -18
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js +4 -18
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +3 -16
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build/components/block-switcher/index.js +12 -43
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +3 -14
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +1 -6
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +12 -27
- package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build/components/block-switcher/utils.js +5 -10
- package/build/components/block-switcher/utils.js.map +1 -1
- package/build/components/block-title/index.js +0 -3
- package/build/components/block-title/index.js.map +1 -1
- package/build/components/block-title/use-block-display-title.js +2 -15
- package/build/components/block-title/use-block-display-title.js.map +1 -1
- package/build/components/block-toolbar/block-name-context.js +1 -3
- package/build/components/block-toolbar/block-name-context.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-last-item.js +1 -2
- package/build/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +24 -43
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/index.js +10 -64
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/index.native.js +1 -15
- package/build/components/block-toolbar/index.native.js.map +1 -1
- package/build/components/block-toolbar/utils.js +58 -74
- package/build/components/block-toolbar/utils.js.map +1 -1
- package/build/components/block-tools/back-compat.js +3 -11
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +50 -23
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +8 -43
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +9 -32
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +8 -30
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +12 -35
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +35 -36
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +3 -12
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-types-list/index.js +1 -10
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +3 -22
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-picker/index.js +1 -8
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +11 -36
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +8 -22
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/icons.js +1 -3
- package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
- package/build/components/block-vertical-alignment-control/index.js +6 -10
- package/build/components/block-vertical-alignment-control/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +4 -10
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/all-input-control.js +8 -13
- package/build/components/border-radius-control/all-input-control.js.map +1 -1
- package/build/components/border-radius-control/index.js +5 -16
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +14 -15
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +5 -7
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/border-radius-control/utils.js +9 -17
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/button-block-appender/index.js +5 -19
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/button-block-appender/index.native.js +4 -13
- package/build/components/button-block-appender/index.native.js.map +1 -1
- package/build/components/caption/index.native.js +1 -7
- package/build/components/caption/index.native.js.map +1 -1
- package/build/components/child-layout-control/index.js +8 -13
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/color-palette/control.js +3 -5
- package/build/components/color-palette/control.js.map +1 -1
- package/build/components/color-palette/index.js +0 -6
- package/build/components/color-palette/index.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +2 -8
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/color-style-selector/index.js +3 -14
- package/build/components/color-style-selector/index.js.map +1 -1
- package/build/components/colors/index.js +0 -4
- package/build/components/colors/index.js.map +1 -1
- package/build/components/colors/utils.js +5 -20
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +15 -30
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +7 -19
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +15 -21
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +7 -20
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js +1 -5
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +0 -13
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/contrast-checker/index.js +20 -31
- package/build/components/contrast-checker/index.js.map +1 -1
- package/build/components/contrast-checker/index.native.js +4 -21
- package/build/components/contrast-checker/index.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +1 -18
- package/build/components/convert-to-group-buttons/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.native.js +5 -17
- package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +3 -19
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +4 -7
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build/components/copy-handler/index.js +24 -53
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +2 -8
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/default-block-appender/index.js +4 -18
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/default-block-appender/index.native.js +14 -21
- package/build/components/default-block-appender/index.native.js.map +1 -1
- package/build/components/default-style-picker/index.js +4 -12
- package/build/components/default-style-picker/index.js.map +1 -1
- package/build/components/dimensions-tool/aspect-ratio-tool.js +1 -6
- package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
- package/build/components/dimensions-tool/index.js +37 -36
- package/build/components/dimensions-tool/index.js.map +1 -1
- package/build/components/dimensions-tool/scale-tool.js +1 -5
- package/build/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build/components/dimensions-tool/width-height-tool.js +5 -15
- package/build/components/dimensions-tool/width-height-tool.js.map +1 -1
- package/build/components/duotone/components.js +5 -11
- package/build/components/duotone/components.js.map +1 -1
- package/build/components/duotone/index.js +0 -2
- package/build/components/duotone/index.js.map +1 -1
- package/build/components/duotone/utils.js +0 -2
- package/build/components/duotone/utils.js.map +1 -1
- package/build/components/duotone-control/index.js +1 -10
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/editable-text/index.js +4 -8
- package/build/components/editable-text/index.js.map +1 -1
- package/build/components/editor-styles/index.js +5 -17
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/floating-toolbar/index.native.js +3 -18
- package/build/components/floating-toolbar/index.native.js.map +1 -1
- package/build/components/floating-toolbar/nav-up-icon.js +1 -5
- package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
- package/build/components/font-appearance-control/index.js +25 -30
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +1 -9
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +52 -51
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/font-sizes/font-size-picker.js +4 -8
- package/build/components/font-sizes/font-size-picker.js.map +1 -1
- package/build/components/font-sizes/index.js +0 -5
- package/build/components/font-sizes/index.js.map +1 -1
- package/build/components/font-sizes/index.native.js +0 -4
- package/build/components/font-sizes/index.native.js.map +1 -1
- package/build/components/font-sizes/utils.js +2 -12
- package/build/components/font-sizes/utils.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +15 -27
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +3 -14
- package/build/components/global-styles/advanced-panel.js.map +1 -1
- package/build/components/global-styles/behaviors-panel.js +64 -0
- package/build/components/global-styles/behaviors-panel.js.map +1 -0
- package/build/components/global-styles/border-panel.js +22 -43
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +30 -69
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.native.js +5 -19
- package/build/components/global-styles/color-panel.native.js.map +1 -1
- package/build/components/global-styles/context.js +1 -2
- package/build/components/global-styles/context.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +33 -92
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +7 -27
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +9 -25
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-block-css-selector.js +33 -31
- package/build/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build/components/global-styles/hooks.js +136 -71
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +19 -15
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +25 -87
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +8 -16
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +96 -190
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +12 -49
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/gradients/index.js +0 -2
- package/build/components/gradients/index.js.map +1 -1
- package/build/components/gradients/index.native.js +0 -4
- package/build/components/gradients/index.native.js.map +1 -1
- package/build/components/gradients/use-gradient.js +3 -21
- package/build/components/gradients/use-gradient.js.map +1 -1
- package/build/components/gradients/with-gradient.js +3 -5
- package/build/components/gradients/with-gradient.js.map +1 -1
- package/build/components/height-control/index.js +2 -12
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/iframe/index.js +23 -46
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/iframe/use-compatibility-styles.js +8 -20
- package/build/components/iframe/use-compatibility-styles.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +3 -9
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/image-editor/constants.js.map +1 -1
- package/build/components/image-editor/context.js +3 -9
- package/build/components/image-editor/context.js.map +1 -1
- package/build/components/image-editor/cropper.js +3 -11
- package/build/components/image-editor/cropper.js.map +1 -1
- package/build/components/image-editor/form-controls.js +1 -5
- package/build/components/image-editor/form-controls.js.map +1 -1
- package/build/components/image-editor/index.js +1 -11
- package/build/components/image-editor/index.js.map +1 -1
- package/build/components/image-editor/rotation-button.js +1 -6
- package/build/components/image-editor/rotation-button.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +5 -15
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/image-editor/use-transform-image.js +1 -12
- package/build/components/image-editor/use-transform-image.js.map +1 -1
- package/build/components/image-editor/zoom-dropdown.js +1 -7
- package/build/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build/components/image-size-control/index.js +1 -9
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/image-size-control/use-dimension-handler.js +7 -14
- package/build/components/image-size-control/use-dimension-handler.js.map +1 -1
- package/build/components/index.js +25 -115
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +0 -53
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +1 -9
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/default-block-appender.js +1 -11
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +22 -38
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +18 -31
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-block-context.js +0 -9
- package/build/components/inner-blocks/use-block-context.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +10 -18
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +18 -27
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inner-blocks/with-client-id.js +3 -5
- package/build/components/inner-blocks/with-client-id.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js +3 -10
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/patterns-list.js +5 -24
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/sidebar.js +1 -7
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +12 -33
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +9 -25
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +1 -14
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js +9 -12
- 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 -8
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-clipboard-block.native.js +1 -7
- package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
- package/build/components/inserter/hooks/use-debounced-input.js +6 -10
- package/build/components/inserter/hooks/use-debounced-input.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +2 -15
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +6 -13
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +29 -66
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +23 -71
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/library.js +1 -11
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +12 -27
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/inserter/media-tab/index.js +0 -4
- package/build/components/inserter/media-tab/index.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +3 -7
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +1 -13
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +10 -35
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +3 -18
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/media-tab/utils.js +2 -6
- package/build/components/inserter/media-tab/utils.js.map +1 -1
- package/build/components/inserter/menu.js +2 -22
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js +5 -24
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +3 -7
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/no-results.js +1 -5
- package/build/components/inserter/no-results.js.map +1 -1
- package/build/components/inserter/no-results.native.js +1 -8
- package/build/components/inserter/no-results.native.js.map +1 -1
- package/build/components/inserter/panel.js +1 -4
- package/build/components/inserter/panel.js.map +1 -1
- package/build/components/inserter/preview-panel.js +14 -15
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +4 -18
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/reusable-block-rename-hint.js +2 -16
- package/build/components/inserter/reusable-block-rename-hint.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.js +6 -19
- package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +1 -9
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/search-items.js +21 -41
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +6 -37
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/search-results.native.js +1 -15
- package/build/components/inserter/search-results.native.js.map +1 -1
- package/build/components/inserter/tabs.js +1 -17
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter/tabs.native.js +5 -20
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter/tips.js +3 -7
- package/build/components/inserter/tips.js.map +1 -1
- package/build/components/inserter/utils.native.js +2 -9
- package/build/components/inserter/utils.native.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +1 -8
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-list-item/index.js +2 -17
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inserter-listbox/context.js +1 -2
- package/build/components/inserter-listbox/context.js.map +1 -1
- package/build/components/inserter-listbox/group.js +1 -7
- package/build/components/inserter-listbox/group.js.map +1 -1
- package/build/components/inserter-listbox/index.js +1 -9
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +9 -14
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inserter-listbox/row.js +1 -7
- package/build/components/inserter-listbox/row.js.map +1 -1
- package/build/components/inserter-menu-extension/index.js +1 -2
- package/build/components/inserter-menu-extension/index.js.map +1 -1
- package/build/components/inspector-controls/block-support-slot-container.js +3 -4
- package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +7 -9
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +4 -16
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +3 -15
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/groups.js +1 -2
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls/index.js +8 -12
- package/build/components/inspector-controls/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +5 -16
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls/slot.native.js +3 -10
- package/build/components/inspector-controls/slot.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js +1 -10
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +1 -11
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +3 -14
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab-hint.js +1 -13
- package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab.js +1 -8
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +1 -10
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +14 -24
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +0 -2
- package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
- package/build/components/inspector-controls-tabs/utils.js +1 -3
- package/build/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build/components/inspector-popover-header/index.js +1 -5
- package/build/components/inspector-popover-header/index.js.map +1 -1
- package/build/components/justify-content-control/index.js +6 -10
- package/build/components/justify-content-control/index.js.map +1 -1
- package/build/components/justify-content-control/ui.js +1 -8
- package/build/components/justify-content-control/ui.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +10 -7
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +2 -7
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/line-height-control/index.js +21 -37
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/line-height-control/index.native.js +5 -7
- package/build/components/line-height-control/index.native.js.map +1 -1
- package/build/components/line-height-control/utils.js +10 -6
- package/build/components/line-height-control/utils.js.map +1 -1
- package/build/components/link-control/constants.js +1 -2
- package/build/components/link-control/constants.js.map +1 -1
- package/build/components/link-control/index.js +79 -52
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/is-url-like.js +4 -8
- package/build/components/link-control/is-url-like.js.map +1 -1
- package/build/components/link-control/link-preview.js +11 -19
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-create-button.js +4 -12
- package/build/components/link-control/search-create-button.js.map +1 -1
- package/build/components/link-control/search-input.js +15 -28
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-item.js +7 -19
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +13 -22
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +1 -7
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/link-control/settings.js +3 -9
- package/build/components/link-control/settings.js.map +1 -1
- package/build/components/link-control/use-create-page.js +5 -12
- package/build/components/link-control/use-create-page.js.map +1 -1
- package/build/components/link-control/use-internal-value.js +9 -12
- package/build/components/link-control/use-internal-value.js.map +1 -1
- package/build/components/link-control/use-rich-url-data.js +9 -14
- package/build/components/link-control/use-rich-url-data.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +10 -24
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/link-control/viewer-slot.js +1 -2
- package/build/components/link-control/viewer-slot.js.map +1 -1
- package/build/components/list-view/appender.js +4 -18
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/aria-referenced-text.js +0 -2
- package/build/components/list-view/aria-referenced-text.js.map +1 -1
- package/build/components/list-view/block-contents.js +4 -11
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +31 -32
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +24 -46
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +7 -37
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/context.js +1 -4
- package/build/components/list-view/context.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +35 -47
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/expander.js +3 -5
- package/build/components/list-view/expander.js.map +1 -1
- package/build/components/list-view/index.js +18 -39
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +1 -8
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +15 -30
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +1 -4
- package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +38 -63
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/use-list-view-expand-selected-item.js +5 -7
- package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build/components/list-view/use-list-view-images.js +84 -0
- package/build/components/list-view/use-list-view-images.js.map +1 -0
- package/build/components/list-view/use-list-view-scroll-into-view.js +6 -8
- package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
- package/build/components/list-view/utils.js +4 -10
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.js +11 -71
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +7 -30
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +8 -39
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-replace-flow/index.native.js +13 -4
- package/build/components/media-replace-flow/index.native.js.map +1 -1
- package/build/components/media-upload/check.js +2 -5
- package/build/components/media-upload/check.js.map +1 -1
- package/build/components/media-upload/index.js +1 -5
- package/build/components/media-upload/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +18 -43
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/media-upload-progress/index.native.js +3 -33
- package/build/components/media-upload-progress/index.native.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +3 -16
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +10 -32
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/observe-typing/index.js +24 -43
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/panel-color-settings/index.js +3 -7
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/plain-text/index.js +0 -7
- package/build/components/plain-text/index.js.map +1 -1
- package/build/components/plain-text/index.native.js +7 -27
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +1 -8
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/block-refs-provider.js +1 -3
- package/build/components/provider/block-refs-provider.js.map +1 -1
- package/build/components/provider/index.js +7 -14
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +3 -9
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-sync.js +23 -41
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +1 -9
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +1 -9
- package/build/components/publish-date-time-picker/index.js.map +1 -1
- package/build/components/recursion-provider/index.js +6 -9
- package/build/components/recursion-provider/index.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +3 -6
- package/build/components/resizable-box-popover/index.js.map +1 -1
- package/build/components/resolution-tool/index.js +1 -5
- package/build/components/resolution-tool/index.js.map +1 -1
- package/build/components/responsive-block-control/index.js +3 -16
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/responsive-block-control/label.js +2 -7
- package/build/components/responsive-block-control/label.js.map +1 -1
- package/build/components/rich-text/content.js +3 -13
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/embed-handler-picker.native.js +1 -7
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build/components/rich-text/file-paste-handler.native.js +0 -1
- package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
- package/build/components/rich-text/format-edit.js +52 -30
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +4 -14
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.native.js +1 -4
- package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +4 -22
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.native.js +1 -6
- package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +12 -38
- package/build/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build/components/rich-text/index.js +18 -68
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +48 -94
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/input-event.js +1 -4
- package/build/components/rich-text/input-event.js.map +1 -1
- package/build/components/rich-text/input-event.native.js +1 -4
- package/build/components/rich-text/input-event.native.js.map +1 -1
- package/build/components/rich-text/prevent-event-discovery.js +1 -6
- package/build/components/rich-text/prevent-event-discovery.js.map +1 -1
- package/build/components/rich-text/remove-browser-shortcuts.native.js +0 -2
- package/build/components/rich-text/remove-browser-shortcuts.native.js.map +1 -1
- package/build/components/rich-text/shortcut.js +1 -5
- package/build/components/rich-text/shortcut.js.map +1 -1
- package/build/components/rich-text/shortcut.native.js +1 -4
- package/build/components/rich-text/shortcut.native.js.map +1 -1
- package/build/components/rich-text/split-value.js +18 -17
- package/build/components/rich-text/split-value.js.map +1 -1
- package/build/components/rich-text/toolbar-button.js +3 -8
- package/build/components/rich-text/toolbar-button.js.map +1 -1
- package/build/components/rich-text/use-before-input-rules.js +5 -22
- package/build/components/rich-text/use-before-input-rules.js.map +1 -1
- package/build/components/rich-text/use-delete.js +6 -15
- package/build/components/rich-text/use-delete.js.map +1 -1
- package/build/components/rich-text/use-enter.js +3 -18
- package/build/components/rich-text/use-enter.js.map +1 -1
- package/build/components/rich-text/use-firefox-compat.js +5 -41
- package/build/components/rich-text/use-firefox-compat.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +10 -23
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/rich-text/use-input-events.js +1 -3
- package/build/components/rich-text/use-input-events.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +10 -35
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-insert-replacement-text.js +0 -5
- package/build/components/rich-text/use-insert-replacement-text.js.map +1 -1
- package/build/components/rich-text/use-mark-persistent.js +6 -9
- package/build/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +24 -71
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/rich-text/use-remove-browser-shortcuts.js +0 -4
- package/build/components/rich-text/use-remove-browser-shortcuts.js.map +1 -1
- package/build/components/rich-text/use-shortcuts.js +1 -3
- package/build/components/rich-text/use-shortcuts.js.map +1 -1
- package/build/components/rich-text/use-undo-automatic-change.js +1 -13
- package/build/components/rich-text/use-undo-automatic-change.js.map +1 -1
- package/build/components/rich-text/utils.js +3 -15
- package/build/components/rich-text/utils.js.map +1 -1
- package/build/components/selection-scroll-into-view/index.js +0 -3
- package/build/components/selection-scroll-into-view/index.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +2 -12
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -6
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/spacing-sizes-control/index.js +13 -23
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/axial.js +7 -14
- package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js +3 -8
- package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/single.js +3 -7
- package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +6 -29
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/sides-dropdown/index.js +1 -7
- package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +36 -68
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/text-decoration-control/index.js +2 -8
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +2 -8
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/tool-selector/index.js +4 -13
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/typewriter/index.js +30 -52
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/ungroup-button/index.native.js +1 -16
- package/build/components/ungroup-button/index.native.js.map +1 -1
- package/build/components/unit-control/index.js +1 -5
- package/build/components/unit-control/index.js.map +1 -1
- package/build/components/url-input/button.js +2 -13
- package/build/components/url-input/button.js.map +1 -1
- package/build/components/url-input/index.js +38 -91
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-input/index.native.js +1 -4
- package/build/components/url-input/index.native.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +3 -36
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/index.js +5 -20
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/url-popover/link-editor.js +1 -8
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/url-popover/link-viewer-url.js +1 -8
- package/build/components/url-popover/link-viewer-url.js.map +1 -1
- package/build/components/url-popover/link-viewer.js +1 -8
- package/build/components/url-popover/link-viewer.js.map +1 -1
- package/build/components/use-block-commands/index.js +247 -0
- package/build/components/use-block-commands/index.js.map +1 -0
- package/build/components/use-block-display-information/index.js +1 -9
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +12 -29
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +12 -24
- package/build/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build/components/use-display-block-controls/index.js +1 -7
- package/build/components/use-display-block-controls/index.js.map +1 -1
- package/build/components/use-display-block-controls/index.native.js +1 -7
- package/build/components/use-display-block-controls/index.native.js.map +1 -1
- package/build/components/use-moving-animation/index.js +4 -20
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +19 -38
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.native.js +11 -15
- package/build/components/use-on-block-drop/index.native.js.map +1 -1
- package/build/components/use-on-block-drop/types.js.map +1 -1
- package/build/components/use-paste-styles/index.js +10 -27
- package/build/components/use-paste-styles/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +0 -14
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-setting/index.js +17 -39
- package/build/components/use-setting/index.js.map +1 -1
- package/build/components/video-player/gridicon-play.native.js +0 -4
- package/build/components/video-player/gridicon-play.native.js.map +1 -1
- package/build/components/video-player/index.native.js +9 -24
- package/build/components/video-player/index.native.js.map +1 -1
- package/build/components/warning/index.js +2 -9
- package/build/components/warning/index.js.map +1 -1
- package/build/components/warning/index.native.js +1 -10
- package/build/components/warning/index.native.js.map +1 -1
- package/build/components/writing-flow/index.js +4 -23
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-arrow-nav.js +35 -60
- package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build/components/writing-flow/use-click-selection.js +3 -10
- package/build/components/writing-flow/use-click-selection.js.map +1 -1
- package/build/components/writing-flow/use-drag-selection.js +25 -31
- package/build/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build/components/writing-flow/use-input.js +6 -21
- package/build/components/writing-flow/use-input.js.map +1 -1
- package/build/components/writing-flow/use-multi-selection.js +10 -16
- package/build/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build/components/writing-flow/use-select-all.js +4 -14
- package/build/components/writing-flow/use-select-all.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js +18 -47
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +28 -44
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/components/writing-mode-control/index.js +2 -8
- package/build/components/writing-mode-control/index.js.map +1 -1
- package/build/elements/index.js +0 -2
- package/build/elements/index.js.map +1 -1
- package/build/hooks/align.js +22 -46
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +5 -9
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +9 -24
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/aria-label.js +5 -11
- package/build/hooks/aria-label.js.map +1 -1
- package/build/hooks/behaviors.js +14 -32
- package/build/hooks/behaviors.js.map +1 -1
- package/build/hooks/border.js +47 -80
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +31 -69
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/compat.js +1 -5
- package/build/hooks/compat.js.map +1 -1
- package/build/hooks/content-lock-ui.js +5 -19
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/contrast-checker.js +4 -13
- package/build/hooks/contrast-checker.js.map +1 -1
- package/build/hooks/custom-class-name.js +21 -37
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-class-name.native.js +3 -11
- package/build/hooks/custom-class-name.native.js.map +1 -1
- package/build/hooks/custom-fields.js +115 -0
- package/build/hooks/custom-fields.js.map +1 -0
- package/build/hooks/dimensions.js +6 -23
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +42 -64
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +9 -29
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +36 -62
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/gap.js +1 -7
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/generated-class-name.js +1 -5
- package/build/hooks/generated-class-name.js.map +1 -1
- package/build/hooks/index.js +1 -27
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +0 -14
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.js +45 -72
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/layout.native.js +4 -4
- package/build/hooks/layout.native.js.map +1 -1
- package/build/hooks/line-height.js +7 -15
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/lock.js +4 -8
- package/build/hooks/lock.js.map +1 -1
- package/build/hooks/margin.js +1 -13
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/metadata-name.js +4 -8
- package/build/hooks/metadata-name.js.map +1 -1
- package/build/hooks/metadata.js +4 -14
- package/build/hooks/metadata.js.map +1 -1
- package/build/hooks/padding.js +1 -13
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +35 -61
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/settings.js +5 -8
- package/build/hooks/settings.js.map +1 -1
- package/build/hooks/style.js +38 -61
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +23 -76
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +11 -27
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +5 -14
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-border-props.js +5 -10
- package/build/hooks/use-border-props.js.map +1 -1
- package/build/hooks/use-cached-truthy.js +0 -2
- package/build/hooks/use-cached-truthy.js.map +1 -1
- package/build/hooks/use-color-props.js +14 -20
- package/build/hooks/use-color-props.js.map +1 -1
- package/build/hooks/use-editor-wrapper-styles.native.js +7 -30
- package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -1
- package/build/hooks/use-spacing-props.js +3 -3
- package/build/hooks/use-spacing-props.js.map +1 -1
- package/build/hooks/use-typography-props.js +2 -9
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +10 -26
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +0 -10
- package/build/index.js.map +1 -1
- package/build/index.native.js +0 -3
- package/build/index.native.js.map +1 -1
- package/build/layouts/constrained.js +13 -37
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/definitions.js.map +1 -1
- package/build/layouts/flex.js +16 -48
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +7 -23
- package/build/layouts/flow.js.map +1 -1
- package/build/layouts/grid.js +18 -32
- package/build/layouts/grid.js.map +1 -1
- package/build/layouts/index.js +3 -9
- package/build/layouts/index.js.map +1 -1
- package/build/layouts/utils.js +3 -12
- package/build/layouts/utils.js.map +1 -1
- package/build/lock-unlock.js +1 -2
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +5 -27
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +2 -8
- package/build/private-apis.native.js.map +1 -1
- package/build/store/actions.js +188 -287
- package/build/store/actions.js.map +1 -1
- package/build/store/array.js +1 -3
- package/build/store/array.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/defaults.js +2 -3
- package/build/store/defaults.js.map +1 -1
- package/build/store/defaults.native.js +3 -3
- package/build/store/defaults.native.js.map +1 -1
- package/build/store/index.js +11 -19
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +26 -91
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +8 -90
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +161 -358
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +257 -522
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +0 -1
- package/build/store/utils.js.map +1 -1
- package/build/utils/block-variation-transforms.js +2 -5
- package/build/utils/block-variation-transforms.js.map +1 -1
- package/build/utils/dom.js +4 -12
- package/build/utils/dom.js.map +1 -1
- package/build/utils/index.js +0 -5
- package/build/utils/index.js.map +1 -1
- package/build/utils/math.js +5 -10
- package/build/utils/math.js.map +1 -1
- package/build/utils/object.js +14 -25
- package/build/utils/object.js.map +1 -1
- package/build/utils/order-inserter-block-items.js +2 -5
- package/build/utils/order-inserter-block-items.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +14 -66
- package/build/utils/parse-css-unit-to-px.js.map +1 -1
- package/build/utils/pasting.js +9 -15
- package/build/utils/pasting.js.map +1 -1
- package/build/utils/pre-parse-patterns.js +1 -16
- package/build/utils/pre-parse-patterns.js.map +1 -1
- package/build/utils/selection.js +1 -4
- package/build/utils/selection.js.map +1 -1
- package/build/utils/sorting.js +3 -8
- package/build/utils/sorting.js.map +1 -1
- package/build/utils/transform-styles/ast/index.js +0 -3
- package/build/utils/transform-styles/ast/index.js.map +1 -1
- package/build/utils/transform-styles/ast/parse.js +95 -137
- package/build/utils/transform-styles/ast/parse.js.map +1 -1
- package/build/utils/transform-styles/ast/stringify/compiler.js +3 -9
- package/build/utils/transform-styles/ast/stringify/compiler.js.map +1 -1
- package/build/utils/transform-styles/ast/stringify/compress.js +25 -27
- package/build/utils/transform-styles/ast/stringify/compress.js.map +1 -1
- package/build/utils/transform-styles/ast/stringify/identity.js +28 -33
- package/build/utils/transform-styles/ast/stringify/identity.js.map +1 -1
- package/build/utils/transform-styles/ast/stringify/index.js +1 -4
- package/build/utils/transform-styles/ast/stringify/index.js.map +1 -1
- package/build/utils/transform-styles/index.js +0 -11
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build/utils/transform-styles/transforms/url-rewrite.js +12 -25
- package/build/utils/transform-styles/transforms/url-rewrite.js.map +1 -1
- package/build/utils/transform-styles/transforms/wrap.js +7 -9
- package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build/utils/transform-styles/traverse.js +1 -8
- package/build/utils/transform-styles/traverse.js.map +1 -1
- package/build/utils/use-should-contextual-toolbar-show.js +0 -9
- package/build/utils/use-should-contextual-toolbar-show.js.map +1 -1
- package/build-module/autocompleters/block.js +10 -16
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/autocompleters/link.js +2 -8
- package/build-module/autocompleters/link.js.map +1 -1
- package/build-module/components/alignment-control/index.js +5 -7
- package/build-module/components/alignment-control/index.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +2 -7
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/autocomplete/index.js +10 -15
- package/build-module/components/autocomplete/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +3 -20
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/constants.js.map +1 -1
- package/build-module/components/block-alignment-control/index.js +5 -7
- package/build-module/components/block-alignment-control/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +8 -12
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +5 -9
- package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +10 -13
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +0 -5
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +4 -9
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-caption/index.native.js +8 -9
- package/build-module/components/block-caption/index.native.js.map +1 -1
- package/build-module/components/block-card/index.js +6 -10
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-compare/block-view.js +0 -1
- package/build-module/components/block-compare/block-view.js.map +1 -1
- package/build-module/components/block-compare/index.js +6 -10
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-content-overlay/index.js +1 -1
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-context/index.js +4 -4
- package/build-module/components/block-context/index.js.map +1 -1
- package/build-module/components/block-controls/fill.js +3 -5
- package/build-module/components/block-controls/fill.js.map +1 -1
- package/build-module/components/block-controls/groups.js.map +1 -1
- package/build-module/components/block-controls/hook.js +1 -4
- package/build-module/components/block-controls/hook.js.map +1 -1
- package/build-module/components/block-controls/index.js +2 -4
- package/build-module/components/block-controls/index.js.map +1 -1
- package/build-module/components/block-controls/slot.js +3 -8
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-controls/slot.native.js +5 -8
- package/build-module/components/block-controls/slot.native.js.map +1 -1
- package/build-module/components/block-controls/use-has-block-controls.js +34 -0
- package/build-module/components/block-controls/use-has-block-controls.js.map +1 -0
- package/build-module/components/block-draggable/draggable-chip.js +2 -5
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.native.js +3 -4
- package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
- package/build-module/components/block-draggable/dropping-insertion-point.native.js +5 -15
- package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
- package/build-module/components/block-draggable/index.js +3 -9
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +8 -34
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.js +8 -10
- package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +2 -11
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
- package/build-module/components/block-edit/context.js +1 -1
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/edit.js +16 -20
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-edit/edit.native.js +6 -7
- package/build-module/components/block-edit/edit.native.js.map +1 -1
- package/build-module/components/block-edit/index.js +5 -5
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-edit-visually-button/index.js +1 -4
- package/build-module/components/block-edit-visually-button/index.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +5 -8
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-full-height-alignment-control/index.js +0 -3
- package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +2 -3
- package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +4 -6
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.native.js +2 -4
- package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build-module/components/block-icon/index.js +2 -6
- package/build-module/components/block-icon/index.js.map +1 -1
- package/build-module/components/block-icon/index.native.js +2 -4
- package/build-module/components/block-icon/index.native.js.map +1 -1
- package/build-module/components/block-info-slot-fill/index.js +5 -9
- package/build-module/components/block-info-slot-fill/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +11 -25
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js +7 -8
- package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
- package/build-module/components/block-list/block-crash-boundary.js +0 -6
- package/build-module/components/block-list/block-crash-boundary.js.map +1 -1
- package/build-module/components/block-list/block-crash-warning.js +1 -2
- package/build-module/components/block-list/block-crash-warning.js.map +1 -1
- package/build-module/components/block-list/block-html.js +8 -12
- package/build-module/components/block-list/block-html.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.js +3 -9
- 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 -10
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-list/block-list-block-context.js.map +1 -1
- package/build-module/components/block-list/block-list-context.native.js +11 -21
- package/build-module/components/block-list/block-list-context.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item-cell.native.js +2 -6
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +8 -12
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +4 -7
- package/build-module/components/block-list/block-outline.native.js.map +1 -1
- package/build-module/components/block-list/block-selection-button.native.js +3 -10
- package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
- package/build-module/components/block-list/block.js +42 -63
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +41 -57
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/grid-item.native.js +1 -4
- package/build-module/components/block-list/grid-item.native.js.map +1 -1
- package/build-module/components/block-list/index.js +12 -18
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +21 -39
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/insertion-point.native.js +2 -5
- package/build-module/components/block-list/insertion-point.native.js.map +1 -1
- package/build-module/components/block-list/layout.js +3 -8
- package/build-module/components/block-list/layout.js.map +1 -1
- package/build-module/components/block-list/subdirectory-icon.js +2 -4
- package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +13 -11
- 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 +4 -2
- 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-block-class-names.js +5 -5
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +2 -6
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +2 -4
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js +6 -8
- package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-refs.js +11 -16
- package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +15 -21
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-handler.js +8 -11
- package/build-module/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-intersection-observer.js +1 -1
- package/build-module/components/block-list/use-block-props/use-intersection-observer.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -6
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js +4 -4
- package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -11
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +15 -30
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +13 -26
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.native.js +1 -9
- package/build-module/components/block-list-appender/index.native.js.map +1 -1
- package/build-module/components/block-lock/index.js.map +1 -1
- package/build-module/components/block-lock/menu-item.js +1 -4
- package/build-module/components/block-lock/menu-item.js.map +1 -1
- package/build-module/components/block-lock/modal.js +12 -13
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +6 -9
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-lock/use-block-lock.js +2 -2
- package/build-module/components/block-lock/use-block-lock.js.map +1 -1
- package/build-module/components/block-media-update-progress/index.native.js +10 -59
- package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
- package/build-module/components/block-mover/button.js +2 -15
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +5 -11
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +4 -11
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-mover/mover-description.js +40 -61
- package/build-module/components/block-mover/mover-description.js.map +1 -1
- package/build-module/components/block-mover/mover-description.native.js +0 -16
- package/build-module/components/block-mover/mover-description.native.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +7 -10
- package/build-module/components/block-navigation/dropdown.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +14 -35
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/constants.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +3 -13
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -6
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-pattern-setup/use-patterns-setup.js +1 -5
- package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +3 -12
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/drop-zone.js +1 -6
- package/build-module/components/block-popover/drop-zone.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +17 -25
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +16 -20
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-popover/use-popover-scroll.js +3 -6
- package/build-module/components/block-popover/use-popover-scroll.js.map +1 -1
- package/build-module/components/block-preview/auto.js +17 -12
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +10 -13
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +2 -7
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +5 -10
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-selection-clearer/index.js +4 -8
- package/build-module/components/block-selection-clearer/index.js.map +1 -1
- package/build-module/components/block-settings/button.native.js +2 -5
- package/build-module/components/block-settings/button.native.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +3 -3
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings/index.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-convert-button.js +0 -3
- 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 +1 -1
- 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 +1 -6
- 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 +17 -40
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +1 -2
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +13 -13
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +4 -15
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +2 -10
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-styles/menu-items.js +1 -6
- package/build-module/components/block-styles/menu-items.js.map +1 -1
- package/build-module/components/block-styles/preview-panel.js +5 -4
- package/build-module/components/block-styles/preview-panel.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +4 -12
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-styles/use-styles-for-block.js +3 -11
- package/build-module/components/block-styles/use-styles-for-block.js.map +1 -1
- package/build-module/components/block-styles/utils.js +4 -10
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-switcher/block-styles-menu.js +1 -2
- package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +6 -12
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js +5 -13
- package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +3 -8
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build-module/components/block-switcher/index.js +12 -26
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -8
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +1 -2
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js +14 -21
- package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build-module/components/block-switcher/utils.js +6 -6
- package/build-module/components/block-switcher/utils.js.map +1 -1
- package/build-module/components/block-title/index.js +2 -1
- package/build-module/components/block-title/index.js.map +1 -1
- package/build-module/components/block-title/use-block-display-title.js +4 -11
- package/build-module/components/block-title/use-block-display-title.js.map +1 -1
- package/build-module/components/block-toolbar/block-name-context.js +0 -2
- package/build-module/components/block-toolbar/block-name-context.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +26 -31
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +13 -49
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.native.js +1 -6
- package/build-module/components/block-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-toolbar/utils.js +56 -69
- package/build-module/components/block-toolbar/utils.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +3 -4
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +51 -13
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +11 -30
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +9 -20
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +9 -22
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +13 -25
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +35 -29
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +3 -8
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-types-list/index.js +1 -7
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +4 -14
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +1 -4
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +15 -30
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +8 -15
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/icons.js +0 -1
- package/build-module/components/block-vertical-alignment-control/icons.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/index.js +5 -7
- package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +4 -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 +8 -10
- package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +5 -8
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +13 -11
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +4 -3
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js +10 -12
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +6 -12
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/button-block-appender/index.native.js +5 -7
- package/build-module/components/button-block-appender/index.native.js.map +1 -1
- package/build-module/components/caption/index.native.js +1 -4
- package/build-module/components/caption/index.native.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +7 -10
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/color-palette/control.js +2 -2
- package/build-module/components/color-palette/control.js.map +1 -1
- package/build-module/components/color-palette/index.js +1 -1
- package/build-module/components/color-palette/index.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +3 -3
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/color-style-selector/index.js +2 -9
- package/build-module/components/color-style-selector/index.js.map +1 -1
- package/build-module/components/colors/index.js.map +1 -1
- package/build-module/components/colors/utils.js +5 -10
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +17 -25
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +8 -15
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +18 -19
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +8 -12
- 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 +2 -3
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +2 -10
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/contrast-checker/index.js +20 -24
- package/build-module/components/contrast-checker/index.js.map +1 -1
- package/build-module/components/contrast-checker/index.native.js +4 -12
- package/build-module/components/contrast-checker/index.native.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +1 -12
- package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.native.js +5 -12
- package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +3 -12
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +6 -5
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build-module/components/copy-handler/index.js +24 -44
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +4 -6
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +7 -9
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.native.js +16 -10
- package/build-module/components/default-block-appender/index.native.js.map +1 -1
- package/build-module/components/default-style-picker/index.js +4 -6
- package/build-module/components/default-style-picker/index.js.map +1 -1
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
- package/build-module/components/dimensions-tool/index.js +39 -33
- package/build-module/components/dimensions-tool/index.js.map +1 -1
- package/build-module/components/dimensions-tool/scale-tool.js +2 -3
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build-module/components/dimensions-tool/width-height-tool.js +5 -12
- package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
- package/build-module/components/duotone/components.js +7 -7
- package/build-module/components/duotone/components.js.map +1 -1
- package/build-module/components/duotone/index.js.map +1 -1
- package/build-module/components/duotone/utils.js +1 -1
- package/build-module/components/duotone/utils.js.map +1 -1
- package/build-module/components/duotone-control/index.js +0 -6
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/editable-text/index.js +4 -6
- package/build-module/components/editable-text/index.js.map +1 -1
- package/build-module/components/editor-styles/index.js +6 -12
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/floating-toolbar/index.native.js +4 -8
- package/build-module/components/floating-toolbar/index.native.js.map +1 -1
- package/build-module/components/floating-toolbar/nav-up-icon.js +0 -3
- package/build-module/components/floating-toolbar/nav-up-icon.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +24 -27
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +1 -5
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +52 -48
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/font-sizes/font-size-picker.js +4 -6
- package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
- package/build-module/components/font-sizes/index.js.map +1 -1
- package/build-module/components/font-sizes/index.native.js.map +1 -1
- package/build-module/components/font-sizes/utils.js +3 -8
- package/build-module/components/font-sizes/utils.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +15 -22
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +3 -9
- package/build-module/components/global-styles/advanced-panel.js.map +1 -1
- package/build-module/components/global-styles/behaviors-panel.js +57 -0
- package/build-module/components/global-styles/behaviors-panel.js.map +1 -0
- package/build-module/components/global-styles/border-panel.js +22 -36
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +31 -56
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.native.js +5 -8
- package/build-module/components/global-styles/color-panel.native.js.map +1 -1
- package/build-module/components/global-styles/context.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +34 -80
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +8 -20
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +10 -20
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-block-css-selector.js +34 -29
- package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +136 -56
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +2 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +25 -73
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +10 -16
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +99 -163
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +14 -44
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/gradients/index.js.map +1 -1
- package/build-module/components/gradients/index.native.js.map +1 -1
- package/build-module/components/gradients/use-gradient.js +3 -11
- package/build-module/components/gradients/use-gradient.js.map +1 -1
- package/build-module/components/gradients/with-gradient.js +2 -3
- package/build-module/components/gradients/with-gradient.js.map +1 -1
- package/build-module/components/height-control/index.js +2 -8
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +26 -37
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/iframe/use-compatibility-styles.js +9 -19
- package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +3 -5
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/image-editor/constants.js.map +1 -1
- package/build-module/components/image-editor/context.js +3 -3
- package/build-module/components/image-editor/context.js.map +1 -1
- package/build-module/components/image-editor/cropper.js +4 -6
- package/build-module/components/image-editor/cropper.js.map +1 -1
- package/build-module/components/image-editor/form-controls.js +1 -2
- package/build-module/components/image-editor/form-controls.js.map +1 -1
- package/build-module/components/image-editor/index.js +1 -2
- package/build-module/components/image-editor/index.js.map +1 -1
- package/build-module/components/image-editor/rotation-button.js +2 -2
- package/build-module/components/image-editor/rotation-button.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +4 -7
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/image-editor/use-transform-image.js +0 -9
- package/build-module/components/image-editor/use-transform-image.js.map +1 -1
- package/build-module/components/image-editor/zoom-dropdown.js +1 -2
- package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build-module/components/image-size-control/index.js +1 -4
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/image-size-control/use-dimension-handler.js +6 -12
- package/build-module/components/image-size-control/use-dimension-handler.js.map +1 -1
- package/build-module/components/index.js +11 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +4 -3
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.js +1 -2
- package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/default-block-appender.js +1 -2
- package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +23 -21
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +21 -20
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-block-context.js +2 -7
- package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +13 -14
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +19 -21
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inner-blocks/with-client-id.js +3 -3
- package/build-module/components/inner-blocks/with-client-id.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js +3 -6
- package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +5 -13
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js +0 -5
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +12 -22
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +9 -16
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +1 -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 +9 -6
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-clipboard-block.native.js +1 -3
- package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +5 -7
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +4 -10
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +6 -7
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +30 -56
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +24 -56
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/library.js +1 -7
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +14 -25
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/inserter/media-tab/index.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.js +3 -5
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -4
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +11 -24
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +4 -7
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build-module/components/inserter/media-tab/utils.js +1 -4
- package/build-module/components/inserter/media-tab/utils.js.map +1 -1
- package/build-module/components/inserter/menu.js +3 -5
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/menu.native.js +6 -15
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +2 -4
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/no-results.js +0 -3
- package/build-module/components/inserter/no-results.js.map +1 -1
- package/build-module/components/inserter/no-results.native.js +2 -5
- package/build-module/components/inserter/no-results.native.js.map +1 -1
- package/build-module/components/inserter/panel.js +0 -3
- package/build-module/components/inserter/panel.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +15 -11
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +5 -8
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/reusable-block-rename-hint.js +1 -7
- package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.js +6 -10
- package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +1 -4
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/inserter/search-items.js +22 -33
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.js +6 -18
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/search-results.native.js +1 -7
- package/build-module/components/inserter/search-results.native.js.map +1 -1
- package/build-module/components/inserter/tabs.js +0 -13
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +6 -13
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inserter/tips.js +2 -4
- package/build-module/components/inserter/tips.js.map +1 -1
- package/build-module/components/inserter/utils.native.js +2 -6
- package/build-module/components/inserter/utils.native.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +0 -4
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +3 -10
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inserter-listbox/context.js.map +1 -1
- package/build-module/components/inserter-listbox/group.js +0 -4
- package/build-module/components/inserter-listbox/group.js.map +1 -1
- package/build-module/components/inserter-listbox/index.js +1 -4
- package/build-module/components/inserter-listbox/index.js.map +1 -1
- package/build-module/components/inserter-listbox/item.js +9 -11
- package/build-module/components/inserter-listbox/item.js.map +1 -1
- package/build-module/components/inserter-listbox/row.js +1 -4
- package/build-module/components/inserter-listbox/row.js.map +1 -1
- package/build-module/components/inserter-menu-extension/index.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-slot-container.js +2 -2
- 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 +7 -5
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +4 -10
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +4 -8
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls/index.js +7 -7
- package/build-module/components/inspector-controls/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +5 -9
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls/slot.native.js +3 -6
- package/build-module/components/inspector-controls/slot.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +1 -6
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +1 -4
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +3 -8
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +0 -4
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab.js +0 -3
- package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -4
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +14 -16
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build-module/components/inspector-popover-header/index.js +0 -1
- package/build-module/components/inspector-popover-header/index.js.map +1 -1
- package/build-module/components/justify-content-control/index.js +5 -7
- package/build-module/components/justify-content-control/index.js.map +1 -1
- package/build-module/components/justify-content-control/ui.js +0 -4
- package/build-module/components/justify-content-control/ui.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +9 -3
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +4 -4
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js +22 -34
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.native.js +4 -4
- package/build-module/components/line-height-control/index.native.js.map +1 -1
- package/build-module/components/line-height-control/utils.js +7 -3
- package/build-module/components/line-height-control/utils.js.map +1 -1
- package/build-module/components/link-control/constants.js +3 -2
- package/build-module/components/link-control/constants.js.map +1 -1
- package/build-module/components/link-control/index.js +81 -38
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/is-url-like.js +5 -6
- package/build-module/components/link-control/is-url-like.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +12 -11
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-create-button.js +3 -7
- package/build-module/components/link-control/search-create-button.js.map +1 -1
- package/build-module/components/link-control/search-input.js +18 -23
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/search-item.js +6 -12
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +14 -14
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +0 -3
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/link-control/settings.js +2 -7
- package/build-module/components/link-control/settings.js.map +1 -1
- package/build-module/components/link-control/use-create-page.js +4 -8
- package/build-module/components/link-control/use-create-page.js.map +1 -1
- package/build-module/components/link-control/use-internal-value.js +8 -10
- package/build-module/components/link-control/use-internal-value.js.map +1 -1
- package/build-module/components/link-control/use-rich-url-data.js +9 -12
- package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +10 -14
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/link-control/viewer-slot.js.map +1 -1
- package/build-module/components/list-view/appender.js +4 -8
- package/build-module/components/list-view/appender.js.map +1 -1
- package/build-module/components/list-view/aria-referenced-text.js +1 -2
- package/build-module/components/list-view/aria-referenced-text.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +5 -5
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +32 -19
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +25 -29
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +9 -28
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/context.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +34 -43
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/expander.js +2 -2
- package/build-module/components/list-view/expander.js.map +1 -1
- package/build-module/components/list-view/index.js +18 -22
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +2 -3
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +15 -22
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +2 -1
- package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +40 -54
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/use-list-view-expand-selected-item.js +5 -4
- package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build-module/components/list-view/use-list-view-images.js +78 -0
- package/build-module/components/list-view/use-list-view-images.js.map +1 -0
- package/build-module/components/list-view/use-list-view-scroll-into-view.js +5 -5
- package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
- package/build-module/components/list-view/utils.js +3 -4
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +12 -59
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +9 -24
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +9 -25
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.native.js +14 -3
- package/build-module/components/media-replace-flow/index.native.js.map +1 -1
- package/build-module/components/media-upload/check.js +2 -2
- package/build-module/components/media-upload/check.js.map +1 -1
- package/build-module/components/media-upload/index.js +2 -3
- package/build-module/components/media-upload/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +18 -29
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/media-upload-progress/index.native.js +4 -27
- package/build-module/components/media-upload-progress/index.native.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +3 -8
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +9 -26
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/observe-typing/index.js +26 -38
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/panel-color-settings/index.js +2 -5
- package/build-module/components/panel-color-settings/index.js.map +1 -1
- package/build-module/components/plain-text/index.js +3 -5
- package/build-module/components/plain-text/index.js.map +1 -1
- package/build-module/components/plain-text/index.native.js +8 -22
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/preview-options/index.js +1 -2
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/block-refs-provider.js +0 -1
- package/build-module/components/provider/block-refs-provider.js.map +1 -1
- package/build-module/components/provider/index.js +8 -5
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +4 -3
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +23 -38
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +1 -5
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +1 -4
- package/build-module/components/publish-date-time-picker/index.js.map +1 -1
- package/build-module/components/recursion-provider/index.js +6 -7
- package/build-module/components/recursion-provider/index.js.map +1 -1
- package/build-module/components/resizable-box-popover/index.js +3 -3
- package/build-module/components/resizable-box-popover/index.js.map +1 -1
- package/build-module/components/resolution-tool/index.js +0 -1
- package/build-module/components/resolution-tool/index.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +4 -14
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/responsive-block-control/label.js +1 -3
- package/build-module/components/responsive-block-control/label.js.map +1 -1
- package/build-module/components/rich-text/content.js +3 -8
- package/build-module/components/rich-text/content.js.map +1 -1
- package/build-module/components/rich-text/embed-handler-picker.native.js +0 -3
- package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
- package/build-module/components/rich-text/format-edit.js +49 -28
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +5 -9
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.native.js +1 -3
- package/build-module/components/rich-text/format-toolbar/index.native.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +4 -14
- package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.native.js +0 -3
- package/build-module/components/rich-text/format-toolbar-container.native.js.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +15 -34
- package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build-module/components/rich-text/index.js +19 -37
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +49 -76
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/input-event.js +1 -2
- package/build-module/components/rich-text/input-event.js.map +1 -1
- package/build-module/components/rich-text/input-event.native.js +0 -1
- package/build-module/components/rich-text/input-event.native.js.map +1 -1
- package/build-module/components/rich-text/prevent-event-discovery.js +0 -4
- package/build-module/components/rich-text/prevent-event-discovery.js.map +1 -1
- package/build-module/components/rich-text/remove-browser-shortcuts.native.js.map +1 -1
- package/build-module/components/rich-text/shortcut.js +1 -2
- package/build-module/components/rich-text/shortcut.js.map +1 -1
- package/build-module/components/rich-text/shortcut.native.js +0 -1
- package/build-module/components/rich-text/shortcut.native.js.map +1 -1
- package/build-module/components/rich-text/split-value.js +19 -16
- package/build-module/components/rich-text/split-value.js.map +1 -1
- package/build-module/components/rich-text/toolbar-button.js +2 -5
- package/build-module/components/rich-text/toolbar-button.js.map +1 -1
- package/build-module/components/rich-text/use-before-input-rules.js +7 -16
- package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-delete.js +5 -10
- package/build-module/components/rich-text/use-delete.js.map +1 -1
- package/build-module/components/rich-text/use-enter.js +3 -10
- package/build-module/components/rich-text/use-enter.js.map +1 -1
- package/build-module/components/rich-text/use-firefox-compat.js +5 -35
- package/build-module/components/rich-text/use-firefox-compat.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +9 -20
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/use-input-events.js +0 -1
- package/build-module/components/rich-text/use-input-events.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +10 -28
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-insert-replacement-text.js +2 -3
- package/build-module/components/rich-text/use-insert-replacement-text.js.map +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js +6 -6
- package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +26 -62
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/use-remove-browser-shortcuts.js +1 -2
- package/build-module/components/rich-text/use-remove-browser-shortcuts.js.map +1 -1
- package/build-module/components/rich-text/use-shortcuts.js +0 -1
- package/build-module/components/rich-text/use-shortcuts.js.map +1 -1
- package/build-module/components/rich-text/use-undo-automatic-change.js +1 -9
- package/build-module/components/rich-text/use-undo-automatic-change.js.map +1 -1
- package/build-module/components/rich-text/utils.js +2 -6
- package/build-module/components/rich-text/utils.js.map +1 -1
- package/build-module/components/selection-scroll-into-view/index.js +1 -1
- package/build-module/components/selection-scroll-into-view/index.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +2 -7
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -3
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/spacing-sizes-control/index.js +13 -14
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.js +6 -9
- package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/separated.js +2 -4
- package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/single.js +2 -3
- package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +6 -19
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +1 -3
- package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +35 -52
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/text-decoration-control/index.js +2 -3
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +2 -3
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/tool-selector/index.js +4 -7
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/typewriter/index.js +30 -46
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/ungroup-button/index.native.js +1 -7
- package/build-module/components/ungroup-button/index.native.js.map +1 -1
- package/build-module/components/unit-control/index.js +1 -2
- package/build-module/components/unit-control/index.js.map +1 -1
- package/build-module/components/url-input/button.js +2 -9
- package/build-module/components/url-input/button.js.map +1 -1
- package/build-module/components/url-input/index.js +41 -81
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-input/index.native.js +1 -2
- package/build-module/components/url-input/index.native.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +3 -31
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/index.js +5 -12
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +2 -3
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/url-popover/link-viewer-url.js +1 -4
- package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
- package/build-module/components/url-popover/link-viewer.js +2 -3
- package/build-module/components/url-popover/link-viewer.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +238 -0
- package/build-module/components/use-block-commands/index.js.map +1 -0
- package/build-module/components/use-block-display-information/index.js +3 -6
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +14 -19
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +13 -16
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build-module/components/use-display-block-controls/index.js +1 -4
- package/build-module/components/use-display-block-controls/index.js.map +1 -1
- package/build-module/components/use-display-block-controls/index.native.js +1 -3
- package/build-module/components/use-display-block-controls/index.native.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +6 -17
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +21 -30
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.native.js +13 -12
- package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
- package/build-module/components/use-on-block-drop/types.js.map +1 -1
- package/build-module/components/use-paste-styles/index.js +12 -21
- package/build-module/components/use-paste-styles/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +1 -13
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-setting/index.js +17 -33
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/components/video-player/gridicon-play.native.js +0 -1
- package/build-module/components/video-player/gridicon-play.native.js.map +1 -1
- package/build-module/components/video-player/index.native.js +12 -17
- package/build-module/components/video-player/index.native.js.map +1 -1
- package/build-module/components/warning/index.js +2 -5
- package/build-module/components/warning/index.js.map +1 -1
- package/build-module/components/warning/index.native.js +2 -5
- package/build-module/components/warning/index.native.js.map +1 -1
- package/build-module/components/writing-flow/index.js +5 -9
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.js +37 -53
- package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build-module/components/writing-flow/use-click-selection.js +3 -6
- package/build-module/components/writing-flow/use-click-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-drag-selection.js +27 -29
- package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-input.js +8 -17
- package/build-module/components/writing-flow/use-input.js.map +1 -1
- package/build-module/components/writing-flow/use-multi-selection.js +10 -14
- package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-select-all.js +4 -9
- package/build-module/components/writing-flow/use-select-all.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js +20 -44
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +28 -34
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/components/writing-mode-control/index.js +2 -3
- package/build-module/components/writing-mode-control/index.js.map +1 -1
- package/build-module/elements/index.js.map +1 -1
- package/build-module/hooks/align.js +25 -36
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +6 -4
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/anchor.js +11 -15
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/aria-label.js +4 -6
- package/build-module/hooks/aria-label.js.map +1 -1
- package/build-module/hooks/behaviors.js +14 -25
- package/build-module/hooks/behaviors.js.map +1 -1
- package/build-module/hooks/border.js +48 -65
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +32 -52
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/compat.js +0 -4
- package/build-module/hooks/compat.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +5 -13
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/contrast-checker.js +4 -11
- package/build-module/hooks/contrast-checker.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +24 -26
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-class-name.native.js +5 -6
- package/build-module/hooks/custom-class-name.native.js.map +1 -1
- package/build-module/hooks/custom-fields.js +113 -0
- package/build-module/hooks/custom-fields.js.map +1 -0
- package/build-module/hooks/dimensions.js +6 -11
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +43 -49
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +9 -20
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +36 -47
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/gap.js +2 -5
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/generated-class-name.js +2 -2
- package/build-module/hooks/generated-class-name.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.map +1 -1
- package/build-module/hooks/layout.js +46 -54
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/layout.native.js +5 -3
- package/build-module/hooks/layout.native.js.map +1 -1
- package/build-module/hooks/line-height.js +7 -8
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/lock.js +5 -6
- package/build-module/hooks/lock.js.map +1 -1
- package/build-module/hooks/margin.js +1 -10
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/metadata-name.js +5 -6
- package/build-module/hooks/metadata-name.js.map +1 -1
- package/build-module/hooks/metadata.js +3 -7
- package/build-module/hooks/metadata.js.map +1 -1
- package/build-module/hooks/padding.js +1 -10
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/position.js +36 -38
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/settings.js +4 -7
- package/build-module/hooks/settings.js.map +1 -1
- package/build-module/hooks/style.js +39 -44
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +22 -33
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +11 -16
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/typography.native.js +5 -7
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-border-props.js +7 -6
- package/build-module/hooks/use-border-props.js.map +1 -1
- package/build-module/hooks/use-cached-truthy.js +1 -1
- package/build-module/hooks/use-cached-truthy.js.map +1 -1
- package/build-module/hooks/use-color-props.js +18 -17
- package/build-module/hooks/use-color-props.js.map +1 -1
- package/build-module/hooks/use-editor-wrapper-styles.native.js +8 -26
- package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -1
- package/build-module/hooks/use-spacing-props.js +5 -3
- package/build-module/hooks/use-spacing-props.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +4 -4
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +12 -18
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/layouts/constrained.js +14 -26
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/definitions.js.map +1 -1
- package/build-module/layouts/flex.js +18 -41
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +8 -17
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/layouts/grid.js +20 -25
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/layouts/index.js +2 -2
- package/build-module/layouts/index.js.map +1 -1
- package/build-module/layouts/utils.js +5 -9
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +6 -5
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +3 -2
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/actions.js +189 -198
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/array.js +1 -1
- package/build-module/store/array.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/defaults.js +1 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/defaults.native.js +2 -1
- package/build-module/store/defaults.native.js.map +1 -1
- package/build-module/store/index.js +13 -9
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +25 -78
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +6 -76
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +161 -328
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +255 -398
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/block-variation-transforms.js +2 -3
- package/build-module/utils/block-variation-transforms.js.map +1 -1
- package/build-module/utils/dom.js +4 -10
- package/build-module/utils/dom.js.map +1 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/math.js +5 -7
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/object.js +15 -21
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/order-inserter-block-items.js +2 -3
- package/build-module/utils/order-inserter-block-items.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +14 -64
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-module/utils/pasting.js +8 -12
- package/build-module/utils/pasting.js.map +1 -1
- package/build-module/utils/pre-parse-patterns.js +1 -14
- package/build-module/utils/pre-parse-patterns.js.map +1 -1
- package/build-module/utils/selection.js +1 -2
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/sorting.js +3 -7
- package/build-module/utils/sorting.js.map +1 -1
- package/build-module/utils/transform-styles/ast/index.js +1 -0
- package/build-module/utils/transform-styles/ast/index.js.map +1 -1
- package/build-module/utils/transform-styles/ast/parse.js +95 -134
- package/build-module/utils/transform-styles/ast/parse.js.map +1 -1
- package/build-module/utils/transform-styles/ast/stringify/compiler.js +5 -6
- package/build-module/utils/transform-styles/ast/stringify/compiler.js.map +1 -1
- package/build-module/utils/transform-styles/ast/stringify/compress.js +28 -19
- package/build-module/utils/transform-styles/ast/stringify/compress.js.map +1 -1
- package/build-module/utils/transform-styles/ast/stringify/identity.js +32 -23
- package/build-module/utils/transform-styles/ast/stringify/identity.js.map +1 -1
- package/build-module/utils/transform-styles/ast/stringify/index.js +1 -0
- package/build-module/utils/transform-styles/ast/stringify/index.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +2 -7
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-module/utils/transform-styles/transforms/url-rewrite.js +12 -24
- package/build-module/utils/transform-styles/transforms/url-rewrite.js.map +1 -1
- package/build-module/utils/transform-styles/transforms/wrap.js +7 -8
- package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-module/utils/transform-styles/traverse.js +1 -4
- package/build-module/utils/transform-styles/traverse.js.map +1 -1
- package/build-module/utils/use-should-contextual-toolbar-show.js +2 -5
- package/build-module/utils/use-should-contextual-toolbar-show.js.map +1 -1
- package/build-style/style-rtl.css +69 -10
- package/build-style/style.css +69 -10
- package/package.json +33 -32
- package/src/autocompleters/block.js +21 -6
- package/src/components/block-caption/README.md +109 -0
- package/src/components/block-controls/use-has-block-controls.js +35 -0
- package/src/components/block-draggable/test/index.native.js +2 -3
- package/src/components/block-editing-mode/index.js +4 -8
- package/src/components/block-inspector/index.js +1 -2
- package/src/components/block-list/block-outline.native.js +2 -2
- package/src/components/block-list/block.js +7 -3
- package/src/components/block-list/index.js +3 -6
- package/src/components/block-list/index.native.js +14 -14
- package/src/components/block-list/test/block-invalid-warning.native.js +15 -1
- package/src/components/block-list/use-in-between-inserter.js +1 -2
- package/src/components/block-list-appender/index.js +1 -2
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +24 -0
- package/src/components/block-parent-selector/index.js +30 -43
- package/src/components/block-preview/auto.js +8 -1
- package/src/components/block-preview/index.js +0 -1
- package/src/components/block-preview/style.scss +2 -1
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -13
- package/src/components/block-toolbar/index.js +36 -64
- package/src/components/block-toolbar/style.scss +10 -0
- package/src/components/block-toolbar/utils.js +57 -45
- package/src/components/block-tools/block-contextual-toolbar.js +124 -38
- package/src/components/block-tools/style.scss +49 -13
- package/src/components/block-variation-picker/index.native.js +52 -72
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/copy-handler/index.js +1 -0
- package/src/components/default-block-appender/index.native.js +13 -11
- package/src/components/dimensions-tool/index.js +1 -1
- package/src/components/editor-styles/index.js +2 -2
- package/src/components/font-sizes/fluid-utils.js +17 -17
- package/src/components/font-sizes/test/fluid-utils.js +6 -6
- package/src/components/global-styles/behaviors-panel.js +71 -0
- package/src/components/global-styles/hooks.js +114 -5
- package/src/components/global-styles/index.js +3 -0
- package/src/components/global-styles/test/typography-utils.js +61 -6
- package/src/components/global-styles/typography-utils.js +15 -6
- package/src/components/global-styles/use-global-styles-output.js +1 -2
- package/src/components/global-styles/utils.js +2 -1
- package/src/components/iframe/index.js +1 -0
- package/src/components/index.js +7 -0
- package/src/components/inserter/hooks/use-block-types-state.js +15 -6
- package/src/components/inserter/hooks/use-debounced-input.js +8 -7
- package/src/components/inserter/hooks/use-patterns-state.js +2 -1
- package/src/components/inserter/menu.js +1 -0
- package/src/components/inserter/preview-panel.js +15 -11
- package/src/components/inserter/reusable-blocks-tab.js +4 -1
- package/src/components/inserter/search-results.js +2 -1
- package/src/components/inserter/stories/{index.js → index.story.js} +4 -4
- package/src/components/inserter/test/search-items.js +4 -1
- package/src/components/inserter-list-item/index.js +3 -1
- package/src/components/keyboard-shortcuts/index.js +10 -0
- package/src/components/line-height-control/index.js +14 -11
- package/src/components/line-height-control/test/index.js +7 -5
- package/src/components/line-height-control/utils.js +6 -1
- package/src/components/link-control/README.md +12 -3
- package/src/components/link-control/index.js +70 -13
- package/src/components/link-control/link-preview.js +10 -4
- package/src/components/link-control/style.scss +12 -2
- package/src/components/link-control/test/index.js +64 -4
- package/src/components/list-view/block-select-button.js +19 -0
- package/src/components/list-view/block.js +1 -4
- package/src/components/list-view/style.scss +25 -0
- package/src/components/list-view/use-list-view-drop-zone.js +5 -1
- package/src/components/list-view/use-list-view-images.js +79 -0
- package/src/components/media-replace-flow/index.native.js +12 -3
- package/src/components/media-upload/test/index.native.js +1 -0
- package/src/components/rich-text/format-edit.js +62 -38
- package/src/components/rich-text/get-rich-text-values.js +22 -28
- package/src/components/rich-text/index.js +8 -1
- package/src/components/rich-text/use-firefox-compat.js +1 -27
- package/src/components/rich-text/use-format-types.js +3 -3
- package/src/components/rich-text/use-paste-handler.js +4 -23
- package/src/components/spacing-sizes-control/test/utils.js +9 -1
- package/src/components/spacing-sizes-control/utils.js +2 -2
- package/src/components/use-block-commands/index.js +284 -0
- package/src/components/use-block-drop-zone/index.js +1 -2
- package/src/components/use-setting/README.md +39 -0
- package/src/components/writing-flow/use-drag-selection.js +5 -1
- package/src/hooks/behaviors.js +10 -16
- package/src/hooks/border.js +2 -1
- package/src/hooks/custom-fields.js +139 -0
- package/src/hooks/index.js +1 -0
- package/src/hooks/layout.js +13 -4
- package/src/hooks/style.js +7 -3
- package/src/private-apis.js +2 -2
- package/src/store/actions.js +71 -30
- package/src/store/private-actions.js +0 -39
- package/src/store/private-selectors.js +1 -67
- package/src/store/selectors.js +66 -81
- package/src/store/test/actions.js +28 -0
- package/src/store/test/private-actions.js +0 -28
- package/src/store/test/private-selectors.js +88 -261
- package/src/store/test/selectors.js +209 -6
- package/src/utils/transform-styles/ast/parse.js +31 -0
- package/src/utils/transform-styles/ast/stringify/compress.js +13 -0
- package/src/utils/transform-styles/ast/stringify/identity.js +13 -0
- package/src/utils/transform-styles/transforms/test/__snapshots__/wrap.js.snap +8 -0
- package/src/utils/transform-styles/transforms/test/wrap.js +11 -0
- package/tsconfig.tsbuildinfo +1 -1
- /package/src/components/block-draggable/stories/{index.js → index.story.js} +0 -0
- /package/src/components/block-mover/stories/{index.js → index.story.js} +0 -0
- /package/src/components/dimensions-tool/stories/{aspect-ratio-tool.js → aspect-ratio-tool.story.js} +0 -0
- /package/src/components/dimensions-tool/stories/{index.js → index.story.js} +0 -0
- /package/src/components/dimensions-tool/stories/{scale-tool.js → scale-tool.story.js} +0 -0
- /package/src/components/dimensions-tool/stories/{width-height-tool.js → width-height-tool.story.js} +0 -0
- /package/src/components/height-control/stories/{index.js → index.story.js} +0 -0
- /package/src/components/line-height-control/stories/{index.js → index.story.js} +0 -0
- /package/src/components/resolution-tool/stories/{index.js → index.story.js} +0 -0
- /package/src/components/text-decoration-control/stories/{index.js → index.story.js} +0 -0
- /package/src/components/text-transform-control/stories/{index.js → index.story.js} +0 -0
- /package/src/components/url-popover/stories/{index.js → index.story.js} +0 -0
package/build/store/selectors.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -31,10 +30,10 @@ exports.canRemoveBlocks = canRemoveBlocks;
|
|
|
31
30
|
exports.didAutomaticChange = didAutomaticChange;
|
|
32
31
|
exports.getAdjacentBlockClientId = getAdjacentBlockClientId;
|
|
33
32
|
exports.getAllowedBlocks = void 0;
|
|
34
|
-
exports.getBehaviors = getBehaviors;
|
|
35
33
|
exports.getBlock = getBlock;
|
|
36
34
|
exports.getBlockAttributes = getBlockAttributes;
|
|
37
35
|
exports.getBlockCount = getBlockCount;
|
|
36
|
+
exports.getBlockEditingMode = void 0;
|
|
38
37
|
exports.getBlockHierarchyRootClientId = getBlockHierarchyRootClientId;
|
|
39
38
|
exports.getBlockIndex = getBlockIndex;
|
|
40
39
|
exports.getBlockInsertionPoint = void 0;
|
|
@@ -98,27 +97,16 @@ exports.isSelectionEnabled = isSelectionEnabled;
|
|
|
98
97
|
exports.isTyping = isTyping;
|
|
99
98
|
exports.isValidTemplate = isValidTemplate;
|
|
100
99
|
exports.wasBlockJustInserted = wasBlockJustInserted;
|
|
101
|
-
|
|
102
100
|
var _rememo = _interopRequireDefault(require("rememo"));
|
|
103
|
-
|
|
104
101
|
var _blocks = require("@wordpress/blocks");
|
|
105
|
-
|
|
106
102
|
var _element = require("@wordpress/element");
|
|
107
|
-
|
|
108
103
|
var _hooks = require("@wordpress/hooks");
|
|
109
|
-
|
|
110
104
|
var _icons = require("@wordpress/icons");
|
|
111
|
-
|
|
112
105
|
var _richText = require("@wordpress/rich-text");
|
|
113
|
-
|
|
114
106
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
115
|
-
|
|
107
|
+
var _data = require("@wordpress/data");
|
|
116
108
|
var _utils = require("./utils");
|
|
117
|
-
|
|
118
109
|
var _sorting = require("../utils/sorting");
|
|
119
|
-
|
|
120
|
-
var _privateSelectors = require("./private-selectors");
|
|
121
|
-
|
|
122
110
|
/**
|
|
123
111
|
* External dependencies
|
|
124
112
|
*/
|
|
@@ -141,10 +129,12 @@ var _privateSelectors = require("./private-selectors");
|
|
|
141
129
|
* @property {number} offset An attribute value offset, based on the rich
|
|
142
130
|
* text value. See `wp.richText.create`.
|
|
143
131
|
*/
|
|
132
|
+
|
|
144
133
|
// Module constants.
|
|
145
134
|
const MILLISECONDS_PER_HOUR = 3600 * 1000;
|
|
146
135
|
const MILLISECONDS_PER_DAY = 24 * 3600 * 1000;
|
|
147
136
|
const MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000;
|
|
137
|
+
|
|
148
138
|
/**
|
|
149
139
|
* Shared reference to an empty array for cases where it is important to avoid
|
|
150
140
|
* returning a new array reference on every invocation, as in a connected or
|
|
@@ -154,8 +144,8 @@ const MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000;
|
|
|
154
144
|
*
|
|
155
145
|
* @type {Array}
|
|
156
146
|
*/
|
|
157
|
-
|
|
158
147
|
const EMPTY_ARRAY = [];
|
|
148
|
+
|
|
159
149
|
/**
|
|
160
150
|
* Shared reference to an empty Set for cases where it is important to avoid
|
|
161
151
|
* returning a new Set reference on every invocation, as in a connected or
|
|
@@ -165,8 +155,8 @@ const EMPTY_ARRAY = [];
|
|
|
165
155
|
*
|
|
166
156
|
* @type {Set}
|
|
167
157
|
*/
|
|
168
|
-
|
|
169
158
|
const EMPTY_SET = new Set();
|
|
159
|
+
|
|
170
160
|
/**
|
|
171
161
|
* Returns a block's name given its client ID, or null if no block exists with
|
|
172
162
|
* the client ID.
|
|
@@ -176,11 +166,9 @@ const EMPTY_SET = new Set();
|
|
|
176
166
|
*
|
|
177
167
|
* @return {string} Block name.
|
|
178
168
|
*/
|
|
179
|
-
|
|
180
169
|
function getBlockName(state, clientId) {
|
|
181
170
|
const block = state.blocks.byClientId.get(clientId);
|
|
182
171
|
const socialLinkName = 'core/social-link';
|
|
183
|
-
|
|
184
172
|
if (_element.Platform.OS !== 'web' && block?.name === socialLinkName) {
|
|
185
173
|
const attributes = state.blocks.attributes.get(clientId);
|
|
186
174
|
const {
|
|
@@ -188,9 +176,9 @@ function getBlockName(state, clientId) {
|
|
|
188
176
|
} = attributes !== null && attributes !== void 0 ? attributes : {};
|
|
189
177
|
return service ? `${socialLinkName}-${service}` : socialLinkName;
|
|
190
178
|
}
|
|
191
|
-
|
|
192
179
|
return block ? block.name : null;
|
|
193
180
|
}
|
|
181
|
+
|
|
194
182
|
/**
|
|
195
183
|
* Returns whether a block is valid or not.
|
|
196
184
|
*
|
|
@@ -199,12 +187,11 @@ function getBlockName(state, clientId) {
|
|
|
199
187
|
*
|
|
200
188
|
* @return {boolean} Is Valid.
|
|
201
189
|
*/
|
|
202
|
-
|
|
203
|
-
|
|
204
190
|
function isBlockValid(state, clientId) {
|
|
205
191
|
const block = state.blocks.byClientId.get(clientId);
|
|
206
192
|
return !!block && block.isValid;
|
|
207
193
|
}
|
|
194
|
+
|
|
208
195
|
/**
|
|
209
196
|
* Returns a block's attributes given its client ID, or null if no block exists with
|
|
210
197
|
* the client ID.
|
|
@@ -214,17 +201,14 @@ function isBlockValid(state, clientId) {
|
|
|
214
201
|
*
|
|
215
202
|
* @return {Object?} Block attributes.
|
|
216
203
|
*/
|
|
217
|
-
|
|
218
|
-
|
|
219
204
|
function getBlockAttributes(state, clientId) {
|
|
220
205
|
const block = state.blocks.byClientId.get(clientId);
|
|
221
|
-
|
|
222
206
|
if (!block) {
|
|
223
207
|
return null;
|
|
224
208
|
}
|
|
225
|
-
|
|
226
209
|
return state.blocks.attributes.get(clientId);
|
|
227
210
|
}
|
|
211
|
+
|
|
228
212
|
/**
|
|
229
213
|
* Returns a block given its client ID. This is a parsed copy of the block,
|
|
230
214
|
* containing its `blockName`, `clientId`, and current `attributes` state. This
|
|
@@ -246,25 +230,22 @@ function getBlockAttributes(state, clientId) {
|
|
|
246
230
|
*
|
|
247
231
|
* @return {Object} Parsed block object.
|
|
248
232
|
*/
|
|
249
|
-
|
|
250
|
-
|
|
251
233
|
function getBlock(state, clientId) {
|
|
252
234
|
if (!state.blocks.byClientId.has(clientId)) {
|
|
253
235
|
return null;
|
|
254
236
|
}
|
|
255
|
-
|
|
256
237
|
return state.blocks.tree.get(clientId);
|
|
257
238
|
}
|
|
258
|
-
|
|
259
239
|
const __unstableGetBlockWithoutInnerBlocks = (0, _rememo.default)((state, clientId) => {
|
|
260
240
|
if (!state.blocks.byClientId.has(clientId)) {
|
|
261
241
|
return null;
|
|
262
242
|
}
|
|
263
|
-
|
|
264
|
-
|
|
243
|
+
return {
|
|
244
|
+
...state.blocks.byClientId.get(clientId),
|
|
265
245
|
attributes: getBlockAttributes(state, clientId)
|
|
266
246
|
};
|
|
267
247
|
}, (state, clientId) => [state.blocks.byClientId.get(clientId), state.blocks.attributes.get(clientId)]);
|
|
248
|
+
|
|
268
249
|
/**
|
|
269
250
|
* Returns all block objects for the current post being edited as an array in
|
|
270
251
|
* the order they appear in the post. Note that this will exclude child blocks
|
|
@@ -275,14 +256,12 @@ const __unstableGetBlockWithoutInnerBlocks = (0, _rememo.default)((state, client
|
|
|
275
256
|
*
|
|
276
257
|
* @return {Object[]} Post blocks.
|
|
277
258
|
*/
|
|
278
|
-
|
|
279
|
-
|
|
280
259
|
exports.__unstableGetBlockWithoutInnerBlocks = __unstableGetBlockWithoutInnerBlocks;
|
|
281
|
-
|
|
282
260
|
function getBlocks(state, rootClientId) {
|
|
283
261
|
const treeKey = !rootClientId || !areInnerBlocksControlled(state, rootClientId) ? rootClientId || '' : 'controlled||' + rootClientId;
|
|
284
262
|
return state.blocks.tree.get(treeKey)?.innerBlocks || EMPTY_ARRAY;
|
|
285
263
|
}
|
|
264
|
+
|
|
286
265
|
/**
|
|
287
266
|
* Returns a stripped down block object containing only its client ID,
|
|
288
267
|
* and its inner blocks' client IDs.
|
|
@@ -294,8 +273,6 @@ function getBlocks(state, rootClientId) {
|
|
|
294
273
|
*
|
|
295
274
|
* @return {Object} Client IDs of the post blocks.
|
|
296
275
|
*/
|
|
297
|
-
|
|
298
|
-
|
|
299
276
|
const __unstableGetClientIdWithClientIdsTree = (0, _rememo.default)((state, clientId) => {
|
|
300
277
|
(0, _deprecated.default)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree", {
|
|
301
278
|
since: '6.3',
|
|
@@ -306,6 +283,7 @@ const __unstableGetClientIdWithClientIdsTree = (0, _rememo.default)((state, clie
|
|
|
306
283
|
innerBlocks: __unstableGetClientIdsTree(state, clientId)
|
|
307
284
|
};
|
|
308
285
|
}, state => [state.blocks.order]);
|
|
286
|
+
|
|
309
287
|
/**
|
|
310
288
|
* Returns the block tree represented in the block-editor store from the
|
|
311
289
|
* given root, consisting of stripped down block objects containing only
|
|
@@ -318,10 +296,7 @@ const __unstableGetClientIdWithClientIdsTree = (0, _rememo.default)((state, clie
|
|
|
318
296
|
*
|
|
319
297
|
* @return {Object[]} Client IDs of the post blocks.
|
|
320
298
|
*/
|
|
321
|
-
|
|
322
|
-
|
|
323
299
|
exports.__unstableGetClientIdWithClientIdsTree = __unstableGetClientIdWithClientIdsTree;
|
|
324
|
-
|
|
325
300
|
const __unstableGetClientIdsTree = (0, _rememo.default)((state, rootClientId = '') => {
|
|
326
301
|
(0, _deprecated.default)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree", {
|
|
327
302
|
since: '6.3',
|
|
@@ -329,6 +304,7 @@ const __unstableGetClientIdsTree = (0, _rememo.default)((state, rootClientId = '
|
|
|
329
304
|
});
|
|
330
305
|
return getBlockOrder(state, rootClientId).map(clientId => __unstableGetClientIdWithClientIdsTree(state, clientId));
|
|
331
306
|
}, state => [state.blocks.order]);
|
|
307
|
+
|
|
332
308
|
/**
|
|
333
309
|
* Returns an array containing the clientIds of all descendants of the blocks
|
|
334
310
|
* given. Returned ids are ordered first by the order of the ids given, then
|
|
@@ -339,20 +315,17 @@ const __unstableGetClientIdsTree = (0, _rememo.default)((state, rootClientId = '
|
|
|
339
315
|
*
|
|
340
316
|
* @return {Array} ids of descendants.
|
|
341
317
|
*/
|
|
342
|
-
|
|
343
|
-
|
|
344
318
|
exports.__unstableGetClientIdsTree = __unstableGetClientIdsTree;
|
|
345
319
|
const getClientIdsOfDescendants = (0, _rememo.default)((state, clientIds) => {
|
|
346
320
|
const collectedIds = [];
|
|
347
|
-
|
|
348
321
|
for (const givenId of clientIds) {
|
|
349
322
|
for (const descendantId of getBlockOrder(state, givenId)) {
|
|
350
323
|
collectedIds.push(descendantId, ...getClientIdsOfDescendants(state, [descendantId]));
|
|
351
324
|
}
|
|
352
325
|
}
|
|
353
|
-
|
|
354
326
|
return collectedIds;
|
|
355
327
|
}, state => [state.blocks.order]);
|
|
328
|
+
|
|
356
329
|
/**
|
|
357
330
|
* Returns an array containing the clientIds of the top-level blocks and
|
|
358
331
|
* their descendants of any depth (for nested blocks). Ids are returned
|
|
@@ -362,17 +335,15 @@ const getClientIdsOfDescendants = (0, _rememo.default)((state, clientIds) => {
|
|
|
362
335
|
*
|
|
363
336
|
* @return {Array} ids of top-level and descendant blocks.
|
|
364
337
|
*/
|
|
365
|
-
|
|
366
338
|
exports.getClientIdsOfDescendants = getClientIdsOfDescendants;
|
|
367
339
|
const getClientIdsWithDescendants = (0, _rememo.default)(state => {
|
|
368
340
|
const collectedIds = [];
|
|
369
|
-
|
|
370
341
|
for (const topLevelId of getBlockOrder(state)) {
|
|
371
342
|
collectedIds.push(topLevelId, ...getClientIdsOfDescendants(state, [topLevelId]));
|
|
372
343
|
}
|
|
373
|
-
|
|
374
344
|
return collectedIds;
|
|
375
345
|
}, state => [state.blocks.order]);
|
|
346
|
+
|
|
376
347
|
/**
|
|
377
348
|
* Returns the total number of blocks, or the total number of blocks with a specific name in a post.
|
|
378
349
|
* The number returned includes nested blocks.
|
|
@@ -382,20 +353,18 @@ const getClientIdsWithDescendants = (0, _rememo.default)(state => {
|
|
|
382
353
|
*
|
|
383
354
|
* @return {number} Number of blocks in the post, or number of blocks with name equal to blockName.
|
|
384
355
|
*/
|
|
385
|
-
|
|
386
356
|
exports.getClientIdsWithDescendants = getClientIdsWithDescendants;
|
|
387
357
|
const getGlobalBlockCount = (0, _rememo.default)((state, blockName) => {
|
|
388
358
|
const clientIds = getClientIdsWithDescendants(state);
|
|
389
|
-
|
|
390
359
|
if (!blockName) {
|
|
391
360
|
return clientIds.length;
|
|
392
361
|
}
|
|
393
|
-
|
|
394
362
|
return clientIds.reduce((accumulator, clientId) => {
|
|
395
363
|
const block = state.blocks.byClientId.get(clientId);
|
|
396
364
|
return block.name === blockName ? accumulator + 1 : accumulator;
|
|
397
365
|
}, 0);
|
|
398
366
|
}, state => [state.blocks.order, state.blocks.byClientId]);
|
|
367
|
+
|
|
399
368
|
/**
|
|
400
369
|
* Returns all global blocks that match a blockName. Results include nested blocks.
|
|
401
370
|
*
|
|
@@ -404,14 +373,11 @@ const getGlobalBlockCount = (0, _rememo.default)((state, blockName) => {
|
|
|
404
373
|
*
|
|
405
374
|
* @return {Array} Array of clientIds of blocks with name equal to blockName.
|
|
406
375
|
*/
|
|
407
|
-
|
|
408
376
|
exports.getGlobalBlockCount = getGlobalBlockCount;
|
|
409
|
-
|
|
410
377
|
const __experimentalGetGlobalBlocksByName = (0, _rememo.default)((state, blockName) => {
|
|
411
378
|
if (!blockName) {
|
|
412
379
|
return EMPTY_ARRAY;
|
|
413
380
|
}
|
|
414
|
-
|
|
415
381
|
const blockNames = Array.isArray(blockName) ? blockName : [blockName];
|
|
416
382
|
const clientIds = getClientIdsWithDescendants(state);
|
|
417
383
|
const foundBlocks = clientIds.filter(clientId => {
|
|
@@ -420,6 +386,7 @@ const __experimentalGetGlobalBlocksByName = (0, _rememo.default)((state, blockNa
|
|
|
420
386
|
});
|
|
421
387
|
return foundBlocks.length > 0 ? foundBlocks : EMPTY_ARRAY;
|
|
422
388
|
}, state => [state.blocks.order, state.blocks.byClientId]);
|
|
389
|
+
|
|
423
390
|
/**
|
|
424
391
|
* Given an array of block client IDs, returns the corresponding array of block
|
|
425
392
|
* objects.
|
|
@@ -429,10 +396,9 @@ const __experimentalGetGlobalBlocksByName = (0, _rememo.default)((state, blockNa
|
|
|
429
396
|
*
|
|
430
397
|
* @return {WPBlock[]} Block objects.
|
|
431
398
|
*/
|
|
432
|
-
|
|
433
|
-
|
|
434
399
|
exports.__experimentalGetGlobalBlocksByName = __experimentalGetGlobalBlocksByName;
|
|
435
400
|
const getBlocksByClientId = (0, _rememo.default)((state, clientIds) => (Array.isArray(clientIds) ? clientIds : [clientIds]).map(clientId => getBlock(state, clientId)), (state, clientIds) => (Array.isArray(clientIds) ? clientIds : [clientIds]).map(clientId => state.blocks.tree.get(clientId)));
|
|
401
|
+
|
|
436
402
|
/**
|
|
437
403
|
* Given an array of block client IDs, returns the corresponding array of block
|
|
438
404
|
* names.
|
|
@@ -442,9 +408,9 @@ const getBlocksByClientId = (0, _rememo.default)((state, clientIds) => (Array.is
|
|
|
442
408
|
*
|
|
443
409
|
* @return {string[]} Block names.
|
|
444
410
|
*/
|
|
445
|
-
|
|
446
411
|
exports.getBlocksByClientId = getBlocksByClientId;
|
|
447
412
|
const getBlockNamesByClientId = (0, _rememo.default)((state, clientIds) => getBlocksByClientId(state, clientIds).filter(Boolean).map(block => block.name), (state, clientIds) => getBlocksByClientId(state, clientIds));
|
|
413
|
+
|
|
448
414
|
/**
|
|
449
415
|
* Returns the number of blocks currently present in the post.
|
|
450
416
|
*
|
|
@@ -453,12 +419,11 @@ const getBlockNamesByClientId = (0, _rememo.default)((state, clientIds) => getBl
|
|
|
453
419
|
*
|
|
454
420
|
* @return {number} Number of blocks in the post.
|
|
455
421
|
*/
|
|
456
|
-
|
|
457
422
|
exports.getBlockNamesByClientId = getBlockNamesByClientId;
|
|
458
|
-
|
|
459
423
|
function getBlockCount(state, rootClientId) {
|
|
460
424
|
return getBlockOrder(state, rootClientId).length;
|
|
461
425
|
}
|
|
426
|
+
|
|
462
427
|
/**
|
|
463
428
|
* Returns the current selection start block client ID, attribute key and text
|
|
464
429
|
* offset.
|
|
@@ -467,11 +432,10 @@ function getBlockCount(state, rootClientId) {
|
|
|
467
432
|
*
|
|
468
433
|
* @return {WPBlockSelection} Selection start information.
|
|
469
434
|
*/
|
|
470
|
-
|
|
471
|
-
|
|
472
435
|
function getSelectionStart(state) {
|
|
473
436
|
return state.selection.selectionStart;
|
|
474
437
|
}
|
|
438
|
+
|
|
475
439
|
/**
|
|
476
440
|
* Returns the current selection end block client ID, attribute key and text
|
|
477
441
|
* offset.
|
|
@@ -480,11 +444,10 @@ function getSelectionStart(state) {
|
|
|
480
444
|
*
|
|
481
445
|
* @return {WPBlockSelection} Selection end information.
|
|
482
446
|
*/
|
|
483
|
-
|
|
484
|
-
|
|
485
447
|
function getSelectionEnd(state) {
|
|
486
448
|
return state.selection.selectionEnd;
|
|
487
449
|
}
|
|
450
|
+
|
|
488
451
|
/**
|
|
489
452
|
* Returns the current block selection start. This value may be null, and it
|
|
490
453
|
* may represent either a singular block selection or multi-selection start.
|
|
@@ -494,11 +457,10 @@ function getSelectionEnd(state) {
|
|
|
494
457
|
*
|
|
495
458
|
* @return {?string} Client ID of block selection start.
|
|
496
459
|
*/
|
|
497
|
-
|
|
498
|
-
|
|
499
460
|
function getBlockSelectionStart(state) {
|
|
500
461
|
return state.selection.selectionStart.clientId;
|
|
501
462
|
}
|
|
463
|
+
|
|
502
464
|
/**
|
|
503
465
|
* Returns the current block selection end. This value may be null, and it
|
|
504
466
|
* may represent either a singular block selection or multi-selection end.
|
|
@@ -508,11 +470,10 @@ function getBlockSelectionStart(state) {
|
|
|
508
470
|
*
|
|
509
471
|
* @return {?string} Client ID of block selection end.
|
|
510
472
|
*/
|
|
511
|
-
|
|
512
|
-
|
|
513
473
|
function getBlockSelectionEnd(state) {
|
|
514
474
|
return state.selection.selectionEnd.clientId;
|
|
515
475
|
}
|
|
476
|
+
|
|
516
477
|
/**
|
|
517
478
|
* Returns the number of blocks currently selected in the post.
|
|
518
479
|
*
|
|
@@ -520,17 +481,14 @@ function getBlockSelectionEnd(state) {
|
|
|
520
481
|
*
|
|
521
482
|
* @return {number} Number of blocks selected in the post.
|
|
522
483
|
*/
|
|
523
|
-
|
|
524
|
-
|
|
525
484
|
function getSelectedBlockCount(state) {
|
|
526
485
|
const multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length;
|
|
527
|
-
|
|
528
486
|
if (multiSelectedBlockCount) {
|
|
529
487
|
return multiSelectedBlockCount;
|
|
530
488
|
}
|
|
531
|
-
|
|
532
489
|
return state.selection.selectionStart.clientId ? 1 : 0;
|
|
533
490
|
}
|
|
491
|
+
|
|
534
492
|
/**
|
|
535
493
|
* Returns true if there is a single selected block, or false otherwise.
|
|
536
494
|
*
|
|
@@ -538,8 +496,6 @@ function getSelectedBlockCount(state) {
|
|
|
538
496
|
*
|
|
539
497
|
* @return {boolean} Whether a single block is selected.
|
|
540
498
|
*/
|
|
541
|
-
|
|
542
|
-
|
|
543
499
|
function hasSelectedBlock(state) {
|
|
544
500
|
const {
|
|
545
501
|
selectionStart,
|
|
@@ -547,6 +503,7 @@ function hasSelectedBlock(state) {
|
|
|
547
503
|
} = state.selection;
|
|
548
504
|
return !!selectionStart.clientId && selectionStart.clientId === selectionEnd.clientId;
|
|
549
505
|
}
|
|
506
|
+
|
|
550
507
|
/**
|
|
551
508
|
* Returns the currently selected block client ID, or null if there is no
|
|
552
509
|
* selected block.
|
|
@@ -555,8 +512,6 @@ function hasSelectedBlock(state) {
|
|
|
555
512
|
*
|
|
556
513
|
* @return {?string} Selected block client ID.
|
|
557
514
|
*/
|
|
558
|
-
|
|
559
|
-
|
|
560
515
|
function getSelectedBlockClientId(state) {
|
|
561
516
|
const {
|
|
562
517
|
selectionStart,
|
|
@@ -565,13 +520,12 @@ function getSelectedBlockClientId(state) {
|
|
|
565
520
|
const {
|
|
566
521
|
clientId
|
|
567
522
|
} = selectionStart;
|
|
568
|
-
|
|
569
523
|
if (!clientId || clientId !== selectionEnd.clientId) {
|
|
570
524
|
return null;
|
|
571
525
|
}
|
|
572
|
-
|
|
573
526
|
return clientId;
|
|
574
527
|
}
|
|
528
|
+
|
|
575
529
|
/**
|
|
576
530
|
* Returns the currently selected block, or null if there is no selected block.
|
|
577
531
|
*
|
|
@@ -579,12 +533,11 @@ function getSelectedBlockClientId(state) {
|
|
|
579
533
|
*
|
|
580
534
|
* @return {?Object} Selected block.
|
|
581
535
|
*/
|
|
582
|
-
|
|
583
|
-
|
|
584
536
|
function getSelectedBlock(state) {
|
|
585
537
|
const clientId = getSelectedBlockClientId(state);
|
|
586
538
|
return clientId ? getBlock(state, clientId) : null;
|
|
587
539
|
}
|
|
540
|
+
|
|
588
541
|
/**
|
|
589
542
|
* Given a block client ID, returns the root block from which the block is
|
|
590
543
|
* nested, an empty string for top-level blocks, or null if the block does not
|
|
@@ -595,11 +548,10 @@ function getSelectedBlock(state) {
|
|
|
595
548
|
*
|
|
596
549
|
* @return {?string} Root client ID, if exists
|
|
597
550
|
*/
|
|
598
|
-
|
|
599
|
-
|
|
600
551
|
function getBlockRootClientId(state, clientId) {
|
|
601
552
|
return state.blocks.parents.has(clientId) ? state.blocks.parents.get(clientId) : null;
|
|
602
553
|
}
|
|
554
|
+
|
|
603
555
|
/**
|
|
604
556
|
* Given a block client ID, returns the list of all its parents from top to bottom.
|
|
605
557
|
*
|
|
@@ -609,23 +561,19 @@ function getBlockRootClientId(state, clientId) {
|
|
|
609
561
|
*
|
|
610
562
|
* @return {Array} ClientIDs of the parent blocks.
|
|
611
563
|
*/
|
|
612
|
-
|
|
613
|
-
|
|
614
564
|
const getBlockParents = (0, _rememo.default)((state, clientId, ascending = false) => {
|
|
615
565
|
const parents = [];
|
|
616
566
|
let current = clientId;
|
|
617
|
-
|
|
618
567
|
while (!!state.blocks.parents.get(current)) {
|
|
619
568
|
current = state.blocks.parents.get(current);
|
|
620
569
|
parents.push(current);
|
|
621
570
|
}
|
|
622
|
-
|
|
623
571
|
if (!parents.length) {
|
|
624
572
|
return EMPTY_ARRAY;
|
|
625
573
|
}
|
|
626
|
-
|
|
627
574
|
return ascending ? parents : parents.reverse();
|
|
628
575
|
}, state => [state.blocks.parents]);
|
|
576
|
+
|
|
629
577
|
/**
|
|
630
578
|
* Given a block client ID and a block name, returns the list of all its parents
|
|
631
579
|
* from top to bottom, filtered by the given name(s). For example, if passed
|
|
@@ -640,7 +588,6 @@ const getBlockParents = (0, _rememo.default)((state, clientId, ascending = false
|
|
|
640
588
|
*
|
|
641
589
|
* @return {Array} ClientIDs of the parent blocks.
|
|
642
590
|
*/
|
|
643
|
-
|
|
644
591
|
exports.getBlockParents = getBlockParents;
|
|
645
592
|
const getBlockParentsByBlockName = (0, _rememo.default)((state, clientId, blockName, ascending = false) => {
|
|
646
593
|
const parents = getBlockParents(state, clientId, ascending);
|
|
@@ -655,20 +602,17 @@ const getBlockParentsByBlockName = (0, _rememo.default)((state, clientId, blockN
|
|
|
655
602
|
*
|
|
656
603
|
* @return {string} Root client ID
|
|
657
604
|
*/
|
|
658
|
-
|
|
659
605
|
exports.getBlockParentsByBlockName = getBlockParentsByBlockName;
|
|
660
|
-
|
|
661
606
|
function getBlockHierarchyRootClientId(state, clientId) {
|
|
662
607
|
let current = clientId;
|
|
663
608
|
let parent;
|
|
664
|
-
|
|
665
609
|
do {
|
|
666
610
|
parent = current;
|
|
667
611
|
current = state.blocks.parents.get(current);
|
|
668
612
|
} while (current);
|
|
669
|
-
|
|
670
613
|
return parent;
|
|
671
614
|
}
|
|
615
|
+
|
|
672
616
|
/**
|
|
673
617
|
* Given a block client ID, returns the lowest common ancestor with selected client ID.
|
|
674
618
|
*
|
|
@@ -677,15 +621,12 @@ function getBlockHierarchyRootClientId(state, clientId) {
|
|
|
677
621
|
*
|
|
678
622
|
* @return {string} Common ancestor client ID or undefined
|
|
679
623
|
*/
|
|
680
|
-
|
|
681
|
-
|
|
682
624
|
function getLowestCommonAncestorWithSelectedBlock(state, clientId) {
|
|
683
625
|
const selectedId = getSelectedBlockClientId(state);
|
|
684
626
|
const clientParents = [...getBlockParents(state, clientId), clientId];
|
|
685
627
|
const selectedParents = [...getBlockParents(state, selectedId), selectedId];
|
|
686
628
|
let lowestCommonAncestor;
|
|
687
629
|
const maxDepth = Math.min(clientParents.length, selectedParents.length);
|
|
688
|
-
|
|
689
630
|
for (let index = 0; index < maxDepth; index++) {
|
|
690
631
|
if (clientParents[index] === selectedParents[index]) {
|
|
691
632
|
lowestCommonAncestor = clientParents[index];
|
|
@@ -693,9 +634,9 @@ function getLowestCommonAncestorWithSelectedBlock(state, clientId) {
|
|
|
693
634
|
break;
|
|
694
635
|
}
|
|
695
636
|
}
|
|
696
|
-
|
|
697
637
|
return lowestCommonAncestor;
|
|
698
638
|
}
|
|
639
|
+
|
|
699
640
|
/**
|
|
700
641
|
* Returns the client ID of the block adjacent one at the given reference
|
|
701
642
|
* startClientId and modifier directionality. Defaults start startClientId to
|
|
@@ -710,55 +651,53 @@ function getLowestCommonAncestorWithSelectedBlock(state, clientId) {
|
|
|
710
651
|
*
|
|
711
652
|
* @return {?string} Return the client ID of the block, or null if none exists.
|
|
712
653
|
*/
|
|
713
|
-
|
|
714
|
-
|
|
715
654
|
function getAdjacentBlockClientId(state, startClientId, modifier = 1) {
|
|
716
655
|
// Default to selected block.
|
|
717
656
|
if (startClientId === undefined) {
|
|
718
657
|
startClientId = getSelectedBlockClientId(state);
|
|
719
|
-
}
|
|
720
|
-
|
|
658
|
+
}
|
|
721
659
|
|
|
660
|
+
// Try multi-selection starting at extent based on modifier.
|
|
722
661
|
if (startClientId === undefined) {
|
|
723
662
|
if (modifier < 0) {
|
|
724
663
|
startClientId = getFirstMultiSelectedBlockClientId(state);
|
|
725
664
|
} else {
|
|
726
665
|
startClientId = getLastMultiSelectedBlockClientId(state);
|
|
727
666
|
}
|
|
728
|
-
}
|
|
729
|
-
|
|
667
|
+
}
|
|
730
668
|
|
|
669
|
+
// Validate working start client ID.
|
|
731
670
|
if (!startClientId) {
|
|
732
671
|
return null;
|
|
733
|
-
}
|
|
734
|
-
// empty string top-level root by explicitly testing against null.
|
|
735
|
-
|
|
672
|
+
}
|
|
736
673
|
|
|
674
|
+
// Retrieve start block root client ID, being careful to allow the falsey
|
|
675
|
+
// empty string top-level root by explicitly testing against null.
|
|
737
676
|
const rootClientId = getBlockRootClientId(state, startClientId);
|
|
738
|
-
|
|
739
677
|
if (rootClientId === null) {
|
|
740
678
|
return null;
|
|
741
679
|
}
|
|
742
|
-
|
|
743
680
|
const {
|
|
744
681
|
order
|
|
745
682
|
} = state.blocks;
|
|
746
683
|
const orderSet = order.get(rootClientId);
|
|
747
684
|
const index = orderSet.indexOf(startClientId);
|
|
748
|
-
const nextIndex = index + 1 * modifier;
|
|
685
|
+
const nextIndex = index + 1 * modifier;
|
|
749
686
|
|
|
687
|
+
// Block was first in set and we're attempting to get previous.
|
|
750
688
|
if (nextIndex < 0) {
|
|
751
689
|
return null;
|
|
752
|
-
}
|
|
753
|
-
|
|
690
|
+
}
|
|
754
691
|
|
|
692
|
+
// Block was last in set and we're attempting to get next.
|
|
755
693
|
if (nextIndex === orderSet.length) {
|
|
756
694
|
return null;
|
|
757
|
-
}
|
|
758
|
-
|
|
695
|
+
}
|
|
759
696
|
|
|
697
|
+
// Assume incremented index is within the set.
|
|
760
698
|
return orderSet[nextIndex];
|
|
761
699
|
}
|
|
700
|
+
|
|
762
701
|
/**
|
|
763
702
|
* Returns the previous block's client ID from the given reference start ID.
|
|
764
703
|
* Defaults start to the selected block. Returns null if there is no previous
|
|
@@ -770,11 +709,10 @@ function getAdjacentBlockClientId(state, startClientId, modifier = 1) {
|
|
|
770
709
|
*
|
|
771
710
|
* @return {?string} Adjacent block's client ID, or null if none exists.
|
|
772
711
|
*/
|
|
773
|
-
|
|
774
|
-
|
|
775
712
|
function getPreviousBlockClientId(state, startClientId) {
|
|
776
713
|
return getAdjacentBlockClientId(state, startClientId, -1);
|
|
777
714
|
}
|
|
715
|
+
|
|
778
716
|
/**
|
|
779
717
|
* Returns the next block's client ID from the given reference start ID.
|
|
780
718
|
* Defaults start to the selected block. Returns null if there is no next
|
|
@@ -786,13 +724,11 @@ function getPreviousBlockClientId(state, startClientId) {
|
|
|
786
724
|
*
|
|
787
725
|
* @return {?string} Adjacent block's client ID, or null if none exists.
|
|
788
726
|
*/
|
|
789
|
-
|
|
790
|
-
|
|
791
727
|
function getNextBlockClientId(state, startClientId) {
|
|
792
728
|
return getAdjacentBlockClientId(state, startClientId, 1);
|
|
793
729
|
}
|
|
794
|
-
/* eslint-disable jsdoc/valid-types */
|
|
795
730
|
|
|
731
|
+
/* eslint-disable jsdoc/valid-types */
|
|
796
732
|
/**
|
|
797
733
|
* Returns the initial caret position for the selected block.
|
|
798
734
|
* This position is to used to position the caret properly when the selected block changes.
|
|
@@ -802,12 +738,11 @@ function getNextBlockClientId(state, startClientId) {
|
|
|
802
738
|
*
|
|
803
739
|
* @return {0|-1|null} Initial position.
|
|
804
740
|
*/
|
|
805
|
-
|
|
806
|
-
|
|
807
741
|
function getSelectedBlocksInitialCaretPosition(state) {
|
|
808
742
|
/* eslint-enable jsdoc/valid-types */
|
|
809
743
|
return state.initialPosition;
|
|
810
744
|
}
|
|
745
|
+
|
|
811
746
|
/**
|
|
812
747
|
* Returns the current selection set of block client IDs (multiselection or single selection).
|
|
813
748
|
*
|
|
@@ -815,41 +750,34 @@ function getSelectedBlocksInitialCaretPosition(state) {
|
|
|
815
750
|
*
|
|
816
751
|
* @return {Array} Multi-selected block client IDs.
|
|
817
752
|
*/
|
|
818
|
-
|
|
819
|
-
|
|
820
753
|
const getSelectedBlockClientIds = (0, _rememo.default)(state => {
|
|
821
754
|
const {
|
|
822
755
|
selectionStart,
|
|
823
756
|
selectionEnd
|
|
824
757
|
} = state.selection;
|
|
825
|
-
|
|
826
758
|
if (!selectionStart.clientId || !selectionEnd.clientId) {
|
|
827
759
|
return EMPTY_ARRAY;
|
|
828
760
|
}
|
|
829
|
-
|
|
830
761
|
if (selectionStart.clientId === selectionEnd.clientId) {
|
|
831
762
|
return [selectionStart.clientId];
|
|
832
|
-
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
// Retrieve root client ID to aid in retrieving relevant nested block
|
|
833
766
|
// order, being careful to allow the falsey empty string top-level root
|
|
834
767
|
// by explicitly testing against null.
|
|
835
|
-
|
|
836
|
-
|
|
837
768
|
const rootClientId = getBlockRootClientId(state, selectionStart.clientId);
|
|
838
|
-
|
|
839
769
|
if (rootClientId === null) {
|
|
840
770
|
return EMPTY_ARRAY;
|
|
841
771
|
}
|
|
842
|
-
|
|
843
772
|
const blockOrder = getBlockOrder(state, rootClientId);
|
|
844
773
|
const startIndex = blockOrder.indexOf(selectionStart.clientId);
|
|
845
774
|
const endIndex = blockOrder.indexOf(selectionEnd.clientId);
|
|
846
|
-
|
|
847
775
|
if (startIndex > endIndex) {
|
|
848
776
|
return blockOrder.slice(endIndex, startIndex + 1);
|
|
849
777
|
}
|
|
850
|
-
|
|
851
778
|
return blockOrder.slice(startIndex, endIndex + 1);
|
|
852
779
|
}, state => [state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId]);
|
|
780
|
+
|
|
853
781
|
/**
|
|
854
782
|
* Returns the current multi-selection set of block client IDs, or an empty
|
|
855
783
|
* array if there is no multi-selection.
|
|
@@ -858,21 +786,18 @@ const getSelectedBlockClientIds = (0, _rememo.default)(state => {
|
|
|
858
786
|
*
|
|
859
787
|
* @return {Array} Multi-selected block client IDs.
|
|
860
788
|
*/
|
|
861
|
-
|
|
862
789
|
exports.getSelectedBlockClientIds = getSelectedBlockClientIds;
|
|
863
|
-
|
|
864
790
|
function getMultiSelectedBlockClientIds(state) {
|
|
865
791
|
const {
|
|
866
792
|
selectionStart,
|
|
867
793
|
selectionEnd
|
|
868
794
|
} = state.selection;
|
|
869
|
-
|
|
870
795
|
if (selectionStart.clientId === selectionEnd.clientId) {
|
|
871
796
|
return EMPTY_ARRAY;
|
|
872
797
|
}
|
|
873
|
-
|
|
874
798
|
return getSelectedBlockClientIds(state);
|
|
875
799
|
}
|
|
800
|
+
|
|
876
801
|
/**
|
|
877
802
|
* Returns the current multi-selection set of blocks, or an empty array if
|
|
878
803
|
* there is no multi-selection.
|
|
@@ -881,17 +806,14 @@ function getMultiSelectedBlockClientIds(state) {
|
|
|
881
806
|
*
|
|
882
807
|
* @return {Array} Multi-selected block objects.
|
|
883
808
|
*/
|
|
884
|
-
|
|
885
|
-
|
|
886
809
|
const getMultiSelectedBlocks = (0, _rememo.default)(state => {
|
|
887
810
|
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state);
|
|
888
|
-
|
|
889
811
|
if (!multiSelectedBlockClientIds.length) {
|
|
890
812
|
return EMPTY_ARRAY;
|
|
891
813
|
}
|
|
892
|
-
|
|
893
814
|
return multiSelectedBlockClientIds.map(clientId => getBlock(state, clientId));
|
|
894
815
|
}, state => [...getSelectedBlockClientIds.getDependants(state), state.blocks.byClientId, state.blocks.order, state.blocks.attributes]);
|
|
816
|
+
|
|
895
817
|
/**
|
|
896
818
|
* Returns the client ID of the first block in the multi-selection set, or null
|
|
897
819
|
* if there is no multi-selection.
|
|
@@ -900,12 +822,11 @@ const getMultiSelectedBlocks = (0, _rememo.default)(state => {
|
|
|
900
822
|
*
|
|
901
823
|
* @return {?string} First block client ID in the multi-selection set.
|
|
902
824
|
*/
|
|
903
|
-
|
|
904
825
|
exports.getMultiSelectedBlocks = getMultiSelectedBlocks;
|
|
905
|
-
|
|
906
826
|
function getFirstMultiSelectedBlockClientId(state) {
|
|
907
827
|
return getMultiSelectedBlockClientIds(state)[0] || null;
|
|
908
828
|
}
|
|
829
|
+
|
|
909
830
|
/**
|
|
910
831
|
* Returns the client ID of the last block in the multi-selection set, or null
|
|
911
832
|
* if there is no multi-selection.
|
|
@@ -914,12 +835,11 @@ function getFirstMultiSelectedBlockClientId(state) {
|
|
|
914
835
|
*
|
|
915
836
|
* @return {?string} Last block client ID in the multi-selection set.
|
|
916
837
|
*/
|
|
917
|
-
|
|
918
|
-
|
|
919
838
|
function getLastMultiSelectedBlockClientId(state) {
|
|
920
839
|
const selectedClientIds = getMultiSelectedBlockClientIds(state);
|
|
921
840
|
return selectedClientIds[selectedClientIds.length - 1] || null;
|
|
922
841
|
}
|
|
842
|
+
|
|
923
843
|
/**
|
|
924
844
|
* Returns true if a multi-selection exists, and the block corresponding to the
|
|
925
845
|
* specified client ID is the first block of the multi-selection set, or false
|
|
@@ -930,11 +850,10 @@ function getLastMultiSelectedBlockClientId(state) {
|
|
|
930
850
|
*
|
|
931
851
|
* @return {boolean} Whether block is first in multi-selection.
|
|
932
852
|
*/
|
|
933
|
-
|
|
934
|
-
|
|
935
853
|
function isFirstMultiSelectedBlock(state, clientId) {
|
|
936
854
|
return getFirstMultiSelectedBlockClientId(state) === clientId;
|
|
937
855
|
}
|
|
856
|
+
|
|
938
857
|
/**
|
|
939
858
|
* Returns true if the client ID occurs within the block multi-selection, or
|
|
940
859
|
* false otherwise.
|
|
@@ -944,11 +863,10 @@ function isFirstMultiSelectedBlock(state, clientId) {
|
|
|
944
863
|
*
|
|
945
864
|
* @return {boolean} Whether block is in multi-selection set.
|
|
946
865
|
*/
|
|
947
|
-
|
|
948
|
-
|
|
949
866
|
function isBlockMultiSelected(state, clientId) {
|
|
950
867
|
return getMultiSelectedBlockClientIds(state).indexOf(clientId) !== -1;
|
|
951
868
|
}
|
|
869
|
+
|
|
952
870
|
/**
|
|
953
871
|
* Returns true if an ancestor of the block is multi-selected, or false
|
|
954
872
|
* otherwise.
|
|
@@ -959,19 +877,16 @@ function isBlockMultiSelected(state, clientId) {
|
|
|
959
877
|
* @return {boolean} Whether an ancestor of the block is in multi-selection
|
|
960
878
|
* set.
|
|
961
879
|
*/
|
|
962
|
-
|
|
963
|
-
|
|
964
880
|
const isAncestorMultiSelected = (0, _rememo.default)((state, clientId) => {
|
|
965
881
|
let ancestorClientId = clientId;
|
|
966
882
|
let isMultiSelected = false;
|
|
967
|
-
|
|
968
883
|
while (ancestorClientId && !isMultiSelected) {
|
|
969
884
|
ancestorClientId = getBlockRootClientId(state, ancestorClientId);
|
|
970
885
|
isMultiSelected = isBlockMultiSelected(state, ancestorClientId);
|
|
971
886
|
}
|
|
972
|
-
|
|
973
887
|
return isMultiSelected;
|
|
974
888
|
}, state => [state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId]);
|
|
889
|
+
|
|
975
890
|
/**
|
|
976
891
|
* Returns the client ID of the block which begins the multi-selection set, or
|
|
977
892
|
* null if there is no multi-selection.
|
|
@@ -984,21 +899,18 @@ const isAncestorMultiSelected = (0, _rememo.default)((state, clientId) => {
|
|
|
984
899
|
*
|
|
985
900
|
* @return {?string} Client ID of block beginning multi-selection.
|
|
986
901
|
*/
|
|
987
|
-
|
|
988
902
|
exports.isAncestorMultiSelected = isAncestorMultiSelected;
|
|
989
|
-
|
|
990
903
|
function getMultiSelectedBlocksStartClientId(state) {
|
|
991
904
|
const {
|
|
992
905
|
selectionStart,
|
|
993
906
|
selectionEnd
|
|
994
907
|
} = state.selection;
|
|
995
|
-
|
|
996
908
|
if (selectionStart.clientId === selectionEnd.clientId) {
|
|
997
909
|
return null;
|
|
998
910
|
}
|
|
999
|
-
|
|
1000
911
|
return selectionStart.clientId || null;
|
|
1001
912
|
}
|
|
913
|
+
|
|
1002
914
|
/**
|
|
1003
915
|
* Returns the client ID of the block which ends the multi-selection set, or
|
|
1004
916
|
* null if there is no multi-selection.
|
|
@@ -1011,20 +923,17 @@ function getMultiSelectedBlocksStartClientId(state) {
|
|
|
1011
923
|
*
|
|
1012
924
|
* @return {?string} Client ID of block ending multi-selection.
|
|
1013
925
|
*/
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
926
|
function getMultiSelectedBlocksEndClientId(state) {
|
|
1017
927
|
const {
|
|
1018
928
|
selectionStart,
|
|
1019
929
|
selectionEnd
|
|
1020
930
|
} = state.selection;
|
|
1021
|
-
|
|
1022
931
|
if (selectionStart.clientId === selectionEnd.clientId) {
|
|
1023
932
|
return null;
|
|
1024
933
|
}
|
|
1025
|
-
|
|
1026
934
|
return selectionEnd.clientId || null;
|
|
1027
935
|
}
|
|
936
|
+
|
|
1028
937
|
/**
|
|
1029
938
|
* Returns true if the selection is not partial.
|
|
1030
939
|
*
|
|
@@ -1032,13 +941,12 @@ function getMultiSelectedBlocksEndClientId(state) {
|
|
|
1032
941
|
*
|
|
1033
942
|
* @return {boolean} Whether the selection is mergeable.
|
|
1034
943
|
*/
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
944
|
function __unstableIsFullySelected(state) {
|
|
1038
945
|
const selectionAnchor = getSelectionStart(state);
|
|
1039
946
|
const selectionFocus = getSelectionEnd(state);
|
|
1040
947
|
return !selectionAnchor.attributeKey && !selectionFocus.attributeKey && typeof selectionAnchor.offset === 'undefined' && typeof selectionFocus.offset === 'undefined';
|
|
1041
948
|
}
|
|
949
|
+
|
|
1042
950
|
/**
|
|
1043
951
|
* Returns true if the selection is collapsed.
|
|
1044
952
|
*
|
|
@@ -1046,14 +954,11 @@ function __unstableIsFullySelected(state) {
|
|
|
1046
954
|
*
|
|
1047
955
|
* @return {boolean} Whether the selection is collapsed.
|
|
1048
956
|
*/
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
957
|
function __unstableIsSelectionCollapsed(state) {
|
|
1052
958
|
const selectionAnchor = getSelectionStart(state);
|
|
1053
959
|
const selectionFocus = getSelectionEnd(state);
|
|
1054
960
|
return !!selectionAnchor && !!selectionFocus && selectionAnchor.clientId === selectionFocus.clientId && selectionAnchor.attributeKey === selectionFocus.attributeKey && selectionAnchor.offset === selectionFocus.offset;
|
|
1055
961
|
}
|
|
1056
|
-
|
|
1057
962
|
function __unstableSelectionHasUnmergeableBlock(state) {
|
|
1058
963
|
return getSelectedBlockClientIds(state).some(clientId => {
|
|
1059
964
|
const blockName = getBlockName(state, clientId);
|
|
@@ -1061,6 +966,7 @@ function __unstableSelectionHasUnmergeableBlock(state) {
|
|
|
1061
966
|
return !blockType.merge;
|
|
1062
967
|
});
|
|
1063
968
|
}
|
|
969
|
+
|
|
1064
970
|
/**
|
|
1065
971
|
* Check whether the selection is mergeable.
|
|
1066
972
|
*
|
|
@@ -1069,29 +975,29 @@ function __unstableSelectionHasUnmergeableBlock(state) {
|
|
|
1069
975
|
*
|
|
1070
976
|
* @return {boolean} Whether the selection is mergeable.
|
|
1071
977
|
*/
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
978
|
function __unstableIsSelectionMergeable(state, isForward) {
|
|
1075
979
|
const selectionAnchor = getSelectionStart(state);
|
|
1076
|
-
const selectionFocus = getSelectionEnd(state);
|
|
980
|
+
const selectionFocus = getSelectionEnd(state);
|
|
1077
981
|
|
|
1078
|
-
|
|
982
|
+
// It's not mergeable if the start and end are within the same block.
|
|
983
|
+
if (selectionAnchor.clientId === selectionFocus.clientId) return false;
|
|
1079
984
|
|
|
985
|
+
// It's not mergeable if there's no rich text selection.
|
|
1080
986
|
if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') return false;
|
|
1081
987
|
const anchorRootClientId = getBlockRootClientId(state, selectionAnchor.clientId);
|
|
1082
|
-
const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId);
|
|
1083
|
-
// block list. Maybe in the future it should be allowed.
|
|
988
|
+
const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId);
|
|
1084
989
|
|
|
990
|
+
// It's not mergeable if the selection doesn't start and end in the same
|
|
991
|
+
// block list. Maybe in the future it should be allowed.
|
|
1085
992
|
if (anchorRootClientId !== focusRootClientId) {
|
|
1086
993
|
return false;
|
|
1087
994
|
}
|
|
1088
|
-
|
|
1089
995
|
const blockOrder = getBlockOrder(state, anchorRootClientId);
|
|
1090
996
|
const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
|
|
1091
|
-
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
|
|
997
|
+
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
|
|
1092
998
|
|
|
999
|
+
// Reassign selection start and end based on order.
|
|
1093
1000
|
let selectionStart, selectionEnd;
|
|
1094
|
-
|
|
1095
1001
|
if (anchorIndex > focusIndex) {
|
|
1096
1002
|
selectionStart = selectionFocus;
|
|
1097
1003
|
selectionEnd = selectionAnchor;
|
|
@@ -1099,20 +1005,22 @@ function __unstableIsSelectionMergeable(state, isForward) {
|
|
|
1099
1005
|
selectionStart = selectionAnchor;
|
|
1100
1006
|
selectionEnd = selectionFocus;
|
|
1101
1007
|
}
|
|
1102
|
-
|
|
1103
1008
|
const targetBlockClientId = isForward ? selectionEnd.clientId : selectionStart.clientId;
|
|
1104
1009
|
const blockToMergeClientId = isForward ? selectionStart.clientId : selectionEnd.clientId;
|
|
1105
1010
|
const targetBlockName = getBlockName(state, targetBlockClientId);
|
|
1106
1011
|
const targetBlockType = (0, _blocks.getBlockType)(targetBlockName);
|
|
1107
1012
|
if (!targetBlockType.merge) return false;
|
|
1108
|
-
const blockToMerge = getBlock(state, blockToMergeClientId);
|
|
1013
|
+
const blockToMerge = getBlock(state, blockToMergeClientId);
|
|
1109
1014
|
|
|
1110
|
-
|
|
1111
|
-
|
|
1015
|
+
// It's mergeable if the blocks are of the same type.
|
|
1016
|
+
if (blockToMerge.name === targetBlockName) return true;
|
|
1112
1017
|
|
|
1018
|
+
// If the blocks are of a different type, try to transform the block being
|
|
1019
|
+
// merged into the same type of block.
|
|
1113
1020
|
const blocksToMerge = (0, _blocks.switchToBlockType)(blockToMerge, targetBlockName);
|
|
1114
1021
|
return blocksToMerge && blocksToMerge.length;
|
|
1115
1022
|
}
|
|
1023
|
+
|
|
1116
1024
|
/**
|
|
1117
1025
|
* Get partial selected blocks with their content updated
|
|
1118
1026
|
* based on the selection.
|
|
@@ -1121,33 +1029,30 @@ function __unstableIsSelectionMergeable(state, isForward) {
|
|
|
1121
1029
|
*
|
|
1122
1030
|
* @return {Object[]} Updated partial selected blocks.
|
|
1123
1031
|
*/
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
1032
|
const __unstableGetSelectedBlocksWithPartialSelection = state => {
|
|
1127
1033
|
const selectionAnchor = getSelectionStart(state);
|
|
1128
1034
|
const selectionFocus = getSelectionEnd(state);
|
|
1129
|
-
|
|
1130
1035
|
if (selectionAnchor.clientId === selectionFocus.clientId) {
|
|
1131
1036
|
return EMPTY_ARRAY;
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1037
|
+
}
|
|
1134
1038
|
|
|
1039
|
+
// Can't split if the selection is not set.
|
|
1135
1040
|
if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') {
|
|
1136
1041
|
return EMPTY_ARRAY;
|
|
1137
1042
|
}
|
|
1138
|
-
|
|
1139
1043
|
const anchorRootClientId = getBlockRootClientId(state, selectionAnchor.clientId);
|
|
1140
|
-
const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId);
|
|
1141
|
-
// block list. Maybe in the future it should be allowed.
|
|
1044
|
+
const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId);
|
|
1142
1045
|
|
|
1046
|
+
// It's not splittable if the selection doesn't start and end in the same
|
|
1047
|
+
// block list. Maybe in the future it should be allowed.
|
|
1143
1048
|
if (anchorRootClientId !== focusRootClientId) {
|
|
1144
1049
|
return EMPTY_ARRAY;
|
|
1145
1050
|
}
|
|
1146
|
-
|
|
1147
1051
|
const blockOrder = getBlockOrder(state, anchorRootClientId);
|
|
1148
1052
|
const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
|
|
1149
|
-
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
|
|
1053
|
+
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
|
|
1150
1054
|
|
|
1055
|
+
// Reassign selection start and end based on order.
|
|
1151
1056
|
const [selectionStart, selectionEnd] = anchorIndex > focusIndex ? [selectionFocus, selectionAnchor] : [selectionAnchor, selectionFocus];
|
|
1152
1057
|
const blockA = getBlock(state, selectionStart.clientId);
|
|
1153
1058
|
const blockAType = (0, _blocks.getBlockType)(blockA.name);
|
|
@@ -1167,15 +1072,19 @@ const __unstableGetSelectedBlocksWithPartialSelection = state => {
|
|
|
1167
1072
|
});
|
|
1168
1073
|
valueA = (0, _richText.remove)(valueA, 0, selectionStart.offset);
|
|
1169
1074
|
valueB = (0, _richText.remove)(valueB, selectionEnd.offset, valueB.text.length);
|
|
1170
|
-
return [{
|
|
1171
|
-
|
|
1075
|
+
return [{
|
|
1076
|
+
...blockA,
|
|
1077
|
+
attributes: {
|
|
1078
|
+
...blockA.attributes,
|
|
1172
1079
|
[selectionStart.attributeKey]: (0, _richText.toHTMLString)({
|
|
1173
1080
|
value: valueA,
|
|
1174
1081
|
...(0, _utils.mapRichTextSettings)(attributeDefinitionA)
|
|
1175
1082
|
})
|
|
1176
1083
|
}
|
|
1177
|
-
}, {
|
|
1178
|
-
|
|
1084
|
+
}, {
|
|
1085
|
+
...blockB,
|
|
1086
|
+
attributes: {
|
|
1087
|
+
...blockB.attributes,
|
|
1179
1088
|
[selectionEnd.attributeKey]: (0, _richText.toHTMLString)({
|
|
1180
1089
|
value: valueB,
|
|
1181
1090
|
...(0, _utils.mapRichTextSettings)(attributeDefinitionB)
|
|
@@ -1183,6 +1092,7 @@ const __unstableGetSelectedBlocksWithPartialSelection = state => {
|
|
|
1183
1092
|
}
|
|
1184
1093
|
}];
|
|
1185
1094
|
};
|
|
1095
|
+
|
|
1186
1096
|
/**
|
|
1187
1097
|
* Returns an array containing all block client IDs in the editor in the order
|
|
1188
1098
|
* they appear. Optionally accepts a root client ID of the block list for which
|
|
@@ -1193,13 +1103,11 @@ const __unstableGetSelectedBlocksWithPartialSelection = state => {
|
|
|
1193
1103
|
*
|
|
1194
1104
|
* @return {Array} Ordered client IDs of editor blocks.
|
|
1195
1105
|
*/
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
1106
|
exports.__unstableGetSelectedBlocksWithPartialSelection = __unstableGetSelectedBlocksWithPartialSelection;
|
|
1199
|
-
|
|
1200
1107
|
function getBlockOrder(state, rootClientId) {
|
|
1201
1108
|
return state.blocks.order.get(rootClientId || '') || EMPTY_ARRAY;
|
|
1202
1109
|
}
|
|
1110
|
+
|
|
1203
1111
|
/**
|
|
1204
1112
|
* Returns the index at which the block corresponding to the specified client
|
|
1205
1113
|
* ID occurs within the block order, or `-1` if the block does not exist.
|
|
@@ -1209,12 +1117,11 @@ function getBlockOrder(state, rootClientId) {
|
|
|
1209
1117
|
*
|
|
1210
1118
|
* @return {number} Index at which block exists in order.
|
|
1211
1119
|
*/
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
1120
|
function getBlockIndex(state, clientId) {
|
|
1215
1121
|
const rootClientId = getBlockRootClientId(state, clientId);
|
|
1216
1122
|
return getBlockOrder(state, rootClientId).indexOf(clientId);
|
|
1217
1123
|
}
|
|
1124
|
+
|
|
1218
1125
|
/**
|
|
1219
1126
|
* Returns true if the block corresponding to the specified client ID is
|
|
1220
1127
|
* currently selected and no multi-selection exists, or false otherwise.
|
|
@@ -1224,20 +1131,17 @@ function getBlockIndex(state, clientId) {
|
|
|
1224
1131
|
*
|
|
1225
1132
|
* @return {boolean} Whether block is selected and multi-selection exists.
|
|
1226
1133
|
*/
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
1134
|
function isBlockSelected(state, clientId) {
|
|
1230
1135
|
const {
|
|
1231
1136
|
selectionStart,
|
|
1232
1137
|
selectionEnd
|
|
1233
1138
|
} = state.selection;
|
|
1234
|
-
|
|
1235
1139
|
if (selectionStart.clientId !== selectionEnd.clientId) {
|
|
1236
1140
|
return false;
|
|
1237
1141
|
}
|
|
1238
|
-
|
|
1239
1142
|
return selectionStart.clientId === clientId;
|
|
1240
1143
|
}
|
|
1144
|
+
|
|
1241
1145
|
/**
|
|
1242
1146
|
* Returns true if one of the block's inner blocks is selected.
|
|
1243
1147
|
*
|
|
@@ -1247,11 +1151,10 @@ function isBlockSelected(state, clientId) {
|
|
|
1247
1151
|
*
|
|
1248
1152
|
* @return {boolean} Whether the block has an inner block selected
|
|
1249
1153
|
*/
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
1154
|
function hasSelectedInnerBlock(state, clientId, deep = false) {
|
|
1253
1155
|
return getBlockOrder(state, clientId).some(innerClientId => isBlockSelected(state, innerClientId) || isBlockMultiSelected(state, innerClientId) || deep && hasSelectedInnerBlock(state, innerClientId, deep));
|
|
1254
1156
|
}
|
|
1157
|
+
|
|
1255
1158
|
/**
|
|
1256
1159
|
* Returns true if one of the block's inner blocks is dragged.
|
|
1257
1160
|
*
|
|
@@ -1261,11 +1164,10 @@ function hasSelectedInnerBlock(state, clientId, deep = false) {
|
|
|
1261
1164
|
*
|
|
1262
1165
|
* @return {boolean} Whether the block has an inner block dragged
|
|
1263
1166
|
*/
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
1167
|
function hasDraggedInnerBlock(state, clientId, deep = false) {
|
|
1267
1168
|
return getBlockOrder(state, clientId).some(innerClientId => isBlockBeingDragged(state, innerClientId) || deep && hasDraggedInnerBlock(state, innerClientId, deep));
|
|
1268
1169
|
}
|
|
1170
|
+
|
|
1269
1171
|
/**
|
|
1270
1172
|
* Returns true if the block corresponding to the specified client ID is
|
|
1271
1173
|
* currently selected but isn't the last of the selected blocks. Here "last"
|
|
@@ -1278,17 +1180,15 @@ function hasDraggedInnerBlock(state, clientId, deep = false) {
|
|
|
1278
1180
|
* @return {boolean} Whether block is selected and not the last in the
|
|
1279
1181
|
* selection.
|
|
1280
1182
|
*/
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
1183
|
function isBlockWithinSelection(state, clientId) {
|
|
1284
1184
|
if (!clientId) {
|
|
1285
1185
|
return false;
|
|
1286
1186
|
}
|
|
1287
|
-
|
|
1288
1187
|
const clientIds = getMultiSelectedBlockClientIds(state);
|
|
1289
1188
|
const index = clientIds.indexOf(clientId);
|
|
1290
1189
|
return index > -1 && index < clientIds.length - 1;
|
|
1291
1190
|
}
|
|
1191
|
+
|
|
1292
1192
|
/**
|
|
1293
1193
|
* Returns true if a multi-selection has been made, or false otherwise.
|
|
1294
1194
|
*
|
|
@@ -1296,8 +1196,6 @@ function isBlockWithinSelection(state, clientId) {
|
|
|
1296
1196
|
*
|
|
1297
1197
|
* @return {boolean} Whether multi-selection has been made.
|
|
1298
1198
|
*/
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
1199
|
function hasMultiSelection(state) {
|
|
1302
1200
|
const {
|
|
1303
1201
|
selectionStart,
|
|
@@ -1305,6 +1203,7 @@ function hasMultiSelection(state) {
|
|
|
1305
1203
|
} = state.selection;
|
|
1306
1204
|
return selectionStart.clientId !== selectionEnd.clientId;
|
|
1307
1205
|
}
|
|
1206
|
+
|
|
1308
1207
|
/**
|
|
1309
1208
|
* Whether in the process of multi-selecting or not. This flag is only true
|
|
1310
1209
|
* while the multi-selection is being selected (by mouse move), and is false
|
|
@@ -1316,11 +1215,10 @@ function hasMultiSelection(state) {
|
|
|
1316
1215
|
*
|
|
1317
1216
|
* @return {boolean} True if multi-selecting, false if not.
|
|
1318
1217
|
*/
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
1218
|
function isMultiSelecting(state) {
|
|
1322
1219
|
return state.isMultiSelecting;
|
|
1323
1220
|
}
|
|
1221
|
+
|
|
1324
1222
|
/**
|
|
1325
1223
|
* Selector that returns if multi-selection is enabled or not.
|
|
1326
1224
|
*
|
|
@@ -1328,11 +1226,10 @@ function isMultiSelecting(state) {
|
|
|
1328
1226
|
*
|
|
1329
1227
|
* @return {boolean} True if it should be possible to multi-select blocks, false if multi-selection is disabled.
|
|
1330
1228
|
*/
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
1229
|
function isSelectionEnabled(state) {
|
|
1334
1230
|
return state.isSelectionEnabled;
|
|
1335
1231
|
}
|
|
1232
|
+
|
|
1336
1233
|
/**
|
|
1337
1234
|
* Returns the block's editing mode, defaulting to "visual" if not explicitly
|
|
1338
1235
|
* assigned.
|
|
@@ -1342,11 +1239,10 @@ function isSelectionEnabled(state) {
|
|
|
1342
1239
|
*
|
|
1343
1240
|
* @return {Object} Block editing mode.
|
|
1344
1241
|
*/
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
1242
|
function getBlockMode(state, clientId) {
|
|
1348
1243
|
return state.blocksMode[clientId] || 'visual';
|
|
1349
1244
|
}
|
|
1245
|
+
|
|
1350
1246
|
/**
|
|
1351
1247
|
* Returns true if the user is typing, or false otherwise.
|
|
1352
1248
|
*
|
|
@@ -1354,11 +1250,10 @@ function getBlockMode(state, clientId) {
|
|
|
1354
1250
|
*
|
|
1355
1251
|
* @return {boolean} Whether user is typing.
|
|
1356
1252
|
*/
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
1253
|
function isTyping(state) {
|
|
1360
1254
|
return state.isTyping;
|
|
1361
1255
|
}
|
|
1256
|
+
|
|
1362
1257
|
/**
|
|
1363
1258
|
* Returns true if the user is dragging blocks, or false otherwise.
|
|
1364
1259
|
*
|
|
@@ -1366,11 +1261,10 @@ function isTyping(state) {
|
|
|
1366
1261
|
*
|
|
1367
1262
|
* @return {boolean} Whether user is dragging blocks.
|
|
1368
1263
|
*/
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
1264
|
function isDraggingBlocks(state) {
|
|
1372
1265
|
return !!state.draggedBlocks.length;
|
|
1373
1266
|
}
|
|
1267
|
+
|
|
1374
1268
|
/**
|
|
1375
1269
|
* Returns the client ids of any blocks being directly dragged.
|
|
1376
1270
|
*
|
|
@@ -1380,11 +1274,10 @@ function isDraggingBlocks(state) {
|
|
|
1380
1274
|
*
|
|
1381
1275
|
* @return {string[]} Array of dragged block client ids.
|
|
1382
1276
|
*/
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
1277
|
function getDraggedBlockClientIds(state) {
|
|
1386
1278
|
return state.draggedBlocks;
|
|
1387
1279
|
}
|
|
1280
|
+
|
|
1388
1281
|
/**
|
|
1389
1282
|
* Returns whether the block is being dragged.
|
|
1390
1283
|
*
|
|
@@ -1397,11 +1290,10 @@ function getDraggedBlockClientIds(state) {
|
|
|
1397
1290
|
*
|
|
1398
1291
|
* @return {boolean} Whether the block is being dragged.
|
|
1399
1292
|
*/
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
1293
|
function isBlockBeingDragged(state, clientId) {
|
|
1403
1294
|
return state.draggedBlocks.includes(clientId);
|
|
1404
1295
|
}
|
|
1296
|
+
|
|
1405
1297
|
/**
|
|
1406
1298
|
* Returns whether a parent/ancestor of the block is being dragged.
|
|
1407
1299
|
*
|
|
@@ -1410,18 +1302,16 @@ function isBlockBeingDragged(state, clientId) {
|
|
|
1410
1302
|
*
|
|
1411
1303
|
* @return {boolean} Whether the block's ancestor is being dragged.
|
|
1412
1304
|
*/
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
1305
|
function isAncestorBeingDragged(state, clientId) {
|
|
1416
1306
|
// Return early if no blocks are being dragged rather than
|
|
1417
1307
|
// the more expensive check for parents.
|
|
1418
1308
|
if (!isDraggingBlocks(state)) {
|
|
1419
1309
|
return false;
|
|
1420
1310
|
}
|
|
1421
|
-
|
|
1422
1311
|
const parents = getBlockParents(state, clientId);
|
|
1423
1312
|
return parents.some(parentClientId => isBlockBeingDragged(state, parentClientId));
|
|
1424
1313
|
}
|
|
1314
|
+
|
|
1425
1315
|
/**
|
|
1426
1316
|
* Returns true if the caret is within formatted text, or false otherwise.
|
|
1427
1317
|
*
|
|
@@ -1429,8 +1319,6 @@ function isAncestorBeingDragged(state, clientId) {
|
|
|
1429
1319
|
*
|
|
1430
1320
|
* @return {boolean} Whether the caret is within formatted text.
|
|
1431
1321
|
*/
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
1322
|
function isCaretWithinFormattedText() {
|
|
1435
1323
|
(0, _deprecated.default)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText', {
|
|
1436
1324
|
since: '6.1',
|
|
@@ -1438,6 +1326,7 @@ function isCaretWithinFormattedText() {
|
|
|
1438
1326
|
});
|
|
1439
1327
|
return false;
|
|
1440
1328
|
}
|
|
1329
|
+
|
|
1441
1330
|
/**
|
|
1442
1331
|
* Returns the insertion point, the index at which the new inserted block would
|
|
1443
1332
|
* be placed. Defaults to the last index.
|
|
@@ -1446,8 +1335,6 @@ function isCaretWithinFormattedText() {
|
|
|
1446
1335
|
*
|
|
1447
1336
|
* @return {Object} Insertion point object with `rootClientId`, `index`.
|
|
1448
1337
|
*/
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
1338
|
const getBlockInsertionPoint = (0, _rememo.default)(state => {
|
|
1452
1339
|
let rootClientId, index;
|
|
1453
1340
|
const {
|
|
@@ -1456,27 +1343,24 @@ const getBlockInsertionPoint = (0, _rememo.default)(state => {
|
|
|
1456
1343
|
selectionEnd
|
|
1457
1344
|
}
|
|
1458
1345
|
} = state;
|
|
1459
|
-
|
|
1460
1346
|
if (insertionPoint !== null) {
|
|
1461
1347
|
return insertionPoint;
|
|
1462
1348
|
}
|
|
1463
|
-
|
|
1464
1349
|
const {
|
|
1465
1350
|
clientId
|
|
1466
1351
|
} = selectionEnd;
|
|
1467
|
-
|
|
1468
1352
|
if (clientId) {
|
|
1469
1353
|
rootClientId = getBlockRootClientId(state, clientId) || undefined;
|
|
1470
1354
|
index = getBlockIndex(state, selectionEnd.clientId) + 1;
|
|
1471
1355
|
} else {
|
|
1472
1356
|
index = getBlockOrder(state).length;
|
|
1473
1357
|
}
|
|
1474
|
-
|
|
1475
1358
|
return {
|
|
1476
1359
|
rootClientId,
|
|
1477
1360
|
index
|
|
1478
1361
|
};
|
|
1479
1362
|
}, state => [state.insertionPoint, state.selection.selectionEnd.clientId, state.blocks.parents, state.blocks.order]);
|
|
1363
|
+
|
|
1480
1364
|
/**
|
|
1481
1365
|
* Returns true if we should show the block insertion point.
|
|
1482
1366
|
*
|
|
@@ -1484,23 +1368,21 @@ const getBlockInsertionPoint = (0, _rememo.default)(state => {
|
|
|
1484
1368
|
*
|
|
1485
1369
|
* @return {?boolean} Whether the insertion point is visible or not.
|
|
1486
1370
|
*/
|
|
1487
|
-
|
|
1488
1371
|
exports.getBlockInsertionPoint = getBlockInsertionPoint;
|
|
1489
|
-
|
|
1490
1372
|
function isBlockInsertionPointVisible(state) {
|
|
1491
1373
|
return state.insertionPoint !== null;
|
|
1492
1374
|
}
|
|
1375
|
+
|
|
1493
1376
|
/**
|
|
1494
1377
|
* Returns whether the blocks matches the template or not.
|
|
1495
1378
|
*
|
|
1496
1379
|
* @param {boolean} state
|
|
1497
1380
|
* @return {?boolean} Whether the template is valid or not.
|
|
1498
1381
|
*/
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
1382
|
function isValidTemplate(state) {
|
|
1502
1383
|
return state.template.isValid;
|
|
1503
1384
|
}
|
|
1385
|
+
|
|
1504
1386
|
/**
|
|
1505
1387
|
* Returns the defined block template
|
|
1506
1388
|
*
|
|
@@ -1508,11 +1390,10 @@ function isValidTemplate(state) {
|
|
|
1508
1390
|
*
|
|
1509
1391
|
* @return {?Array} Block Template.
|
|
1510
1392
|
*/
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
1393
|
function getTemplate(state) {
|
|
1514
1394
|
return state.settings.template;
|
|
1515
1395
|
}
|
|
1396
|
+
|
|
1516
1397
|
/**
|
|
1517
1398
|
* Returns the defined block template lock. Optionally accepts a root block
|
|
1518
1399
|
* client ID as context, otherwise defaulting to the global context.
|
|
@@ -1522,25 +1403,18 @@ function getTemplate(state) {
|
|
|
1522
1403
|
*
|
|
1523
1404
|
* @return {string|false} Block Template Lock
|
|
1524
1405
|
*/
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
1406
|
function getTemplateLock(state, rootClientId) {
|
|
1528
1407
|
var _getBlockListSettings;
|
|
1529
|
-
|
|
1530
1408
|
if (!rootClientId) {
|
|
1531
1409
|
var _state$settings$templ;
|
|
1532
|
-
|
|
1533
1410
|
return (_state$settings$templ = state.settings.templateLock) !== null && _state$settings$templ !== void 0 ? _state$settings$templ : false;
|
|
1534
1411
|
}
|
|
1535
|
-
|
|
1536
1412
|
return (_getBlockListSettings = getBlockListSettings(state, rootClientId)?.templateLock) !== null && _getBlockListSettings !== void 0 ? _getBlockListSettings : false;
|
|
1537
1413
|
}
|
|
1538
|
-
|
|
1539
1414
|
const checkAllowList = (list, item, defaultResult = null) => {
|
|
1540
1415
|
if (typeof list === 'boolean') {
|
|
1541
1416
|
return list;
|
|
1542
1417
|
}
|
|
1543
|
-
|
|
1544
1418
|
if (Array.isArray(list)) {
|
|
1545
1419
|
// TODO: when there is a canonical way to detect that we are editing a post
|
|
1546
1420
|
// the following check should be changed to something like:
|
|
@@ -1548,12 +1422,11 @@ const checkAllowList = (list, item, defaultResult = null) => {
|
|
|
1548
1422
|
if (list.includes('core/post-content') && item === null) {
|
|
1549
1423
|
return true;
|
|
1550
1424
|
}
|
|
1551
|
-
|
|
1552
1425
|
return list.includes(item);
|
|
1553
1426
|
}
|
|
1554
|
-
|
|
1555
1427
|
return defaultResult;
|
|
1556
1428
|
};
|
|
1429
|
+
|
|
1557
1430
|
/**
|
|
1558
1431
|
* Determines if the given block type is allowed to be inserted into the block list.
|
|
1559
1432
|
* This function is not exported and not memoized because using a memoized selector
|
|
@@ -1567,48 +1440,38 @@ const checkAllowList = (list, item, defaultResult = null) => {
|
|
|
1567
1440
|
*
|
|
1568
1441
|
* @return {boolean} Whether the given block type is allowed to be inserted.
|
|
1569
1442
|
*/
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
1443
|
const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) => {
|
|
1573
1444
|
let blockType;
|
|
1574
|
-
|
|
1575
1445
|
if (blockName && 'object' === typeof blockName) {
|
|
1576
1446
|
blockType = blockName;
|
|
1577
1447
|
blockName = blockType.name;
|
|
1578
1448
|
} else {
|
|
1579
1449
|
blockType = (0, _blocks.getBlockType)(blockName);
|
|
1580
1450
|
}
|
|
1581
|
-
|
|
1582
1451
|
if (!blockType) {
|
|
1583
1452
|
return false;
|
|
1584
1453
|
}
|
|
1585
|
-
|
|
1586
1454
|
const {
|
|
1587
1455
|
allowedBlockTypes
|
|
1588
1456
|
} = getSettings(state);
|
|
1589
1457
|
const isBlockAllowedInEditor = checkAllowList(allowedBlockTypes, blockName, true);
|
|
1590
|
-
|
|
1591
1458
|
if (!isBlockAllowedInEditor) {
|
|
1592
1459
|
return false;
|
|
1593
1460
|
}
|
|
1594
|
-
|
|
1595
1461
|
const isLocked = !!getTemplateLock(state, rootClientId);
|
|
1596
|
-
|
|
1597
1462
|
if (isLocked) {
|
|
1598
1463
|
return false;
|
|
1599
1464
|
}
|
|
1600
|
-
|
|
1601
|
-
if ((0, _privateSelectors.getBlockEditingMode)(state, rootClientId !== null && rootClientId !== void 0 ? rootClientId : '') === 'disabled') {
|
|
1465
|
+
if (getBlockEditingMode(state, rootClientId !== null && rootClientId !== void 0 ? rootClientId : '') === 'disabled') {
|
|
1602
1466
|
return false;
|
|
1603
1467
|
}
|
|
1468
|
+
const parentBlockListSettings = getBlockListSettings(state, rootClientId);
|
|
1604
1469
|
|
|
1605
|
-
|
|
1470
|
+
// The parent block doesn't have settings indicating it doesn't support
|
|
1606
1471
|
// inner blocks, return false.
|
|
1607
|
-
|
|
1608
1472
|
if (rootClientId && parentBlockListSettings === undefined) {
|
|
1609
1473
|
return false;
|
|
1610
1474
|
}
|
|
1611
|
-
|
|
1612
1475
|
const parentAllowedBlocks = parentBlockListSettings?.allowedBlocks;
|
|
1613
1476
|
const hasParentAllowedBlock = checkAllowList(parentAllowedBlocks, blockName);
|
|
1614
1477
|
const blockAllowedParentBlocks = blockType.parent;
|
|
@@ -1616,17 +1479,15 @@ const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) =>
|
|
|
1616
1479
|
const hasBlockAllowedParent = checkAllowList(blockAllowedParentBlocks, parentName);
|
|
1617
1480
|
let hasBlockAllowedAncestor = true;
|
|
1618
1481
|
const blockAllowedAncestorBlocks = blockType.ancestor;
|
|
1619
|
-
|
|
1620
1482
|
if (blockAllowedAncestorBlocks) {
|
|
1621
1483
|
const ancestors = [rootClientId, ...getBlockParents(state, rootClientId)];
|
|
1622
1484
|
hasBlockAllowedAncestor = ancestors.some(ancestorClientId => checkAllowList(blockAllowedAncestorBlocks, getBlockName(state, ancestorClientId)));
|
|
1623
1485
|
}
|
|
1624
|
-
|
|
1625
1486
|
const canInsert = hasBlockAllowedAncestor && (hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true);
|
|
1626
|
-
|
|
1627
1487
|
if (!canInsert) {
|
|
1628
1488
|
return canInsert;
|
|
1629
1489
|
}
|
|
1490
|
+
|
|
1630
1491
|
/**
|
|
1631
1492
|
* This filter is an ad-hoc solution to prevent adding template parts inside post content.
|
|
1632
1493
|
* Conceptually, having a filter inside a selector is bad pattern so this code will be
|
|
@@ -1639,8 +1500,6 @@ const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) =>
|
|
|
1639
1500
|
* Filters are global: Once they're defined, they will affect all editor instances and all registries.
|
|
1640
1501
|
* An ideal API would only affect specific editor instances.
|
|
1641
1502
|
*/
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
1503
|
return (0, _hooks.applyFilters)('blockEditor.__unstableCanInsertBlockType', canInsert, blockType, rootClientId, {
|
|
1645
1504
|
// Pass bound selectors of the current registry. If we're in a nested
|
|
1646
1505
|
// context, the data will differ from the one selected from the root
|
|
@@ -1649,6 +1508,7 @@ const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) =>
|
|
|
1649
1508
|
getBlockParentsByBlockName: getBlockParentsByBlockName.bind(null, state)
|
|
1650
1509
|
});
|
|
1651
1510
|
};
|
|
1511
|
+
|
|
1652
1512
|
/**
|
|
1653
1513
|
* Determines if the given block type is allowed to be inserted into the block list.
|
|
1654
1514
|
*
|
|
@@ -1658,9 +1518,8 @@ const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) =>
|
|
|
1658
1518
|
*
|
|
1659
1519
|
* @return {boolean} Whether the given block type is allowed to be inserted.
|
|
1660
1520
|
*/
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
1521
|
const canInsertBlockType = (0, _rememo.default)(canInsertBlockTypeUnmemoized, (state, blockName, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId.get(rootClientId), state.settings.allowedBlockTypes, state.settings.templateLock, state.blockEditingModes]);
|
|
1522
|
+
|
|
1664
1523
|
/**
|
|
1665
1524
|
* Determines if the given blocks are allowed to be inserted into the block
|
|
1666
1525
|
* list.
|
|
@@ -1671,12 +1530,11 @@ const canInsertBlockType = (0, _rememo.default)(canInsertBlockTypeUnmemoized, (s
|
|
|
1671
1530
|
*
|
|
1672
1531
|
* @return {boolean} Whether the given blocks are allowed to be inserted.
|
|
1673
1532
|
*/
|
|
1674
|
-
|
|
1675
1533
|
exports.canInsertBlockType = canInsertBlockType;
|
|
1676
|
-
|
|
1677
1534
|
function canInsertBlocks(state, clientIds, rootClientId = null) {
|
|
1678
1535
|
return clientIds.every(id => canInsertBlockType(state, getBlockName(state, id), rootClientId));
|
|
1679
1536
|
}
|
|
1537
|
+
|
|
1680
1538
|
/**
|
|
1681
1539
|
* Determines if the given block is allowed to be deleted.
|
|
1682
1540
|
*
|
|
@@ -1686,25 +1544,20 @@ function canInsertBlocks(state, clientIds, rootClientId = null) {
|
|
|
1686
1544
|
*
|
|
1687
1545
|
* @return {boolean} Whether the given block is allowed to be removed.
|
|
1688
1546
|
*/
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
1547
|
function canRemoveBlock(state, clientId, rootClientId = null) {
|
|
1692
1548
|
const attributes = getBlockAttributes(state, clientId);
|
|
1693
|
-
|
|
1694
1549
|
if (attributes === null) {
|
|
1695
1550
|
return true;
|
|
1696
1551
|
}
|
|
1697
|
-
|
|
1698
1552
|
if (attributes.lock?.remove !== undefined) {
|
|
1699
1553
|
return !attributes.lock.remove;
|
|
1700
1554
|
}
|
|
1701
|
-
|
|
1702
1555
|
if (getTemplateLock(state, rootClientId)) {
|
|
1703
1556
|
return false;
|
|
1704
1557
|
}
|
|
1705
|
-
|
|
1706
|
-
return (0, _privateSelectors.getBlockEditingMode)(state, rootClientId) !== 'disabled';
|
|
1558
|
+
return getBlockEditingMode(state, rootClientId) !== 'disabled';
|
|
1707
1559
|
}
|
|
1560
|
+
|
|
1708
1561
|
/**
|
|
1709
1562
|
* Determines if the given blocks are allowed to be removed.
|
|
1710
1563
|
*
|
|
@@ -1714,11 +1567,10 @@ function canRemoveBlock(state, clientId, rootClientId = null) {
|
|
|
1714
1567
|
*
|
|
1715
1568
|
* @return {boolean} Whether the given blocks are allowed to be removed.
|
|
1716
1569
|
*/
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
1570
|
function canRemoveBlocks(state, clientIds, rootClientId = null) {
|
|
1720
1571
|
return clientIds.every(clientId => canRemoveBlock(state, clientId, rootClientId));
|
|
1721
1572
|
}
|
|
1573
|
+
|
|
1722
1574
|
/**
|
|
1723
1575
|
* Determines if the given block is allowed to be moved.
|
|
1724
1576
|
*
|
|
@@ -1728,25 +1580,20 @@ function canRemoveBlocks(state, clientIds, rootClientId = null) {
|
|
|
1728
1580
|
*
|
|
1729
1581
|
* @return {boolean | undefined} Whether the given block is allowed to be moved.
|
|
1730
1582
|
*/
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
1583
|
function canMoveBlock(state, clientId, rootClientId = null) {
|
|
1734
1584
|
const attributes = getBlockAttributes(state, clientId);
|
|
1735
|
-
|
|
1736
1585
|
if (attributes === null) {
|
|
1737
1586
|
return true;
|
|
1738
1587
|
}
|
|
1739
|
-
|
|
1740
1588
|
if (attributes.lock?.move !== undefined) {
|
|
1741
1589
|
return !attributes.lock.move;
|
|
1742
1590
|
}
|
|
1743
|
-
|
|
1744
1591
|
if (getTemplateLock(state, rootClientId) === 'all') {
|
|
1745
1592
|
return false;
|
|
1746
1593
|
}
|
|
1747
|
-
|
|
1748
|
-
return (0, _privateSelectors.getBlockEditingMode)(state, rootClientId) !== 'disabled';
|
|
1594
|
+
return getBlockEditingMode(state, rootClientId) !== 'disabled';
|
|
1749
1595
|
}
|
|
1596
|
+
|
|
1750
1597
|
/**
|
|
1751
1598
|
* Determines if the given blocks are allowed to be moved.
|
|
1752
1599
|
*
|
|
@@ -1756,11 +1603,10 @@ function canMoveBlock(state, clientId, rootClientId = null) {
|
|
|
1756
1603
|
*
|
|
1757
1604
|
* @return {boolean} Whether the given blocks are allowed to be moved.
|
|
1758
1605
|
*/
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
1606
|
function canMoveBlocks(state, clientIds, rootClientId = null) {
|
|
1762
1607
|
return clientIds.every(clientId => canMoveBlock(state, clientId, rootClientId));
|
|
1763
1608
|
}
|
|
1609
|
+
|
|
1764
1610
|
/**
|
|
1765
1611
|
* Determines if the given block is allowed to be edited.
|
|
1766
1612
|
*
|
|
@@ -1769,21 +1615,19 @@ function canMoveBlocks(state, clientIds, rootClientId = null) {
|
|
|
1769
1615
|
*
|
|
1770
1616
|
* @return {boolean} Whether the given block is allowed to be edited.
|
|
1771
1617
|
*/
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
1618
|
function canEditBlock(state, clientId) {
|
|
1775
1619
|
const attributes = getBlockAttributes(state, clientId);
|
|
1776
|
-
|
|
1777
1620
|
if (attributes === null) {
|
|
1778
1621
|
return true;
|
|
1779
1622
|
}
|
|
1780
|
-
|
|
1781
1623
|
const {
|
|
1782
1624
|
lock
|
|
1783
|
-
} = attributes;
|
|
1625
|
+
} = attributes;
|
|
1784
1626
|
|
|
1627
|
+
// When the edit is true, we cannot edit the block.
|
|
1785
1628
|
return !lock?.edit;
|
|
1786
1629
|
}
|
|
1630
|
+
|
|
1787
1631
|
/**
|
|
1788
1632
|
* Determines if the given block type can be locked/unlocked by a user.
|
|
1789
1633
|
*
|
|
@@ -1792,16 +1636,15 @@ function canEditBlock(state, clientId) {
|
|
|
1792
1636
|
*
|
|
1793
1637
|
* @return {boolean} Whether a given block type can be locked/unlocked.
|
|
1794
1638
|
*/
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
1639
|
function canLockBlockType(state, nameOrType) {
|
|
1798
1640
|
if (!(0, _blocks.hasBlockSupport)(nameOrType, 'lock', true)) {
|
|
1799
1641
|
return false;
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1642
|
+
}
|
|
1802
1643
|
|
|
1644
|
+
// Use block editor settings as the default value.
|
|
1803
1645
|
return !!state.settings?.canLockBlocks;
|
|
1804
1646
|
}
|
|
1647
|
+
|
|
1805
1648
|
/**
|
|
1806
1649
|
* Returns information about how recently and frequently a block has been inserted.
|
|
1807
1650
|
*
|
|
@@ -1812,13 +1655,11 @@ function canLockBlockType(state, nameOrType) {
|
|
|
1812
1655
|
* insert occurred as a UNIX epoch, and `count` which is
|
|
1813
1656
|
* the number of inserts that have occurred.
|
|
1814
1657
|
*/
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
1658
|
function getInsertUsage(state, id) {
|
|
1818
1659
|
var _state$preferences$in;
|
|
1819
|
-
|
|
1820
1660
|
return (_state$preferences$in = state.preferences.insertUsage?.[id]) !== null && _state$preferences$in !== void 0 ? _state$preferences$in : null;
|
|
1821
1661
|
}
|
|
1662
|
+
|
|
1822
1663
|
/**
|
|
1823
1664
|
* Returns whether we can show a block type in the inserter
|
|
1824
1665
|
*
|
|
@@ -1828,15 +1669,13 @@ function getInsertUsage(state, id) {
|
|
|
1828
1669
|
*
|
|
1829
1670
|
* @return {boolean} Whether the given block type is allowed to be shown in the inserter.
|
|
1830
1671
|
*/
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
1672
|
const canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => {
|
|
1834
1673
|
if (!(0, _blocks.hasBlockSupport)(blockType, 'inserter', true)) {
|
|
1835
1674
|
return false;
|
|
1836
1675
|
}
|
|
1837
|
-
|
|
1838
1676
|
return canInsertBlockTypeUnmemoized(state, blockType.name, rootClientId);
|
|
1839
1677
|
};
|
|
1678
|
+
|
|
1840
1679
|
/**
|
|
1841
1680
|
* Return a function to be used to tranform a block variation to an inserter item
|
|
1842
1681
|
*
|
|
@@ -1844,15 +1683,14 @@ const canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => {
|
|
|
1844
1683
|
* @param {Object} item Denormalized inserter item
|
|
1845
1684
|
* @return {Function} Function to transform a block variation to inserter item
|
|
1846
1685
|
*/
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
1686
|
const getItemFromVariation = (state, item) => variation => {
|
|
1850
1687
|
const variationId = `${item.id}/${variation.name}`;
|
|
1851
1688
|
const {
|
|
1852
1689
|
time,
|
|
1853
1690
|
count = 0
|
|
1854
1691
|
} = getInsertUsage(state, variationId) || {};
|
|
1855
|
-
return {
|
|
1692
|
+
return {
|
|
1693
|
+
...item,
|
|
1856
1694
|
id: variationId,
|
|
1857
1695
|
icon: variation.icon || item.icon,
|
|
1858
1696
|
title: variation.title || item.title,
|
|
@@ -1860,7 +1698,8 @@ const getItemFromVariation = (state, item) => variation => {
|
|
|
1860
1698
|
category: variation.category || item.category,
|
|
1861
1699
|
// If `example` is explicitly undefined for the variation, the preview will not be shown.
|
|
1862
1700
|
example: variation.hasOwnProperty('example') ? variation.example : item.example,
|
|
1863
|
-
initialAttributes: {
|
|
1701
|
+
initialAttributes: {
|
|
1702
|
+
...item.initialAttributes,
|
|
1864
1703
|
...variation.attributes
|
|
1865
1704
|
},
|
|
1866
1705
|
innerBlocks: variation.innerBlocks,
|
|
@@ -1868,6 +1707,7 @@ const getItemFromVariation = (state, item) => variation => {
|
|
|
1868
1707
|
frecency: calculateFrecency(time, count)
|
|
1869
1708
|
};
|
|
1870
1709
|
};
|
|
1710
|
+
|
|
1871
1711
|
/**
|
|
1872
1712
|
* Returns the calculated frecency.
|
|
1873
1713
|
*
|
|
@@ -1879,31 +1719,25 @@ const getItemFromVariation = (state, item) => variation => {
|
|
|
1879
1719
|
*
|
|
1880
1720
|
* @return {number} The calculated frecency.
|
|
1881
1721
|
*/
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
1722
|
const calculateFrecency = (time, count) => {
|
|
1885
1723
|
if (!time) {
|
|
1886
1724
|
return count;
|
|
1887
|
-
}
|
|
1725
|
+
}
|
|
1726
|
+
// The selector is cached, which means Date.now() is the last time that the
|
|
1888
1727
|
// relevant state changed. This suits our needs.
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
1728
|
const duration = Date.now() - time;
|
|
1892
|
-
|
|
1893
1729
|
switch (true) {
|
|
1894
1730
|
case duration < MILLISECONDS_PER_HOUR:
|
|
1895
1731
|
return count * 4;
|
|
1896
|
-
|
|
1897
1732
|
case duration < MILLISECONDS_PER_DAY:
|
|
1898
1733
|
return count * 2;
|
|
1899
|
-
|
|
1900
1734
|
case duration < MILLISECONDS_PER_WEEK:
|
|
1901
1735
|
return count / 2;
|
|
1902
|
-
|
|
1903
1736
|
default:
|
|
1904
1737
|
return count / 4;
|
|
1905
1738
|
}
|
|
1906
1739
|
};
|
|
1740
|
+
|
|
1907
1741
|
/**
|
|
1908
1742
|
* Returns a function that accepts a block type and builds an item to be shown
|
|
1909
1743
|
* in a specific context. It's used for building items for Inserter and available
|
|
@@ -1914,20 +1748,16 @@ const calculateFrecency = (time, count) => {
|
|
|
1914
1748
|
* @param {string} options.buildScope The scope for which the item is going to be used.
|
|
1915
1749
|
* @return {Function} Function returns an item to be shown in a specific context (Inserter|Transforms list).
|
|
1916
1750
|
*/
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
1751
|
const buildBlockTypeItem = (state, {
|
|
1920
1752
|
buildScope = 'inserter'
|
|
1921
1753
|
}) => blockType => {
|
|
1922
1754
|
const id = blockType.name;
|
|
1923
1755
|
let isDisabled = false;
|
|
1924
|
-
|
|
1925
1756
|
if (!(0, _blocks.hasBlockSupport)(blockType.name, 'multiple', true)) {
|
|
1926
1757
|
isDisabled = getBlocksByClientId(state, getClientIdsWithDescendants(state)).some(({
|
|
1927
1758
|
name
|
|
1928
1759
|
}) => name === blockType.name);
|
|
1929
1760
|
}
|
|
1930
|
-
|
|
1931
1761
|
const {
|
|
1932
1762
|
time,
|
|
1933
1763
|
count = 0
|
|
@@ -1942,7 +1772,8 @@ const buildBlockTypeItem = (state, {
|
|
|
1942
1772
|
};
|
|
1943
1773
|
if (buildScope === 'transform') return blockItemBase;
|
|
1944
1774
|
const inserterVariations = (0, _blocks.getBlockVariations)(blockType.name, 'inserter');
|
|
1945
|
-
return {
|
|
1775
|
+
return {
|
|
1776
|
+
...blockItemBase,
|
|
1946
1777
|
initialAttributes: {},
|
|
1947
1778
|
description: blockType.description,
|
|
1948
1779
|
category: blockType.category,
|
|
@@ -1950,9 +1781,9 @@ const buildBlockTypeItem = (state, {
|
|
|
1950
1781
|
variations: inserterVariations,
|
|
1951
1782
|
example: blockType.example,
|
|
1952
1783
|
utility: 1 // Deprecated.
|
|
1953
|
-
|
|
1954
1784
|
};
|
|
1955
1785
|
};
|
|
1786
|
+
|
|
1956
1787
|
/**
|
|
1957
1788
|
* Determines the items that appear in the inserter. Includes both static
|
|
1958
1789
|
* items (e.g. a regular block type) and dynamic items (e.g. a reusable block).
|
|
@@ -1982,49 +1813,12 @@ const buildBlockTypeItem = (state, {
|
|
|
1982
1813
|
* this item.
|
|
1983
1814
|
* @property {number} frecency Heuristic that combines frequency and recency.
|
|
1984
1815
|
*/
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
1816
|
const getInserterItems = (0, _rememo.default)((state, rootClientId = null) => {
|
|
1988
|
-
/*
|
|
1989
|
-
* Matches block comment delimiters amid serialized content.
|
|
1990
|
-
*
|
|
1991
|
-
* @see `tokenizer` in `@wordpress/block-serialization-default-parser`
|
|
1992
|
-
* package
|
|
1993
|
-
*
|
|
1994
|
-
* blockParserTokenizer differs from the original tokenizer in the
|
|
1995
|
-
* following ways:
|
|
1996
|
-
*
|
|
1997
|
-
* - removed global flag (/g)
|
|
1998
|
-
* - prepended ^\s*
|
|
1999
|
-
*
|
|
2000
|
-
*/
|
|
2001
|
-
const blockParserTokenizer = /^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/;
|
|
2002
|
-
|
|
2003
1817
|
const buildReusableBlockInserterItem = reusableBlock => {
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
* outermost block contained in the reusable block. This requires
|
|
2009
|
-
* scanning the serialized form of the reusable block to find its
|
|
2010
|
-
* first block delimiter, then looking up the corresponding block
|
|
2011
|
-
* type, if available.
|
|
2012
|
-
*/
|
|
2013
|
-
|
|
2014
|
-
if (_element.Platform.OS === 'web') {
|
|
2015
|
-
const content = typeof reusableBlock.content.raw === 'string' ? reusableBlock.content.raw : reusableBlock.content;
|
|
2016
|
-
const rawBlockMatch = content.match(blockParserTokenizer);
|
|
2017
|
-
|
|
2018
|
-
if (rawBlockMatch) {
|
|
2019
|
-
const [,, namespace = 'core/', blockName] = rawBlockMatch;
|
|
2020
|
-
const referencedBlockType = (0, _blocks.getBlockType)(namespace + blockName);
|
|
2021
|
-
|
|
2022
|
-
if (referencedBlockType) {
|
|
2023
|
-
icon = referencedBlockType.icon;
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
}
|
|
2027
|
-
|
|
1818
|
+
const icon = !reusableBlock.wp_pattern_sync_status ? {
|
|
1819
|
+
src: _icons.symbol,
|
|
1820
|
+
foreground: 'var(--wp-block-synced-color)'
|
|
1821
|
+
} : _icons.symbol;
|
|
2028
1822
|
const id = `core/block/${reusableBlock.id}`;
|
|
2029
1823
|
const {
|
|
2030
1824
|
time,
|
|
@@ -2045,15 +1839,11 @@ const getInserterItems = (0, _rememo.default)((state, rootClientId = null) => {
|
|
|
2045
1839
|
utility: 1,
|
|
2046
1840
|
// Deprecated.
|
|
2047
1841
|
frecency,
|
|
2048
|
-
content: reusableBlock.content.raw
|
|
1842
|
+
content: reusableBlock.content.raw,
|
|
1843
|
+
syncStatus: reusableBlock.wp_pattern_sync_status
|
|
2049
1844
|
};
|
|
2050
1845
|
};
|
|
2051
|
-
|
|
2052
|
-
const syncedPatternInserterItems = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) ? getReusableBlocks(state).filter(reusableBlock => // Reusable blocks that are fully synced should have no sync status set
|
|
2053
|
-
// for backwards compat between patterns and old reusable blocks, but
|
|
2054
|
-
// some in release 16.1 may have had sync status inadvertantly set to
|
|
2055
|
-
// 'fully' if created in the site editor.
|
|
2056
|
-
reusableBlock.wp_pattern_sync_status === 'fully' || reusableBlock.wp_pattern_sync_status === '' || !reusableBlock.wp_pattern_sync_status).map(buildReusableBlockInserterItem) : [];
|
|
1846
|
+
const syncedPatternInserterItems = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) ? getReusableBlocks(state).map(buildReusableBlockInserterItem) : [];
|
|
2057
1847
|
const buildBlockTypeInserterItem = buildBlockTypeItem(state, {
|
|
2058
1848
|
buildScope: 'inserter'
|
|
2059
1849
|
});
|
|
@@ -2061,26 +1851,25 @@ const getInserterItems = (0, _rememo.default)((state, rootClientId = null) => {
|
|
|
2061
1851
|
const items = blockTypeInserterItems.reduce((accumulator, item) => {
|
|
2062
1852
|
const {
|
|
2063
1853
|
variations = []
|
|
2064
|
-
} = item;
|
|
2065
|
-
|
|
1854
|
+
} = item;
|
|
1855
|
+
// Exclude any block type item that is to be replaced by a default variation.
|
|
2066
1856
|
if (!variations.some(({
|
|
2067
1857
|
isDefault
|
|
2068
1858
|
}) => isDefault)) {
|
|
2069
1859
|
accumulator.push(item);
|
|
2070
1860
|
}
|
|
2071
|
-
|
|
2072
1861
|
if (variations.length) {
|
|
2073
1862
|
const variationMapper = getItemFromVariation(state, item);
|
|
2074
1863
|
accumulator.push(...variations.map(variationMapper));
|
|
2075
1864
|
}
|
|
2076
|
-
|
|
2077
1865
|
return accumulator;
|
|
2078
|
-
}, []);
|
|
1866
|
+
}, []);
|
|
1867
|
+
|
|
1868
|
+
// Ensure core blocks are prioritized in the returned results,
|
|
2079
1869
|
// because third party blocks can be registered earlier than
|
|
2080
1870
|
// the core blocks (usually by using the `init` action),
|
|
2081
1871
|
// thus affecting the display order.
|
|
2082
1872
|
// We don't sort reusable blocks as they are handled differently.
|
|
2083
|
-
|
|
2084
1873
|
const groupByType = (blocks, block) => {
|
|
2085
1874
|
const {
|
|
2086
1875
|
core,
|
|
@@ -2090,7 +1879,6 @@ const getInserterItems = (0, _rememo.default)((state, rootClientId = null) => {
|
|
|
2090
1879
|
type.push(block);
|
|
2091
1880
|
return blocks;
|
|
2092
1881
|
};
|
|
2093
|
-
|
|
2094
1882
|
const {
|
|
2095
1883
|
core: coreItems,
|
|
2096
1884
|
noncore: nonCoreItems
|
|
@@ -2101,6 +1889,7 @@ const getInserterItems = (0, _rememo.default)((state, rootClientId = null) => {
|
|
|
2101
1889
|
const sortedBlockTypes = [...coreItems, ...nonCoreItems];
|
|
2102
1890
|
return [...sortedBlockTypes, ...syncedPatternInserterItems];
|
|
2103
1891
|
}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.blocks.order, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, getReusableBlocks(state), (0, _blocks.getBlockTypes)()]);
|
|
1892
|
+
|
|
2104
1893
|
/**
|
|
2105
1894
|
* Determines the items that appear in the available block transforms list.
|
|
2106
1895
|
*
|
|
@@ -2127,7 +1916,6 @@ const getInserterItems = (0, _rememo.default)((state, rootClientId = null) => {
|
|
|
2127
1916
|
* this item.
|
|
2128
1917
|
* @property {number} frecency Heuristic that combines frequency and recency.
|
|
2129
1918
|
*/
|
|
2130
|
-
|
|
2131
1919
|
exports.getInserterItems = getInserterItems;
|
|
2132
1920
|
const getBlockTransformItems = (0, _rememo.default)((state, blocks, rootClientId = null) => {
|
|
2133
1921
|
const normalizedBlocks = Array.isArray(blocks) ? blocks : [blocks];
|
|
@@ -2140,11 +1928,11 @@ const getBlockTransformItems = (0, _rememo.default)((state, blocks, rootClientId
|
|
|
2140
1928
|
if (itemsByName[block?.name]) {
|
|
2141
1929
|
accumulator.push(itemsByName[block.name]);
|
|
2142
1930
|
}
|
|
2143
|
-
|
|
2144
1931
|
return accumulator;
|
|
2145
1932
|
}, []);
|
|
2146
1933
|
return (0, _sorting.orderBy)(possibleTransforms, block => itemsByName[block.name].frecency, 'desc');
|
|
2147
1934
|
}, (state, blocks, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, (0, _blocks.getBlockTypes)()]);
|
|
1935
|
+
|
|
2148
1936
|
/**
|
|
2149
1937
|
* Determines whether there are items to show in the inserter.
|
|
2150
1938
|
*
|
|
@@ -2153,18 +1941,16 @@ const getBlockTransformItems = (0, _rememo.default)((state, blocks, rootClientId
|
|
|
2153
1941
|
*
|
|
2154
1942
|
* @return {boolean} Items that appear in inserter.
|
|
2155
1943
|
*/
|
|
2156
|
-
|
|
2157
1944
|
exports.getBlockTransformItems = getBlockTransformItems;
|
|
2158
1945
|
const hasInserterItems = (0, _rememo.default)((state, rootClientId = null) => {
|
|
2159
1946
|
const hasBlockType = (0, _blocks.getBlockTypes)().some(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId));
|
|
2160
|
-
|
|
2161
1947
|
if (hasBlockType) {
|
|
2162
1948
|
return true;
|
|
2163
1949
|
}
|
|
2164
|
-
|
|
2165
1950
|
const hasReusableBlock = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) && getReusableBlocks(state).length > 0;
|
|
2166
1951
|
return hasReusableBlock;
|
|
2167
1952
|
}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.settings.allowedBlockTypes, state.settings.templateLock, getReusableBlocks(state), (0, _blocks.getBlockTypes)()]);
|
|
1953
|
+
|
|
2168
1954
|
/**
|
|
2169
1955
|
* Returns the list of allowed inserter blocks for inner blocks children.
|
|
2170
1956
|
*
|
|
@@ -2173,19 +1959,16 @@ const hasInserterItems = (0, _rememo.default)((state, rootClientId = null) => {
|
|
|
2173
1959
|
*
|
|
2174
1960
|
* @return {Array?} The list of allowed block types.
|
|
2175
1961
|
*/
|
|
2176
|
-
|
|
2177
1962
|
exports.hasInserterItems = hasInserterItems;
|
|
2178
1963
|
const getAllowedBlocks = (0, _rememo.default)((state, rootClientId = null) => {
|
|
2179
1964
|
if (!rootClientId) {
|
|
2180
1965
|
return;
|
|
2181
1966
|
}
|
|
2182
|
-
|
|
2183
1967
|
const blockTypes = (0, _blocks.getBlockTypes)().filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId));
|
|
2184
1968
|
const hasReusableBlock = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) && getReusableBlocks(state).length > 0;
|
|
2185
1969
|
return [...blockTypes, ...(hasReusableBlock ? ['core/block'] : [])];
|
|
2186
1970
|
}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.settings.allowedBlockTypes, state.settings.templateLock, getReusableBlocks(state), (0, _blocks.getBlockTypes)()]);
|
|
2187
1971
|
exports.getAllowedBlocks = getAllowedBlocks;
|
|
2188
|
-
|
|
2189
1972
|
const __experimentalGetAllowedBlocks = (0, _rememo.default)((state, rootClientId = null) => {
|
|
2190
1973
|
(0, _deprecated.default)('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks', {
|
|
2191
1974
|
alternative: 'wp.data.select( "core/block-editor" ).getAllowedBlocks',
|
|
@@ -2194,6 +1977,7 @@ const __experimentalGetAllowedBlocks = (0, _rememo.default)((state, rootClientId
|
|
|
2194
1977
|
});
|
|
2195
1978
|
return getAllowedBlocks(state, rootClientId);
|
|
2196
1979
|
}, (state, rootClientId) => [...getAllowedBlocks.getDependants(state, rootClientId)]);
|
|
1980
|
+
|
|
2197
1981
|
/**
|
|
2198
1982
|
* Returns the block to be directly inserted by the block appender.
|
|
2199
1983
|
*
|
|
@@ -2207,29 +1991,22 @@ const __experimentalGetAllowedBlocks = (0, _rememo.default)((state, rootClientId
|
|
|
2207
1991
|
* @property {?Object} attributes Attributes to pass to the newly created block.
|
|
2208
1992
|
* @property {?Array<string>} attributesToCopy Attributes to be copied from adjecent blocks when inserted.
|
|
2209
1993
|
*/
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
1994
|
exports.__experimentalGetAllowedBlocks = __experimentalGetAllowedBlocks;
|
|
2213
1995
|
const getDirectInsertBlock = (0, _rememo.default)((state, rootClientId = null) => {
|
|
2214
1996
|
if (!rootClientId) {
|
|
2215
1997
|
return;
|
|
2216
1998
|
}
|
|
2217
|
-
|
|
2218
1999
|
const defaultBlock = state.blockListSettings[rootClientId]?.defaultBlock;
|
|
2219
2000
|
const directInsert = state.blockListSettings[rootClientId]?.directInsert;
|
|
2220
|
-
|
|
2221
2001
|
if (!defaultBlock || !directInsert) {
|
|
2222
2002
|
return;
|
|
2223
2003
|
}
|
|
2224
|
-
|
|
2225
2004
|
if (typeof directInsert === 'function') {
|
|
2226
2005
|
return directInsert(getBlock(state, rootClientId)) ? defaultBlock : null;
|
|
2227
2006
|
}
|
|
2228
|
-
|
|
2229
2007
|
return defaultBlock;
|
|
2230
2008
|
}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.tree.get(rootClientId)]);
|
|
2231
2009
|
exports.getDirectInsertBlock = getDirectInsertBlock;
|
|
2232
|
-
|
|
2233
2010
|
const __experimentalGetDirectInsertBlock = (0, _rememo.default)((state, rootClientId = null) => {
|
|
2234
2011
|
(0, _deprecated.default)('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock', {
|
|
2235
2012
|
alternative: 'wp.data.select( "core/block-editor" ).getDirectInsertBlock',
|
|
@@ -2238,35 +2015,26 @@ const __experimentalGetDirectInsertBlock = (0, _rememo.default)((state, rootClie
|
|
|
2238
2015
|
});
|
|
2239
2016
|
return getDirectInsertBlock(state, rootClientId);
|
|
2240
2017
|
}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.tree.get(rootClientId)]);
|
|
2241
|
-
|
|
2242
2018
|
exports.__experimentalGetDirectInsertBlock = __experimentalGetDirectInsertBlock;
|
|
2243
|
-
|
|
2244
2019
|
const checkAllowListRecursive = (blocks, allowedBlockTypes) => {
|
|
2245
2020
|
if (typeof allowedBlockTypes === 'boolean') {
|
|
2246
2021
|
return allowedBlockTypes;
|
|
2247
2022
|
}
|
|
2248
|
-
|
|
2249
2023
|
const blocksQueue = [...blocks];
|
|
2250
|
-
|
|
2251
2024
|
while (blocksQueue.length > 0) {
|
|
2252
2025
|
const block = blocksQueue.shift();
|
|
2253
2026
|
const isAllowed = checkAllowList(allowedBlockTypes, block.name || block.blockName, true);
|
|
2254
|
-
|
|
2255
2027
|
if (!isAllowed) {
|
|
2256
2028
|
return false;
|
|
2257
2029
|
}
|
|
2258
|
-
|
|
2259
2030
|
block.innerBlocks?.forEach(innerBlock => {
|
|
2260
2031
|
blocksQueue.push(innerBlock);
|
|
2261
2032
|
});
|
|
2262
2033
|
}
|
|
2263
|
-
|
|
2264
2034
|
return true;
|
|
2265
2035
|
};
|
|
2266
|
-
|
|
2267
2036
|
function getUnsyncedPatterns(state) {
|
|
2268
2037
|
var _state$settings$__exp;
|
|
2269
|
-
|
|
2270
2038
|
const reusableBlocks = (_state$settings$__exp = state?.settings?.__experimentalReusableBlocks) !== null && _state$settings$__exp !== void 0 ? _state$settings$__exp : EMPTY_ARRAY;
|
|
2271
2039
|
return reusableBlocks.filter(reusableBlock => reusableBlock.wp_pattern_sync_status === 'unsynced').map(reusableBlock => {
|
|
2272
2040
|
return {
|
|
@@ -2277,25 +2045,22 @@ function getUnsyncedPatterns(state) {
|
|
|
2277
2045
|
};
|
|
2278
2046
|
});
|
|
2279
2047
|
}
|
|
2280
|
-
|
|
2281
2048
|
const __experimentalGetParsedPattern = (0, _rememo.default)((state, patternName) => {
|
|
2282
2049
|
const patterns = state.settings.__experimentalBlockPatterns;
|
|
2283
2050
|
const unsyncedPatterns = getUnsyncedPatterns(state);
|
|
2284
2051
|
const pattern = [...patterns, ...unsyncedPatterns].find(({
|
|
2285
2052
|
name
|
|
2286
2053
|
}) => name === patternName);
|
|
2287
|
-
|
|
2288
2054
|
if (!pattern) {
|
|
2289
2055
|
return null;
|
|
2290
2056
|
}
|
|
2291
|
-
|
|
2292
|
-
|
|
2057
|
+
return {
|
|
2058
|
+
...pattern,
|
|
2293
2059
|
blocks: (0, _blocks.parse)(pattern.content, {
|
|
2294
2060
|
__unstableSkipMigrationLogs: true
|
|
2295
2061
|
})
|
|
2296
2062
|
};
|
|
2297
2063
|
}, state => [state.settings.__experimentalBlockPatterns, state.settings.__experimentalReusableBlocks]);
|
|
2298
|
-
|
|
2299
2064
|
exports.__experimentalGetParsedPattern = __experimentalGetParsedPattern;
|
|
2300
2065
|
const getAllAllowedPatterns = (0, _rememo.default)(state => {
|
|
2301
2066
|
const patterns = state.settings.__experimentalBlockPatterns;
|
|
@@ -2313,6 +2078,7 @@ const getAllAllowedPatterns = (0, _rememo.default)(state => {
|
|
|
2313
2078
|
}) => checkAllowListRecursive(blocks, allowedBlockTypes));
|
|
2314
2079
|
return allowedPatterns;
|
|
2315
2080
|
}, state => [state.settings.__experimentalBlockPatterns, state.settings.__experimentalReusableBlocks, state.settings.allowedBlockTypes]);
|
|
2081
|
+
|
|
2316
2082
|
/**
|
|
2317
2083
|
* Returns the list of allowed patterns for inner blocks children.
|
|
2318
2084
|
*
|
|
@@ -2321,7 +2087,6 @@ const getAllAllowedPatterns = (0, _rememo.default)(state => {
|
|
|
2321
2087
|
*
|
|
2322
2088
|
* @return {Array?} The list of allowed patterns.
|
|
2323
2089
|
*/
|
|
2324
|
-
|
|
2325
2090
|
const __experimentalGetAllowedPatterns = (0, _rememo.default)((state, rootClientId = null) => {
|
|
2326
2091
|
const availableParsedPatterns = getAllAllowedPatterns(state);
|
|
2327
2092
|
const patternsAllowed = availableParsedPatterns.filter(({
|
|
@@ -2331,6 +2096,7 @@ const __experimentalGetAllowedPatterns = (0, _rememo.default)((state, rootClient
|
|
|
2331
2096
|
}) => canInsertBlockType(state, name, rootClientId)));
|
|
2332
2097
|
return patternsAllowed;
|
|
2333
2098
|
}, (state, rootClientId) => [state.settings.__experimentalBlockPatterns, state.settings.__experimentalReusableBlocks, state.settings.allowedBlockTypes, state.settings.templateLock, state.blockListSettings[rootClientId], state.blocks.byClientId.get(rootClientId)]);
|
|
2099
|
+
|
|
2334
2100
|
/**
|
|
2335
2101
|
* Returns the list of patterns based on their declared `blockTypes`
|
|
2336
2102
|
* and a block's name.
|
|
@@ -2344,25 +2110,18 @@ const __experimentalGetAllowedPatterns = (0, _rememo.default)((state, rootClient
|
|
|
2344
2110
|
*
|
|
2345
2111
|
* @return {Array} The list of matched block patterns based on declared `blockTypes` and block name.
|
|
2346
2112
|
*/
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
2113
|
exports.__experimentalGetAllowedPatterns = __experimentalGetAllowedPatterns;
|
|
2350
2114
|
const getPatternsByBlockTypes = (0, _rememo.default)((state, blockNames, rootClientId = null) => {
|
|
2351
2115
|
if (!blockNames) return EMPTY_ARRAY;
|
|
2352
|
-
|
|
2353
2116
|
const patterns = __experimentalGetAllowedPatterns(state, rootClientId);
|
|
2354
|
-
|
|
2355
2117
|
const normalizedBlockNames = Array.isArray(blockNames) ? blockNames : [blockNames];
|
|
2356
2118
|
const filteredPatterns = patterns.filter(pattern => pattern?.blockTypes?.some?.(blockName => normalizedBlockNames.includes(blockName)));
|
|
2357
|
-
|
|
2358
2119
|
if (filteredPatterns.length === 0) {
|
|
2359
2120
|
return EMPTY_ARRAY;
|
|
2360
2121
|
}
|
|
2361
|
-
|
|
2362
2122
|
return filteredPatterns;
|
|
2363
2123
|
}, (state, blockNames, rootClientId) => [...__experimentalGetAllowedPatterns.getDependants(state, rootClientId)]);
|
|
2364
2124
|
exports.getPatternsByBlockTypes = getPatternsByBlockTypes;
|
|
2365
|
-
|
|
2366
2125
|
const __experimentalGetPatternsByBlockTypes = (0, _rememo.default)((state, blockNames, rootClientId = null) => {
|
|
2367
2126
|
(0, _deprecated.default)('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes', {
|
|
2368
2127
|
alternative: 'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',
|
|
@@ -2371,6 +2130,7 @@ const __experimentalGetPatternsByBlockTypes = (0, _rememo.default)((state, block
|
|
|
2371
2130
|
});
|
|
2372
2131
|
return getPatternsByBlockTypes(state, blockNames, rootClientId);
|
|
2373
2132
|
}, (state, blockNames, rootClientId) => [...__experimentalGetAllowedPatterns.getDependants(state, rootClientId)]);
|
|
2133
|
+
|
|
2374
2134
|
/**
|
|
2375
2135
|
* Determines the items that appear in the available pattern transforms list.
|
|
2376
2136
|
*
|
|
@@ -2388,10 +2148,7 @@ const __experimentalGetPatternsByBlockTypes = (0, _rememo.default)((state, block
|
|
|
2388
2148
|
*
|
|
2389
2149
|
* @return {WPBlockPattern[]} Items that are eligible for a pattern transformation.
|
|
2390
2150
|
*/
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
2151
|
exports.__experimentalGetPatternsByBlockTypes = __experimentalGetPatternsByBlockTypes;
|
|
2394
|
-
|
|
2395
2152
|
const __experimentalGetPatternTransformItems = (0, _rememo.default)((state, blocks, rootClientId = null) => {
|
|
2396
2153
|
if (!blocks) return EMPTY_ARRAY;
|
|
2397
2154
|
/**
|
|
@@ -2401,15 +2158,14 @@ const __experimentalGetPatternTransformItems = (0, _rememo.default)((state, bloc
|
|
|
2401
2158
|
* return the inner blocks of an inner block controller, so we still need
|
|
2402
2159
|
* to check for this case too.
|
|
2403
2160
|
*/
|
|
2404
|
-
|
|
2405
2161
|
if (blocks.some(({
|
|
2406
2162
|
clientId,
|
|
2407
2163
|
innerBlocks
|
|
2408
2164
|
}) => innerBlocks.length || areInnerBlocksControlled(state, clientId))) {
|
|
2409
2165
|
return EMPTY_ARRAY;
|
|
2410
|
-
}
|
|
2411
|
-
|
|
2166
|
+
}
|
|
2412
2167
|
|
|
2168
|
+
// Create a Set of the selected block names that is used in patterns filtering.
|
|
2413
2169
|
const selectedBlockNames = Array.from(new Set(blocks.map(({
|
|
2414
2170
|
name
|
|
2415
2171
|
}) => name)));
|
|
@@ -2419,9 +2175,9 @@ const __experimentalGetPatternTransformItems = (0, _rememo.default)((state, bloc
|
|
|
2419
2175
|
* block pattern's blocks and try to find matches from the selected blocks.
|
|
2420
2176
|
* Now this happens in the consumer to avoid heavy operations in the selector.
|
|
2421
2177
|
*/
|
|
2422
|
-
|
|
2423
2178
|
return getPatternsByBlockTypes(state, selectedBlockNames, rootClientId);
|
|
2424
2179
|
}, (state, blocks, rootClientId) => [...getPatternsByBlockTypes.getDependants(state, rootClientId)]);
|
|
2180
|
+
|
|
2425
2181
|
/**
|
|
2426
2182
|
* Returns the Block List settings of a block, if any exist.
|
|
2427
2183
|
*
|
|
@@ -2430,13 +2186,11 @@ const __experimentalGetPatternTransformItems = (0, _rememo.default)((state, bloc
|
|
|
2430
2186
|
*
|
|
2431
2187
|
* @return {?Object} Block settings of the block if set.
|
|
2432
2188
|
*/
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
2189
|
exports.__experimentalGetPatternTransformItems = __experimentalGetPatternTransformItems;
|
|
2436
|
-
|
|
2437
2190
|
function getBlockListSettings(state, clientId) {
|
|
2438
2191
|
return state.blockListSettings[clientId];
|
|
2439
2192
|
}
|
|
2193
|
+
|
|
2440
2194
|
/**
|
|
2441
2195
|
* Returns the editor settings.
|
|
2442
2196
|
*
|
|
@@ -2444,36 +2198,10 @@ function getBlockListSettings(state, clientId) {
|
|
|
2444
2198
|
*
|
|
2445
2199
|
* @return {Object} The editor settings object.
|
|
2446
2200
|
*/
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
2201
|
function getSettings(state) {
|
|
2450
2202
|
return state.settings;
|
|
2451
2203
|
}
|
|
2452
|
-
/**
|
|
2453
|
-
* Returns the behaviors registered with the editor.
|
|
2454
|
-
*
|
|
2455
|
-
* Behaviors are named, reusable pieces of functionality that can be
|
|
2456
|
-
* attached to blocks. They are registered with the editor using the
|
|
2457
|
-
* `theme.json` file.
|
|
2458
|
-
*
|
|
2459
|
-
* @example
|
|
2460
|
-
*
|
|
2461
|
-
* ```js
|
|
2462
|
-
* const behaviors = select( blockEditorStore ).getBehaviors();
|
|
2463
|
-
* if ( behaviors?.lightbox ) {
|
|
2464
|
-
* // Do something with the lightbox.
|
|
2465
|
-
* }
|
|
2466
|
-
*```
|
|
2467
|
-
*
|
|
2468
|
-
* @param {Object} state Editor state.
|
|
2469
|
-
*
|
|
2470
|
-
* @return {Object} The editor behaviors object.
|
|
2471
|
-
*/
|
|
2472
|
-
|
|
2473
2204
|
|
|
2474
|
-
function getBehaviors(state) {
|
|
2475
|
-
return state.settings.behaviors;
|
|
2476
|
-
}
|
|
2477
2205
|
/**
|
|
2478
2206
|
* Returns true if the most recent block change is be considered persistent, or
|
|
2479
2207
|
* false otherwise. A persistent change is one committed by BlockEditorProvider
|
|
@@ -2483,11 +2211,10 @@ function getBehaviors(state) {
|
|
|
2483
2211
|
*
|
|
2484
2212
|
* @return {boolean} Whether the most recent block change was persistent.
|
|
2485
2213
|
*/
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
2214
|
function isLastBlockChangePersistent(state) {
|
|
2489
2215
|
return state.blocks.isPersistentChange;
|
|
2490
2216
|
}
|
|
2217
|
+
|
|
2491
2218
|
/**
|
|
2492
2219
|
* Returns the block list settings for an array of blocks, if any exist.
|
|
2493
2220
|
*
|
|
@@ -2497,19 +2224,18 @@ function isLastBlockChangePersistent(state) {
|
|
|
2497
2224
|
* @return {Object} An object where the keys are client ids and the values are
|
|
2498
2225
|
* a block list setting object.
|
|
2499
2226
|
*/
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
2227
|
const __experimentalGetBlockListSettingsForBlocks = (0, _rememo.default)((state, clientIds = []) => {
|
|
2503
2228
|
return clientIds.reduce((blockListSettingsForBlocks, clientId) => {
|
|
2504
2229
|
if (!state.blockListSettings[clientId]) {
|
|
2505
2230
|
return blockListSettingsForBlocks;
|
|
2506
2231
|
}
|
|
2507
|
-
|
|
2508
|
-
|
|
2232
|
+
return {
|
|
2233
|
+
...blockListSettingsForBlocks,
|
|
2509
2234
|
[clientId]: state.blockListSettings[clientId]
|
|
2510
2235
|
};
|
|
2511
2236
|
}, {});
|
|
2512
2237
|
}, state => [state.blockListSettings]);
|
|
2238
|
+
|
|
2513
2239
|
/**
|
|
2514
2240
|
* Returns the title of a given reusable block
|
|
2515
2241
|
*
|
|
@@ -2518,19 +2244,15 @@ const __experimentalGetBlockListSettingsForBlocks = (0, _rememo.default)((state,
|
|
|
2518
2244
|
*
|
|
2519
2245
|
* @return {string} The reusable block saved title.
|
|
2520
2246
|
*/
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
2247
|
exports.__experimentalGetBlockListSettingsForBlocks = __experimentalGetBlockListSettingsForBlocks;
|
|
2524
|
-
|
|
2525
2248
|
const __experimentalGetReusableBlockTitle = (0, _rememo.default)((state, ref) => {
|
|
2526
2249
|
const reusableBlock = getReusableBlocks(state).find(block => block.id === ref);
|
|
2527
|
-
|
|
2528
2250
|
if (!reusableBlock) {
|
|
2529
2251
|
return null;
|
|
2530
2252
|
}
|
|
2531
|
-
|
|
2532
2253
|
return reusableBlock.title?.raw;
|
|
2533
2254
|
}, state => [getReusableBlocks(state)]);
|
|
2255
|
+
|
|
2534
2256
|
/**
|
|
2535
2257
|
* Returns true if the most recent block change is be considered ignored, or
|
|
2536
2258
|
* false otherwise. An ignored change is one not to be committed by
|
|
@@ -2540,10 +2262,7 @@ const __experimentalGetReusableBlockTitle = (0, _rememo.default)((state, ref) =>
|
|
|
2540
2262
|
*
|
|
2541
2263
|
* @return {boolean} Whether the most recent block change was ignored.
|
|
2542
2264
|
*/
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
2265
|
exports.__experimentalGetReusableBlockTitle = __experimentalGetReusableBlockTitle;
|
|
2546
|
-
|
|
2547
2266
|
function __unstableIsLastBlockChangeIgnored(state) {
|
|
2548
2267
|
// TODO: Removal Plan: Changes incurred by RECEIVE_BLOCKS should not be
|
|
2549
2268
|
// ignored if in-fact they result in a change in blocks state. The current
|
|
@@ -2552,6 +2271,7 @@ function __unstableIsLastBlockChangeIgnored(state) {
|
|
|
2552
2271
|
// their own separate block editor / state (#7119).
|
|
2553
2272
|
return state.blocks.isIgnoredChange;
|
|
2554
2273
|
}
|
|
2274
|
+
|
|
2555
2275
|
/**
|
|
2556
2276
|
* Returns the block attributes changed as a result of the last dispatched
|
|
2557
2277
|
* action.
|
|
@@ -2561,11 +2281,10 @@ function __unstableIsLastBlockChangeIgnored(state) {
|
|
|
2561
2281
|
* @return {Object<string,Object>} Subsets of block attributes changed, keyed
|
|
2562
2282
|
* by block client ID.
|
|
2563
2283
|
*/
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
2284
|
function __experimentalGetLastBlockAttributeChanges(state) {
|
|
2567
2285
|
return state.lastBlockAttributesChange;
|
|
2568
2286
|
}
|
|
2287
|
+
|
|
2569
2288
|
/**
|
|
2570
2289
|
* Returns the available reusable blocks
|
|
2571
2290
|
*
|
|
@@ -2573,13 +2292,11 @@ function __experimentalGetLastBlockAttributeChanges(state) {
|
|
|
2573
2292
|
*
|
|
2574
2293
|
* @return {Array} Reusable blocks
|
|
2575
2294
|
*/
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
2295
|
function getReusableBlocks(state) {
|
|
2579
2296
|
var _state$settings$__exp2;
|
|
2580
|
-
|
|
2581
2297
|
return (_state$settings$__exp2 = state?.settings?.__experimentalReusableBlocks) !== null && _state$settings$__exp2 !== void 0 ? _state$settings$__exp2 : EMPTY_ARRAY;
|
|
2582
2298
|
}
|
|
2299
|
+
|
|
2583
2300
|
/**
|
|
2584
2301
|
* Returns whether the navigation mode is enabled.
|
|
2585
2302
|
*
|
|
@@ -2587,11 +2304,10 @@ function getReusableBlocks(state) {
|
|
|
2587
2304
|
*
|
|
2588
2305
|
* @return {boolean} Is navigation mode enabled.
|
|
2589
2306
|
*/
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
2307
|
function isNavigationMode(state) {
|
|
2593
2308
|
return state.editorMode === 'navigation';
|
|
2594
2309
|
}
|
|
2310
|
+
|
|
2595
2311
|
/**
|
|
2596
2312
|
* Returns the current editor mode.
|
|
2597
2313
|
*
|
|
@@ -2599,11 +2315,10 @@ function isNavigationMode(state) {
|
|
|
2599
2315
|
*
|
|
2600
2316
|
* @return {string} the editor mode.
|
|
2601
2317
|
*/
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
2318
|
function __unstableGetEditorMode(state) {
|
|
2605
2319
|
return state.editorMode;
|
|
2606
2320
|
}
|
|
2321
|
+
|
|
2607
2322
|
/**
|
|
2608
2323
|
* Returns whether block moving mode is enabled.
|
|
2609
2324
|
*
|
|
@@ -2611,11 +2326,10 @@ function __unstableGetEditorMode(state) {
|
|
|
2611
2326
|
*
|
|
2612
2327
|
* @return {string} Client Id of moving block.
|
|
2613
2328
|
*/
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
2329
|
function hasBlockMovingClientId(state) {
|
|
2617
2330
|
return state.hasBlockMovingClientId;
|
|
2618
2331
|
}
|
|
2332
|
+
|
|
2619
2333
|
/**
|
|
2620
2334
|
* Returns true if the last change was an automatic change, false otherwise.
|
|
2621
2335
|
*
|
|
@@ -2623,11 +2337,10 @@ function hasBlockMovingClientId(state) {
|
|
|
2623
2337
|
*
|
|
2624
2338
|
* @return {boolean} Whether the last change was automatic.
|
|
2625
2339
|
*/
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
2340
|
function didAutomaticChange(state) {
|
|
2629
2341
|
return !!state.automaticChangeStatus;
|
|
2630
2342
|
}
|
|
2343
|
+
|
|
2631
2344
|
/**
|
|
2632
2345
|
* Returns true if the current highlighted block matches the block clientId.
|
|
2633
2346
|
*
|
|
@@ -2636,11 +2349,10 @@ function didAutomaticChange(state) {
|
|
|
2636
2349
|
*
|
|
2637
2350
|
* @return {boolean} Whether the block is currently highlighted.
|
|
2638
2351
|
*/
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
2352
|
function isBlockHighlighted(state, clientId) {
|
|
2642
2353
|
return state.highlightedBlock === clientId;
|
|
2643
2354
|
}
|
|
2355
|
+
|
|
2644
2356
|
/**
|
|
2645
2357
|
* Checks if a given block has controlled inner blocks.
|
|
2646
2358
|
*
|
|
@@ -2649,11 +2361,10 @@ function isBlockHighlighted(state, clientId) {
|
|
|
2649
2361
|
*
|
|
2650
2362
|
* @return {boolean} True if the block has controlled inner blocks.
|
|
2651
2363
|
*/
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
2364
|
function areInnerBlocksControlled(state, clientId) {
|
|
2655
2365
|
return !!state.blocks.controlledInnerBlocks[clientId];
|
|
2656
2366
|
}
|
|
2367
|
+
|
|
2657
2368
|
/**
|
|
2658
2369
|
* Returns the clientId for the first 'active' block of a given array of block names.
|
|
2659
2370
|
* A block is 'active' if it (or a child) is the selected block.
|
|
@@ -2664,31 +2375,25 @@ function areInnerBlocksControlled(state, clientId) {
|
|
|
2664
2375
|
*
|
|
2665
2376
|
* @return {string} The matching block's clientId.
|
|
2666
2377
|
*/
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
2378
|
const __experimentalGetActiveBlockIdByBlockNames = (0, _rememo.default)((state, validBlockNames) => {
|
|
2670
2379
|
if (!validBlockNames.length) {
|
|
2671
2380
|
return null;
|
|
2672
|
-
}
|
|
2673
|
-
|
|
2674
|
-
|
|
2381
|
+
}
|
|
2382
|
+
// Check if selected block is a valid entity area.
|
|
2675
2383
|
const selectedBlockClientId = getSelectedBlockClientId(state);
|
|
2676
|
-
|
|
2677
2384
|
if (validBlockNames.includes(getBlockName(state, selectedBlockClientId))) {
|
|
2678
2385
|
return selectedBlockClientId;
|
|
2679
|
-
}
|
|
2680
|
-
|
|
2681
|
-
|
|
2386
|
+
}
|
|
2387
|
+
// Check if first selected block is a child of a valid entity area.
|
|
2682
2388
|
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state);
|
|
2683
2389
|
const entityAreaParents = getBlockParentsByBlockName(state, selectedBlockClientId || multiSelectedBlockClientIds[0], validBlockNames);
|
|
2684
|
-
|
|
2685
2390
|
if (entityAreaParents) {
|
|
2686
2391
|
// Last parent closest/most interior.
|
|
2687
2392
|
return entityAreaParents[entityAreaParents.length - 1];
|
|
2688
2393
|
}
|
|
2689
|
-
|
|
2690
2394
|
return null;
|
|
2691
2395
|
}, (state, validBlockNames) => [state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId, validBlockNames]);
|
|
2396
|
+
|
|
2692
2397
|
/**
|
|
2693
2398
|
* Tells if the block with the passed clientId was just inserted.
|
|
2694
2399
|
*
|
|
@@ -2697,16 +2402,14 @@ const __experimentalGetActiveBlockIdByBlockNames = (0, _rememo.default)((state,
|
|
|
2697
2402
|
* @param {?string} source Optional insertion source of the block.
|
|
2698
2403
|
* @return {boolean} True if the block matches the last block inserted from the specified source.
|
|
2699
2404
|
*/
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
2405
|
exports.__experimentalGetActiveBlockIdByBlockNames = __experimentalGetActiveBlockIdByBlockNames;
|
|
2703
|
-
|
|
2704
2406
|
function wasBlockJustInserted(state, clientId, source) {
|
|
2705
2407
|
const {
|
|
2706
2408
|
lastBlockInserted
|
|
2707
2409
|
} = state;
|
|
2708
2410
|
return lastBlockInserted.clientIds?.includes(clientId) && lastBlockInserted.source === source;
|
|
2709
2411
|
}
|
|
2412
|
+
|
|
2710
2413
|
/**
|
|
2711
2414
|
* Tells if the block is visible on the canvas or not.
|
|
2712
2415
|
*
|
|
@@ -2714,53 +2417,43 @@ function wasBlockJustInserted(state, clientId, source) {
|
|
|
2714
2417
|
* @param {Object} clientId Client Id of the block.
|
|
2715
2418
|
* @return {boolean} True if the block is visible.
|
|
2716
2419
|
*/
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
2420
|
function isBlockVisible(state, clientId) {
|
|
2720
2421
|
var _state$blockVisibilit;
|
|
2721
|
-
|
|
2722
2422
|
return (_state$blockVisibilit = state.blockVisibility?.[clientId]) !== null && _state$blockVisibilit !== void 0 ? _state$blockVisibilit : true;
|
|
2723
2423
|
}
|
|
2424
|
+
|
|
2724
2425
|
/**
|
|
2725
2426
|
* Returns the list of all hidden blocks.
|
|
2726
2427
|
*
|
|
2727
2428
|
* @param {Object} state Global application state.
|
|
2728
2429
|
* @return {[string]} List of hidden blocks.
|
|
2729
2430
|
*/
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
2431
|
const __unstableGetVisibleBlocks = (0, _rememo.default)(state => {
|
|
2733
2432
|
const visibleBlocks = new Set(Object.keys(state.blockVisibility).filter(key => state.blockVisibility[key]));
|
|
2734
|
-
|
|
2735
2433
|
if (visibleBlocks.size === 0) {
|
|
2736
2434
|
return EMPTY_SET;
|
|
2737
2435
|
}
|
|
2738
|
-
|
|
2739
2436
|
return visibleBlocks;
|
|
2740
2437
|
}, state => [state.blockVisibility]);
|
|
2438
|
+
|
|
2741
2439
|
/**
|
|
2742
2440
|
* DO-NOT-USE in production.
|
|
2743
2441
|
* This selector is created for internal/experimental only usage and may be
|
|
2744
2442
|
* removed anytime without any warning, causing breakage on any plugin or theme invoking it.
|
|
2745
2443
|
*/
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
2444
|
exports.__unstableGetVisibleBlocks = __unstableGetVisibleBlocks;
|
|
2749
|
-
|
|
2750
2445
|
const __unstableGetContentLockingParent = (0, _rememo.default)((state, clientId) => {
|
|
2751
2446
|
let current = clientId;
|
|
2752
2447
|
let result;
|
|
2753
|
-
|
|
2754
2448
|
while (state.blocks.parents.has(current)) {
|
|
2755
2449
|
current = state.blocks.parents.get(current);
|
|
2756
|
-
|
|
2757
2450
|
if (current && getTemplateLock(state, current) === 'contentOnly') {
|
|
2758
2451
|
result = current;
|
|
2759
2452
|
}
|
|
2760
2453
|
}
|
|
2761
|
-
|
|
2762
2454
|
return result;
|
|
2763
2455
|
}, state => [state.blocks.parents, state.blockListSettings]);
|
|
2456
|
+
|
|
2764
2457
|
/**
|
|
2765
2458
|
* DO-NOT-USE in production.
|
|
2766
2459
|
* This selector is created for internal/experimental only usage and may be
|
|
@@ -2768,56 +2461,98 @@ const __unstableGetContentLockingParent = (0, _rememo.default)((state, clientId)
|
|
|
2768
2461
|
*
|
|
2769
2462
|
* @param {Object} state Global application state.
|
|
2770
2463
|
*/
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
2464
|
exports.__unstableGetContentLockingParent = __unstableGetContentLockingParent;
|
|
2774
|
-
|
|
2775
2465
|
function __unstableGetTemporarilyEditingAsBlocks(state) {
|
|
2776
2466
|
return state.temporarilyEditingAsBlocks;
|
|
2777
2467
|
}
|
|
2778
|
-
|
|
2779
2468
|
function __unstableHasActiveBlockOverlayActive(state, clientId) {
|
|
2780
2469
|
// Prevent overlay on blocks with a non-default editing mode. If the mdoe is
|
|
2781
2470
|
// 'disabled' then the overlay is redundant since the block can't be
|
|
2782
2471
|
// selected. If the mode is 'contentOnly' then the overlay is redundant
|
|
2783
2472
|
// since there will be no controls to interact with once selected.
|
|
2784
|
-
if (
|
|
2473
|
+
if (getBlockEditingMode(state, clientId) !== 'default') {
|
|
2785
2474
|
return false;
|
|
2786
|
-
}
|
|
2787
|
-
|
|
2475
|
+
}
|
|
2788
2476
|
|
|
2477
|
+
// If the block editing is locked, the block overlay is always active.
|
|
2789
2478
|
if (!canEditBlock(state, clientId)) {
|
|
2790
2479
|
return true;
|
|
2791
2480
|
}
|
|
2481
|
+
const editorMode = __unstableGetEditorMode(state);
|
|
2792
2482
|
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2483
|
+
// In zoom-out mode, the block overlay is always active for top level blocks.
|
|
2796
2484
|
if (editorMode === 'zoom-out' && clientId && !getBlockRootClientId(state, clientId)) {
|
|
2797
2485
|
return true;
|
|
2798
|
-
}
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
// In navigation mode, the block overlay is active when the block is not
|
|
2799
2489
|
// selected (and doesn't contain a selected child). The same behavior is
|
|
2800
2490
|
// also enabled in all modes for blocks that have controlled children
|
|
2801
2491
|
// (reusable block, template part, navigation), unless explicitly disabled
|
|
2802
2492
|
// with `supports.__experimentalDisableBlockOverlay`.
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
2493
|
const blockSupportDisable = (0, _blocks.hasBlockSupport)(getBlockName(state, clientId), '__experimentalDisableBlockOverlay', false);
|
|
2806
2494
|
const shouldEnableIfUnselected = editorMode === 'navigation' || (blockSupportDisable ? false : areInnerBlocksControlled(state, clientId));
|
|
2807
2495
|
return shouldEnableIfUnselected && !isBlockSelected(state, clientId) && !hasSelectedInnerBlock(state, clientId, true);
|
|
2808
2496
|
}
|
|
2809
|
-
|
|
2810
2497
|
function __unstableIsWithinBlockOverlay(state, clientId) {
|
|
2811
2498
|
let parent = state.blocks.parents.get(clientId);
|
|
2812
|
-
|
|
2813
2499
|
while (!!parent) {
|
|
2814
2500
|
if (__unstableHasActiveBlockOverlayActive(state, parent)) {
|
|
2815
2501
|
return true;
|
|
2816
2502
|
}
|
|
2817
|
-
|
|
2818
2503
|
parent = state.blocks.parents.get(parent);
|
|
2819
2504
|
}
|
|
2820
|
-
|
|
2821
2505
|
return false;
|
|
2822
2506
|
}
|
|
2507
|
+
|
|
2508
|
+
/**
|
|
2509
|
+
* @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode
|
|
2510
|
+
*/
|
|
2511
|
+
|
|
2512
|
+
/**
|
|
2513
|
+
* Returns the block editing mode for a given block.
|
|
2514
|
+
*
|
|
2515
|
+
* The mode can be one of three options:
|
|
2516
|
+
*
|
|
2517
|
+
* - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be
|
|
2518
|
+
* selected.
|
|
2519
|
+
* - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the
|
|
2520
|
+
* toolbar, the block movers, block settings.
|
|
2521
|
+
* - `'default'`: Allows editing the block as normal.
|
|
2522
|
+
*
|
|
2523
|
+
* Blocks can set a mode using the `useBlockEditingMode` hook.
|
|
2524
|
+
*
|
|
2525
|
+
* The mode is inherited by all of the block's inner blocks, unless they have
|
|
2526
|
+
* their own mode.
|
|
2527
|
+
*
|
|
2528
|
+
* A template lock can also set a mode. If the template lock is `'contentOnly'`,
|
|
2529
|
+
* the block's mode is overridden to `'contentOnly'` if the block has a content
|
|
2530
|
+
* role attribute, or `'disabled'` otherwise.
|
|
2531
|
+
*
|
|
2532
|
+
* @see useBlockEditingMode
|
|
2533
|
+
*
|
|
2534
|
+
* @param {Object} state Global application state.
|
|
2535
|
+
* @param {string} clientId The block client ID, or `''` for the root container.
|
|
2536
|
+
*
|
|
2537
|
+
* @return {BlockEditingMode} The block editing mode. One of `'disabled'`,
|
|
2538
|
+
* `'contentOnly'`, or `'default'`.
|
|
2539
|
+
*/
|
|
2540
|
+
const getBlockEditingMode = (0, _data.createRegistrySelector)(select => (state, clientId = '') => {
|
|
2541
|
+
if (state.blockEditingModes.has(clientId)) {
|
|
2542
|
+
return state.blockEditingModes.get(clientId);
|
|
2543
|
+
}
|
|
2544
|
+
if (!clientId) {
|
|
2545
|
+
return 'default';
|
|
2546
|
+
}
|
|
2547
|
+
const rootClientId = getBlockRootClientId(state, clientId);
|
|
2548
|
+
const templateLock = getTemplateLock(state, rootClientId);
|
|
2549
|
+
if (templateLock === 'contentOnly') {
|
|
2550
|
+
const name = getBlockName(state, clientId);
|
|
2551
|
+
const isContent = select(_blocks.store).__experimentalHasContentRoleAttribute(name);
|
|
2552
|
+
return isContent ? 'contentOnly' : 'disabled';
|
|
2553
|
+
}
|
|
2554
|
+
const parentMode = getBlockEditingMode(state, rootClientId);
|
|
2555
|
+
return parentMode === 'contentOnly' ? 'default' : parentMode;
|
|
2556
|
+
});
|
|
2557
|
+
exports.getBlockEditingMode = getBlockEditingMode;
|
|
2823
2558
|
//# sourceMappingURL=selectors.js.map
|