@wordpress/block-editor 12.7.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 +2 -0
- package/README.md +42 -0
- package/build/autocompleters/block.js +3 -22
- 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 +2 -11
- 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 +38 -81
- 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 +9 -28
- 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 +5 -22
- 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 +9 -18
- 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 +14 -37
- 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 +6 -30
- 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 +4 -25
- 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 +51 -26
- 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 +1 -16
- 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 +3 -15
- 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 +41 -40
- 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 +3 -5
- package/build/components/global-styles/behaviors-panel.js.map +1 -1
- 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 +41 -90
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +0 -16
- 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 +6 -14
- 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 +11 -48
- 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 +0 -6
- 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 +1 -3
- 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 +4 -12
- 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 +3 -17
- 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 +1 -16
- 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 +42 -56
- 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 +10 -18
- 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 +33 -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 +1 -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 +3 -10
- 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 +2 -21
- 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 +34 -66
- 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 +12 -23
- package/build/hooks/behaviors.js.map +1 -1
- package/build/hooks/border.js +45 -79
- 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 +29 -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 +2 -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 +187 -285
- 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 +255 -453
- 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 +3 -13
- 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 +4 -7
- 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 +41 -64
- 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 +10 -15
- 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 +7 -13
- 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 +11 -11
- 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 +14 -23
- 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 +7 -13
- 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 +4 -22
- 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 +52 -16
- 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 +2 -7
- 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 +4 -10
- 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 +41 -37
- 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 +2 -2
- package/build-module/components/global-styles/behaviors-panel.js.map +1 -1
- 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 +42 -72
- package/build-module/components/global-styles/hooks.js.map +1 -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 +8 -14
- 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 +13 -43
- 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 +2 -3
- 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.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 +4 -6
- 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 +3 -8
- 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 +2 -9
- 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 +44 -40
- 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 +11 -10
- 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 +35 -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 +3 -4
- 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 +3 -7
- 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 +4 -18
- 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 +33 -50
- 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 +12 -16
- package/build-module/hooks/behaviors.js.map +1 -1
- package/build-module/hooks/border.js +46 -64
- 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 +30 -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 +3 -4
- 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 +188 -196
- 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 +253 -331
- 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 +52 -6
- package/build-style/style.css +52 -6
- package/package.json +33 -32
- 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-editing-mode/index.js +3 -7
- 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 +1 -2
- package/src/components/block-list/index.native.js +14 -14
- package/src/components/block-list/test/block-invalid-warning.native.js +7 -0
- 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-parent-selector/index.js +1 -2
- package/src/components/block-preview/index.js +0 -1
- package/src/components/block-toolbar/index.js +1 -2
- package/src/components/block-toolbar/style.scss +10 -0
- package/src/components/block-tools/block-contextual-toolbar.js +87 -9
- package/src/components/block-tools/style.scss +34 -10
- 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/global-styles/test/typography-utils.js +55 -0
- package/src/components/global-styles/typography-utils.js +12 -3
- package/src/components/global-styles/use-global-styles-output.js +1 -2
- package/src/components/iframe/index.js +1 -0
- package/src/components/index.js +7 -0
- package/src/components/inserter/hooks/use-patterns-state.js +1 -1
- package/src/components/inserter/menu.js +1 -0
- package/src/components/inserter/preview-panel.js +15 -11
- 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/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/index.js +27 -7
- package/src/components/link-control/link-preview.js +4 -0
- package/src/components/link-control/style.scss +9 -0
- package/src/components/link-control/test/index.js +63 -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-images.js +79 -0
- 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/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/custom-fields.js +139 -0
- package/src/hooks/index.js +1 -0
- package/src/hooks/layout.js +13 -4
- package/src/private-apis.js +0 -2
- package/src/store/actions.js +49 -2
- package/src/store/private-actions.js +0 -39
- package/src/store/private-selectors.js +1 -67
- package/src/store/selectors.js +64 -2
- 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 +203 -1
- 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
|
@@ -2,23 +2,24 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import createSelector from 'rememo';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* WordPress dependencies
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
-
import { getBlockType, getBlockTypes, getBlockVariations, hasBlockSupport, getPossibleBlockTransformations, parse, switchToBlockType } from '@wordpress/blocks';
|
|
9
|
+
import { getBlockType, getBlockTypes, getBlockVariations, hasBlockSupport, getPossibleBlockTransformations, parse, switchToBlockType, store as blocksStore } from '@wordpress/blocks';
|
|
10
10
|
import { Platform } from '@wordpress/element';
|
|
11
11
|
import { applyFilters } from '@wordpress/hooks';
|
|
12
12
|
import { symbol } from '@wordpress/icons';
|
|
13
13
|
import { create, remove, toHTMLString } from '@wordpress/rich-text';
|
|
14
14
|
import deprecated from '@wordpress/deprecated';
|
|
15
|
+
import { createRegistrySelector } from '@wordpress/data';
|
|
16
|
+
|
|
15
17
|
/**
|
|
16
18
|
* Internal dependencies
|
|
17
19
|
*/
|
|
18
|
-
|
|
19
20
|
import { mapRichTextSettings } from './utils';
|
|
20
21
|
import { orderBy } from '../utils/sorting';
|
|
21
|
-
|
|
22
|
+
|
|
22
23
|
/**
|
|
23
24
|
* A block selection object.
|
|
24
25
|
*
|
|
@@ -29,11 +30,12 @@ import { getBlockEditingMode } from './private-selectors';
|
|
|
29
30
|
* @property {number} offset An attribute value offset, based on the rich
|
|
30
31
|
* text value. See `wp.richText.create`.
|
|
31
32
|
*/
|
|
32
|
-
// Module constants.
|
|
33
33
|
|
|
34
|
+
// Module constants.
|
|
34
35
|
const MILLISECONDS_PER_HOUR = 3600 * 1000;
|
|
35
36
|
const MILLISECONDS_PER_DAY = 24 * 3600 * 1000;
|
|
36
37
|
const MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000;
|
|
38
|
+
|
|
37
39
|
/**
|
|
38
40
|
* Shared reference to an empty array for cases where it is important to avoid
|
|
39
41
|
* returning a new array reference on every invocation, as in a connected or
|
|
@@ -43,8 +45,8 @@ const MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000;
|
|
|
43
45
|
*
|
|
44
46
|
* @type {Array}
|
|
45
47
|
*/
|
|
46
|
-
|
|
47
48
|
const EMPTY_ARRAY = [];
|
|
49
|
+
|
|
48
50
|
/**
|
|
49
51
|
* Shared reference to an empty Set for cases where it is important to avoid
|
|
50
52
|
* returning a new Set reference on every invocation, as in a connected or
|
|
@@ -54,8 +56,8 @@ const EMPTY_ARRAY = [];
|
|
|
54
56
|
*
|
|
55
57
|
* @type {Set}
|
|
56
58
|
*/
|
|
57
|
-
|
|
58
59
|
const EMPTY_SET = new Set();
|
|
60
|
+
|
|
59
61
|
/**
|
|
60
62
|
* Returns a block's name given its client ID, or null if no block exists with
|
|
61
63
|
* the client ID.
|
|
@@ -65,11 +67,9 @@ const EMPTY_SET = new Set();
|
|
|
65
67
|
*
|
|
66
68
|
* @return {string} Block name.
|
|
67
69
|
*/
|
|
68
|
-
|
|
69
70
|
export function getBlockName(state, clientId) {
|
|
70
71
|
const block = state.blocks.byClientId.get(clientId);
|
|
71
72
|
const socialLinkName = 'core/social-link';
|
|
72
|
-
|
|
73
73
|
if (Platform.OS !== 'web' && block?.name === socialLinkName) {
|
|
74
74
|
const attributes = state.blocks.attributes.get(clientId);
|
|
75
75
|
const {
|
|
@@ -77,9 +77,9 @@ export function getBlockName(state, clientId) {
|
|
|
77
77
|
} = attributes !== null && attributes !== void 0 ? attributes : {};
|
|
78
78
|
return service ? `${socialLinkName}-${service}` : socialLinkName;
|
|
79
79
|
}
|
|
80
|
-
|
|
81
80
|
return block ? block.name : null;
|
|
82
81
|
}
|
|
82
|
+
|
|
83
83
|
/**
|
|
84
84
|
* Returns whether a block is valid or not.
|
|
85
85
|
*
|
|
@@ -88,11 +88,11 @@ export function getBlockName(state, clientId) {
|
|
|
88
88
|
*
|
|
89
89
|
* @return {boolean} Is Valid.
|
|
90
90
|
*/
|
|
91
|
-
|
|
92
91
|
export function isBlockValid(state, clientId) {
|
|
93
92
|
const block = state.blocks.byClientId.get(clientId);
|
|
94
93
|
return !!block && block.isValid;
|
|
95
94
|
}
|
|
95
|
+
|
|
96
96
|
/**
|
|
97
97
|
* Returns a block's attributes given its client ID, or null if no block exists with
|
|
98
98
|
* the client ID.
|
|
@@ -102,16 +102,14 @@ export function isBlockValid(state, clientId) {
|
|
|
102
102
|
*
|
|
103
103
|
* @return {Object?} Block attributes.
|
|
104
104
|
*/
|
|
105
|
-
|
|
106
105
|
export function getBlockAttributes(state, clientId) {
|
|
107
106
|
const block = state.blocks.byClientId.get(clientId);
|
|
108
|
-
|
|
109
107
|
if (!block) {
|
|
110
108
|
return null;
|
|
111
109
|
}
|
|
112
|
-
|
|
113
110
|
return state.blocks.attributes.get(clientId);
|
|
114
111
|
}
|
|
112
|
+
|
|
115
113
|
/**
|
|
116
114
|
* Returns a block given its client ID. This is a parsed copy of the block,
|
|
117
115
|
* containing its `blockName`, `clientId`, and current `attributes` state. This
|
|
@@ -133,23 +131,22 @@ export function getBlockAttributes(state, clientId) {
|
|
|
133
131
|
*
|
|
134
132
|
* @return {Object} Parsed block object.
|
|
135
133
|
*/
|
|
136
|
-
|
|
137
134
|
export function getBlock(state, clientId) {
|
|
138
135
|
if (!state.blocks.byClientId.has(clientId)) {
|
|
139
136
|
return null;
|
|
140
137
|
}
|
|
141
|
-
|
|
142
138
|
return state.blocks.tree.get(clientId);
|
|
143
139
|
}
|
|
144
140
|
export const __unstableGetBlockWithoutInnerBlocks = createSelector((state, clientId) => {
|
|
145
141
|
if (!state.blocks.byClientId.has(clientId)) {
|
|
146
142
|
return null;
|
|
147
143
|
}
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
return {
|
|
145
|
+
...state.blocks.byClientId.get(clientId),
|
|
150
146
|
attributes: getBlockAttributes(state, clientId)
|
|
151
147
|
};
|
|
152
148
|
}, (state, clientId) => [state.blocks.byClientId.get(clientId), state.blocks.attributes.get(clientId)]);
|
|
149
|
+
|
|
153
150
|
/**
|
|
154
151
|
* Returns all block objects for the current post being edited as an array in
|
|
155
152
|
* the order they appear in the post. Note that this will exclude child blocks
|
|
@@ -160,11 +157,11 @@ export const __unstableGetBlockWithoutInnerBlocks = createSelector((state, clien
|
|
|
160
157
|
*
|
|
161
158
|
* @return {Object[]} Post blocks.
|
|
162
159
|
*/
|
|
163
|
-
|
|
164
160
|
export function getBlocks(state, rootClientId) {
|
|
165
161
|
const treeKey = !rootClientId || !areInnerBlocksControlled(state, rootClientId) ? rootClientId || '' : 'controlled||' + rootClientId;
|
|
166
162
|
return state.blocks.tree.get(treeKey)?.innerBlocks || EMPTY_ARRAY;
|
|
167
163
|
}
|
|
164
|
+
|
|
168
165
|
/**
|
|
169
166
|
* Returns a stripped down block object containing only its client ID,
|
|
170
167
|
* and its inner blocks' client IDs.
|
|
@@ -176,7 +173,6 @@ export function getBlocks(state, rootClientId) {
|
|
|
176
173
|
*
|
|
177
174
|
* @return {Object} Client IDs of the post blocks.
|
|
178
175
|
*/
|
|
179
|
-
|
|
180
176
|
export const __unstableGetClientIdWithClientIdsTree = createSelector((state, clientId) => {
|
|
181
177
|
deprecated("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree", {
|
|
182
178
|
since: '6.3',
|
|
@@ -187,6 +183,7 @@ export const __unstableGetClientIdWithClientIdsTree = createSelector((state, cli
|
|
|
187
183
|
innerBlocks: __unstableGetClientIdsTree(state, clientId)
|
|
188
184
|
};
|
|
189
185
|
}, state => [state.blocks.order]);
|
|
186
|
+
|
|
190
187
|
/**
|
|
191
188
|
* Returns the block tree represented in the block-editor store from the
|
|
192
189
|
* given root, consisting of stripped down block objects containing only
|
|
@@ -199,7 +196,6 @@ export const __unstableGetClientIdWithClientIdsTree = createSelector((state, cli
|
|
|
199
196
|
*
|
|
200
197
|
* @return {Object[]} Client IDs of the post blocks.
|
|
201
198
|
*/
|
|
202
|
-
|
|
203
199
|
export const __unstableGetClientIdsTree = createSelector((state, rootClientId = '') => {
|
|
204
200
|
deprecated("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree", {
|
|
205
201
|
since: '6.3',
|
|
@@ -207,6 +203,7 @@ export const __unstableGetClientIdsTree = createSelector((state, rootClientId =
|
|
|
207
203
|
});
|
|
208
204
|
return getBlockOrder(state, rootClientId).map(clientId => __unstableGetClientIdWithClientIdsTree(state, clientId));
|
|
209
205
|
}, state => [state.blocks.order]);
|
|
206
|
+
|
|
210
207
|
/**
|
|
211
208
|
* Returns an array containing the clientIds of all descendants of the blocks
|
|
212
209
|
* given. Returned ids are ordered first by the order of the ids given, then
|
|
@@ -217,18 +214,16 @@ export const __unstableGetClientIdsTree = createSelector((state, rootClientId =
|
|
|
217
214
|
*
|
|
218
215
|
* @return {Array} ids of descendants.
|
|
219
216
|
*/
|
|
220
|
-
|
|
221
217
|
export const getClientIdsOfDescendants = createSelector((state, clientIds) => {
|
|
222
218
|
const collectedIds = [];
|
|
223
|
-
|
|
224
219
|
for (const givenId of clientIds) {
|
|
225
220
|
for (const descendantId of getBlockOrder(state, givenId)) {
|
|
226
221
|
collectedIds.push(descendantId, ...getClientIdsOfDescendants(state, [descendantId]));
|
|
227
222
|
}
|
|
228
223
|
}
|
|
229
|
-
|
|
230
224
|
return collectedIds;
|
|
231
225
|
}, state => [state.blocks.order]);
|
|
226
|
+
|
|
232
227
|
/**
|
|
233
228
|
* Returns an array containing the clientIds of the top-level blocks and
|
|
234
229
|
* their descendants of any depth (for nested blocks). Ids are returned
|
|
@@ -238,16 +233,14 @@ export const getClientIdsOfDescendants = createSelector((state, clientIds) => {
|
|
|
238
233
|
*
|
|
239
234
|
* @return {Array} ids of top-level and descendant blocks.
|
|
240
235
|
*/
|
|
241
|
-
|
|
242
236
|
export const getClientIdsWithDescendants = createSelector(state => {
|
|
243
237
|
const collectedIds = [];
|
|
244
|
-
|
|
245
238
|
for (const topLevelId of getBlockOrder(state)) {
|
|
246
239
|
collectedIds.push(topLevelId, ...getClientIdsOfDescendants(state, [topLevelId]));
|
|
247
240
|
}
|
|
248
|
-
|
|
249
241
|
return collectedIds;
|
|
250
242
|
}, state => [state.blocks.order]);
|
|
243
|
+
|
|
251
244
|
/**
|
|
252
245
|
* Returns the total number of blocks, or the total number of blocks with a specific name in a post.
|
|
253
246
|
* The number returned includes nested blocks.
|
|
@@ -257,19 +250,17 @@ export const getClientIdsWithDescendants = createSelector(state => {
|
|
|
257
250
|
*
|
|
258
251
|
* @return {number} Number of blocks in the post, or number of blocks with name equal to blockName.
|
|
259
252
|
*/
|
|
260
|
-
|
|
261
253
|
export const getGlobalBlockCount = createSelector((state, blockName) => {
|
|
262
254
|
const clientIds = getClientIdsWithDescendants(state);
|
|
263
|
-
|
|
264
255
|
if (!blockName) {
|
|
265
256
|
return clientIds.length;
|
|
266
257
|
}
|
|
267
|
-
|
|
268
258
|
return clientIds.reduce((accumulator, clientId) => {
|
|
269
259
|
const block = state.blocks.byClientId.get(clientId);
|
|
270
260
|
return block.name === blockName ? accumulator + 1 : accumulator;
|
|
271
261
|
}, 0);
|
|
272
262
|
}, state => [state.blocks.order, state.blocks.byClientId]);
|
|
263
|
+
|
|
273
264
|
/**
|
|
274
265
|
* Returns all global blocks that match a blockName. Results include nested blocks.
|
|
275
266
|
*
|
|
@@ -278,12 +269,10 @@ export const getGlobalBlockCount = createSelector((state, blockName) => {
|
|
|
278
269
|
*
|
|
279
270
|
* @return {Array} Array of clientIds of blocks with name equal to blockName.
|
|
280
271
|
*/
|
|
281
|
-
|
|
282
272
|
export const __experimentalGetGlobalBlocksByName = createSelector((state, blockName) => {
|
|
283
273
|
if (!blockName) {
|
|
284
274
|
return EMPTY_ARRAY;
|
|
285
275
|
}
|
|
286
|
-
|
|
287
276
|
const blockNames = Array.isArray(blockName) ? blockName : [blockName];
|
|
288
277
|
const clientIds = getClientIdsWithDescendants(state);
|
|
289
278
|
const foundBlocks = clientIds.filter(clientId => {
|
|
@@ -292,6 +281,7 @@ export const __experimentalGetGlobalBlocksByName = createSelector((state, blockN
|
|
|
292
281
|
});
|
|
293
282
|
return foundBlocks.length > 0 ? foundBlocks : EMPTY_ARRAY;
|
|
294
283
|
}, state => [state.blocks.order, state.blocks.byClientId]);
|
|
284
|
+
|
|
295
285
|
/**
|
|
296
286
|
* Given an array of block client IDs, returns the corresponding array of block
|
|
297
287
|
* objects.
|
|
@@ -301,8 +291,8 @@ export const __experimentalGetGlobalBlocksByName = createSelector((state, blockN
|
|
|
301
291
|
*
|
|
302
292
|
* @return {WPBlock[]} Block objects.
|
|
303
293
|
*/
|
|
304
|
-
|
|
305
294
|
export const getBlocksByClientId = createSelector((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)));
|
|
295
|
+
|
|
306
296
|
/**
|
|
307
297
|
* Given an array of block client IDs, returns the corresponding array of block
|
|
308
298
|
* names.
|
|
@@ -312,8 +302,8 @@ export const getBlocksByClientId = createSelector((state, clientIds) => (Array.i
|
|
|
312
302
|
*
|
|
313
303
|
* @return {string[]} Block names.
|
|
314
304
|
*/
|
|
315
|
-
|
|
316
305
|
export const getBlockNamesByClientId = createSelector((state, clientIds) => getBlocksByClientId(state, clientIds).filter(Boolean).map(block => block.name), (state, clientIds) => getBlocksByClientId(state, clientIds));
|
|
306
|
+
|
|
317
307
|
/**
|
|
318
308
|
* Returns the number of blocks currently present in the post.
|
|
319
309
|
*
|
|
@@ -322,10 +312,10 @@ export const getBlockNamesByClientId = createSelector((state, clientIds) => getB
|
|
|
322
312
|
*
|
|
323
313
|
* @return {number} Number of blocks in the post.
|
|
324
314
|
*/
|
|
325
|
-
|
|
326
315
|
export function getBlockCount(state, rootClientId) {
|
|
327
316
|
return getBlockOrder(state, rootClientId).length;
|
|
328
317
|
}
|
|
318
|
+
|
|
329
319
|
/**
|
|
330
320
|
* Returns the current selection start block client ID, attribute key and text
|
|
331
321
|
* offset.
|
|
@@ -334,10 +324,10 @@ export function getBlockCount(state, rootClientId) {
|
|
|
334
324
|
*
|
|
335
325
|
* @return {WPBlockSelection} Selection start information.
|
|
336
326
|
*/
|
|
337
|
-
|
|
338
327
|
export function getSelectionStart(state) {
|
|
339
328
|
return state.selection.selectionStart;
|
|
340
329
|
}
|
|
330
|
+
|
|
341
331
|
/**
|
|
342
332
|
* Returns the current selection end block client ID, attribute key and text
|
|
343
333
|
* offset.
|
|
@@ -346,10 +336,10 @@ export function getSelectionStart(state) {
|
|
|
346
336
|
*
|
|
347
337
|
* @return {WPBlockSelection} Selection end information.
|
|
348
338
|
*/
|
|
349
|
-
|
|
350
339
|
export function getSelectionEnd(state) {
|
|
351
340
|
return state.selection.selectionEnd;
|
|
352
341
|
}
|
|
342
|
+
|
|
353
343
|
/**
|
|
354
344
|
* Returns the current block selection start. This value may be null, and it
|
|
355
345
|
* may represent either a singular block selection or multi-selection start.
|
|
@@ -359,10 +349,10 @@ export function getSelectionEnd(state) {
|
|
|
359
349
|
*
|
|
360
350
|
* @return {?string} Client ID of block selection start.
|
|
361
351
|
*/
|
|
362
|
-
|
|
363
352
|
export function getBlockSelectionStart(state) {
|
|
364
353
|
return state.selection.selectionStart.clientId;
|
|
365
354
|
}
|
|
355
|
+
|
|
366
356
|
/**
|
|
367
357
|
* Returns the current block selection end. This value may be null, and it
|
|
368
358
|
* may represent either a singular block selection or multi-selection end.
|
|
@@ -372,10 +362,10 @@ export function getBlockSelectionStart(state) {
|
|
|
372
362
|
*
|
|
373
363
|
* @return {?string} Client ID of block selection end.
|
|
374
364
|
*/
|
|
375
|
-
|
|
376
365
|
export function getBlockSelectionEnd(state) {
|
|
377
366
|
return state.selection.selectionEnd.clientId;
|
|
378
367
|
}
|
|
368
|
+
|
|
379
369
|
/**
|
|
380
370
|
* Returns the number of blocks currently selected in the post.
|
|
381
371
|
*
|
|
@@ -383,16 +373,14 @@ export function getBlockSelectionEnd(state) {
|
|
|
383
373
|
*
|
|
384
374
|
* @return {number} Number of blocks selected in the post.
|
|
385
375
|
*/
|
|
386
|
-
|
|
387
376
|
export function getSelectedBlockCount(state) {
|
|
388
377
|
const multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length;
|
|
389
|
-
|
|
390
378
|
if (multiSelectedBlockCount) {
|
|
391
379
|
return multiSelectedBlockCount;
|
|
392
380
|
}
|
|
393
|
-
|
|
394
381
|
return state.selection.selectionStart.clientId ? 1 : 0;
|
|
395
382
|
}
|
|
383
|
+
|
|
396
384
|
/**
|
|
397
385
|
* Returns true if there is a single selected block, or false otherwise.
|
|
398
386
|
*
|
|
@@ -400,7 +388,6 @@ export function getSelectedBlockCount(state) {
|
|
|
400
388
|
*
|
|
401
389
|
* @return {boolean} Whether a single block is selected.
|
|
402
390
|
*/
|
|
403
|
-
|
|
404
391
|
export function hasSelectedBlock(state) {
|
|
405
392
|
const {
|
|
406
393
|
selectionStart,
|
|
@@ -408,6 +395,7 @@ export function hasSelectedBlock(state) {
|
|
|
408
395
|
} = state.selection;
|
|
409
396
|
return !!selectionStart.clientId && selectionStart.clientId === selectionEnd.clientId;
|
|
410
397
|
}
|
|
398
|
+
|
|
411
399
|
/**
|
|
412
400
|
* Returns the currently selected block client ID, or null if there is no
|
|
413
401
|
* selected block.
|
|
@@ -416,7 +404,6 @@ export function hasSelectedBlock(state) {
|
|
|
416
404
|
*
|
|
417
405
|
* @return {?string} Selected block client ID.
|
|
418
406
|
*/
|
|
419
|
-
|
|
420
407
|
export function getSelectedBlockClientId(state) {
|
|
421
408
|
const {
|
|
422
409
|
selectionStart,
|
|
@@ -425,13 +412,12 @@ export function getSelectedBlockClientId(state) {
|
|
|
425
412
|
const {
|
|
426
413
|
clientId
|
|
427
414
|
} = selectionStart;
|
|
428
|
-
|
|
429
415
|
if (!clientId || clientId !== selectionEnd.clientId) {
|
|
430
416
|
return null;
|
|
431
417
|
}
|
|
432
|
-
|
|
433
418
|
return clientId;
|
|
434
419
|
}
|
|
420
|
+
|
|
435
421
|
/**
|
|
436
422
|
* Returns the currently selected block, or null if there is no selected block.
|
|
437
423
|
*
|
|
@@ -439,11 +425,11 @@ export function getSelectedBlockClientId(state) {
|
|
|
439
425
|
*
|
|
440
426
|
* @return {?Object} Selected block.
|
|
441
427
|
*/
|
|
442
|
-
|
|
443
428
|
export function getSelectedBlock(state) {
|
|
444
429
|
const clientId = getSelectedBlockClientId(state);
|
|
445
430
|
return clientId ? getBlock(state, clientId) : null;
|
|
446
431
|
}
|
|
432
|
+
|
|
447
433
|
/**
|
|
448
434
|
* Given a block client ID, returns the root block from which the block is
|
|
449
435
|
* nested, an empty string for top-level blocks, or null if the block does not
|
|
@@ -454,10 +440,10 @@ export function getSelectedBlock(state) {
|
|
|
454
440
|
*
|
|
455
441
|
* @return {?string} Root client ID, if exists
|
|
456
442
|
*/
|
|
457
|
-
|
|
458
443
|
export function getBlockRootClientId(state, clientId) {
|
|
459
444
|
return state.blocks.parents.has(clientId) ? state.blocks.parents.get(clientId) : null;
|
|
460
445
|
}
|
|
446
|
+
|
|
461
447
|
/**
|
|
462
448
|
* Given a block client ID, returns the list of all its parents from top to bottom.
|
|
463
449
|
*
|
|
@@ -467,22 +453,19 @@ export function getBlockRootClientId(state, clientId) {
|
|
|
467
453
|
*
|
|
468
454
|
* @return {Array} ClientIDs of the parent blocks.
|
|
469
455
|
*/
|
|
470
|
-
|
|
471
456
|
export const getBlockParents = createSelector((state, clientId, ascending = false) => {
|
|
472
457
|
const parents = [];
|
|
473
458
|
let current = clientId;
|
|
474
|
-
|
|
475
459
|
while (!!state.blocks.parents.get(current)) {
|
|
476
460
|
current = state.blocks.parents.get(current);
|
|
477
461
|
parents.push(current);
|
|
478
462
|
}
|
|
479
|
-
|
|
480
463
|
if (!parents.length) {
|
|
481
464
|
return EMPTY_ARRAY;
|
|
482
465
|
}
|
|
483
|
-
|
|
484
466
|
return ascending ? parents : parents.reverse();
|
|
485
467
|
}, state => [state.blocks.parents]);
|
|
468
|
+
|
|
486
469
|
/**
|
|
487
470
|
* Given a block client ID and a block name, returns the list of all its parents
|
|
488
471
|
* from top to bottom, filtered by the given name(s). For example, if passed
|
|
@@ -497,7 +480,6 @@ export const getBlockParents = createSelector((state, clientId, ascending = fals
|
|
|
497
480
|
*
|
|
498
481
|
* @return {Array} ClientIDs of the parent blocks.
|
|
499
482
|
*/
|
|
500
|
-
|
|
501
483
|
export const getBlockParentsByBlockName = createSelector((state, clientId, blockName, ascending = false) => {
|
|
502
484
|
const parents = getBlockParents(state, clientId, ascending);
|
|
503
485
|
const hasName = Array.isArray(blockName) ? name => blockName.includes(name) : name => blockName === name;
|
|
@@ -511,18 +493,16 @@ export const getBlockParentsByBlockName = createSelector((state, clientId, block
|
|
|
511
493
|
*
|
|
512
494
|
* @return {string} Root client ID
|
|
513
495
|
*/
|
|
514
|
-
|
|
515
496
|
export function getBlockHierarchyRootClientId(state, clientId) {
|
|
516
497
|
let current = clientId;
|
|
517
498
|
let parent;
|
|
518
|
-
|
|
519
499
|
do {
|
|
520
500
|
parent = current;
|
|
521
501
|
current = state.blocks.parents.get(current);
|
|
522
502
|
} while (current);
|
|
523
|
-
|
|
524
503
|
return parent;
|
|
525
504
|
}
|
|
505
|
+
|
|
526
506
|
/**
|
|
527
507
|
* Given a block client ID, returns the lowest common ancestor with selected client ID.
|
|
528
508
|
*
|
|
@@ -531,14 +511,12 @@ export function getBlockHierarchyRootClientId(state, clientId) {
|
|
|
531
511
|
*
|
|
532
512
|
* @return {string} Common ancestor client ID or undefined
|
|
533
513
|
*/
|
|
534
|
-
|
|
535
514
|
export function getLowestCommonAncestorWithSelectedBlock(state, clientId) {
|
|
536
515
|
const selectedId = getSelectedBlockClientId(state);
|
|
537
516
|
const clientParents = [...getBlockParents(state, clientId), clientId];
|
|
538
517
|
const selectedParents = [...getBlockParents(state, selectedId), selectedId];
|
|
539
518
|
let lowestCommonAncestor;
|
|
540
519
|
const maxDepth = Math.min(clientParents.length, selectedParents.length);
|
|
541
|
-
|
|
542
520
|
for (let index = 0; index < maxDepth; index++) {
|
|
543
521
|
if (clientParents[index] === selectedParents[index]) {
|
|
544
522
|
lowestCommonAncestor = clientParents[index];
|
|
@@ -546,9 +524,9 @@ export function getLowestCommonAncestorWithSelectedBlock(state, clientId) {
|
|
|
546
524
|
break;
|
|
547
525
|
}
|
|
548
526
|
}
|
|
549
|
-
|
|
550
527
|
return lowestCommonAncestor;
|
|
551
528
|
}
|
|
529
|
+
|
|
552
530
|
/**
|
|
553
531
|
* Returns the client ID of the block adjacent one at the given reference
|
|
554
532
|
* startClientId and modifier directionality. Defaults start startClientId to
|
|
@@ -563,54 +541,53 @@ export function getLowestCommonAncestorWithSelectedBlock(state, clientId) {
|
|
|
563
541
|
*
|
|
564
542
|
* @return {?string} Return the client ID of the block, or null if none exists.
|
|
565
543
|
*/
|
|
566
|
-
|
|
567
544
|
export function getAdjacentBlockClientId(state, startClientId, modifier = 1) {
|
|
568
545
|
// Default to selected block.
|
|
569
546
|
if (startClientId === undefined) {
|
|
570
547
|
startClientId = getSelectedBlockClientId(state);
|
|
571
|
-
}
|
|
572
|
-
|
|
548
|
+
}
|
|
573
549
|
|
|
550
|
+
// Try multi-selection starting at extent based on modifier.
|
|
574
551
|
if (startClientId === undefined) {
|
|
575
552
|
if (modifier < 0) {
|
|
576
553
|
startClientId = getFirstMultiSelectedBlockClientId(state);
|
|
577
554
|
} else {
|
|
578
555
|
startClientId = getLastMultiSelectedBlockClientId(state);
|
|
579
556
|
}
|
|
580
|
-
}
|
|
581
|
-
|
|
557
|
+
}
|
|
582
558
|
|
|
559
|
+
// Validate working start client ID.
|
|
583
560
|
if (!startClientId) {
|
|
584
561
|
return null;
|
|
585
|
-
}
|
|
586
|
-
// empty string top-level root by explicitly testing against null.
|
|
587
|
-
|
|
562
|
+
}
|
|
588
563
|
|
|
564
|
+
// Retrieve start block root client ID, being careful to allow the falsey
|
|
565
|
+
// empty string top-level root by explicitly testing against null.
|
|
589
566
|
const rootClientId = getBlockRootClientId(state, startClientId);
|
|
590
|
-
|
|
591
567
|
if (rootClientId === null) {
|
|
592
568
|
return null;
|
|
593
569
|
}
|
|
594
|
-
|
|
595
570
|
const {
|
|
596
571
|
order
|
|
597
572
|
} = state.blocks;
|
|
598
573
|
const orderSet = order.get(rootClientId);
|
|
599
574
|
const index = orderSet.indexOf(startClientId);
|
|
600
|
-
const nextIndex = index + 1 * modifier;
|
|
575
|
+
const nextIndex = index + 1 * modifier;
|
|
601
576
|
|
|
577
|
+
// Block was first in set and we're attempting to get previous.
|
|
602
578
|
if (nextIndex < 0) {
|
|
603
579
|
return null;
|
|
604
|
-
}
|
|
605
|
-
|
|
580
|
+
}
|
|
606
581
|
|
|
582
|
+
// Block was last in set and we're attempting to get next.
|
|
607
583
|
if (nextIndex === orderSet.length) {
|
|
608
584
|
return null;
|
|
609
|
-
}
|
|
610
|
-
|
|
585
|
+
}
|
|
611
586
|
|
|
587
|
+
// Assume incremented index is within the set.
|
|
612
588
|
return orderSet[nextIndex];
|
|
613
589
|
}
|
|
590
|
+
|
|
614
591
|
/**
|
|
615
592
|
* Returns the previous block's client ID from the given reference start ID.
|
|
616
593
|
* Defaults start to the selected block. Returns null if there is no previous
|
|
@@ -622,10 +599,10 @@ export function getAdjacentBlockClientId(state, startClientId, modifier = 1) {
|
|
|
622
599
|
*
|
|
623
600
|
* @return {?string} Adjacent block's client ID, or null if none exists.
|
|
624
601
|
*/
|
|
625
|
-
|
|
626
602
|
export function getPreviousBlockClientId(state, startClientId) {
|
|
627
603
|
return getAdjacentBlockClientId(state, startClientId, -1);
|
|
628
604
|
}
|
|
605
|
+
|
|
629
606
|
/**
|
|
630
607
|
* Returns the next block's client ID from the given reference start ID.
|
|
631
608
|
* Defaults start to the selected block. Returns null if there is no next
|
|
@@ -637,12 +614,11 @@ export function getPreviousBlockClientId(state, startClientId) {
|
|
|
637
614
|
*
|
|
638
615
|
* @return {?string} Adjacent block's client ID, or null if none exists.
|
|
639
616
|
*/
|
|
640
|
-
|
|
641
617
|
export function getNextBlockClientId(state, startClientId) {
|
|
642
618
|
return getAdjacentBlockClientId(state, startClientId, 1);
|
|
643
619
|
}
|
|
644
|
-
/* eslint-disable jsdoc/valid-types */
|
|
645
620
|
|
|
621
|
+
/* eslint-disable jsdoc/valid-types */
|
|
646
622
|
/**
|
|
647
623
|
* Returns the initial caret position for the selected block.
|
|
648
624
|
* This position is to used to position the caret properly when the selected block changes.
|
|
@@ -652,11 +628,11 @@ export function getNextBlockClientId(state, startClientId) {
|
|
|
652
628
|
*
|
|
653
629
|
* @return {0|-1|null} Initial position.
|
|
654
630
|
*/
|
|
655
|
-
|
|
656
631
|
export function getSelectedBlocksInitialCaretPosition(state) {
|
|
657
632
|
/* eslint-enable jsdoc/valid-types */
|
|
658
633
|
return state.initialPosition;
|
|
659
634
|
}
|
|
635
|
+
|
|
660
636
|
/**
|
|
661
637
|
* Returns the current selection set of block client IDs (multiselection or single selection).
|
|
662
638
|
*
|
|
@@ -664,40 +640,34 @@ export function getSelectedBlocksInitialCaretPosition(state) {
|
|
|
664
640
|
*
|
|
665
641
|
* @return {Array} Multi-selected block client IDs.
|
|
666
642
|
*/
|
|
667
|
-
|
|
668
643
|
export const getSelectedBlockClientIds = createSelector(state => {
|
|
669
644
|
const {
|
|
670
645
|
selectionStart,
|
|
671
646
|
selectionEnd
|
|
672
647
|
} = state.selection;
|
|
673
|
-
|
|
674
648
|
if (!selectionStart.clientId || !selectionEnd.clientId) {
|
|
675
649
|
return EMPTY_ARRAY;
|
|
676
650
|
}
|
|
677
|
-
|
|
678
651
|
if (selectionStart.clientId === selectionEnd.clientId) {
|
|
679
652
|
return [selectionStart.clientId];
|
|
680
|
-
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// Retrieve root client ID to aid in retrieving relevant nested block
|
|
681
656
|
// order, being careful to allow the falsey empty string top-level root
|
|
682
657
|
// by explicitly testing against null.
|
|
683
|
-
|
|
684
|
-
|
|
685
658
|
const rootClientId = getBlockRootClientId(state, selectionStart.clientId);
|
|
686
|
-
|
|
687
659
|
if (rootClientId === null) {
|
|
688
660
|
return EMPTY_ARRAY;
|
|
689
661
|
}
|
|
690
|
-
|
|
691
662
|
const blockOrder = getBlockOrder(state, rootClientId);
|
|
692
663
|
const startIndex = blockOrder.indexOf(selectionStart.clientId);
|
|
693
664
|
const endIndex = blockOrder.indexOf(selectionEnd.clientId);
|
|
694
|
-
|
|
695
665
|
if (startIndex > endIndex) {
|
|
696
666
|
return blockOrder.slice(endIndex, startIndex + 1);
|
|
697
667
|
}
|
|
698
|
-
|
|
699
668
|
return blockOrder.slice(startIndex, endIndex + 1);
|
|
700
669
|
}, state => [state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId]);
|
|
670
|
+
|
|
701
671
|
/**
|
|
702
672
|
* Returns the current multi-selection set of block client IDs, or an empty
|
|
703
673
|
* array if there is no multi-selection.
|
|
@@ -706,19 +676,17 @@ export const getSelectedBlockClientIds = createSelector(state => {
|
|
|
706
676
|
*
|
|
707
677
|
* @return {Array} Multi-selected block client IDs.
|
|
708
678
|
*/
|
|
709
|
-
|
|
710
679
|
export function getMultiSelectedBlockClientIds(state) {
|
|
711
680
|
const {
|
|
712
681
|
selectionStart,
|
|
713
682
|
selectionEnd
|
|
714
683
|
} = state.selection;
|
|
715
|
-
|
|
716
684
|
if (selectionStart.clientId === selectionEnd.clientId) {
|
|
717
685
|
return EMPTY_ARRAY;
|
|
718
686
|
}
|
|
719
|
-
|
|
720
687
|
return getSelectedBlockClientIds(state);
|
|
721
688
|
}
|
|
689
|
+
|
|
722
690
|
/**
|
|
723
691
|
* Returns the current multi-selection set of blocks, or an empty array if
|
|
724
692
|
* there is no multi-selection.
|
|
@@ -727,16 +695,14 @@ export function getMultiSelectedBlockClientIds(state) {
|
|
|
727
695
|
*
|
|
728
696
|
* @return {Array} Multi-selected block objects.
|
|
729
697
|
*/
|
|
730
|
-
|
|
731
698
|
export const getMultiSelectedBlocks = createSelector(state => {
|
|
732
699
|
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state);
|
|
733
|
-
|
|
734
700
|
if (!multiSelectedBlockClientIds.length) {
|
|
735
701
|
return EMPTY_ARRAY;
|
|
736
702
|
}
|
|
737
|
-
|
|
738
703
|
return multiSelectedBlockClientIds.map(clientId => getBlock(state, clientId));
|
|
739
704
|
}, state => [...getSelectedBlockClientIds.getDependants(state), state.blocks.byClientId, state.blocks.order, state.blocks.attributes]);
|
|
705
|
+
|
|
740
706
|
/**
|
|
741
707
|
* Returns the client ID of the first block in the multi-selection set, or null
|
|
742
708
|
* if there is no multi-selection.
|
|
@@ -745,10 +711,10 @@ export const getMultiSelectedBlocks = createSelector(state => {
|
|
|
745
711
|
*
|
|
746
712
|
* @return {?string} First block client ID in the multi-selection set.
|
|
747
713
|
*/
|
|
748
|
-
|
|
749
714
|
export function getFirstMultiSelectedBlockClientId(state) {
|
|
750
715
|
return getMultiSelectedBlockClientIds(state)[0] || null;
|
|
751
716
|
}
|
|
717
|
+
|
|
752
718
|
/**
|
|
753
719
|
* Returns the client ID of the last block in the multi-selection set, or null
|
|
754
720
|
* if there is no multi-selection.
|
|
@@ -757,11 +723,11 @@ export function getFirstMultiSelectedBlockClientId(state) {
|
|
|
757
723
|
*
|
|
758
724
|
* @return {?string} Last block client ID in the multi-selection set.
|
|
759
725
|
*/
|
|
760
|
-
|
|
761
726
|
export function getLastMultiSelectedBlockClientId(state) {
|
|
762
727
|
const selectedClientIds = getMultiSelectedBlockClientIds(state);
|
|
763
728
|
return selectedClientIds[selectedClientIds.length - 1] || null;
|
|
764
729
|
}
|
|
730
|
+
|
|
765
731
|
/**
|
|
766
732
|
* Returns true if a multi-selection exists, and the block corresponding to the
|
|
767
733
|
* specified client ID is the first block of the multi-selection set, or false
|
|
@@ -772,10 +738,10 @@ export function getLastMultiSelectedBlockClientId(state) {
|
|
|
772
738
|
*
|
|
773
739
|
* @return {boolean} Whether block is first in multi-selection.
|
|
774
740
|
*/
|
|
775
|
-
|
|
776
741
|
export function isFirstMultiSelectedBlock(state, clientId) {
|
|
777
742
|
return getFirstMultiSelectedBlockClientId(state) === clientId;
|
|
778
743
|
}
|
|
744
|
+
|
|
779
745
|
/**
|
|
780
746
|
* Returns true if the client ID occurs within the block multi-selection, or
|
|
781
747
|
* false otherwise.
|
|
@@ -785,10 +751,10 @@ export function isFirstMultiSelectedBlock(state, clientId) {
|
|
|
785
751
|
*
|
|
786
752
|
* @return {boolean} Whether block is in multi-selection set.
|
|
787
753
|
*/
|
|
788
|
-
|
|
789
754
|
export function isBlockMultiSelected(state, clientId) {
|
|
790
755
|
return getMultiSelectedBlockClientIds(state).indexOf(clientId) !== -1;
|
|
791
756
|
}
|
|
757
|
+
|
|
792
758
|
/**
|
|
793
759
|
* Returns true if an ancestor of the block is multi-selected, or false
|
|
794
760
|
* otherwise.
|
|
@@ -799,18 +765,16 @@ export function isBlockMultiSelected(state, clientId) {
|
|
|
799
765
|
* @return {boolean} Whether an ancestor of the block is in multi-selection
|
|
800
766
|
* set.
|
|
801
767
|
*/
|
|
802
|
-
|
|
803
768
|
export const isAncestorMultiSelected = createSelector((state, clientId) => {
|
|
804
769
|
let ancestorClientId = clientId;
|
|
805
770
|
let isMultiSelected = false;
|
|
806
|
-
|
|
807
771
|
while (ancestorClientId && !isMultiSelected) {
|
|
808
772
|
ancestorClientId = getBlockRootClientId(state, ancestorClientId);
|
|
809
773
|
isMultiSelected = isBlockMultiSelected(state, ancestorClientId);
|
|
810
774
|
}
|
|
811
|
-
|
|
812
775
|
return isMultiSelected;
|
|
813
776
|
}, state => [state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId]);
|
|
777
|
+
|
|
814
778
|
/**
|
|
815
779
|
* Returns the client ID of the block which begins the multi-selection set, or
|
|
816
780
|
* null if there is no multi-selection.
|
|
@@ -823,19 +787,17 @@ export const isAncestorMultiSelected = createSelector((state, clientId) => {
|
|
|
823
787
|
*
|
|
824
788
|
* @return {?string} Client ID of block beginning multi-selection.
|
|
825
789
|
*/
|
|
826
|
-
|
|
827
790
|
export function getMultiSelectedBlocksStartClientId(state) {
|
|
828
791
|
const {
|
|
829
792
|
selectionStart,
|
|
830
793
|
selectionEnd
|
|
831
794
|
} = state.selection;
|
|
832
|
-
|
|
833
795
|
if (selectionStart.clientId === selectionEnd.clientId) {
|
|
834
796
|
return null;
|
|
835
797
|
}
|
|
836
|
-
|
|
837
798
|
return selectionStart.clientId || null;
|
|
838
799
|
}
|
|
800
|
+
|
|
839
801
|
/**
|
|
840
802
|
* Returns the client ID of the block which ends the multi-selection set, or
|
|
841
803
|
* null if there is no multi-selection.
|
|
@@ -848,19 +810,17 @@ export function getMultiSelectedBlocksStartClientId(state) {
|
|
|
848
810
|
*
|
|
849
811
|
* @return {?string} Client ID of block ending multi-selection.
|
|
850
812
|
*/
|
|
851
|
-
|
|
852
813
|
export function getMultiSelectedBlocksEndClientId(state) {
|
|
853
814
|
const {
|
|
854
815
|
selectionStart,
|
|
855
816
|
selectionEnd
|
|
856
817
|
} = state.selection;
|
|
857
|
-
|
|
858
818
|
if (selectionStart.clientId === selectionEnd.clientId) {
|
|
859
819
|
return null;
|
|
860
820
|
}
|
|
861
|
-
|
|
862
821
|
return selectionEnd.clientId || null;
|
|
863
822
|
}
|
|
823
|
+
|
|
864
824
|
/**
|
|
865
825
|
* Returns true if the selection is not partial.
|
|
866
826
|
*
|
|
@@ -868,12 +828,12 @@ export function getMultiSelectedBlocksEndClientId(state) {
|
|
|
868
828
|
*
|
|
869
829
|
* @return {boolean} Whether the selection is mergeable.
|
|
870
830
|
*/
|
|
871
|
-
|
|
872
831
|
export function __unstableIsFullySelected(state) {
|
|
873
832
|
const selectionAnchor = getSelectionStart(state);
|
|
874
833
|
const selectionFocus = getSelectionEnd(state);
|
|
875
834
|
return !selectionAnchor.attributeKey && !selectionFocus.attributeKey && typeof selectionAnchor.offset === 'undefined' && typeof selectionFocus.offset === 'undefined';
|
|
876
835
|
}
|
|
836
|
+
|
|
877
837
|
/**
|
|
878
838
|
* Returns true if the selection is collapsed.
|
|
879
839
|
*
|
|
@@ -881,7 +841,6 @@ export function __unstableIsFullySelected(state) {
|
|
|
881
841
|
*
|
|
882
842
|
* @return {boolean} Whether the selection is collapsed.
|
|
883
843
|
*/
|
|
884
|
-
|
|
885
844
|
export function __unstableIsSelectionCollapsed(state) {
|
|
886
845
|
const selectionAnchor = getSelectionStart(state);
|
|
887
846
|
const selectionFocus = getSelectionEnd(state);
|
|
@@ -894,6 +853,7 @@ export function __unstableSelectionHasUnmergeableBlock(state) {
|
|
|
894
853
|
return !blockType.merge;
|
|
895
854
|
});
|
|
896
855
|
}
|
|
856
|
+
|
|
897
857
|
/**
|
|
898
858
|
* Check whether the selection is mergeable.
|
|
899
859
|
*
|
|
@@ -902,28 +862,29 @@ export function __unstableSelectionHasUnmergeableBlock(state) {
|
|
|
902
862
|
*
|
|
903
863
|
* @return {boolean} Whether the selection is mergeable.
|
|
904
864
|
*/
|
|
905
|
-
|
|
906
865
|
export function __unstableIsSelectionMergeable(state, isForward) {
|
|
907
866
|
const selectionAnchor = getSelectionStart(state);
|
|
908
|
-
const selectionFocus = getSelectionEnd(state);
|
|
867
|
+
const selectionFocus = getSelectionEnd(state);
|
|
909
868
|
|
|
910
|
-
|
|
869
|
+
// It's not mergeable if the start and end are within the same block.
|
|
870
|
+
if (selectionAnchor.clientId === selectionFocus.clientId) return false;
|
|
911
871
|
|
|
872
|
+
// It's not mergeable if there's no rich text selection.
|
|
912
873
|
if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') return false;
|
|
913
874
|
const anchorRootClientId = getBlockRootClientId(state, selectionAnchor.clientId);
|
|
914
|
-
const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId);
|
|
915
|
-
// block list. Maybe in the future it should be allowed.
|
|
875
|
+
const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId);
|
|
916
876
|
|
|
877
|
+
// It's not mergeable if the selection doesn't start and end in the same
|
|
878
|
+
// block list. Maybe in the future it should be allowed.
|
|
917
879
|
if (anchorRootClientId !== focusRootClientId) {
|
|
918
880
|
return false;
|
|
919
881
|
}
|
|
920
|
-
|
|
921
882
|
const blockOrder = getBlockOrder(state, anchorRootClientId);
|
|
922
883
|
const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
|
|
923
|
-
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
|
|
884
|
+
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
|
|
924
885
|
|
|
886
|
+
// Reassign selection start and end based on order.
|
|
925
887
|
let selectionStart, selectionEnd;
|
|
926
|
-
|
|
927
888
|
if (anchorIndex > focusIndex) {
|
|
928
889
|
selectionStart = selectionFocus;
|
|
929
890
|
selectionEnd = selectionAnchor;
|
|
@@ -931,20 +892,22 @@ export function __unstableIsSelectionMergeable(state, isForward) {
|
|
|
931
892
|
selectionStart = selectionAnchor;
|
|
932
893
|
selectionEnd = selectionFocus;
|
|
933
894
|
}
|
|
934
|
-
|
|
935
895
|
const targetBlockClientId = isForward ? selectionEnd.clientId : selectionStart.clientId;
|
|
936
896
|
const blockToMergeClientId = isForward ? selectionStart.clientId : selectionEnd.clientId;
|
|
937
897
|
const targetBlockName = getBlockName(state, targetBlockClientId);
|
|
938
898
|
const targetBlockType = getBlockType(targetBlockName);
|
|
939
899
|
if (!targetBlockType.merge) return false;
|
|
940
|
-
const blockToMerge = getBlock(state, blockToMergeClientId);
|
|
900
|
+
const blockToMerge = getBlock(state, blockToMergeClientId);
|
|
941
901
|
|
|
942
|
-
|
|
943
|
-
|
|
902
|
+
// It's mergeable if the blocks are of the same type.
|
|
903
|
+
if (blockToMerge.name === targetBlockName) return true;
|
|
944
904
|
|
|
905
|
+
// If the blocks are of a different type, try to transform the block being
|
|
906
|
+
// merged into the same type of block.
|
|
945
907
|
const blocksToMerge = switchToBlockType(blockToMerge, targetBlockName);
|
|
946
908
|
return blocksToMerge && blocksToMerge.length;
|
|
947
909
|
}
|
|
910
|
+
|
|
948
911
|
/**
|
|
949
912
|
* Get partial selected blocks with their content updated
|
|
950
913
|
* based on the selection.
|
|
@@ -953,32 +916,30 @@ export function __unstableIsSelectionMergeable(state, isForward) {
|
|
|
953
916
|
*
|
|
954
917
|
* @return {Object[]} Updated partial selected blocks.
|
|
955
918
|
*/
|
|
956
|
-
|
|
957
919
|
export const __unstableGetSelectedBlocksWithPartialSelection = state => {
|
|
958
920
|
const selectionAnchor = getSelectionStart(state);
|
|
959
921
|
const selectionFocus = getSelectionEnd(state);
|
|
960
|
-
|
|
961
922
|
if (selectionAnchor.clientId === selectionFocus.clientId) {
|
|
962
923
|
return EMPTY_ARRAY;
|
|
963
|
-
}
|
|
964
|
-
|
|
924
|
+
}
|
|
965
925
|
|
|
926
|
+
// Can't split if the selection is not set.
|
|
966
927
|
if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') {
|
|
967
928
|
return EMPTY_ARRAY;
|
|
968
929
|
}
|
|
969
|
-
|
|
970
930
|
const anchorRootClientId = getBlockRootClientId(state, selectionAnchor.clientId);
|
|
971
|
-
const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId);
|
|
972
|
-
// block list. Maybe in the future it should be allowed.
|
|
931
|
+
const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId);
|
|
973
932
|
|
|
933
|
+
// It's not splittable if the selection doesn't start and end in the same
|
|
934
|
+
// block list. Maybe in the future it should be allowed.
|
|
974
935
|
if (anchorRootClientId !== focusRootClientId) {
|
|
975
936
|
return EMPTY_ARRAY;
|
|
976
937
|
}
|
|
977
|
-
|
|
978
938
|
const blockOrder = getBlockOrder(state, anchorRootClientId);
|
|
979
939
|
const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
|
|
980
|
-
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
|
|
940
|
+
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
|
|
981
941
|
|
|
942
|
+
// Reassign selection start and end based on order.
|
|
982
943
|
const [selectionStart, selectionEnd] = anchorIndex > focusIndex ? [selectionFocus, selectionAnchor] : [selectionAnchor, selectionFocus];
|
|
983
944
|
const blockA = getBlock(state, selectionStart.clientId);
|
|
984
945
|
const blockAType = getBlockType(blockA.name);
|
|
@@ -998,15 +959,19 @@ export const __unstableGetSelectedBlocksWithPartialSelection = state => {
|
|
|
998
959
|
});
|
|
999
960
|
valueA = remove(valueA, 0, selectionStart.offset);
|
|
1000
961
|
valueB = remove(valueB, selectionEnd.offset, valueB.text.length);
|
|
1001
|
-
return [{
|
|
1002
|
-
|
|
962
|
+
return [{
|
|
963
|
+
...blockA,
|
|
964
|
+
attributes: {
|
|
965
|
+
...blockA.attributes,
|
|
1003
966
|
[selectionStart.attributeKey]: toHTMLString({
|
|
1004
967
|
value: valueA,
|
|
1005
968
|
...mapRichTextSettings(attributeDefinitionA)
|
|
1006
969
|
})
|
|
1007
970
|
}
|
|
1008
|
-
}, {
|
|
1009
|
-
|
|
971
|
+
}, {
|
|
972
|
+
...blockB,
|
|
973
|
+
attributes: {
|
|
974
|
+
...blockB.attributes,
|
|
1010
975
|
[selectionEnd.attributeKey]: toHTMLString({
|
|
1011
976
|
value: valueB,
|
|
1012
977
|
...mapRichTextSettings(attributeDefinitionB)
|
|
@@ -1014,6 +979,7 @@ export const __unstableGetSelectedBlocksWithPartialSelection = state => {
|
|
|
1014
979
|
}
|
|
1015
980
|
}];
|
|
1016
981
|
};
|
|
982
|
+
|
|
1017
983
|
/**
|
|
1018
984
|
* Returns an array containing all block client IDs in the editor in the order
|
|
1019
985
|
* they appear. Optionally accepts a root client ID of the block list for which
|
|
@@ -1024,10 +990,10 @@ export const __unstableGetSelectedBlocksWithPartialSelection = state => {
|
|
|
1024
990
|
*
|
|
1025
991
|
* @return {Array} Ordered client IDs of editor blocks.
|
|
1026
992
|
*/
|
|
1027
|
-
|
|
1028
993
|
export function getBlockOrder(state, rootClientId) {
|
|
1029
994
|
return state.blocks.order.get(rootClientId || '') || EMPTY_ARRAY;
|
|
1030
995
|
}
|
|
996
|
+
|
|
1031
997
|
/**
|
|
1032
998
|
* Returns the index at which the block corresponding to the specified client
|
|
1033
999
|
* ID occurs within the block order, or `-1` if the block does not exist.
|
|
@@ -1037,11 +1003,11 @@ export function getBlockOrder(state, rootClientId) {
|
|
|
1037
1003
|
*
|
|
1038
1004
|
* @return {number} Index at which block exists in order.
|
|
1039
1005
|
*/
|
|
1040
|
-
|
|
1041
1006
|
export function getBlockIndex(state, clientId) {
|
|
1042
1007
|
const rootClientId = getBlockRootClientId(state, clientId);
|
|
1043
1008
|
return getBlockOrder(state, rootClientId).indexOf(clientId);
|
|
1044
1009
|
}
|
|
1010
|
+
|
|
1045
1011
|
/**
|
|
1046
1012
|
* Returns true if the block corresponding to the specified client ID is
|
|
1047
1013
|
* currently selected and no multi-selection exists, or false otherwise.
|
|
@@ -1051,19 +1017,17 @@ export function getBlockIndex(state, clientId) {
|
|
|
1051
1017
|
*
|
|
1052
1018
|
* @return {boolean} Whether block is selected and multi-selection exists.
|
|
1053
1019
|
*/
|
|
1054
|
-
|
|
1055
1020
|
export function isBlockSelected(state, clientId) {
|
|
1056
1021
|
const {
|
|
1057
1022
|
selectionStart,
|
|
1058
1023
|
selectionEnd
|
|
1059
1024
|
} = state.selection;
|
|
1060
|
-
|
|
1061
1025
|
if (selectionStart.clientId !== selectionEnd.clientId) {
|
|
1062
1026
|
return false;
|
|
1063
1027
|
}
|
|
1064
|
-
|
|
1065
1028
|
return selectionStart.clientId === clientId;
|
|
1066
1029
|
}
|
|
1030
|
+
|
|
1067
1031
|
/**
|
|
1068
1032
|
* Returns true if one of the block's inner blocks is selected.
|
|
1069
1033
|
*
|
|
@@ -1073,10 +1037,10 @@ export function isBlockSelected(state, clientId) {
|
|
|
1073
1037
|
*
|
|
1074
1038
|
* @return {boolean} Whether the block has an inner block selected
|
|
1075
1039
|
*/
|
|
1076
|
-
|
|
1077
1040
|
export function hasSelectedInnerBlock(state, clientId, deep = false) {
|
|
1078
1041
|
return getBlockOrder(state, clientId).some(innerClientId => isBlockSelected(state, innerClientId) || isBlockMultiSelected(state, innerClientId) || deep && hasSelectedInnerBlock(state, innerClientId, deep));
|
|
1079
1042
|
}
|
|
1043
|
+
|
|
1080
1044
|
/**
|
|
1081
1045
|
* Returns true if one of the block's inner blocks is dragged.
|
|
1082
1046
|
*
|
|
@@ -1086,10 +1050,10 @@ export function hasSelectedInnerBlock(state, clientId, deep = false) {
|
|
|
1086
1050
|
*
|
|
1087
1051
|
* @return {boolean} Whether the block has an inner block dragged
|
|
1088
1052
|
*/
|
|
1089
|
-
|
|
1090
1053
|
export function hasDraggedInnerBlock(state, clientId, deep = false) {
|
|
1091
1054
|
return getBlockOrder(state, clientId).some(innerClientId => isBlockBeingDragged(state, innerClientId) || deep && hasDraggedInnerBlock(state, innerClientId, deep));
|
|
1092
1055
|
}
|
|
1056
|
+
|
|
1093
1057
|
/**
|
|
1094
1058
|
* Returns true if the block corresponding to the specified client ID is
|
|
1095
1059
|
* currently selected but isn't the last of the selected blocks. Here "last"
|
|
@@ -1102,16 +1066,15 @@ export function hasDraggedInnerBlock(state, clientId, deep = false) {
|
|
|
1102
1066
|
* @return {boolean} Whether block is selected and not the last in the
|
|
1103
1067
|
* selection.
|
|
1104
1068
|
*/
|
|
1105
|
-
|
|
1106
1069
|
export function isBlockWithinSelection(state, clientId) {
|
|
1107
1070
|
if (!clientId) {
|
|
1108
1071
|
return false;
|
|
1109
1072
|
}
|
|
1110
|
-
|
|
1111
1073
|
const clientIds = getMultiSelectedBlockClientIds(state);
|
|
1112
1074
|
const index = clientIds.indexOf(clientId);
|
|
1113
1075
|
return index > -1 && index < clientIds.length - 1;
|
|
1114
1076
|
}
|
|
1077
|
+
|
|
1115
1078
|
/**
|
|
1116
1079
|
* Returns true if a multi-selection has been made, or false otherwise.
|
|
1117
1080
|
*
|
|
@@ -1119,7 +1082,6 @@ export function isBlockWithinSelection(state, clientId) {
|
|
|
1119
1082
|
*
|
|
1120
1083
|
* @return {boolean} Whether multi-selection has been made.
|
|
1121
1084
|
*/
|
|
1122
|
-
|
|
1123
1085
|
export function hasMultiSelection(state) {
|
|
1124
1086
|
const {
|
|
1125
1087
|
selectionStart,
|
|
@@ -1127,6 +1089,7 @@ export function hasMultiSelection(state) {
|
|
|
1127
1089
|
} = state.selection;
|
|
1128
1090
|
return selectionStart.clientId !== selectionEnd.clientId;
|
|
1129
1091
|
}
|
|
1092
|
+
|
|
1130
1093
|
/**
|
|
1131
1094
|
* Whether in the process of multi-selecting or not. This flag is only true
|
|
1132
1095
|
* while the multi-selection is being selected (by mouse move), and is false
|
|
@@ -1138,10 +1101,10 @@ export function hasMultiSelection(state) {
|
|
|
1138
1101
|
*
|
|
1139
1102
|
* @return {boolean} True if multi-selecting, false if not.
|
|
1140
1103
|
*/
|
|
1141
|
-
|
|
1142
1104
|
export function isMultiSelecting(state) {
|
|
1143
1105
|
return state.isMultiSelecting;
|
|
1144
1106
|
}
|
|
1107
|
+
|
|
1145
1108
|
/**
|
|
1146
1109
|
* Selector that returns if multi-selection is enabled or not.
|
|
1147
1110
|
*
|
|
@@ -1149,10 +1112,10 @@ export function isMultiSelecting(state) {
|
|
|
1149
1112
|
*
|
|
1150
1113
|
* @return {boolean} True if it should be possible to multi-select blocks, false if multi-selection is disabled.
|
|
1151
1114
|
*/
|
|
1152
|
-
|
|
1153
1115
|
export function isSelectionEnabled(state) {
|
|
1154
1116
|
return state.isSelectionEnabled;
|
|
1155
1117
|
}
|
|
1118
|
+
|
|
1156
1119
|
/**
|
|
1157
1120
|
* Returns the block's editing mode, defaulting to "visual" if not explicitly
|
|
1158
1121
|
* assigned.
|
|
@@ -1162,10 +1125,10 @@ export function isSelectionEnabled(state) {
|
|
|
1162
1125
|
*
|
|
1163
1126
|
* @return {Object} Block editing mode.
|
|
1164
1127
|
*/
|
|
1165
|
-
|
|
1166
1128
|
export function getBlockMode(state, clientId) {
|
|
1167
1129
|
return state.blocksMode[clientId] || 'visual';
|
|
1168
1130
|
}
|
|
1131
|
+
|
|
1169
1132
|
/**
|
|
1170
1133
|
* Returns true if the user is typing, or false otherwise.
|
|
1171
1134
|
*
|
|
@@ -1173,10 +1136,10 @@ export function getBlockMode(state, clientId) {
|
|
|
1173
1136
|
*
|
|
1174
1137
|
* @return {boolean} Whether user is typing.
|
|
1175
1138
|
*/
|
|
1176
|
-
|
|
1177
1139
|
export function isTyping(state) {
|
|
1178
1140
|
return state.isTyping;
|
|
1179
1141
|
}
|
|
1142
|
+
|
|
1180
1143
|
/**
|
|
1181
1144
|
* Returns true if the user is dragging blocks, or false otherwise.
|
|
1182
1145
|
*
|
|
@@ -1184,10 +1147,10 @@ export function isTyping(state) {
|
|
|
1184
1147
|
*
|
|
1185
1148
|
* @return {boolean} Whether user is dragging blocks.
|
|
1186
1149
|
*/
|
|
1187
|
-
|
|
1188
1150
|
export function isDraggingBlocks(state) {
|
|
1189
1151
|
return !!state.draggedBlocks.length;
|
|
1190
1152
|
}
|
|
1153
|
+
|
|
1191
1154
|
/**
|
|
1192
1155
|
* Returns the client ids of any blocks being directly dragged.
|
|
1193
1156
|
*
|
|
@@ -1197,10 +1160,10 @@ export function isDraggingBlocks(state) {
|
|
|
1197
1160
|
*
|
|
1198
1161
|
* @return {string[]} Array of dragged block client ids.
|
|
1199
1162
|
*/
|
|
1200
|
-
|
|
1201
1163
|
export function getDraggedBlockClientIds(state) {
|
|
1202
1164
|
return state.draggedBlocks;
|
|
1203
1165
|
}
|
|
1166
|
+
|
|
1204
1167
|
/**
|
|
1205
1168
|
* Returns whether the block is being dragged.
|
|
1206
1169
|
*
|
|
@@ -1213,10 +1176,10 @@ export function getDraggedBlockClientIds(state) {
|
|
|
1213
1176
|
*
|
|
1214
1177
|
* @return {boolean} Whether the block is being dragged.
|
|
1215
1178
|
*/
|
|
1216
|
-
|
|
1217
1179
|
export function isBlockBeingDragged(state, clientId) {
|
|
1218
1180
|
return state.draggedBlocks.includes(clientId);
|
|
1219
1181
|
}
|
|
1182
|
+
|
|
1220
1183
|
/**
|
|
1221
1184
|
* Returns whether a parent/ancestor of the block is being dragged.
|
|
1222
1185
|
*
|
|
@@ -1225,17 +1188,16 @@ export function isBlockBeingDragged(state, clientId) {
|
|
|
1225
1188
|
*
|
|
1226
1189
|
* @return {boolean} Whether the block's ancestor is being dragged.
|
|
1227
1190
|
*/
|
|
1228
|
-
|
|
1229
1191
|
export function isAncestorBeingDragged(state, clientId) {
|
|
1230
1192
|
// Return early if no blocks are being dragged rather than
|
|
1231
1193
|
// the more expensive check for parents.
|
|
1232
1194
|
if (!isDraggingBlocks(state)) {
|
|
1233
1195
|
return false;
|
|
1234
1196
|
}
|
|
1235
|
-
|
|
1236
1197
|
const parents = getBlockParents(state, clientId);
|
|
1237
1198
|
return parents.some(parentClientId => isBlockBeingDragged(state, parentClientId));
|
|
1238
1199
|
}
|
|
1200
|
+
|
|
1239
1201
|
/**
|
|
1240
1202
|
* Returns true if the caret is within formatted text, or false otherwise.
|
|
1241
1203
|
*
|
|
@@ -1243,7 +1205,6 @@ export function isAncestorBeingDragged(state, clientId) {
|
|
|
1243
1205
|
*
|
|
1244
1206
|
* @return {boolean} Whether the caret is within formatted text.
|
|
1245
1207
|
*/
|
|
1246
|
-
|
|
1247
1208
|
export function isCaretWithinFormattedText() {
|
|
1248
1209
|
deprecated('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText', {
|
|
1249
1210
|
since: '6.1',
|
|
@@ -1251,6 +1212,7 @@ export function isCaretWithinFormattedText() {
|
|
|
1251
1212
|
});
|
|
1252
1213
|
return false;
|
|
1253
1214
|
}
|
|
1215
|
+
|
|
1254
1216
|
/**
|
|
1255
1217
|
* Returns the insertion point, the index at which the new inserted block would
|
|
1256
1218
|
* be placed. Defaults to the last index.
|
|
@@ -1259,7 +1221,6 @@ export function isCaretWithinFormattedText() {
|
|
|
1259
1221
|
*
|
|
1260
1222
|
* @return {Object} Insertion point object with `rootClientId`, `index`.
|
|
1261
1223
|
*/
|
|
1262
|
-
|
|
1263
1224
|
export const getBlockInsertionPoint = createSelector(state => {
|
|
1264
1225
|
let rootClientId, index;
|
|
1265
1226
|
const {
|
|
@@ -1268,27 +1229,24 @@ export const getBlockInsertionPoint = createSelector(state => {
|
|
|
1268
1229
|
selectionEnd
|
|
1269
1230
|
}
|
|
1270
1231
|
} = state;
|
|
1271
|
-
|
|
1272
1232
|
if (insertionPoint !== null) {
|
|
1273
1233
|
return insertionPoint;
|
|
1274
1234
|
}
|
|
1275
|
-
|
|
1276
1235
|
const {
|
|
1277
1236
|
clientId
|
|
1278
1237
|
} = selectionEnd;
|
|
1279
|
-
|
|
1280
1238
|
if (clientId) {
|
|
1281
1239
|
rootClientId = getBlockRootClientId(state, clientId) || undefined;
|
|
1282
1240
|
index = getBlockIndex(state, selectionEnd.clientId) + 1;
|
|
1283
1241
|
} else {
|
|
1284
1242
|
index = getBlockOrder(state).length;
|
|
1285
1243
|
}
|
|
1286
|
-
|
|
1287
1244
|
return {
|
|
1288
1245
|
rootClientId,
|
|
1289
1246
|
index
|
|
1290
1247
|
};
|
|
1291
1248
|
}, state => [state.insertionPoint, state.selection.selectionEnd.clientId, state.blocks.parents, state.blocks.order]);
|
|
1249
|
+
|
|
1292
1250
|
/**
|
|
1293
1251
|
* Returns true if we should show the block insertion point.
|
|
1294
1252
|
*
|
|
@@ -1296,20 +1254,20 @@ export const getBlockInsertionPoint = createSelector(state => {
|
|
|
1296
1254
|
*
|
|
1297
1255
|
* @return {?boolean} Whether the insertion point is visible or not.
|
|
1298
1256
|
*/
|
|
1299
|
-
|
|
1300
1257
|
export function isBlockInsertionPointVisible(state) {
|
|
1301
1258
|
return state.insertionPoint !== null;
|
|
1302
1259
|
}
|
|
1260
|
+
|
|
1303
1261
|
/**
|
|
1304
1262
|
* Returns whether the blocks matches the template or not.
|
|
1305
1263
|
*
|
|
1306
1264
|
* @param {boolean} state
|
|
1307
1265
|
* @return {?boolean} Whether the template is valid or not.
|
|
1308
1266
|
*/
|
|
1309
|
-
|
|
1310
1267
|
export function isValidTemplate(state) {
|
|
1311
1268
|
return state.template.isValid;
|
|
1312
1269
|
}
|
|
1270
|
+
|
|
1313
1271
|
/**
|
|
1314
1272
|
* Returns the defined block template
|
|
1315
1273
|
*
|
|
@@ -1317,10 +1275,10 @@ export function isValidTemplate(state) {
|
|
|
1317
1275
|
*
|
|
1318
1276
|
* @return {?Array} Block Template.
|
|
1319
1277
|
*/
|
|
1320
|
-
|
|
1321
1278
|
export function getTemplate(state) {
|
|
1322
1279
|
return state.settings.template;
|
|
1323
1280
|
}
|
|
1281
|
+
|
|
1324
1282
|
/**
|
|
1325
1283
|
* Returns the defined block template lock. Optionally accepts a root block
|
|
1326
1284
|
* client ID as context, otherwise defaulting to the global context.
|
|
@@ -1330,24 +1288,18 @@ export function getTemplate(state) {
|
|
|
1330
1288
|
*
|
|
1331
1289
|
* @return {string|false} Block Template Lock
|
|
1332
1290
|
*/
|
|
1333
|
-
|
|
1334
1291
|
export function getTemplateLock(state, rootClientId) {
|
|
1335
1292
|
var _getBlockListSettings;
|
|
1336
|
-
|
|
1337
1293
|
if (!rootClientId) {
|
|
1338
1294
|
var _state$settings$templ;
|
|
1339
|
-
|
|
1340
1295
|
return (_state$settings$templ = state.settings.templateLock) !== null && _state$settings$templ !== void 0 ? _state$settings$templ : false;
|
|
1341
1296
|
}
|
|
1342
|
-
|
|
1343
1297
|
return (_getBlockListSettings = getBlockListSettings(state, rootClientId)?.templateLock) !== null && _getBlockListSettings !== void 0 ? _getBlockListSettings : false;
|
|
1344
1298
|
}
|
|
1345
|
-
|
|
1346
1299
|
const checkAllowList = (list, item, defaultResult = null) => {
|
|
1347
1300
|
if (typeof list === 'boolean') {
|
|
1348
1301
|
return list;
|
|
1349
1302
|
}
|
|
1350
|
-
|
|
1351
1303
|
if (Array.isArray(list)) {
|
|
1352
1304
|
// TODO: when there is a canonical way to detect that we are editing a post
|
|
1353
1305
|
// the following check should be changed to something like:
|
|
@@ -1355,12 +1307,11 @@ const checkAllowList = (list, item, defaultResult = null) => {
|
|
|
1355
1307
|
if (list.includes('core/post-content') && item === null) {
|
|
1356
1308
|
return true;
|
|
1357
1309
|
}
|
|
1358
|
-
|
|
1359
1310
|
return list.includes(item);
|
|
1360
1311
|
}
|
|
1361
|
-
|
|
1362
1312
|
return defaultResult;
|
|
1363
1313
|
};
|
|
1314
|
+
|
|
1364
1315
|
/**
|
|
1365
1316
|
* Determines if the given block type is allowed to be inserted into the block list.
|
|
1366
1317
|
* This function is not exported and not memoized because using a memoized selector
|
|
@@ -1374,48 +1325,38 @@ const checkAllowList = (list, item, defaultResult = null) => {
|
|
|
1374
1325
|
*
|
|
1375
1326
|
* @return {boolean} Whether the given block type is allowed to be inserted.
|
|
1376
1327
|
*/
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
1328
|
const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) => {
|
|
1380
1329
|
let blockType;
|
|
1381
|
-
|
|
1382
1330
|
if (blockName && 'object' === typeof blockName) {
|
|
1383
1331
|
blockType = blockName;
|
|
1384
1332
|
blockName = blockType.name;
|
|
1385
1333
|
} else {
|
|
1386
1334
|
blockType = getBlockType(blockName);
|
|
1387
1335
|
}
|
|
1388
|
-
|
|
1389
1336
|
if (!blockType) {
|
|
1390
1337
|
return false;
|
|
1391
1338
|
}
|
|
1392
|
-
|
|
1393
1339
|
const {
|
|
1394
1340
|
allowedBlockTypes
|
|
1395
1341
|
} = getSettings(state);
|
|
1396
1342
|
const isBlockAllowedInEditor = checkAllowList(allowedBlockTypes, blockName, true);
|
|
1397
|
-
|
|
1398
1343
|
if (!isBlockAllowedInEditor) {
|
|
1399
1344
|
return false;
|
|
1400
1345
|
}
|
|
1401
|
-
|
|
1402
1346
|
const isLocked = !!getTemplateLock(state, rootClientId);
|
|
1403
|
-
|
|
1404
1347
|
if (isLocked) {
|
|
1405
1348
|
return false;
|
|
1406
1349
|
}
|
|
1407
|
-
|
|
1408
1350
|
if (getBlockEditingMode(state, rootClientId !== null && rootClientId !== void 0 ? rootClientId : '') === 'disabled') {
|
|
1409
1351
|
return false;
|
|
1410
1352
|
}
|
|
1353
|
+
const parentBlockListSettings = getBlockListSettings(state, rootClientId);
|
|
1411
1354
|
|
|
1412
|
-
|
|
1355
|
+
// The parent block doesn't have settings indicating it doesn't support
|
|
1413
1356
|
// inner blocks, return false.
|
|
1414
|
-
|
|
1415
1357
|
if (rootClientId && parentBlockListSettings === undefined) {
|
|
1416
1358
|
return false;
|
|
1417
1359
|
}
|
|
1418
|
-
|
|
1419
1360
|
const parentAllowedBlocks = parentBlockListSettings?.allowedBlocks;
|
|
1420
1361
|
const hasParentAllowedBlock = checkAllowList(parentAllowedBlocks, blockName);
|
|
1421
1362
|
const blockAllowedParentBlocks = blockType.parent;
|
|
@@ -1423,17 +1364,15 @@ const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) =>
|
|
|
1423
1364
|
const hasBlockAllowedParent = checkAllowList(blockAllowedParentBlocks, parentName);
|
|
1424
1365
|
let hasBlockAllowedAncestor = true;
|
|
1425
1366
|
const blockAllowedAncestorBlocks = blockType.ancestor;
|
|
1426
|
-
|
|
1427
1367
|
if (blockAllowedAncestorBlocks) {
|
|
1428
1368
|
const ancestors = [rootClientId, ...getBlockParents(state, rootClientId)];
|
|
1429
1369
|
hasBlockAllowedAncestor = ancestors.some(ancestorClientId => checkAllowList(blockAllowedAncestorBlocks, getBlockName(state, ancestorClientId)));
|
|
1430
1370
|
}
|
|
1431
|
-
|
|
1432
1371
|
const canInsert = hasBlockAllowedAncestor && (hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true);
|
|
1433
|
-
|
|
1434
1372
|
if (!canInsert) {
|
|
1435
1373
|
return canInsert;
|
|
1436
1374
|
}
|
|
1375
|
+
|
|
1437
1376
|
/**
|
|
1438
1377
|
* This filter is an ad-hoc solution to prevent adding template parts inside post content.
|
|
1439
1378
|
* Conceptually, having a filter inside a selector is bad pattern so this code will be
|
|
@@ -1446,8 +1385,6 @@ const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) =>
|
|
|
1446
1385
|
* Filters are global: Once they're defined, they will affect all editor instances and all registries.
|
|
1447
1386
|
* An ideal API would only affect specific editor instances.
|
|
1448
1387
|
*/
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
1388
|
return applyFilters('blockEditor.__unstableCanInsertBlockType', canInsert, blockType, rootClientId, {
|
|
1452
1389
|
// Pass bound selectors of the current registry. If we're in a nested
|
|
1453
1390
|
// context, the data will differ from the one selected from the root
|
|
@@ -1456,6 +1393,7 @@ const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) =>
|
|
|
1456
1393
|
getBlockParentsByBlockName: getBlockParentsByBlockName.bind(null, state)
|
|
1457
1394
|
});
|
|
1458
1395
|
};
|
|
1396
|
+
|
|
1459
1397
|
/**
|
|
1460
1398
|
* Determines if the given block type is allowed to be inserted into the block list.
|
|
1461
1399
|
*
|
|
@@ -1465,9 +1403,8 @@ const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) =>
|
|
|
1465
1403
|
*
|
|
1466
1404
|
* @return {boolean} Whether the given block type is allowed to be inserted.
|
|
1467
1405
|
*/
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
1406
|
export const canInsertBlockType = createSelector(canInsertBlockTypeUnmemoized, (state, blockName, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId.get(rootClientId), state.settings.allowedBlockTypes, state.settings.templateLock, state.blockEditingModes]);
|
|
1407
|
+
|
|
1471
1408
|
/**
|
|
1472
1409
|
* Determines if the given blocks are allowed to be inserted into the block
|
|
1473
1410
|
* list.
|
|
@@ -1478,10 +1415,10 @@ export const canInsertBlockType = createSelector(canInsertBlockTypeUnmemoized, (
|
|
|
1478
1415
|
*
|
|
1479
1416
|
* @return {boolean} Whether the given blocks are allowed to be inserted.
|
|
1480
1417
|
*/
|
|
1481
|
-
|
|
1482
1418
|
export function canInsertBlocks(state, clientIds, rootClientId = null) {
|
|
1483
1419
|
return clientIds.every(id => canInsertBlockType(state, getBlockName(state, id), rootClientId));
|
|
1484
1420
|
}
|
|
1421
|
+
|
|
1485
1422
|
/**
|
|
1486
1423
|
* Determines if the given block is allowed to be deleted.
|
|
1487
1424
|
*
|
|
@@ -1491,24 +1428,20 @@ export function canInsertBlocks(state, clientIds, rootClientId = null) {
|
|
|
1491
1428
|
*
|
|
1492
1429
|
* @return {boolean} Whether the given block is allowed to be removed.
|
|
1493
1430
|
*/
|
|
1494
|
-
|
|
1495
1431
|
export function canRemoveBlock(state, clientId, rootClientId = null) {
|
|
1496
1432
|
const attributes = getBlockAttributes(state, clientId);
|
|
1497
|
-
|
|
1498
1433
|
if (attributes === null) {
|
|
1499
1434
|
return true;
|
|
1500
1435
|
}
|
|
1501
|
-
|
|
1502
1436
|
if (attributes.lock?.remove !== undefined) {
|
|
1503
1437
|
return !attributes.lock.remove;
|
|
1504
1438
|
}
|
|
1505
|
-
|
|
1506
1439
|
if (getTemplateLock(state, rootClientId)) {
|
|
1507
1440
|
return false;
|
|
1508
1441
|
}
|
|
1509
|
-
|
|
1510
1442
|
return getBlockEditingMode(state, rootClientId) !== 'disabled';
|
|
1511
1443
|
}
|
|
1444
|
+
|
|
1512
1445
|
/**
|
|
1513
1446
|
* Determines if the given blocks are allowed to be removed.
|
|
1514
1447
|
*
|
|
@@ -1518,10 +1451,10 @@ export function canRemoveBlock(state, clientId, rootClientId = null) {
|
|
|
1518
1451
|
*
|
|
1519
1452
|
* @return {boolean} Whether the given blocks are allowed to be removed.
|
|
1520
1453
|
*/
|
|
1521
|
-
|
|
1522
1454
|
export function canRemoveBlocks(state, clientIds, rootClientId = null) {
|
|
1523
1455
|
return clientIds.every(clientId => canRemoveBlock(state, clientId, rootClientId));
|
|
1524
1456
|
}
|
|
1457
|
+
|
|
1525
1458
|
/**
|
|
1526
1459
|
* Determines if the given block is allowed to be moved.
|
|
1527
1460
|
*
|
|
@@ -1531,24 +1464,20 @@ export function canRemoveBlocks(state, clientIds, rootClientId = null) {
|
|
|
1531
1464
|
*
|
|
1532
1465
|
* @return {boolean | undefined} Whether the given block is allowed to be moved.
|
|
1533
1466
|
*/
|
|
1534
|
-
|
|
1535
1467
|
export function canMoveBlock(state, clientId, rootClientId = null) {
|
|
1536
1468
|
const attributes = getBlockAttributes(state, clientId);
|
|
1537
|
-
|
|
1538
1469
|
if (attributes === null) {
|
|
1539
1470
|
return true;
|
|
1540
1471
|
}
|
|
1541
|
-
|
|
1542
1472
|
if (attributes.lock?.move !== undefined) {
|
|
1543
1473
|
return !attributes.lock.move;
|
|
1544
1474
|
}
|
|
1545
|
-
|
|
1546
1475
|
if (getTemplateLock(state, rootClientId) === 'all') {
|
|
1547
1476
|
return false;
|
|
1548
1477
|
}
|
|
1549
|
-
|
|
1550
1478
|
return getBlockEditingMode(state, rootClientId) !== 'disabled';
|
|
1551
1479
|
}
|
|
1480
|
+
|
|
1552
1481
|
/**
|
|
1553
1482
|
* Determines if the given blocks are allowed to be moved.
|
|
1554
1483
|
*
|
|
@@ -1558,10 +1487,10 @@ export function canMoveBlock(state, clientId, rootClientId = null) {
|
|
|
1558
1487
|
*
|
|
1559
1488
|
* @return {boolean} Whether the given blocks are allowed to be moved.
|
|
1560
1489
|
*/
|
|
1561
|
-
|
|
1562
1490
|
export function canMoveBlocks(state, clientIds, rootClientId = null) {
|
|
1563
1491
|
return clientIds.every(clientId => canMoveBlock(state, clientId, rootClientId));
|
|
1564
1492
|
}
|
|
1493
|
+
|
|
1565
1494
|
/**
|
|
1566
1495
|
* Determines if the given block is allowed to be edited.
|
|
1567
1496
|
*
|
|
@@ -1570,20 +1499,19 @@ export function canMoveBlocks(state, clientIds, rootClientId = null) {
|
|
|
1570
1499
|
*
|
|
1571
1500
|
* @return {boolean} Whether the given block is allowed to be edited.
|
|
1572
1501
|
*/
|
|
1573
|
-
|
|
1574
1502
|
export function canEditBlock(state, clientId) {
|
|
1575
1503
|
const attributes = getBlockAttributes(state, clientId);
|
|
1576
|
-
|
|
1577
1504
|
if (attributes === null) {
|
|
1578
1505
|
return true;
|
|
1579
1506
|
}
|
|
1580
|
-
|
|
1581
1507
|
const {
|
|
1582
1508
|
lock
|
|
1583
|
-
} = attributes;
|
|
1509
|
+
} = attributes;
|
|
1584
1510
|
|
|
1511
|
+
// When the edit is true, we cannot edit the block.
|
|
1585
1512
|
return !lock?.edit;
|
|
1586
1513
|
}
|
|
1514
|
+
|
|
1587
1515
|
/**
|
|
1588
1516
|
* Determines if the given block type can be locked/unlocked by a user.
|
|
1589
1517
|
*
|
|
@@ -1592,15 +1520,15 @@ export function canEditBlock(state, clientId) {
|
|
|
1592
1520
|
*
|
|
1593
1521
|
* @return {boolean} Whether a given block type can be locked/unlocked.
|
|
1594
1522
|
*/
|
|
1595
|
-
|
|
1596
1523
|
export function canLockBlockType(state, nameOrType) {
|
|
1597
1524
|
if (!hasBlockSupport(nameOrType, 'lock', true)) {
|
|
1598
1525
|
return false;
|
|
1599
|
-
}
|
|
1600
|
-
|
|
1526
|
+
}
|
|
1601
1527
|
|
|
1528
|
+
// Use block editor settings as the default value.
|
|
1602
1529
|
return !!state.settings?.canLockBlocks;
|
|
1603
1530
|
}
|
|
1531
|
+
|
|
1604
1532
|
/**
|
|
1605
1533
|
* Returns information about how recently and frequently a block has been inserted.
|
|
1606
1534
|
*
|
|
@@ -1611,12 +1539,11 @@ export function canLockBlockType(state, nameOrType) {
|
|
|
1611
1539
|
* insert occurred as a UNIX epoch, and `count` which is
|
|
1612
1540
|
* the number of inserts that have occurred.
|
|
1613
1541
|
*/
|
|
1614
|
-
|
|
1615
1542
|
function getInsertUsage(state, id) {
|
|
1616
1543
|
var _state$preferences$in;
|
|
1617
|
-
|
|
1618
1544
|
return (_state$preferences$in = state.preferences.insertUsage?.[id]) !== null && _state$preferences$in !== void 0 ? _state$preferences$in : null;
|
|
1619
1545
|
}
|
|
1546
|
+
|
|
1620
1547
|
/**
|
|
1621
1548
|
* Returns whether we can show a block type in the inserter
|
|
1622
1549
|
*
|
|
@@ -1626,15 +1553,13 @@ function getInsertUsage(state, id) {
|
|
|
1626
1553
|
*
|
|
1627
1554
|
* @return {boolean} Whether the given block type is allowed to be shown in the inserter.
|
|
1628
1555
|
*/
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
1556
|
const canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => {
|
|
1632
1557
|
if (!hasBlockSupport(blockType, 'inserter', true)) {
|
|
1633
1558
|
return false;
|
|
1634
1559
|
}
|
|
1635
|
-
|
|
1636
1560
|
return canInsertBlockTypeUnmemoized(state, blockType.name, rootClientId);
|
|
1637
1561
|
};
|
|
1562
|
+
|
|
1638
1563
|
/**
|
|
1639
1564
|
* Return a function to be used to tranform a block variation to an inserter item
|
|
1640
1565
|
*
|
|
@@ -1642,15 +1567,14 @@ const canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => {
|
|
|
1642
1567
|
* @param {Object} item Denormalized inserter item
|
|
1643
1568
|
* @return {Function} Function to transform a block variation to inserter item
|
|
1644
1569
|
*/
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
1570
|
const getItemFromVariation = (state, item) => variation => {
|
|
1648
1571
|
const variationId = `${item.id}/${variation.name}`;
|
|
1649
1572
|
const {
|
|
1650
1573
|
time,
|
|
1651
1574
|
count = 0
|
|
1652
1575
|
} = getInsertUsage(state, variationId) || {};
|
|
1653
|
-
return {
|
|
1576
|
+
return {
|
|
1577
|
+
...item,
|
|
1654
1578
|
id: variationId,
|
|
1655
1579
|
icon: variation.icon || item.icon,
|
|
1656
1580
|
title: variation.title || item.title,
|
|
@@ -1658,7 +1582,8 @@ const getItemFromVariation = (state, item) => variation => {
|
|
|
1658
1582
|
category: variation.category || item.category,
|
|
1659
1583
|
// If `example` is explicitly undefined for the variation, the preview will not be shown.
|
|
1660
1584
|
example: variation.hasOwnProperty('example') ? variation.example : item.example,
|
|
1661
|
-
initialAttributes: {
|
|
1585
|
+
initialAttributes: {
|
|
1586
|
+
...item.initialAttributes,
|
|
1662
1587
|
...variation.attributes
|
|
1663
1588
|
},
|
|
1664
1589
|
innerBlocks: variation.innerBlocks,
|
|
@@ -1666,6 +1591,7 @@ const getItemFromVariation = (state, item) => variation => {
|
|
|
1666
1591
|
frecency: calculateFrecency(time, count)
|
|
1667
1592
|
};
|
|
1668
1593
|
};
|
|
1594
|
+
|
|
1669
1595
|
/**
|
|
1670
1596
|
* Returns the calculated frecency.
|
|
1671
1597
|
*
|
|
@@ -1677,31 +1603,25 @@ const getItemFromVariation = (state, item) => variation => {
|
|
|
1677
1603
|
*
|
|
1678
1604
|
* @return {number} The calculated frecency.
|
|
1679
1605
|
*/
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
1606
|
const calculateFrecency = (time, count) => {
|
|
1683
1607
|
if (!time) {
|
|
1684
1608
|
return count;
|
|
1685
|
-
}
|
|
1609
|
+
}
|
|
1610
|
+
// The selector is cached, which means Date.now() is the last time that the
|
|
1686
1611
|
// relevant state changed. This suits our needs.
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
1612
|
const duration = Date.now() - time;
|
|
1690
|
-
|
|
1691
1613
|
switch (true) {
|
|
1692
1614
|
case duration < MILLISECONDS_PER_HOUR:
|
|
1693
1615
|
return count * 4;
|
|
1694
|
-
|
|
1695
1616
|
case duration < MILLISECONDS_PER_DAY:
|
|
1696
1617
|
return count * 2;
|
|
1697
|
-
|
|
1698
1618
|
case duration < MILLISECONDS_PER_WEEK:
|
|
1699
1619
|
return count / 2;
|
|
1700
|
-
|
|
1701
1620
|
default:
|
|
1702
1621
|
return count / 4;
|
|
1703
1622
|
}
|
|
1704
1623
|
};
|
|
1624
|
+
|
|
1705
1625
|
/**
|
|
1706
1626
|
* Returns a function that accepts a block type and builds an item to be shown
|
|
1707
1627
|
* in a specific context. It's used for building items for Inserter and available
|
|
@@ -1712,20 +1632,16 @@ const calculateFrecency = (time, count) => {
|
|
|
1712
1632
|
* @param {string} options.buildScope The scope for which the item is going to be used.
|
|
1713
1633
|
* @return {Function} Function returns an item to be shown in a specific context (Inserter|Transforms list).
|
|
1714
1634
|
*/
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
1635
|
const buildBlockTypeItem = (state, {
|
|
1718
1636
|
buildScope = 'inserter'
|
|
1719
1637
|
}) => blockType => {
|
|
1720
1638
|
const id = blockType.name;
|
|
1721
1639
|
let isDisabled = false;
|
|
1722
|
-
|
|
1723
1640
|
if (!hasBlockSupport(blockType.name, 'multiple', true)) {
|
|
1724
1641
|
isDisabled = getBlocksByClientId(state, getClientIdsWithDescendants(state)).some(({
|
|
1725
1642
|
name
|
|
1726
1643
|
}) => name === blockType.name);
|
|
1727
1644
|
}
|
|
1728
|
-
|
|
1729
1645
|
const {
|
|
1730
1646
|
time,
|
|
1731
1647
|
count = 0
|
|
@@ -1740,7 +1656,8 @@ const buildBlockTypeItem = (state, {
|
|
|
1740
1656
|
};
|
|
1741
1657
|
if (buildScope === 'transform') return blockItemBase;
|
|
1742
1658
|
const inserterVariations = getBlockVariations(blockType.name, 'inserter');
|
|
1743
|
-
return {
|
|
1659
|
+
return {
|
|
1660
|
+
...blockItemBase,
|
|
1744
1661
|
initialAttributes: {},
|
|
1745
1662
|
description: blockType.description,
|
|
1746
1663
|
category: blockType.category,
|
|
@@ -1748,9 +1665,9 @@ const buildBlockTypeItem = (state, {
|
|
|
1748
1665
|
variations: inserterVariations,
|
|
1749
1666
|
example: blockType.example,
|
|
1750
1667
|
utility: 1 // Deprecated.
|
|
1751
|
-
|
|
1752
1668
|
};
|
|
1753
1669
|
};
|
|
1670
|
+
|
|
1754
1671
|
/**
|
|
1755
1672
|
* Determines the items that appear in the inserter. Includes both static
|
|
1756
1673
|
* items (e.g. a regular block type) and dynamic items (e.g. a reusable block).
|
|
@@ -1780,11 +1697,12 @@ const buildBlockTypeItem = (state, {
|
|
|
1780
1697
|
* this item.
|
|
1781
1698
|
* @property {number} frecency Heuristic that combines frequency and recency.
|
|
1782
1699
|
*/
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
1700
|
export const getInserterItems = createSelector((state, rootClientId = null) => {
|
|
1786
1701
|
const buildReusableBlockInserterItem = reusableBlock => {
|
|
1787
|
-
const icon =
|
|
1702
|
+
const icon = !reusableBlock.wp_pattern_sync_status ? {
|
|
1703
|
+
src: symbol,
|
|
1704
|
+
foreground: 'var(--wp-block-synced-color)'
|
|
1705
|
+
} : symbol;
|
|
1788
1706
|
const id = `core/block/${reusableBlock.id}`;
|
|
1789
1707
|
const {
|
|
1790
1708
|
time,
|
|
@@ -1809,7 +1727,6 @@ export const getInserterItems = createSelector((state, rootClientId = null) => {
|
|
|
1809
1727
|
syncStatus: reusableBlock.wp_pattern_sync_status
|
|
1810
1728
|
};
|
|
1811
1729
|
};
|
|
1812
|
-
|
|
1813
1730
|
const syncedPatternInserterItems = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) ? getReusableBlocks(state).map(buildReusableBlockInserterItem) : [];
|
|
1814
1731
|
const buildBlockTypeInserterItem = buildBlockTypeItem(state, {
|
|
1815
1732
|
buildScope: 'inserter'
|
|
@@ -1818,26 +1735,25 @@ export const getInserterItems = createSelector((state, rootClientId = null) => {
|
|
|
1818
1735
|
const items = blockTypeInserterItems.reduce((accumulator, item) => {
|
|
1819
1736
|
const {
|
|
1820
1737
|
variations = []
|
|
1821
|
-
} = item;
|
|
1822
|
-
|
|
1738
|
+
} = item;
|
|
1739
|
+
// Exclude any block type item that is to be replaced by a default variation.
|
|
1823
1740
|
if (!variations.some(({
|
|
1824
1741
|
isDefault
|
|
1825
1742
|
}) => isDefault)) {
|
|
1826
1743
|
accumulator.push(item);
|
|
1827
1744
|
}
|
|
1828
|
-
|
|
1829
1745
|
if (variations.length) {
|
|
1830
1746
|
const variationMapper = getItemFromVariation(state, item);
|
|
1831
1747
|
accumulator.push(...variations.map(variationMapper));
|
|
1832
1748
|
}
|
|
1833
|
-
|
|
1834
1749
|
return accumulator;
|
|
1835
|
-
}, []);
|
|
1750
|
+
}, []);
|
|
1751
|
+
|
|
1752
|
+
// Ensure core blocks are prioritized in the returned results,
|
|
1836
1753
|
// because third party blocks can be registered earlier than
|
|
1837
1754
|
// the core blocks (usually by using the `init` action),
|
|
1838
1755
|
// thus affecting the display order.
|
|
1839
1756
|
// We don't sort reusable blocks as they are handled differently.
|
|
1840
|
-
|
|
1841
1757
|
const groupByType = (blocks, block) => {
|
|
1842
1758
|
const {
|
|
1843
1759
|
core,
|
|
@@ -1847,7 +1763,6 @@ export const getInserterItems = createSelector((state, rootClientId = null) => {
|
|
|
1847
1763
|
type.push(block);
|
|
1848
1764
|
return blocks;
|
|
1849
1765
|
};
|
|
1850
|
-
|
|
1851
1766
|
const {
|
|
1852
1767
|
core: coreItems,
|
|
1853
1768
|
noncore: nonCoreItems
|
|
@@ -1858,6 +1773,7 @@ export const getInserterItems = createSelector((state, rootClientId = null) => {
|
|
|
1858
1773
|
const sortedBlockTypes = [...coreItems, ...nonCoreItems];
|
|
1859
1774
|
return [...sortedBlockTypes, ...syncedPatternInserterItems];
|
|
1860
1775
|
}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.blocks.order, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, getReusableBlocks(state), getBlockTypes()]);
|
|
1776
|
+
|
|
1861
1777
|
/**
|
|
1862
1778
|
* Determines the items that appear in the available block transforms list.
|
|
1863
1779
|
*
|
|
@@ -1884,7 +1800,6 @@ export const getInserterItems = createSelector((state, rootClientId = null) => {
|
|
|
1884
1800
|
* this item.
|
|
1885
1801
|
* @property {number} frecency Heuristic that combines frequency and recency.
|
|
1886
1802
|
*/
|
|
1887
|
-
|
|
1888
1803
|
export const getBlockTransformItems = createSelector((state, blocks, rootClientId = null) => {
|
|
1889
1804
|
const normalizedBlocks = Array.isArray(blocks) ? blocks : [blocks];
|
|
1890
1805
|
const buildBlockTypeTransformItem = buildBlockTypeItem(state, {
|
|
@@ -1896,11 +1811,11 @@ export const getBlockTransformItems = createSelector((state, blocks, rootClientI
|
|
|
1896
1811
|
if (itemsByName[block?.name]) {
|
|
1897
1812
|
accumulator.push(itemsByName[block.name]);
|
|
1898
1813
|
}
|
|
1899
|
-
|
|
1900
1814
|
return accumulator;
|
|
1901
1815
|
}, []);
|
|
1902
1816
|
return orderBy(possibleTransforms, block => itemsByName[block.name].frecency, 'desc');
|
|
1903
1817
|
}, (state, blocks, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, getBlockTypes()]);
|
|
1818
|
+
|
|
1904
1819
|
/**
|
|
1905
1820
|
* Determines whether there are items to show in the inserter.
|
|
1906
1821
|
*
|
|
@@ -1909,17 +1824,15 @@ export const getBlockTransformItems = createSelector((state, blocks, rootClientI
|
|
|
1909
1824
|
*
|
|
1910
1825
|
* @return {boolean} Items that appear in inserter.
|
|
1911
1826
|
*/
|
|
1912
|
-
|
|
1913
1827
|
export const hasInserterItems = createSelector((state, rootClientId = null) => {
|
|
1914
1828
|
const hasBlockType = getBlockTypes().some(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId));
|
|
1915
|
-
|
|
1916
1829
|
if (hasBlockType) {
|
|
1917
1830
|
return true;
|
|
1918
1831
|
}
|
|
1919
|
-
|
|
1920
1832
|
const hasReusableBlock = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) && getReusableBlocks(state).length > 0;
|
|
1921
1833
|
return hasReusableBlock;
|
|
1922
1834
|
}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.settings.allowedBlockTypes, state.settings.templateLock, getReusableBlocks(state), getBlockTypes()]);
|
|
1835
|
+
|
|
1923
1836
|
/**
|
|
1924
1837
|
* Returns the list of allowed inserter blocks for inner blocks children.
|
|
1925
1838
|
*
|
|
@@ -1928,12 +1841,10 @@ export const hasInserterItems = createSelector((state, rootClientId = null) => {
|
|
|
1928
1841
|
*
|
|
1929
1842
|
* @return {Array?} The list of allowed block types.
|
|
1930
1843
|
*/
|
|
1931
|
-
|
|
1932
1844
|
export const getAllowedBlocks = createSelector((state, rootClientId = null) => {
|
|
1933
1845
|
if (!rootClientId) {
|
|
1934
1846
|
return;
|
|
1935
1847
|
}
|
|
1936
|
-
|
|
1937
1848
|
const blockTypes = getBlockTypes().filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId));
|
|
1938
1849
|
const hasReusableBlock = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) && getReusableBlocks(state).length > 0;
|
|
1939
1850
|
return [...blockTypes, ...(hasReusableBlock ? ['core/block'] : [])];
|
|
@@ -1946,6 +1857,7 @@ export const __experimentalGetAllowedBlocks = createSelector((state, rootClientI
|
|
|
1946
1857
|
});
|
|
1947
1858
|
return getAllowedBlocks(state, rootClientId);
|
|
1948
1859
|
}, (state, rootClientId) => [...getAllowedBlocks.getDependants(state, rootClientId)]);
|
|
1860
|
+
|
|
1949
1861
|
/**
|
|
1950
1862
|
* Returns the block to be directly inserted by the block appender.
|
|
1951
1863
|
*
|
|
@@ -1959,23 +1871,18 @@ export const __experimentalGetAllowedBlocks = createSelector((state, rootClientI
|
|
|
1959
1871
|
* @property {?Object} attributes Attributes to pass to the newly created block.
|
|
1960
1872
|
* @property {?Array<string>} attributesToCopy Attributes to be copied from adjecent blocks when inserted.
|
|
1961
1873
|
*/
|
|
1962
|
-
|
|
1963
1874
|
export const getDirectInsertBlock = createSelector((state, rootClientId = null) => {
|
|
1964
1875
|
if (!rootClientId) {
|
|
1965
1876
|
return;
|
|
1966
1877
|
}
|
|
1967
|
-
|
|
1968
1878
|
const defaultBlock = state.blockListSettings[rootClientId]?.defaultBlock;
|
|
1969
1879
|
const directInsert = state.blockListSettings[rootClientId]?.directInsert;
|
|
1970
|
-
|
|
1971
1880
|
if (!defaultBlock || !directInsert) {
|
|
1972
1881
|
return;
|
|
1973
1882
|
}
|
|
1974
|
-
|
|
1975
1883
|
if (typeof directInsert === 'function') {
|
|
1976
1884
|
return directInsert(getBlock(state, rootClientId)) ? defaultBlock : null;
|
|
1977
1885
|
}
|
|
1978
|
-
|
|
1979
1886
|
return defaultBlock;
|
|
1980
1887
|
}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.tree.get(rootClientId)]);
|
|
1981
1888
|
export const __experimentalGetDirectInsertBlock = createSelector((state, rootClientId = null) => {
|
|
@@ -1986,33 +1893,25 @@ export const __experimentalGetDirectInsertBlock = createSelector((state, rootCli
|
|
|
1986
1893
|
});
|
|
1987
1894
|
return getDirectInsertBlock(state, rootClientId);
|
|
1988
1895
|
}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.tree.get(rootClientId)]);
|
|
1989
|
-
|
|
1990
1896
|
const checkAllowListRecursive = (blocks, allowedBlockTypes) => {
|
|
1991
1897
|
if (typeof allowedBlockTypes === 'boolean') {
|
|
1992
1898
|
return allowedBlockTypes;
|
|
1993
1899
|
}
|
|
1994
|
-
|
|
1995
1900
|
const blocksQueue = [...blocks];
|
|
1996
|
-
|
|
1997
1901
|
while (blocksQueue.length > 0) {
|
|
1998
1902
|
const block = blocksQueue.shift();
|
|
1999
1903
|
const isAllowed = checkAllowList(allowedBlockTypes, block.name || block.blockName, true);
|
|
2000
|
-
|
|
2001
1904
|
if (!isAllowed) {
|
|
2002
1905
|
return false;
|
|
2003
1906
|
}
|
|
2004
|
-
|
|
2005
1907
|
block.innerBlocks?.forEach(innerBlock => {
|
|
2006
1908
|
blocksQueue.push(innerBlock);
|
|
2007
1909
|
});
|
|
2008
1910
|
}
|
|
2009
|
-
|
|
2010
1911
|
return true;
|
|
2011
1912
|
};
|
|
2012
|
-
|
|
2013
1913
|
function getUnsyncedPatterns(state) {
|
|
2014
1914
|
var _state$settings$__exp;
|
|
2015
|
-
|
|
2016
1915
|
const reusableBlocks = (_state$settings$__exp = state?.settings?.__experimentalReusableBlocks) !== null && _state$settings$__exp !== void 0 ? _state$settings$__exp : EMPTY_ARRAY;
|
|
2017
1916
|
return reusableBlocks.filter(reusableBlock => reusableBlock.wp_pattern_sync_status === 'unsynced').map(reusableBlock => {
|
|
2018
1917
|
return {
|
|
@@ -2023,19 +1922,17 @@ function getUnsyncedPatterns(state) {
|
|
|
2023
1922
|
};
|
|
2024
1923
|
});
|
|
2025
1924
|
}
|
|
2026
|
-
|
|
2027
1925
|
export const __experimentalGetParsedPattern = createSelector((state, patternName) => {
|
|
2028
1926
|
const patterns = state.settings.__experimentalBlockPatterns;
|
|
2029
1927
|
const unsyncedPatterns = getUnsyncedPatterns(state);
|
|
2030
1928
|
const pattern = [...patterns, ...unsyncedPatterns].find(({
|
|
2031
1929
|
name
|
|
2032
1930
|
}) => name === patternName);
|
|
2033
|
-
|
|
2034
1931
|
if (!pattern) {
|
|
2035
1932
|
return null;
|
|
2036
1933
|
}
|
|
2037
|
-
|
|
2038
|
-
|
|
1934
|
+
return {
|
|
1935
|
+
...pattern,
|
|
2039
1936
|
blocks: parse(pattern.content, {
|
|
2040
1937
|
__unstableSkipMigrationLogs: true
|
|
2041
1938
|
})
|
|
@@ -2057,6 +1954,7 @@ const getAllAllowedPatterns = createSelector(state => {
|
|
|
2057
1954
|
}) => checkAllowListRecursive(blocks, allowedBlockTypes));
|
|
2058
1955
|
return allowedPatterns;
|
|
2059
1956
|
}, state => [state.settings.__experimentalBlockPatterns, state.settings.__experimentalReusableBlocks, state.settings.allowedBlockTypes]);
|
|
1957
|
+
|
|
2060
1958
|
/**
|
|
2061
1959
|
* Returns the list of allowed patterns for inner blocks children.
|
|
2062
1960
|
*
|
|
@@ -2065,7 +1963,6 @@ const getAllAllowedPatterns = createSelector(state => {
|
|
|
2065
1963
|
*
|
|
2066
1964
|
* @return {Array?} The list of allowed patterns.
|
|
2067
1965
|
*/
|
|
2068
|
-
|
|
2069
1966
|
export const __experimentalGetAllowedPatterns = createSelector((state, rootClientId = null) => {
|
|
2070
1967
|
const availableParsedPatterns = getAllAllowedPatterns(state);
|
|
2071
1968
|
const patternsAllowed = availableParsedPatterns.filter(({
|
|
@@ -2075,6 +1972,7 @@ export const __experimentalGetAllowedPatterns = createSelector((state, rootClien
|
|
|
2075
1972
|
}) => canInsertBlockType(state, name, rootClientId)));
|
|
2076
1973
|
return patternsAllowed;
|
|
2077
1974
|
}, (state, rootClientId) => [state.settings.__experimentalBlockPatterns, state.settings.__experimentalReusableBlocks, state.settings.allowedBlockTypes, state.settings.templateLock, state.blockListSettings[rootClientId], state.blocks.byClientId.get(rootClientId)]);
|
|
1975
|
+
|
|
2078
1976
|
/**
|
|
2079
1977
|
* Returns the list of patterns based on their declared `blockTypes`
|
|
2080
1978
|
* and a block's name.
|
|
@@ -2088,19 +1986,14 @@ export const __experimentalGetAllowedPatterns = createSelector((state, rootClien
|
|
|
2088
1986
|
*
|
|
2089
1987
|
* @return {Array} The list of matched block patterns based on declared `blockTypes` and block name.
|
|
2090
1988
|
*/
|
|
2091
|
-
|
|
2092
1989
|
export const getPatternsByBlockTypes = createSelector((state, blockNames, rootClientId = null) => {
|
|
2093
1990
|
if (!blockNames) return EMPTY_ARRAY;
|
|
2094
|
-
|
|
2095
1991
|
const patterns = __experimentalGetAllowedPatterns(state, rootClientId);
|
|
2096
|
-
|
|
2097
1992
|
const normalizedBlockNames = Array.isArray(blockNames) ? blockNames : [blockNames];
|
|
2098
1993
|
const filteredPatterns = patterns.filter(pattern => pattern?.blockTypes?.some?.(blockName => normalizedBlockNames.includes(blockName)));
|
|
2099
|
-
|
|
2100
1994
|
if (filteredPatterns.length === 0) {
|
|
2101
1995
|
return EMPTY_ARRAY;
|
|
2102
1996
|
}
|
|
2103
|
-
|
|
2104
1997
|
return filteredPatterns;
|
|
2105
1998
|
}, (state, blockNames, rootClientId) => [...__experimentalGetAllowedPatterns.getDependants(state, rootClientId)]);
|
|
2106
1999
|
export const __experimentalGetPatternsByBlockTypes = createSelector((state, blockNames, rootClientId = null) => {
|
|
@@ -2111,6 +2004,7 @@ export const __experimentalGetPatternsByBlockTypes = createSelector((state, bloc
|
|
|
2111
2004
|
});
|
|
2112
2005
|
return getPatternsByBlockTypes(state, blockNames, rootClientId);
|
|
2113
2006
|
}, (state, blockNames, rootClientId) => [...__experimentalGetAllowedPatterns.getDependants(state, rootClientId)]);
|
|
2007
|
+
|
|
2114
2008
|
/**
|
|
2115
2009
|
* Determines the items that appear in the available pattern transforms list.
|
|
2116
2010
|
*
|
|
@@ -2128,7 +2022,6 @@ export const __experimentalGetPatternsByBlockTypes = createSelector((state, bloc
|
|
|
2128
2022
|
*
|
|
2129
2023
|
* @return {WPBlockPattern[]} Items that are eligible for a pattern transformation.
|
|
2130
2024
|
*/
|
|
2131
|
-
|
|
2132
2025
|
export const __experimentalGetPatternTransformItems = createSelector((state, blocks, rootClientId = null) => {
|
|
2133
2026
|
if (!blocks) return EMPTY_ARRAY;
|
|
2134
2027
|
/**
|
|
@@ -2138,15 +2031,14 @@ export const __experimentalGetPatternTransformItems = createSelector((state, blo
|
|
|
2138
2031
|
* return the inner blocks of an inner block controller, so we still need
|
|
2139
2032
|
* to check for this case too.
|
|
2140
2033
|
*/
|
|
2141
|
-
|
|
2142
2034
|
if (blocks.some(({
|
|
2143
2035
|
clientId,
|
|
2144
2036
|
innerBlocks
|
|
2145
2037
|
}) => innerBlocks.length || areInnerBlocksControlled(state, clientId))) {
|
|
2146
2038
|
return EMPTY_ARRAY;
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2039
|
+
}
|
|
2149
2040
|
|
|
2041
|
+
// Create a Set of the selected block names that is used in patterns filtering.
|
|
2150
2042
|
const selectedBlockNames = Array.from(new Set(blocks.map(({
|
|
2151
2043
|
name
|
|
2152
2044
|
}) => name)));
|
|
@@ -2156,9 +2048,9 @@ export const __experimentalGetPatternTransformItems = createSelector((state, blo
|
|
|
2156
2048
|
* block pattern's blocks and try to find matches from the selected blocks.
|
|
2157
2049
|
* Now this happens in the consumer to avoid heavy operations in the selector.
|
|
2158
2050
|
*/
|
|
2159
|
-
|
|
2160
2051
|
return getPatternsByBlockTypes(state, selectedBlockNames, rootClientId);
|
|
2161
2052
|
}, (state, blocks, rootClientId) => [...getPatternsByBlockTypes.getDependants(state, rootClientId)]);
|
|
2053
|
+
|
|
2162
2054
|
/**
|
|
2163
2055
|
* Returns the Block List settings of a block, if any exist.
|
|
2164
2056
|
*
|
|
@@ -2167,10 +2059,10 @@ export const __experimentalGetPatternTransformItems = createSelector((state, blo
|
|
|
2167
2059
|
*
|
|
2168
2060
|
* @return {?Object} Block settings of the block if set.
|
|
2169
2061
|
*/
|
|
2170
|
-
|
|
2171
2062
|
export function getBlockListSettings(state, clientId) {
|
|
2172
2063
|
return state.blockListSettings[clientId];
|
|
2173
2064
|
}
|
|
2065
|
+
|
|
2174
2066
|
/**
|
|
2175
2067
|
* Returns the editor settings.
|
|
2176
2068
|
*
|
|
@@ -2178,10 +2070,10 @@ export function getBlockListSettings(state, clientId) {
|
|
|
2178
2070
|
*
|
|
2179
2071
|
* @return {Object} The editor settings object.
|
|
2180
2072
|
*/
|
|
2181
|
-
|
|
2182
2073
|
export function getSettings(state) {
|
|
2183
2074
|
return state.settings;
|
|
2184
2075
|
}
|
|
2076
|
+
|
|
2185
2077
|
/**
|
|
2186
2078
|
* Returns true if the most recent block change is be considered persistent, or
|
|
2187
2079
|
* false otherwise. A persistent change is one committed by BlockEditorProvider
|
|
@@ -2191,10 +2083,10 @@ export function getSettings(state) {
|
|
|
2191
2083
|
*
|
|
2192
2084
|
* @return {boolean} Whether the most recent block change was persistent.
|
|
2193
2085
|
*/
|
|
2194
|
-
|
|
2195
2086
|
export function isLastBlockChangePersistent(state) {
|
|
2196
2087
|
return state.blocks.isPersistentChange;
|
|
2197
2088
|
}
|
|
2089
|
+
|
|
2198
2090
|
/**
|
|
2199
2091
|
* Returns the block list settings for an array of blocks, if any exist.
|
|
2200
2092
|
*
|
|
@@ -2204,18 +2096,18 @@ export function isLastBlockChangePersistent(state) {
|
|
|
2204
2096
|
* @return {Object} An object where the keys are client ids and the values are
|
|
2205
2097
|
* a block list setting object.
|
|
2206
2098
|
*/
|
|
2207
|
-
|
|
2208
2099
|
export const __experimentalGetBlockListSettingsForBlocks = createSelector((state, clientIds = []) => {
|
|
2209
2100
|
return clientIds.reduce((blockListSettingsForBlocks, clientId) => {
|
|
2210
2101
|
if (!state.blockListSettings[clientId]) {
|
|
2211
2102
|
return blockListSettingsForBlocks;
|
|
2212
2103
|
}
|
|
2213
|
-
|
|
2214
|
-
|
|
2104
|
+
return {
|
|
2105
|
+
...blockListSettingsForBlocks,
|
|
2215
2106
|
[clientId]: state.blockListSettings[clientId]
|
|
2216
2107
|
};
|
|
2217
2108
|
}, {});
|
|
2218
2109
|
}, state => [state.blockListSettings]);
|
|
2110
|
+
|
|
2219
2111
|
/**
|
|
2220
2112
|
* Returns the title of a given reusable block
|
|
2221
2113
|
*
|
|
@@ -2224,16 +2116,14 @@ export const __experimentalGetBlockListSettingsForBlocks = createSelector((state
|
|
|
2224
2116
|
*
|
|
2225
2117
|
* @return {string} The reusable block saved title.
|
|
2226
2118
|
*/
|
|
2227
|
-
|
|
2228
2119
|
export const __experimentalGetReusableBlockTitle = createSelector((state, ref) => {
|
|
2229
2120
|
const reusableBlock = getReusableBlocks(state).find(block => block.id === ref);
|
|
2230
|
-
|
|
2231
2121
|
if (!reusableBlock) {
|
|
2232
2122
|
return null;
|
|
2233
2123
|
}
|
|
2234
|
-
|
|
2235
2124
|
return reusableBlock.title?.raw;
|
|
2236
2125
|
}, state => [getReusableBlocks(state)]);
|
|
2126
|
+
|
|
2237
2127
|
/**
|
|
2238
2128
|
* Returns true if the most recent block change is be considered ignored, or
|
|
2239
2129
|
* false otherwise. An ignored change is one not to be committed by
|
|
@@ -2243,7 +2133,6 @@ export const __experimentalGetReusableBlockTitle = createSelector((state, ref) =
|
|
|
2243
2133
|
*
|
|
2244
2134
|
* @return {boolean} Whether the most recent block change was ignored.
|
|
2245
2135
|
*/
|
|
2246
|
-
|
|
2247
2136
|
export function __unstableIsLastBlockChangeIgnored(state) {
|
|
2248
2137
|
// TODO: Removal Plan: Changes incurred by RECEIVE_BLOCKS should not be
|
|
2249
2138
|
// ignored if in-fact they result in a change in blocks state. The current
|
|
@@ -2252,6 +2141,7 @@ export function __unstableIsLastBlockChangeIgnored(state) {
|
|
|
2252
2141
|
// their own separate block editor / state (#7119).
|
|
2253
2142
|
return state.blocks.isIgnoredChange;
|
|
2254
2143
|
}
|
|
2144
|
+
|
|
2255
2145
|
/**
|
|
2256
2146
|
* Returns the block attributes changed as a result of the last dispatched
|
|
2257
2147
|
* action.
|
|
@@ -2261,10 +2151,10 @@ export function __unstableIsLastBlockChangeIgnored(state) {
|
|
|
2261
2151
|
* @return {Object<string,Object>} Subsets of block attributes changed, keyed
|
|
2262
2152
|
* by block client ID.
|
|
2263
2153
|
*/
|
|
2264
|
-
|
|
2265
2154
|
export function __experimentalGetLastBlockAttributeChanges(state) {
|
|
2266
2155
|
return state.lastBlockAttributesChange;
|
|
2267
2156
|
}
|
|
2157
|
+
|
|
2268
2158
|
/**
|
|
2269
2159
|
* Returns the available reusable blocks
|
|
2270
2160
|
*
|
|
@@ -2272,12 +2162,11 @@ export function __experimentalGetLastBlockAttributeChanges(state) {
|
|
|
2272
2162
|
*
|
|
2273
2163
|
* @return {Array} Reusable blocks
|
|
2274
2164
|
*/
|
|
2275
|
-
|
|
2276
2165
|
function getReusableBlocks(state) {
|
|
2277
2166
|
var _state$settings$__exp2;
|
|
2278
|
-
|
|
2279
2167
|
return (_state$settings$__exp2 = state?.settings?.__experimentalReusableBlocks) !== null && _state$settings$__exp2 !== void 0 ? _state$settings$__exp2 : EMPTY_ARRAY;
|
|
2280
2168
|
}
|
|
2169
|
+
|
|
2281
2170
|
/**
|
|
2282
2171
|
* Returns whether the navigation mode is enabled.
|
|
2283
2172
|
*
|
|
@@ -2285,11 +2174,10 @@ function getReusableBlocks(state) {
|
|
|
2285
2174
|
*
|
|
2286
2175
|
* @return {boolean} Is navigation mode enabled.
|
|
2287
2176
|
*/
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
2177
|
export function isNavigationMode(state) {
|
|
2291
2178
|
return state.editorMode === 'navigation';
|
|
2292
2179
|
}
|
|
2180
|
+
|
|
2293
2181
|
/**
|
|
2294
2182
|
* Returns the current editor mode.
|
|
2295
2183
|
*
|
|
@@ -2297,10 +2185,10 @@ export function isNavigationMode(state) {
|
|
|
2297
2185
|
*
|
|
2298
2186
|
* @return {string} the editor mode.
|
|
2299
2187
|
*/
|
|
2300
|
-
|
|
2301
2188
|
export function __unstableGetEditorMode(state) {
|
|
2302
2189
|
return state.editorMode;
|
|
2303
2190
|
}
|
|
2191
|
+
|
|
2304
2192
|
/**
|
|
2305
2193
|
* Returns whether block moving mode is enabled.
|
|
2306
2194
|
*
|
|
@@ -2308,10 +2196,10 @@ export function __unstableGetEditorMode(state) {
|
|
|
2308
2196
|
*
|
|
2309
2197
|
* @return {string} Client Id of moving block.
|
|
2310
2198
|
*/
|
|
2311
|
-
|
|
2312
2199
|
export function hasBlockMovingClientId(state) {
|
|
2313
2200
|
return state.hasBlockMovingClientId;
|
|
2314
2201
|
}
|
|
2202
|
+
|
|
2315
2203
|
/**
|
|
2316
2204
|
* Returns true if the last change was an automatic change, false otherwise.
|
|
2317
2205
|
*
|
|
@@ -2319,10 +2207,10 @@ export function hasBlockMovingClientId(state) {
|
|
|
2319
2207
|
*
|
|
2320
2208
|
* @return {boolean} Whether the last change was automatic.
|
|
2321
2209
|
*/
|
|
2322
|
-
|
|
2323
2210
|
export function didAutomaticChange(state) {
|
|
2324
2211
|
return !!state.automaticChangeStatus;
|
|
2325
2212
|
}
|
|
2213
|
+
|
|
2326
2214
|
/**
|
|
2327
2215
|
* Returns true if the current highlighted block matches the block clientId.
|
|
2328
2216
|
*
|
|
@@ -2331,10 +2219,10 @@ export function didAutomaticChange(state) {
|
|
|
2331
2219
|
*
|
|
2332
2220
|
* @return {boolean} Whether the block is currently highlighted.
|
|
2333
2221
|
*/
|
|
2334
|
-
|
|
2335
2222
|
export function isBlockHighlighted(state, clientId) {
|
|
2336
2223
|
return state.highlightedBlock === clientId;
|
|
2337
2224
|
}
|
|
2225
|
+
|
|
2338
2226
|
/**
|
|
2339
2227
|
* Checks if a given block has controlled inner blocks.
|
|
2340
2228
|
*
|
|
@@ -2343,10 +2231,10 @@ export function isBlockHighlighted(state, clientId) {
|
|
|
2343
2231
|
*
|
|
2344
2232
|
* @return {boolean} True if the block has controlled inner blocks.
|
|
2345
2233
|
*/
|
|
2346
|
-
|
|
2347
2234
|
export function areInnerBlocksControlled(state, clientId) {
|
|
2348
2235
|
return !!state.blocks.controlledInnerBlocks[clientId];
|
|
2349
2236
|
}
|
|
2237
|
+
|
|
2350
2238
|
/**
|
|
2351
2239
|
* Returns the clientId for the first 'active' block of a given array of block names.
|
|
2352
2240
|
* A block is 'active' if it (or a child) is the selected block.
|
|
@@ -2357,30 +2245,25 @@ export function areInnerBlocksControlled(state, clientId) {
|
|
|
2357
2245
|
*
|
|
2358
2246
|
* @return {string} The matching block's clientId.
|
|
2359
2247
|
*/
|
|
2360
|
-
|
|
2361
2248
|
export const __experimentalGetActiveBlockIdByBlockNames = createSelector((state, validBlockNames) => {
|
|
2362
2249
|
if (!validBlockNames.length) {
|
|
2363
2250
|
return null;
|
|
2364
|
-
}
|
|
2365
|
-
|
|
2366
|
-
|
|
2251
|
+
}
|
|
2252
|
+
// Check if selected block is a valid entity area.
|
|
2367
2253
|
const selectedBlockClientId = getSelectedBlockClientId(state);
|
|
2368
|
-
|
|
2369
2254
|
if (validBlockNames.includes(getBlockName(state, selectedBlockClientId))) {
|
|
2370
2255
|
return selectedBlockClientId;
|
|
2371
|
-
}
|
|
2372
|
-
|
|
2373
|
-
|
|
2256
|
+
}
|
|
2257
|
+
// Check if first selected block is a child of a valid entity area.
|
|
2374
2258
|
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state);
|
|
2375
2259
|
const entityAreaParents = getBlockParentsByBlockName(state, selectedBlockClientId || multiSelectedBlockClientIds[0], validBlockNames);
|
|
2376
|
-
|
|
2377
2260
|
if (entityAreaParents) {
|
|
2378
2261
|
// Last parent closest/most interior.
|
|
2379
2262
|
return entityAreaParents[entityAreaParents.length - 1];
|
|
2380
2263
|
}
|
|
2381
|
-
|
|
2382
2264
|
return null;
|
|
2383
2265
|
}, (state, validBlockNames) => [state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId, validBlockNames]);
|
|
2266
|
+
|
|
2384
2267
|
/**
|
|
2385
2268
|
* Tells if the block with the passed clientId was just inserted.
|
|
2386
2269
|
*
|
|
@@ -2389,13 +2272,13 @@ export const __experimentalGetActiveBlockIdByBlockNames = createSelector((state,
|
|
|
2389
2272
|
* @param {?string} source Optional insertion source of the block.
|
|
2390
2273
|
* @return {boolean} True if the block matches the last block inserted from the specified source.
|
|
2391
2274
|
*/
|
|
2392
|
-
|
|
2393
2275
|
export function wasBlockJustInserted(state, clientId, source) {
|
|
2394
2276
|
const {
|
|
2395
2277
|
lastBlockInserted
|
|
2396
2278
|
} = state;
|
|
2397
2279
|
return lastBlockInserted.clientIds?.includes(clientId) && lastBlockInserted.source === source;
|
|
2398
2280
|
}
|
|
2281
|
+
|
|
2399
2282
|
/**
|
|
2400
2283
|
* Tells if the block is visible on the canvas or not.
|
|
2401
2284
|
*
|
|
@@ -2403,48 +2286,42 @@ export function wasBlockJustInserted(state, clientId, source) {
|
|
|
2403
2286
|
* @param {Object} clientId Client Id of the block.
|
|
2404
2287
|
* @return {boolean} True if the block is visible.
|
|
2405
2288
|
*/
|
|
2406
|
-
|
|
2407
2289
|
export function isBlockVisible(state, clientId) {
|
|
2408
2290
|
var _state$blockVisibilit;
|
|
2409
|
-
|
|
2410
2291
|
return (_state$blockVisibilit = state.blockVisibility?.[clientId]) !== null && _state$blockVisibilit !== void 0 ? _state$blockVisibilit : true;
|
|
2411
2292
|
}
|
|
2293
|
+
|
|
2412
2294
|
/**
|
|
2413
2295
|
* Returns the list of all hidden blocks.
|
|
2414
2296
|
*
|
|
2415
2297
|
* @param {Object} state Global application state.
|
|
2416
2298
|
* @return {[string]} List of hidden blocks.
|
|
2417
2299
|
*/
|
|
2418
|
-
|
|
2419
2300
|
export const __unstableGetVisibleBlocks = createSelector(state => {
|
|
2420
2301
|
const visibleBlocks = new Set(Object.keys(state.blockVisibility).filter(key => state.blockVisibility[key]));
|
|
2421
|
-
|
|
2422
2302
|
if (visibleBlocks.size === 0) {
|
|
2423
2303
|
return EMPTY_SET;
|
|
2424
2304
|
}
|
|
2425
|
-
|
|
2426
2305
|
return visibleBlocks;
|
|
2427
2306
|
}, state => [state.blockVisibility]);
|
|
2307
|
+
|
|
2428
2308
|
/**
|
|
2429
2309
|
* DO-NOT-USE in production.
|
|
2430
2310
|
* This selector is created for internal/experimental only usage and may be
|
|
2431
2311
|
* removed anytime without any warning, causing breakage on any plugin or theme invoking it.
|
|
2432
2312
|
*/
|
|
2433
|
-
|
|
2434
2313
|
export const __unstableGetContentLockingParent = createSelector((state, clientId) => {
|
|
2435
2314
|
let current = clientId;
|
|
2436
2315
|
let result;
|
|
2437
|
-
|
|
2438
2316
|
while (state.blocks.parents.has(current)) {
|
|
2439
2317
|
current = state.blocks.parents.get(current);
|
|
2440
|
-
|
|
2441
2318
|
if (current && getTemplateLock(state, current) === 'contentOnly') {
|
|
2442
2319
|
result = current;
|
|
2443
2320
|
}
|
|
2444
2321
|
}
|
|
2445
|
-
|
|
2446
2322
|
return result;
|
|
2447
2323
|
}, state => [state.blocks.parents, state.blockListSettings]);
|
|
2324
|
+
|
|
2448
2325
|
/**
|
|
2449
2326
|
* DO-NOT-USE in production.
|
|
2450
2327
|
* This selector is created for internal/experimental only usage and may be
|
|
@@ -2452,7 +2329,6 @@ export const __unstableGetContentLockingParent = createSelector((state, clientId
|
|
|
2452
2329
|
*
|
|
2453
2330
|
* @param {Object} state Global application state.
|
|
2454
2331
|
*/
|
|
2455
|
-
|
|
2456
2332
|
export function __unstableGetTemporarilyEditingAsBlocks(state) {
|
|
2457
2333
|
return state.temporarilyEditingAsBlocks;
|
|
2458
2334
|
}
|
|
@@ -2463,40 +2339,86 @@ export function __unstableHasActiveBlockOverlayActive(state, clientId) {
|
|
|
2463
2339
|
// since there will be no controls to interact with once selected.
|
|
2464
2340
|
if (getBlockEditingMode(state, clientId) !== 'default') {
|
|
2465
2341
|
return false;
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2342
|
+
}
|
|
2468
2343
|
|
|
2344
|
+
// If the block editing is locked, the block overlay is always active.
|
|
2469
2345
|
if (!canEditBlock(state, clientId)) {
|
|
2470
2346
|
return true;
|
|
2471
2347
|
}
|
|
2348
|
+
const editorMode = __unstableGetEditorMode(state);
|
|
2472
2349
|
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2350
|
+
// In zoom-out mode, the block overlay is always active for top level blocks.
|
|
2476
2351
|
if (editorMode === 'zoom-out' && clientId && !getBlockRootClientId(state, clientId)) {
|
|
2477
2352
|
return true;
|
|
2478
|
-
}
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
// In navigation mode, the block overlay is active when the block is not
|
|
2479
2356
|
// selected (and doesn't contain a selected child). The same behavior is
|
|
2480
2357
|
// also enabled in all modes for blocks that have controlled children
|
|
2481
2358
|
// (reusable block, template part, navigation), unless explicitly disabled
|
|
2482
2359
|
// with `supports.__experimentalDisableBlockOverlay`.
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
2360
|
const blockSupportDisable = hasBlockSupport(getBlockName(state, clientId), '__experimentalDisableBlockOverlay', false);
|
|
2486
2361
|
const shouldEnableIfUnselected = editorMode === 'navigation' || (blockSupportDisable ? false : areInnerBlocksControlled(state, clientId));
|
|
2487
2362
|
return shouldEnableIfUnselected && !isBlockSelected(state, clientId) && !hasSelectedInnerBlock(state, clientId, true);
|
|
2488
2363
|
}
|
|
2489
2364
|
export function __unstableIsWithinBlockOverlay(state, clientId) {
|
|
2490
2365
|
let parent = state.blocks.parents.get(clientId);
|
|
2491
|
-
|
|
2492
2366
|
while (!!parent) {
|
|
2493
2367
|
if (__unstableHasActiveBlockOverlayActive(state, parent)) {
|
|
2494
2368
|
return true;
|
|
2495
2369
|
}
|
|
2496
|
-
|
|
2497
2370
|
parent = state.blocks.parents.get(parent);
|
|
2498
2371
|
}
|
|
2499
|
-
|
|
2500
2372
|
return false;
|
|
2501
2373
|
}
|
|
2374
|
+
|
|
2375
|
+
/**
|
|
2376
|
+
* @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode
|
|
2377
|
+
*/
|
|
2378
|
+
|
|
2379
|
+
/**
|
|
2380
|
+
* Returns the block editing mode for a given block.
|
|
2381
|
+
*
|
|
2382
|
+
* The mode can be one of three options:
|
|
2383
|
+
*
|
|
2384
|
+
* - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be
|
|
2385
|
+
* selected.
|
|
2386
|
+
* - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the
|
|
2387
|
+
* toolbar, the block movers, block settings.
|
|
2388
|
+
* - `'default'`: Allows editing the block as normal.
|
|
2389
|
+
*
|
|
2390
|
+
* Blocks can set a mode using the `useBlockEditingMode` hook.
|
|
2391
|
+
*
|
|
2392
|
+
* The mode is inherited by all of the block's inner blocks, unless they have
|
|
2393
|
+
* their own mode.
|
|
2394
|
+
*
|
|
2395
|
+
* A template lock can also set a mode. If the template lock is `'contentOnly'`,
|
|
2396
|
+
* the block's mode is overridden to `'contentOnly'` if the block has a content
|
|
2397
|
+
* role attribute, or `'disabled'` otherwise.
|
|
2398
|
+
*
|
|
2399
|
+
* @see useBlockEditingMode
|
|
2400
|
+
*
|
|
2401
|
+
* @param {Object} state Global application state.
|
|
2402
|
+
* @param {string} clientId The block client ID, or `''` for the root container.
|
|
2403
|
+
*
|
|
2404
|
+
* @return {BlockEditingMode} The block editing mode. One of `'disabled'`,
|
|
2405
|
+
* `'contentOnly'`, or `'default'`.
|
|
2406
|
+
*/
|
|
2407
|
+
export const getBlockEditingMode = createRegistrySelector(select => (state, clientId = '') => {
|
|
2408
|
+
if (state.blockEditingModes.has(clientId)) {
|
|
2409
|
+
return state.blockEditingModes.get(clientId);
|
|
2410
|
+
}
|
|
2411
|
+
if (!clientId) {
|
|
2412
|
+
return 'default';
|
|
2413
|
+
}
|
|
2414
|
+
const rootClientId = getBlockRootClientId(state, clientId);
|
|
2415
|
+
const templateLock = getTemplateLock(state, rootClientId);
|
|
2416
|
+
if (templateLock === 'contentOnly') {
|
|
2417
|
+
const name = getBlockName(state, clientId);
|
|
2418
|
+
const isContent = select(blocksStore).__experimentalHasContentRoleAttribute(name);
|
|
2419
|
+
return isContent ? 'contentOnly' : 'disabled';
|
|
2420
|
+
}
|
|
2421
|
+
const parentMode = getBlockEditingMode(state, rootClientId);
|
|
2422
|
+
return parentMode === 'contentOnly' ? 'default' : parentMode;
|
|
2423
|
+
});
|
|
2502
2424
|
//# sourceMappingURL=selectors.js.map
|