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