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