@wordpress/block-editor 15.21.0 → 15.21.1
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 +17 -1
- package/build/components/block-compare/index.cjs +2 -2
- package/build/components/block-compare/index.cjs.map +2 -2
- package/build/components/block-patterns-list/index.cjs +1 -1
- package/build/components/block-patterns-list/index.cjs.map +2 -2
- package/build/components/block-switcher/block-transformations-menu.cjs +16 -15
- package/build/components/block-switcher/block-transformations-menu.cjs.map +2 -2
- package/build/components/block-switcher/index.cjs +4 -4
- package/build/components/block-switcher/index.cjs.map +2 -2
- package/build/components/global-styles/advanced-panel.cjs +23 -15
- package/build/components/global-styles/advanced-panel.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +2 -2
- package/build/components/global-styles/background-panel.cjs.map +2 -2
- package/build/components/global-styles/border-panel.cjs +2 -0
- package/build/components/global-styles/border-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +1 -1
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/inner-blocks/use-inner-block-template-sync.cjs +3 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +2 -2
- package/build/components/inserter/hooks/use-patterns-state.cjs +1 -1
- package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
- package/build/components/inserter/index.cjs +179 -220
- package/build/components/inserter/index.cjs.map +3 -3
- package/build/components/inserter/search-results.cjs +1 -1
- package/build/components/inserter/search-results.cjs.map +2 -2
- package/build/components/list-view/block-select-button.cjs +10 -12
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/block.cjs +2 -1
- package/build/components/list-view/block.cjs.map +2 -2
- package/build/components/provider/use-block-sync.cjs +11 -2
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/before-input-rules.cjs +4 -4
- package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/delete.cjs +4 -4
- package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/enter.cjs +7 -2
- package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/input-events.cjs +4 -4
- package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-rules.cjs +17 -4
- package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +4 -4
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +4 -4
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs +4 -4
- package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +4 -4
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
- package/build/components/rich-text/index.cjs +1 -23
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/use-block-commands/index.cjs +5 -5
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/hooks/anchor.cjs +11 -15
- package/build/hooks/anchor.cjs.map +2 -2
- package/build/hooks/border.cjs +0 -3
- package/build/hooks/border.cjs.map +2 -2
- package/build/hooks/color.cjs +1 -4
- package/build/hooks/color.cjs.map +2 -2
- package/build/hooks/dimensions.cjs +0 -3
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/fit-text.cjs +11 -0
- package/build/hooks/fit-text.cjs.map +2 -2
- package/build/hooks/position.cjs +19 -22
- package/build/hooks/position.cjs.map +2 -2
- package/build/hooks/supports.cjs +0 -7
- package/build/hooks/supports.cjs.map +2 -2
- package/build/store/actions.cjs +7 -3
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-actions.cjs +1 -2
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +23 -0
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +14 -6
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +60 -41
- package/build/store/selectors.cjs.map +2 -2
- package/build-module/components/block-compare/index.mjs +1 -1
- package/build-module/components/block-compare/index.mjs.map +2 -2
- package/build-module/components/block-patterns-list/index.mjs +1 -1
- package/build-module/components/block-patterns-list/index.mjs.map +2 -2
- package/build-module/components/block-switcher/block-transformations-menu.mjs +16 -15
- package/build-module/components/block-switcher/block-transformations-menu.mjs.map +2 -2
- package/build-module/components/block-switcher/index.mjs +4 -4
- package/build-module/components/block-switcher/index.mjs.map +2 -2
- package/build-module/components/global-styles/advanced-panel.mjs +23 -15
- package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +3 -3
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +2 -0
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +3 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +2 -2
- package/build-module/components/inserter/hooks/use-patterns-state.mjs +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
- package/build-module/components/inserter/index.mjs +185 -222
- package/build-module/components/inserter/index.mjs.map +3 -3
- package/build-module/components/inserter/search-results.mjs +1 -1
- package/build-module/components/inserter/search-results.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +10 -12
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/block.mjs +2 -1
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/provider/use-block-sync.mjs +11 -2
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/delete.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +7 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-events.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs +17 -4
- package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +1 -23
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/use-block-commands/index.mjs +5 -5
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/hooks/anchor.mjs +11 -15
- package/build-module/hooks/anchor.mjs.map +2 -2
- package/build-module/hooks/border.mjs +1 -4
- package/build-module/hooks/border.mjs.map +2 -2
- package/build-module/hooks/color.mjs +2 -5
- package/build-module/hooks/color.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs +1 -4
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/fit-text.mjs +11 -0
- package/build-module/hooks/fit-text.mjs.map +2 -2
- package/build-module/hooks/position.mjs +20 -23
- package/build-module/hooks/position.mjs.map +2 -2
- package/build-module/hooks/supports.mjs +0 -7
- package/build-module/hooks/supports.mjs.map +2 -2
- package/build-module/store/actions.mjs +7 -3
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +1 -2
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +21 -0
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +14 -6
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +62 -42
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-style/content-rtl.css +12 -0
- package/build-style/content.css +12 -0
- package/build-style/style-rtl.css +26 -8
- package/build-style/style.css +26 -8
- package/package.json +49 -46
- package/src/components/block-breadcrumb/README.md +2 -2
- package/src/components/block-compare/README.md +6 -6
- package/src/components/block-compare/index.js +1 -3
- package/src/components/block-patterns-list/index.js +1 -1
- package/src/components/block-preview/README.md +1 -1
- package/src/components/block-switcher/block-transformations-menu.js +16 -18
- package/src/components/block-switcher/index.js +4 -4
- package/src/components/block-types-list/README.md +0 -19
- package/src/components/global-styles/advanced-panel.js +5 -1
- package/src/components/global-styles/background-panel.js +3 -3
- package/src/components/global-styles/border-panel.js +2 -0
- package/src/components/global-styles/dimensions-panel.js +12 -13
- package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -1
- package/src/components/inserter/hooks/use-patterns-state.js +1 -1
- package/src/components/inserter/index.js +257 -288
- package/src/components/inserter/search-results.js +1 -3
- package/src/components/justify-content-control/README.md +1 -1
- package/src/components/list-view/block-select-button.js +9 -13
- package/src/components/list-view/block.js +1 -0
- package/src/components/media-placeholder/README.md +1 -29
- package/src/components/media-upload/README.md +0 -19
- package/src/components/provider/test/use-block-sync.js +40 -0
- package/src/components/provider/use-block-sync.js +12 -2
- package/src/components/rich-text/event-listeners/before-input-rules.js +5 -4
- package/src/components/rich-text/event-listeners/delete.js +9 -4
- package/src/components/rich-text/event-listeners/enter.js +9 -2
- package/src/components/rich-text/event-listeners/input-events.js +13 -4
- package/src/components/rich-text/event-listeners/input-rules.js +20 -4
- package/src/components/rich-text/event-listeners/insert-replacement-text.js +9 -4
- package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +9 -4
- package/src/components/rich-text/event-listeners/shortcuts.js +13 -4
- package/src/components/rich-text/event-listeners/undo-automatic-change.js +5 -4
- package/src/components/rich-text/index.js +1 -33
- package/src/components/unit-control/README.md +1 -1
- package/src/components/url-popover/README.md +1 -1
- package/src/components/use-block-commands/index.js +5 -5
- package/src/hooks/anchor.js +9 -17
- package/src/hooks/border.js +1 -5
- package/src/hooks/color.js +1 -6
- package/src/hooks/dimensions.js +1 -5
- package/src/hooks/fit-text.js +16 -0
- package/src/hooks/position.js +23 -27
- package/src/hooks/supports.js +0 -9
- package/src/store/actions.js +13 -3
- package/src/store/private-actions.js +1 -4
- package/src/store/private-selectors.js +42 -0
- package/src/store/reducer.js +19 -7
- package/src/store/selectors.js +91 -53
- package/src/store/test/actions.js +21 -0
- package/src/store/test/reducer.js +46 -0
- package/src/store/test/selectors.js +77 -0
- package/build/components/media-upload-progress/constants.cjs +0 -46
- package/build/components/media-upload-progress/constants.cjs.map +0 -7
- package/build/components/rich-text/native/format-edit.cjs +0 -60
- package/build/components/rich-text/native/format-edit.cjs.map +0 -7
- package/build/components/rich-text/native/index.cjs +0 -28
- package/build/components/rich-text/native/index.cjs.map +0 -7
- package/build/components/rich-text/native/use-format-types.cjs +0 -139
- package/build/components/rich-text/native/use-format-types.cjs.map +0 -7
- package/build-module/components/media-upload-progress/constants.mjs +0 -16
- package/build-module/components/media-upload-progress/constants.mjs.map +0 -7
- package/build-module/components/rich-text/native/format-edit.mjs +0 -39
- package/build-module/components/rich-text/native/format-edit.mjs.map +0 -7
- package/build-module/components/rich-text/native/index.mjs +0 -7
- package/build-module/components/rich-text/native/index.mjs.map +0 -7
- package/build-module/components/rich-text/native/use-format-types.mjs +0 -114
- package/build-module/components/rich-text/native/use-format-types.mjs.map +0 -7
- package/src/components/audio-player/audio-url-parser.native.js +0 -20
- package/src/components/audio-player/index.native.js +0 -225
- package/src/components/audio-player/styles.native.scss +0 -114
- package/src/components/audio-player/test/audio-url-parser.native.js +0 -53
- package/src/components/block-alignment-control/test/index.native.js +0 -37
- package/src/components/block-alignment-control/ui.native.js +0 -86
- package/src/components/block-caption/README.md +0 -104
- package/src/components/block-caption/index.native.js +0 -89
- package/src/components/block-caption/styles.native.scss +0 -7
- package/src/components/block-controls/slot.native.js +0 -33
- package/src/components/block-draggable/draggable-chip.native.js +0 -49
- package/src/components/block-draggable/dropping-insertion-point.native.js +0 -181
- package/src/components/block-draggable/dropping-insertion-point.native.scss +0 -8
- package/src/components/block-draggable/index.native.js +0 -467
- package/src/components/block-draggable/style.native.scss +0 -19
- package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +0 -73
- package/src/components/block-draggable/test/helpers.native.js +0 -182
- package/src/components/block-draggable/test/index.native.js +0 -419
- package/src/components/block-draggable/use-scroll-when-dragging.native.js +0 -135
- package/src/components/block-edit/edit.native.js +0 -49
- package/src/components/block-edit/test/edit.native.js +0 -65
- package/src/components/block-heading-level-dropdown/index.native.js +0 -68
- package/src/components/block-icon/index.native.js +0 -47
- package/src/components/block-icon/style.native.scss +0 -7
- package/src/components/block-list/block-crash-boundary.native.js +0 -43
- package/src/components/block-list/block-crash-warning.native.js +0 -21
- package/src/components/block-list/block-invalid-warning.native.js +0 -70
- package/src/components/block-list/block-list-context.native.js +0 -172
- package/src/components/block-list/block-list-item-cell.native.js +0 -62
- package/src/components/block-list/block-list-item.native.js +0 -209
- package/src/components/block-list/block-list-item.native.scss +0 -16
- package/src/components/block-list/block-outline.native.js +0 -77
- package/src/components/block-list/block-selection-button.native.js +0 -100
- package/src/components/block-list/block-selection-button.native.scss +0 -34
- package/src/components/block-list/block.native.js +0 -716
- package/src/components/block-list/block.native.scss +0 -62
- package/src/components/block-list/grid-item.native.js +0 -58
- package/src/components/block-list/index.native.js +0 -437
- package/src/components/block-list/insertion-point.native.js +0 -36
- package/src/components/block-list/style.native.scss +0 -117
- package/src/components/block-list/test/block-invalid-warning.native.js +0 -62
- package/src/components/block-list/test/block-list-context.native.js +0 -243
- package/src/components/block-list/test/block-outline.native.js +0 -255
- package/src/components/block-list/test/fixtures/block-list-context.native.js +0 -79
- package/src/components/block-list/test/index.native.js +0 -205
- package/src/components/block-list/use-block-props/index.native.js +0 -10
- package/src/components/block-list/use-scroll-upon-insertion.native.js +0 -52
- package/src/components/block-list-appender/index.native.js +0 -70
- package/src/components/block-list-appender/style.native.scss +0 -8
- package/src/components/block-media-update-progress/README.md +0 -100
- package/src/components/block-media-update-progress/index.native.js +0 -299
- package/src/components/block-media-update-progress/styles.native.scss +0 -9
- package/src/components/block-media-update-progress/test/index.native.js +0 -543
- package/src/components/block-mover/index.native.js +0 -193
- package/src/components/block-mover/mover-description.native.js +0 -155
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -218
- package/src/components/block-mover/test/index.native.js +0 -186
- package/src/components/block-settings/button.native.js +0 -41
- package/src/components/block-settings/container.native.js +0 -91
- package/src/components/block-settings/container.native.scss +0 -4
- package/src/components/block-settings/index.native.js +0 -5
- package/src/components/block-styles/index.native.js +0 -94
- package/src/components/block-styles/preview.native.js +0 -109
- package/src/components/block-styles/style.native.scss +0 -64
- package/src/components/block-switcher/block-transformations-menu.native.js +0 -91
- package/src/components/block-toolbar/block-toolbar-menu.native.js +0 -477
- package/src/components/block-toolbar/index.native.js +0 -126
- package/src/components/block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap +0 -125
- package/src/components/block-toolbar/test/block-toolbar-menu.native.js +0 -405
- package/src/components/block-toolbar/test/index.native.js +0 -36
- package/src/components/block-types-list/index.native.js +0 -175
- package/src/components/block-types-list/style.native.scss +0 -25
- package/src/components/block-variation-picker/index.native.js +0 -107
- package/src/components/block-variation-picker/style.native.scss +0 -32
- package/src/components/button-block-appender/index.native.js +0 -92
- package/src/components/button-block-appender/styles.native.scss +0 -43
- package/src/components/caption/README.md +0 -44
- package/src/components/caption/index.native.js +0 -61
- package/src/components/colors-gradients/panel-color-gradient-settings.native.js +0 -59
- package/src/components/contrast-checker/index.native.js +0 -113
- package/src/components/contrast-checker/style.native.scss +0 -26
- package/src/components/convert-to-group-buttons/index.native.js +0 -79
- package/src/components/default-block-appender/index.native.js +0 -113
- package/src/components/default-block-appender/style.native.scss +0 -18
- package/src/components/floating-toolbar/floatingToolbar.android.scss +0 -4
- package/src/components/floating-toolbar/floatingToolbar.ios.scss +0 -3
- package/src/components/floating-toolbar/index.native.js +0 -141
- package/src/components/floating-toolbar/styles.native.scss +0 -43
- package/src/components/font-sizes/index.native.js +0 -7
- package/src/components/global-styles/color-panel.native.js +0 -207
- package/src/components/global-styles/test/use-global-styles-context.native.js +0 -435
- package/src/components/global-styles/use-global-styles-context.native.js +0 -592
- package/src/components/gradients/index.native.js +0 -2
- package/src/components/image-link-destinations/index.native.js +0 -152
- package/src/components/image-link-destinations/style.native.scss +0 -16
- package/src/components/index.native.js +0 -108
- package/src/components/inner-blocks/constants.native.js +0 -5
- package/src/components/inner-blocks/index.native.js +0 -221
- package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +0 -124
- package/src/components/inserter/block-types-tab.native.js +0 -76
- package/src/components/inserter/hooks/use-block-type-impressions.native.js +0 -47
- package/src/components/inserter/hooks/use-clipboard-block.native.js +0 -40
- package/src/components/inserter/index.native.js +0 -424
- package/src/components/inserter/menu.native.js +0 -237
- package/src/components/inserter/no-results.native.js +0 -49
- package/src/components/inserter/reusable-blocks-tab.native.js +0 -45
- package/src/components/inserter/search-results.native.js +0 -67
- package/src/components/inserter/style.native.scss +0 -83
- package/src/components/inserter/tabs.native.js +0 -152
- package/src/components/inserter/test/__snapshots__/index.native.js.snap +0 -117
- package/src/components/inserter/test/fixtures/index.native.js +0 -12
- package/src/components/inserter/test/index.native.js +0 -273
- package/src/components/inserter/test/reusable-blocks-tab.native.js +0 -62
- package/src/components/inserter/test/utils.native.js +0 -37
- package/src/components/inserter/utils.native.js +0 -46
- package/src/components/inserter-button/index.native.js +0 -108
- package/src/components/inserter-button/style.native.scss +0 -72
- package/src/components/inspector-controls/fill.native.js +0 -62
- package/src/components/inspector-controls/slot.native.js +0 -35
- package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +0 -31
- package/src/components/line-height-control/index.native.js +0 -28
- package/src/components/media-placeholder/index.native.js +0 -258
- package/src/components/media-placeholder/styles.native.scss +0 -108
- package/src/components/media-replace-flow/index.native.js +0 -12
- package/src/components/media-upload/constants.native.js +0 -14
- package/src/components/media-upload/index.native.js +0 -356
- package/src/components/media-upload/style.native.scss +0 -4
- package/src/components/media-upload/test/index.native.js +0 -172
- package/src/components/media-upload-progress/README.md +0 -100
- package/src/components/media-upload-progress/constants.js +0 -6
- package/src/components/media-upload-progress/index.native.js +0 -233
- package/src/components/media-upload-progress/styles.native.scss +0 -15
- package/src/components/media-upload-progress/test/index.native.js +0 -220
- package/src/components/plain-text/index.native.js +0 -164
- package/src/components/plain-text/style.native.scss +0 -10
- package/src/components/provider/index.native.js +0 -32
- package/src/components/rich-text/embed-handler-picker.native.js +0 -65
- package/src/components/rich-text/file-paste-handler.native.js +0 -3
- package/src/components/rich-text/format-toolbar/index.native.js +0 -21
- package/src/components/rich-text/format-toolbar-container.native.js +0 -16
- package/src/components/rich-text/index.native.js +0 -701
- package/src/components/rich-text/input-event.native.js +0 -10
- package/src/components/rich-text/native/format-edit.js +0 -44
- package/src/components/rich-text/native/get-format-colors.native.js +0 -47
- package/src/components/rich-text/native/index.js +0 -1
- package/src/components/rich-text/native/index.native.js +0 -1389
- package/src/components/rich-text/native/style.native.scss +0 -28
- package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +0 -79
- package/src/components/rich-text/native/test/index.native.js +0 -345
- package/src/components/rich-text/native/test/performance/rich-text.native.js +0 -44
- package/src/components/rich-text/native/toolbar-button-with-options.native.js +0 -61
- package/src/components/rich-text/native/use-format-types.js +0 -146
- package/src/components/rich-text/remove-browser-shortcuts.native.js +0 -1
- package/src/components/rich-text/shortcut.native.js +0 -10
- package/src/components/ungroup-button/README.md +0 -23
- package/src/components/ungroup-button/index.native.js +0 -77
- package/src/components/unsupported-block-details/index.native.js +0 -187
- package/src/components/unsupported-block-details/style.native.scss +0 -56
- package/src/components/url-input/index.native.js +0 -33
- package/src/components/use-block-drop-zone/index.native.js +0 -207
- package/src/components/use-on-block-drop/index.native.js +0 -115
- package/src/components/use-unsupported-block-editor/index.native.js +0 -59
- package/src/components/video-player/gridicon-play.native.js +0 -13
- package/src/components/video-player/index.native.js +0 -133
- package/src/components/video-player/styles.native.scss +0 -29
- package/src/components/warning/index.native.js +0 -64
- package/src/components/warning/style.native.scss +0 -47
- package/src/hooks/align.native.js +0 -49
- package/src/hooks/custom-class-name.native.js +0 -70
- package/src/hooks/index.native.js +0 -36
- package/src/hooks/layout.native.js +0 -23
- package/src/hooks/test/__snapshots__/align.native.js.snap +0 -73
- package/src/hooks/test/__snapshots__/anchor.native.js.snap +0 -7
- package/src/hooks/test/align.native.js +0 -134
- package/src/hooks/test/anchor.native.js +0 -32
- package/src/hooks/test/use-editor-wrapper-styles.native.js +0 -282
- package/src/hooks/typography.native.js +0 -60
- package/src/hooks/use-editor-wrapper-styles.native.js +0 -250
- package/src/hooks/use-editor-wrapper-styles.native.scss +0 -12
- package/src/index.native.js +0 -6
- package/src/private-apis.native.js +0 -21
- package/src/store/defaults.native.js +0 -23
|
@@ -37,17 +37,16 @@ var import_clsx = __toESM(require("clsx"));
|
|
|
37
37
|
var import_a11y = require("@wordpress/a11y");
|
|
38
38
|
var import_i18n = require("@wordpress/i18n");
|
|
39
39
|
var import_components = require("@wordpress/components");
|
|
40
|
-
var import_element = require("@wordpress/element");
|
|
41
40
|
var import_data = require("@wordpress/data");
|
|
42
|
-
var import_compose = require("@wordpress/compose");
|
|
43
41
|
var import_blocks = require("@wordpress/blocks");
|
|
42
|
+
var import_element = require("@wordpress/element");
|
|
44
43
|
var import_icons = require("@wordpress/icons");
|
|
45
44
|
var import_menu = __toESM(require("./menu.cjs"));
|
|
46
45
|
var import_quick_inserter = __toESM(require("./quick-inserter.cjs"));
|
|
47
46
|
var import_store = require("../../store/index.cjs");
|
|
48
47
|
var import_get_appender_label = require("./get-appender-label.cjs");
|
|
49
48
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
-
var
|
|
49
|
+
var UnforwardedInserterToggle = ({
|
|
51
50
|
onToggle,
|
|
52
51
|
disabled,
|
|
53
52
|
isOpen,
|
|
@@ -55,7 +54,7 @@ var defaultRenderToggle = ({
|
|
|
55
54
|
hasSingleBlockType,
|
|
56
55
|
appenderLabel,
|
|
57
56
|
toggleProps = {}
|
|
58
|
-
}) => {
|
|
57
|
+
}, ref) => {
|
|
59
58
|
const {
|
|
60
59
|
as: Wrapper = import_components.Button,
|
|
61
60
|
label: labelProp,
|
|
@@ -85,6 +84,7 @@ var defaultRenderToggle = ({
|
|
|
85
84
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
85
|
Wrapper,
|
|
87
86
|
{
|
|
87
|
+
ref,
|
|
88
88
|
__next40pxDefaultSize: toggleProps.as ? void 0 : true,
|
|
89
89
|
icon: import_icons.plus,
|
|
90
90
|
label,
|
|
@@ -99,70 +99,169 @@ var defaultRenderToggle = ({
|
|
|
99
99
|
}
|
|
100
100
|
);
|
|
101
101
|
};
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
var InserterToggle = (0, import_element.forwardRef)(UnforwardedInserterToggle);
|
|
103
|
+
var UnforwardedInserter = ({
|
|
104
|
+
clientId,
|
|
105
|
+
rootClientId,
|
|
106
|
+
disabled,
|
|
107
|
+
isAppender,
|
|
108
|
+
position,
|
|
109
|
+
selectBlockOnInsert,
|
|
110
|
+
shouldDirectInsert = true,
|
|
111
|
+
showInserterHelpPanel,
|
|
112
|
+
// This prop is experimental to give some time for the quick inserter to mature
|
|
113
|
+
// Feel free to make them stable after a few releases.
|
|
114
|
+
__experimentalIsQuick: isQuick,
|
|
115
|
+
onSelectOrClose,
|
|
116
|
+
onToggle,
|
|
117
|
+
renderToggle: renderToggleProp,
|
|
118
|
+
toggleProps
|
|
119
|
+
}, ref) => {
|
|
120
|
+
const {
|
|
121
|
+
hasItems,
|
|
122
|
+
hasSingleBlockType,
|
|
123
|
+
blockTitle,
|
|
124
|
+
allowedBlockType,
|
|
125
|
+
blockToInsert,
|
|
126
|
+
appenderLabel,
|
|
127
|
+
targetRootClientId
|
|
128
|
+
} = (0, import_data.useSelect)(
|
|
129
|
+
(select) => {
|
|
130
|
+
const {
|
|
131
|
+
getBlockRootClientId: getBlockRootClientId2,
|
|
132
|
+
hasInserterItems,
|
|
133
|
+
getAllowedBlocks,
|
|
134
|
+
getDirectInsertBlock,
|
|
135
|
+
getBlockListSettings
|
|
136
|
+
} = select(import_store.store);
|
|
137
|
+
const { getBlockVariations, getBlockType: getBlockType2 } = select(import_blocks.store);
|
|
138
|
+
const _targetRootClientId = rootClientId || getBlockRootClientId2(clientId) || void 0;
|
|
139
|
+
const allowedBlocks = getAllowedBlocks(_targetRootClientId);
|
|
140
|
+
const directInsertBlock = shouldDirectInsert && getDirectInsertBlock(_targetRootClientId);
|
|
141
|
+
const { defaultBlock } = getBlockListSettings(_targetRootClientId) ?? {};
|
|
142
|
+
const _hasSingleBlockType = allowedBlocks?.length === 1 && getBlockVariations(allowedBlocks[0].name, "inserter")?.length === 0;
|
|
143
|
+
const _allowedBlockType = _hasSingleBlockType ? allowedBlocks[0] : null;
|
|
144
|
+
let _blockToInsert = directInsertBlock || null;
|
|
145
|
+
if (!_blockToInsert && _hasSingleBlockType && defaultBlock?.name === _allowedBlockType.name) {
|
|
146
|
+
_blockToInsert = defaultBlock;
|
|
147
|
+
}
|
|
148
|
+
const defaultBlockType = directInsertBlock ? getBlockType2(directInsertBlock.name) : null;
|
|
149
|
+
return {
|
|
150
|
+
hasItems: hasInserterItems(_targetRootClientId),
|
|
151
|
+
hasSingleBlockType: _hasSingleBlockType,
|
|
152
|
+
blockTitle: _allowedBlockType ? _allowedBlockType.title : "",
|
|
153
|
+
allowedBlockType: _allowedBlockType,
|
|
154
|
+
blockToInsert: _blockToInsert,
|
|
155
|
+
appenderLabel: (0, import_get_appender_label.getAppenderLabel)(
|
|
156
|
+
directInsertBlock,
|
|
157
|
+
defaultBlockType
|
|
158
|
+
),
|
|
159
|
+
targetRootClientId: _targetRootClientId
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
[rootClientId, clientId, shouldDirectInsert]
|
|
163
|
+
);
|
|
164
|
+
const { insertBlock } = (0, import_data.useDispatch)(import_store.store);
|
|
165
|
+
const {
|
|
166
|
+
getBlock,
|
|
167
|
+
getBlockIndex,
|
|
168
|
+
getBlockOrder,
|
|
169
|
+
getBlockRootClientId,
|
|
170
|
+
getBlockSelectionEnd,
|
|
171
|
+
getPreviousBlockClientId
|
|
172
|
+
} = (0, import_data.useSelect)(import_store.store);
|
|
173
|
+
const { getActiveBlockVariation, getBlockType } = (0, import_data.useSelect)(import_blocks.store);
|
|
174
|
+
if (!hasItems && (isAppender || targetRootClientId || clientId)) {
|
|
175
|
+
return null;
|
|
108
176
|
}
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
177
|
+
function insertOnlyAllowedBlock() {
|
|
178
|
+
const blockName = blockToInsert?.name ?? allowedBlockType.name;
|
|
179
|
+
function getAdjacentBlockAttributes(attributesToCopy) {
|
|
180
|
+
if (!attributesToCopy?.length) {
|
|
181
|
+
return {};
|
|
182
|
+
}
|
|
183
|
+
let adjacentAttributes;
|
|
184
|
+
if (clientId) {
|
|
185
|
+
const currentBlock = getBlock(clientId);
|
|
186
|
+
const previousBlock = getBlock(
|
|
187
|
+
getPreviousBlockClientId(clientId)
|
|
188
|
+
);
|
|
189
|
+
if (currentBlock?.name === previousBlock?.name) {
|
|
190
|
+
adjacentAttributes = previousBlock?.attributes;
|
|
191
|
+
}
|
|
192
|
+
} else if (targetRootClientId) {
|
|
193
|
+
const lastInnerBlock = getBlock(targetRootClientId)?.innerBlocks?.at(-1);
|
|
194
|
+
if (lastInnerBlock?.name === blockName) {
|
|
195
|
+
adjacentAttributes = lastInnerBlock.attributes;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (!adjacentAttributes) {
|
|
199
|
+
return {};
|
|
200
|
+
}
|
|
201
|
+
return Object.fromEntries(
|
|
202
|
+
attributesToCopy.filter((attr) => attr in adjacentAttributes).map((attr) => [attr, adjacentAttributes[attr]])
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
function getInsertionIndex() {
|
|
206
|
+
if (clientId) {
|
|
207
|
+
return getBlockIndex(clientId);
|
|
208
|
+
}
|
|
209
|
+
const end = getBlockSelectionEnd();
|
|
210
|
+
if (!isAppender && end && getBlockRootClientId(end) === targetRootClientId) {
|
|
211
|
+
return getBlockIndex(end) + 1;
|
|
212
|
+
}
|
|
213
|
+
return getBlockOrder(targetRootClientId).length;
|
|
214
|
+
}
|
|
215
|
+
const newAttributes = getAdjacentBlockAttributes(
|
|
216
|
+
blockToInsert?.attributesToCopy
|
|
217
|
+
);
|
|
218
|
+
const newBlock = (0, import_blocks.createBlock)(blockName, {
|
|
219
|
+
...blockToInsert?.attributes,
|
|
220
|
+
...newAttributes
|
|
221
|
+
});
|
|
222
|
+
insertBlock(
|
|
223
|
+
newBlock,
|
|
224
|
+
getInsertionIndex(),
|
|
225
|
+
targetRootClientId,
|
|
226
|
+
selectBlockOnInsert
|
|
227
|
+
);
|
|
228
|
+
onSelectOrClose?.(newBlock);
|
|
229
|
+
const blockTypeToInsert = getBlockType(blockName);
|
|
230
|
+
let blockLabelToInsert;
|
|
231
|
+
if (blockTypeToInsert) {
|
|
232
|
+
blockLabelToInsert = (0, import_blocks.__experimentalGetBlockLabel)(
|
|
233
|
+
blockTypeToInsert,
|
|
234
|
+
newBlock.attributes
|
|
235
|
+
);
|
|
236
|
+
if (blockLabelToInsert === blockTypeToInsert.title) {
|
|
237
|
+
blockLabelToInsert = getActiveBlockVariation(blockName, newBlock.attributes)?.title || blockLabelToInsert;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (blockLabelToInsert) {
|
|
241
|
+
const message = (0, import_i18n.sprintf)(
|
|
242
|
+
// translators: %s: the name of the block that has been added
|
|
243
|
+
(0, import_i18n.__)("%s block added"),
|
|
244
|
+
blockLabelToInsert
|
|
245
|
+
);
|
|
246
|
+
(0, import_a11y.speak)(message);
|
|
113
247
|
}
|
|
114
248
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
* @param {Object} options
|
|
119
|
-
* @param {Function} options.onToggle Callback to invoke when toggle is
|
|
120
|
-
* pressed.
|
|
121
|
-
* @param {boolean} options.isOpen Whether dropdown is currently open.
|
|
122
|
-
*
|
|
123
|
-
* @return {Element} Dropdown toggle element.
|
|
124
|
-
*/
|
|
125
|
-
renderToggle({ onToggle, isOpen }) {
|
|
126
|
-
const {
|
|
127
|
-
disabled,
|
|
128
|
-
blockTitle,
|
|
129
|
-
hasSingleBlockType,
|
|
130
|
-
appenderLabel,
|
|
131
|
-
toggleProps,
|
|
132
|
-
hasItems,
|
|
133
|
-
renderToggle = defaultRenderToggle
|
|
134
|
-
} = this.props;
|
|
135
|
-
return renderToggle({
|
|
136
|
-
onToggle,
|
|
249
|
+
function renderToggle({ onToggle: dropdownOnToggle, isOpen }) {
|
|
250
|
+
const toggleArgs = {
|
|
251
|
+
onToggle: dropdownOnToggle,
|
|
137
252
|
isOpen,
|
|
138
253
|
disabled: disabled || !hasItems,
|
|
139
254
|
blockTitle,
|
|
140
255
|
hasSingleBlockType,
|
|
141
256
|
appenderLabel,
|
|
142
257
|
toggleProps
|
|
143
|
-
}
|
|
258
|
+
};
|
|
259
|
+
if (renderToggleProp) {
|
|
260
|
+
return renderToggleProp(toggleArgs);
|
|
261
|
+
}
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InserterToggle, { ref, ...toggleArgs });
|
|
144
263
|
}
|
|
145
|
-
|
|
146
|
-
* Render callback to display Dropdown content element.
|
|
147
|
-
*
|
|
148
|
-
* @param {Object} options
|
|
149
|
-
* @param {Function} options.onClose Callback to invoke when dropdown is
|
|
150
|
-
* closed.
|
|
151
|
-
*
|
|
152
|
-
* @return {Element} Dropdown content element.
|
|
153
|
-
*/
|
|
154
|
-
renderContent({ onClose }) {
|
|
155
|
-
const {
|
|
156
|
-
rootClientId,
|
|
157
|
-
clientId,
|
|
158
|
-
isAppender,
|
|
159
|
-
showInserterHelpPanel,
|
|
160
|
-
// This prop is experimental to give some time for the quick inserter to mature
|
|
161
|
-
// Feel free to make them stable after a few releases.
|
|
162
|
-
__experimentalIsQuick: isQuick,
|
|
163
|
-
onSelectOrClose,
|
|
164
|
-
selectBlockOnInsert
|
|
165
|
-
} = this.props;
|
|
264
|
+
function renderContent({ onClose }) {
|
|
166
265
|
if (isQuick) {
|
|
167
266
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
168
267
|
import_quick_inserter.default,
|
|
@@ -174,7 +273,7 @@ var Inserter = class extends import_element.Component {
|
|
|
174
273
|
}
|
|
175
274
|
onClose();
|
|
176
275
|
},
|
|
177
|
-
rootClientId,
|
|
276
|
+
rootClientId: targetRootClientId,
|
|
178
277
|
clientId,
|
|
179
278
|
isAppender,
|
|
180
279
|
selectBlockOnInsert
|
|
@@ -188,173 +287,33 @@ var Inserter = class extends import_element.Component {
|
|
|
188
287
|
onClose();
|
|
189
288
|
},
|
|
190
289
|
onClose,
|
|
191
|
-
rootClientId,
|
|
290
|
+
rootClientId: targetRootClientId,
|
|
192
291
|
clientId,
|
|
193
292
|
isAppender,
|
|
194
293
|
showInserterHelpPanel
|
|
195
294
|
}
|
|
196
295
|
);
|
|
197
296
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
position,
|
|
201
|
-
hasSingleBlockType,
|
|
202
|
-
blockToInsert,
|
|
203
|
-
insertOnlyAllowedBlock,
|
|
204
|
-
__experimentalIsQuick: isQuick,
|
|
205
|
-
onSelectOrClose
|
|
206
|
-
} = this.props;
|
|
207
|
-
if (hasSingleBlockType || blockToInsert) {
|
|
208
|
-
return this.renderToggle({ onToggle: insertOnlyAllowedBlock });
|
|
209
|
-
}
|
|
210
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
211
|
-
import_components.Dropdown,
|
|
212
|
-
{
|
|
213
|
-
className: "block-editor-inserter",
|
|
214
|
-
contentClassName: (0, import_clsx.default)("block-editor-inserter__popover", {
|
|
215
|
-
"is-quick": isQuick
|
|
216
|
-
}),
|
|
217
|
-
popoverProps: { position, shift: true },
|
|
218
|
-
onToggle: this.onToggle,
|
|
219
|
-
expandOnMobile: true,
|
|
220
|
-
headerTitle: (0, import_i18n.__)("Add a block"),
|
|
221
|
-
renderToggle: this.renderToggle,
|
|
222
|
-
renderContent: this.renderContent,
|
|
223
|
-
onClose: onSelectOrClose
|
|
224
|
-
}
|
|
225
|
-
);
|
|
297
|
+
if (hasSingleBlockType || blockToInsert) {
|
|
298
|
+
return renderToggle({ onToggle: insertOnlyAllowedBlock });
|
|
226
299
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const directInsertBlock = shouldDirectInsert && getDirectInsertBlock(rootClientId);
|
|
242
|
-
const { defaultBlock } = getBlockListSettings(rootClientId) ?? {};
|
|
243
|
-
const hasSingleBlockType = allowedBlocks?.length === 1 && getBlockVariations(allowedBlocks[0].name, "inserter")?.length === 0;
|
|
244
|
-
const allowedBlockType = hasSingleBlockType ? allowedBlocks[0] : null;
|
|
245
|
-
let blockToInsert = directInsertBlock || null;
|
|
246
|
-
if (!blockToInsert && hasSingleBlockType && defaultBlock?.name === allowedBlockType.name) {
|
|
247
|
-
blockToInsert = defaultBlock;
|
|
248
|
-
}
|
|
249
|
-
const defaultBlockType = directInsertBlock ? getBlockType(directInsertBlock.name) : null;
|
|
250
|
-
const appenderLabel = (0, import_get_appender_label.getAppenderLabel)(
|
|
251
|
-
directInsertBlock,
|
|
252
|
-
defaultBlockType
|
|
253
|
-
);
|
|
254
|
-
return {
|
|
255
|
-
hasItems: hasInserterItems(rootClientId),
|
|
256
|
-
hasSingleBlockType,
|
|
257
|
-
blockTitle: allowedBlockType ? allowedBlockType.title : "",
|
|
258
|
-
allowedBlockType,
|
|
259
|
-
blockToInsert,
|
|
260
|
-
appenderLabel,
|
|
261
|
-
rootClientId
|
|
262
|
-
};
|
|
300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
301
|
+
import_components.Dropdown,
|
|
302
|
+
{
|
|
303
|
+
className: "block-editor-inserter",
|
|
304
|
+
contentClassName: (0, import_clsx.default)("block-editor-inserter__popover", {
|
|
305
|
+
"is-quick": isQuick
|
|
306
|
+
}),
|
|
307
|
+
popoverProps: { position, shift: true },
|
|
308
|
+
onToggle,
|
|
309
|
+
expandOnMobile: true,
|
|
310
|
+
headerTitle: (0, import_i18n.__)("Add a block"),
|
|
311
|
+
renderToggle,
|
|
312
|
+
renderContent,
|
|
313
|
+
onClose: onSelectOrClose
|
|
263
314
|
}
|
|
264
|
-
)
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const {
|
|
269
|
-
rootClientId,
|
|
270
|
-
clientId,
|
|
271
|
-
isAppender,
|
|
272
|
-
hasSingleBlockType,
|
|
273
|
-
allowedBlockType,
|
|
274
|
-
blockToInsert,
|
|
275
|
-
onSelectOrClose,
|
|
276
|
-
selectBlockOnInsert
|
|
277
|
-
} = ownProps;
|
|
278
|
-
if (!hasSingleBlockType && !blockToInsert) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
const blockName = blockToInsert?.name ?? allowedBlockType.name;
|
|
282
|
-
function getAdjacentBlockAttributes(attributesToCopy) {
|
|
283
|
-
if (!attributesToCopy?.length) {
|
|
284
|
-
return {};
|
|
285
|
-
}
|
|
286
|
-
const { getBlock, getPreviousBlockClientId } = select(import_store.store);
|
|
287
|
-
let adjacentAttributes;
|
|
288
|
-
if (clientId) {
|
|
289
|
-
const currentBlock = getBlock(clientId);
|
|
290
|
-
const previousBlock = getBlock(
|
|
291
|
-
getPreviousBlockClientId(clientId)
|
|
292
|
-
);
|
|
293
|
-
if (currentBlock?.name === previousBlock?.name) {
|
|
294
|
-
adjacentAttributes = previousBlock?.attributes;
|
|
295
|
-
}
|
|
296
|
-
} else if (rootClientId) {
|
|
297
|
-
const lastInnerBlock = getBlock(rootClientId)?.innerBlocks?.at(-1);
|
|
298
|
-
if (lastInnerBlock?.name === blockName) {
|
|
299
|
-
adjacentAttributes = lastInnerBlock.attributes;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
if (!adjacentAttributes) {
|
|
303
|
-
return {};
|
|
304
|
-
}
|
|
305
|
-
return Object.fromEntries(
|
|
306
|
-
attributesToCopy.filter((attr) => attr in adjacentAttributes).map((attr) => [
|
|
307
|
-
attr,
|
|
308
|
-
adjacentAttributes[attr]
|
|
309
|
-
])
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
function getInsertionIndex() {
|
|
313
|
-
const {
|
|
314
|
-
getBlockIndex,
|
|
315
|
-
getBlockSelectionEnd,
|
|
316
|
-
getBlockOrder,
|
|
317
|
-
getBlockRootClientId
|
|
318
|
-
} = select(import_store.store);
|
|
319
|
-
if (clientId) {
|
|
320
|
-
return getBlockIndex(clientId);
|
|
321
|
-
}
|
|
322
|
-
const end = getBlockSelectionEnd();
|
|
323
|
-
if (!isAppender && end && getBlockRootClientId(end) === rootClientId) {
|
|
324
|
-
return getBlockIndex(end) + 1;
|
|
325
|
-
}
|
|
326
|
-
return getBlockOrder(rootClientId).length;
|
|
327
|
-
}
|
|
328
|
-
const { insertBlock } = dispatch(import_store.store);
|
|
329
|
-
const newAttributes = getAdjacentBlockAttributes(
|
|
330
|
-
blockToInsert?.attributesToCopy
|
|
331
|
-
);
|
|
332
|
-
const newBlock = (0, import_blocks.createBlock)(blockName, {
|
|
333
|
-
...blockToInsert?.attributes || {},
|
|
334
|
-
...newAttributes
|
|
335
|
-
});
|
|
336
|
-
insertBlock(
|
|
337
|
-
newBlock,
|
|
338
|
-
getInsertionIndex(),
|
|
339
|
-
rootClientId,
|
|
340
|
-
selectBlockOnInsert
|
|
341
|
-
);
|
|
342
|
-
if (onSelectOrClose) {
|
|
343
|
-
onSelectOrClose(newBlock);
|
|
344
|
-
}
|
|
345
|
-
const message = (0, import_i18n.sprintf)(
|
|
346
|
-
// translators: %s: the name of the block that has been added
|
|
347
|
-
(0, import_i18n.__)("%s block added"),
|
|
348
|
-
allowedBlockType.title
|
|
349
|
-
);
|
|
350
|
-
(0, import_a11y.speak)(message);
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
}),
|
|
354
|
-
// The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as
|
|
355
|
-
// a way to detect the global Inserter.
|
|
356
|
-
(0, import_compose.ifCondition)(
|
|
357
|
-
({ hasItems, isAppender, rootClientId, clientId }) => hasItems || !isAppender && !rootClientId && !clientId
|
|
358
|
-
)
|
|
359
|
-
])(Inserter);
|
|
315
|
+
);
|
|
316
|
+
};
|
|
317
|
+
var Inserter = (0, import_element.forwardRef)(UnforwardedInserter);
|
|
318
|
+
var inserter_default = Inserter;
|
|
360
319
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/inserter/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { Component } from '@wordpress/element';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { createBlock, store as blocksStore } from '@wordpress/blocks';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport InserterMenu from './menu';\nimport QuickInserter from './quick-inserter';\nimport { store as blockEditorStore } from '../../store';\nimport { getAppenderLabel } from './get-appender-label';\n\nconst defaultRenderToggle = ( {\n\tonToggle,\n\tdisabled,\n\tisOpen,\n\tblockTitle,\n\thasSingleBlockType,\n\tappenderLabel,\n\ttoggleProps = {},\n} ) => {\n\tconst {\n\t\tas: Wrapper = Button,\n\t\tlabel: labelProp,\n\t\tonClick,\n\t\t...rest\n\t} = toggleProps;\n\n\tlet label = labelProp;\n\tif ( ! label && appenderLabel ) {\n\t\t// Block returns the full label; use directly (consistent with getBlockLabel).\n\t\tlabel = appenderLabel;\n\t} else if ( ! label && hasSingleBlockType ) {\n\t\tlabel = sprintf(\n\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t_x( 'Add %s', 'directly add the only allowed block' ),\n\t\t\tblockTitle.toLowerCase()\n\t\t);\n\t} else if ( ! label ) {\n\t\tlabel = _x( 'Add block', 'Generic label for block inserter button' );\n\t}\n\n\t// Handle both onClick functions from the toggle and the parent component.\n\tfunction handleClick( event ) {\n\t\tif ( onToggle ) {\n\t\t\tonToggle( event );\n\t\t}\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Wrapper\n\t\t\t__next40pxDefaultSize={ toggleProps.as ? undefined : true }\n\t\t\ticon={ plus }\n\t\t\tlabel={ label }\n\t\t\ttooltipPosition=\"bottom\"\n\t\t\tonClick={ handleClick }\n\t\t\tclassName=\"block-editor-inserter__toggle\"\n\t\t\taria-haspopup={ ! hasSingleBlockType ? 'true' : false }\n\t\t\taria-expanded={ ! hasSingleBlockType ? isOpen : false }\n\t\t\tisPressed={ ! hasSingleBlockType && isOpen }\n\t\t\tdisabled={ disabled }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n};\n\nclass Inserter extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onToggle = this.onToggle.bind( this );\n\t\tthis.renderToggle = this.renderToggle.bind( this );\n\t\tthis.renderContent = this.renderContent.bind( this );\n\t}\n\n\tonToggle( isOpen ) {\n\t\tconst { onToggle } = this.props;\n\n\t\t// Surface toggle callback to parent component.\n\t\tif ( onToggle ) {\n\t\t\tonToggle( isOpen );\n\t\t}\n\t}\n\n\t/**\n\t * Render callback to display Dropdown toggle element.\n\t *\n\t * @param {Object} options\n\t * @param {Function} options.onToggle Callback to invoke when toggle is\n\t * pressed.\n\t * @param {boolean} options.isOpen Whether dropdown is currently open.\n\t *\n\t * @return {Element} Dropdown toggle element.\n\t */\n\trenderToggle( { onToggle, isOpen } ) {\n\t\tconst {\n\t\t\tdisabled,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tappenderLabel,\n\t\t\ttoggleProps,\n\t\t\thasItems,\n\t\t\trenderToggle = defaultRenderToggle,\n\t\t} = this.props;\n\n\t\treturn renderToggle( {\n\t\t\tonToggle,\n\t\t\tisOpen,\n\t\t\tdisabled: disabled || ! hasItems,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tappenderLabel,\n\t\t\ttoggleProps,\n\t\t} );\n\t}\n\n\t/**\n\t * Render callback to display Dropdown content element.\n\t *\n\t * @param {Object} options\n\t * @param {Function} options.onClose Callback to invoke when dropdown is\n\t * closed.\n\t *\n\t * @return {Element} Dropdown content element.\n\t */\n\trenderContent( { onClose } ) {\n\t\tconst {\n\t\t\trootClientId,\n\t\t\tclientId,\n\t\t\tisAppender,\n\t\t\tshowInserterHelpPanel,\n\t\t\t// This prop is experimental to give some time for the quick inserter to mature\n\t\t\t// Feel free to make them stable after a few releases.\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t\tselectBlockOnInsert,\n\t\t} = this.props;\n\n\t\tif ( isQuick ) {\n\t\t\treturn (\n\t\t\t\t<QuickInserter\n\t\t\t\t\tonSelect={ ( blocks ) => {\n\t\t\t\t\t\tconst firstBlock =\n\t\t\t\t\t\t\tArray.isArray( blocks ) && blocks?.length\n\t\t\t\t\t\t\t\t? blocks[ 0 ]\n\t\t\t\t\t\t\t\t: blocks;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tonSelectOrClose &&\n\t\t\t\t\t\t\ttypeof onSelectOrClose === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonSelectOrClose( firstBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisAppender={ isAppender }\n\t\t\t\t\tselectBlockOnInsert={ selectBlockOnInsert }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<InserterMenu\n\t\t\t\tonSelect={ () => {\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t\tonClose={ onClose }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisAppender={ isAppender }\n\t\t\t\tshowInserterHelpPanel={ showInserterHelpPanel }\n\t\t\t/>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tposition,\n\t\t\thasSingleBlockType,\n\t\t\tblockToInsert,\n\t\t\tinsertOnlyAllowedBlock,\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t} = this.props;\n\n\t\tif ( hasSingleBlockType || blockToInsert ) {\n\t\t\treturn this.renderToggle( { onToggle: insertOnlyAllowedBlock } );\n\t\t}\n\n\t\treturn (\n\t\t\t<Dropdown\n\t\t\t\tclassName=\"block-editor-inserter\"\n\t\t\t\tcontentClassName={ clsx( 'block-editor-inserter__popover', {\n\t\t\t\t\t'is-quick': isQuick,\n\t\t\t\t} ) }\n\t\t\t\tpopoverProps={ { position, shift: true } }\n\t\t\t\tonToggle={ this.onToggle }\n\t\t\t\texpandOnMobile\n\t\t\t\theaderTitle={ __( 'Add a block' ) }\n\t\t\t\trenderToggle={ this.renderToggle }\n\t\t\t\trenderContent={ this.renderContent }\n\t\t\t\tonClose={ onSelectOrClose }\n\t\t\t/>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect(\n\t\t( select, { clientId, rootClientId, shouldDirectInsert = true } ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasInserterItems,\n\t\t\t\tgetAllowedBlocks,\n\t\t\t\tgetDirectInsertBlock,\n\t\t\t\tgetBlockListSettings,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockVariations, getBlockType } = select( blocksStore );\n\n\t\t\trootClientId =\n\t\t\t\trootClientId || getBlockRootClientId( clientId ) || undefined;\n\n\t\t\tconst allowedBlocks = getAllowedBlocks( rootClientId );\n\t\t\tconst directInsertBlock =\n\t\t\t\tshouldDirectInsert && getDirectInsertBlock( rootClientId );\n\t\t\tconst { defaultBlock } = getBlockListSettings( rootClientId ) ?? {};\n\n\t\t\tconst hasSingleBlockType =\n\t\t\t\tallowedBlocks?.length === 1 &&\n\t\t\t\tgetBlockVariations( allowedBlocks[ 0 ].name, 'inserter' )\n\t\t\t\t\t?.length === 0;\n\t\t\tconst allowedBlockType = hasSingleBlockType\n\t\t\t\t? allowedBlocks[ 0 ]\n\t\t\t\t: null;\n\n\t\t\t// Single-block-type parents get adjacent-attribute copying\n\t\t\t// without needing to set `directInsert: true`.\n\t\t\tlet blockToInsert = directInsertBlock || null;\n\t\t\tif (\n\t\t\t\t! blockToInsert &&\n\t\t\t\thasSingleBlockType &&\n\t\t\t\tdefaultBlock?.name === allowedBlockType.name\n\t\t\t) {\n\t\t\t\tblockToInsert = defaultBlock;\n\t\t\t}\n\n\t\t\tconst defaultBlockType = directInsertBlock\n\t\t\t\t? getBlockType( directInsertBlock.name )\n\t\t\t\t: null;\n\t\t\tconst appenderLabel = getAppenderLabel(\n\t\t\t\tdirectInsertBlock,\n\t\t\t\tdefaultBlockType\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\thasItems: hasInserterItems( rootClientId ),\n\t\t\t\thasSingleBlockType,\n\t\t\t\tblockTitle: allowedBlockType ? allowedBlockType.title : '',\n\t\t\t\tallowedBlockType,\n\t\t\t\tblockToInsert,\n\t\t\t\tappenderLabel,\n\t\t\t\trootClientId,\n\t\t\t};\n\t\t}\n\t),\n\twithDispatch( ( dispatch, ownProps, { select } ) => {\n\t\treturn {\n\t\t\tinsertOnlyAllowedBlock() {\n\t\t\t\tconst {\n\t\t\t\t\trootClientId,\n\t\t\t\t\tclientId,\n\t\t\t\t\tisAppender,\n\t\t\t\t\thasSingleBlockType,\n\t\t\t\t\tallowedBlockType,\n\t\t\t\t\tblockToInsert,\n\t\t\t\t\tonSelectOrClose,\n\t\t\t\t\tselectBlockOnInsert,\n\t\t\t\t} = ownProps;\n\n\t\t\t\tif ( ! hasSingleBlockType && ! blockToInsert ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst blockName = blockToInsert?.name ?? allowedBlockType.name;\n\n\t\t\t\tfunction getAdjacentBlockAttributes( attributesToCopy ) {\n\t\t\t\t\tif ( ! attributesToCopy?.length ) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { getBlock, getPreviousBlockClientId } =\n\t\t\t\t\t\tselect( blockEditorStore );\n\n\t\t\t\t\t// Find the adjacent block of the same type whose attributes\n\t\t\t\t\t// should be copied: previous sibling when inserting next to\n\t\t\t\t\t// an existing block, otherwise the last child of the root.\n\t\t\t\t\tlet adjacentAttributes;\n\t\t\t\t\tif ( clientId ) {\n\t\t\t\t\t\tconst currentBlock = getBlock( clientId );\n\t\t\t\t\t\tconst previousBlock = getBlock(\n\t\t\t\t\t\t\tgetPreviousBlockClientId( clientId )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( currentBlock?.name === previousBlock?.name ) {\n\t\t\t\t\t\t\tadjacentAttributes = previousBlock?.attributes;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\t\tconst lastInnerBlock =\n\t\t\t\t\t\t\tgetBlock( rootClientId )?.innerBlocks?.at( -1 );\n\t\t\t\t\t\tif ( lastInnerBlock?.name === blockName ) {\n\t\t\t\t\t\t\tadjacentAttributes = lastInnerBlock.attributes;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! adjacentAttributes ) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Object.fromEntries(\n\t\t\t\t\t\tattributesToCopy\n\t\t\t\t\t\t\t.filter( ( attr ) => attr in adjacentAttributes )\n\t\t\t\t\t\t\t.map( ( attr ) => [\n\t\t\t\t\t\t\t\tattr,\n\t\t\t\t\t\t\t\tadjacentAttributes[ attr ],\n\t\t\t\t\t\t\t] )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tfunction getInsertionIndex() {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\t\tgetBlockSelectionEnd,\n\t\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\t} = select( blockEditorStore );\n\n\t\t\t\t\t// If the clientId is defined, we insert at the position of the block.\n\t\t\t\t\tif ( clientId ) {\n\t\t\t\t\t\treturn getBlockIndex( clientId );\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there a selected block, we insert after the selected block.\n\t\t\t\t\tconst end = getBlockSelectionEnd();\n\t\t\t\t\tif (\n\t\t\t\t\t\t! isAppender &&\n\t\t\t\t\t\tend &&\n\t\t\t\t\t\tgetBlockRootClientId( end ) === rootClientId\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn getBlockIndex( end ) + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Otherwise, we insert at the end of the current rootClientId.\n\t\t\t\t\treturn getBlockOrder( rootClientId ).length;\n\t\t\t\t}\n\n\t\t\t\tconst { insertBlock } = dispatch( blockEditorStore );\n\n\t\t\t\t// Attempt to augment the inserted block with attributes from an adjacent block.\n\t\t\t\t// This ensures styling from nearby blocks is preserved in the newly inserted block.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/37904\n\t\t\t\tconst newAttributes = getAdjacentBlockAttributes(\n\t\t\t\t\tblockToInsert?.attributesToCopy\n\t\t\t\t);\n\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\t...( blockToInsert?.attributes || {} ),\n\t\t\t\t\t...newAttributes,\n\t\t\t\t} );\n\n\t\t\t\tinsertBlock(\n\t\t\t\t\tnewBlock,\n\t\t\t\t\tgetInsertionIndex(),\n\t\t\t\t\trootClientId,\n\t\t\t\t\tselectBlockOnInsert\n\t\t\t\t);\n\n\t\t\t\tif ( onSelectOrClose ) {\n\t\t\t\t\tonSelectOrClose( newBlock );\n\t\t\t\t}\n\n\t\t\t\tconst message = sprintf(\n\t\t\t\t\t// translators: %s: the name of the block that has been added\n\t\t\t\t\t__( '%s block added' ),\n\t\t\t\t\tallowedBlockType.title\n\t\t\t\t);\n\t\t\t\tspeak( message );\n\t\t\t},\n\t\t};\n\t} ),\n\t// The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as\n\t// a way to detect the global Inserter.\n\tifCondition(\n\t\t( { hasItems, isAppender, rootClientId, clientId } ) =>\n\t\t\thasItems || ( ! isAppender && ! rootClientId && ! clientId )\n\t),\n] )( Inserter );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAAsB;AACtB,kBAAgC;AAChC,wBAAiC;AACjC,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tcreateBlock,\n\tstore as blocksStore,\n\t__experimentalGetBlockLabel as getBlockLabel,\n} from '@wordpress/blocks';\nimport { forwardRef } from '@wordpress/element';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport InserterMenu from './menu';\nimport QuickInserter from './quick-inserter';\nimport { store as blockEditorStore } from '../../store';\nimport { getAppenderLabel } from './get-appender-label';\n\nconst UnforwardedInserterToggle = (\n\t{\n\t\tonToggle,\n\t\tdisabled,\n\t\tisOpen,\n\t\tblockTitle,\n\t\thasSingleBlockType,\n\t\tappenderLabel,\n\t\ttoggleProps = {},\n\t},\n\tref\n) => {\n\tconst {\n\t\tas: Wrapper = Button,\n\t\tlabel: labelProp,\n\t\tonClick,\n\t\t...rest\n\t} = toggleProps;\n\n\tlet label = labelProp;\n\tif ( ! label && appenderLabel ) {\n\t\t// Block returns the full label; use directly (consistent with getBlockLabel).\n\t\tlabel = appenderLabel;\n\t} else if ( ! label && hasSingleBlockType ) {\n\t\tlabel = sprintf(\n\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t_x( 'Add %s', 'directly add the only allowed block' ),\n\t\t\tblockTitle.toLowerCase()\n\t\t);\n\t} else if ( ! label ) {\n\t\tlabel = _x( 'Add block', 'Generic label for block inserter button' );\n\t}\n\n\t// Handle both onClick functions from the toggle and the parent component.\n\tfunction handleClick( event ) {\n\t\tif ( onToggle ) {\n\t\t\tonToggle( event );\n\t\t}\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Wrapper\n\t\t\tref={ ref }\n\t\t\t__next40pxDefaultSize={ toggleProps.as ? undefined : true }\n\t\t\ticon={ plus }\n\t\t\tlabel={ label }\n\t\t\ttooltipPosition=\"bottom\"\n\t\t\tonClick={ handleClick }\n\t\t\tclassName=\"block-editor-inserter__toggle\"\n\t\t\taria-haspopup={ ! hasSingleBlockType ? 'true' : false }\n\t\t\taria-expanded={ ! hasSingleBlockType ? isOpen : false }\n\t\t\tisPressed={ ! hasSingleBlockType && isOpen }\n\t\t\tdisabled={ disabled }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n};\n\nconst InserterToggle = forwardRef( UnforwardedInserterToggle );\n\nconst UnforwardedInserter = (\n\t{\n\t\tclientId,\n\t\trootClientId,\n\t\tdisabled,\n\t\tisAppender,\n\t\tposition,\n\t\tselectBlockOnInsert,\n\t\tshouldDirectInsert = true,\n\t\tshowInserterHelpPanel,\n\t\t// This prop is experimental to give some time for the quick inserter to mature\n\t\t// Feel free to make them stable after a few releases.\n\t\t__experimentalIsQuick: isQuick,\n\t\tonSelectOrClose,\n\t\tonToggle,\n\t\trenderToggle: renderToggleProp,\n\t\ttoggleProps,\n\t},\n\tref\n) => {\n\tconst {\n\t\thasItems,\n\t\thasSingleBlockType,\n\t\tblockTitle,\n\t\tallowedBlockType,\n\t\tblockToInsert,\n\t\tappenderLabel,\n\t\ttargetRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasInserterItems,\n\t\t\t\tgetAllowedBlocks,\n\t\t\t\tgetDirectInsertBlock,\n\t\t\t\tgetBlockListSettings,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockVariations, getBlockType } = select( blocksStore );\n\n\t\t\tconst _targetRootClientId =\n\t\t\t\trootClientId || getBlockRootClientId( clientId ) || undefined;\n\n\t\t\tconst allowedBlocks = getAllowedBlocks( _targetRootClientId );\n\t\t\tconst directInsertBlock =\n\t\t\t\tshouldDirectInsert &&\n\t\t\t\tgetDirectInsertBlock( _targetRootClientId );\n\t\t\tconst { defaultBlock } =\n\t\t\t\tgetBlockListSettings( _targetRootClientId ) ?? {};\n\n\t\t\tconst _hasSingleBlockType =\n\t\t\t\tallowedBlocks?.length === 1 &&\n\t\t\t\tgetBlockVariations( allowedBlocks[ 0 ].name, 'inserter' )\n\t\t\t\t\t?.length === 0;\n\t\t\tconst _allowedBlockType = _hasSingleBlockType\n\t\t\t\t? allowedBlocks[ 0 ]\n\t\t\t\t: null;\n\n\t\t\t// Single-block-type parents get adjacent-attribute copying\n\t\t\t// without needing to set `directInsert: true`.\n\t\t\tlet _blockToInsert = directInsertBlock || null;\n\t\t\tif (\n\t\t\t\t! _blockToInsert &&\n\t\t\t\t_hasSingleBlockType &&\n\t\t\t\tdefaultBlock?.name === _allowedBlockType.name\n\t\t\t) {\n\t\t\t\t_blockToInsert = defaultBlock;\n\t\t\t}\n\n\t\t\tconst defaultBlockType = directInsertBlock\n\t\t\t\t? getBlockType( directInsertBlock.name )\n\t\t\t\t: null;\n\t\t\treturn {\n\t\t\t\thasItems: hasInserterItems( _targetRootClientId ),\n\t\t\t\thasSingleBlockType: _hasSingleBlockType,\n\t\t\t\tblockTitle: _allowedBlockType ? _allowedBlockType.title : '',\n\t\t\t\tallowedBlockType: _allowedBlockType,\n\t\t\t\tblockToInsert: _blockToInsert,\n\t\t\t\tappenderLabel: getAppenderLabel(\n\t\t\t\t\tdirectInsertBlock,\n\t\t\t\t\tdefaultBlockType\n\t\t\t\t),\n\t\t\t\ttargetRootClientId: _targetRootClientId,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId, clientId, shouldDirectInsert ]\n\t);\n\n\tconst { insertBlock } = useDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlock,\n\t\tgetBlockIndex,\n\t\tgetBlockOrder,\n\t\tgetBlockRootClientId,\n\t\tgetBlockSelectionEnd,\n\t\tgetPreviousBlockClientId,\n\t} = useSelect( blockEditorStore );\n\tconst { getActiveBlockVariation, getBlockType } = useSelect( blocksStore );\n\n\t// The global inserter (no isAppender, no rootClientId, no clientId) should\n\t// always render, even with no items.\n\tif ( ! hasItems && ( isAppender || targetRootClientId || clientId ) ) {\n\t\treturn null;\n\t}\n\n\tfunction insertOnlyAllowedBlock() {\n\t\tconst blockName = blockToInsert?.name ?? allowedBlockType.name;\n\n\t\tfunction getAdjacentBlockAttributes( attributesToCopy ) {\n\t\t\tif ( ! attributesToCopy?.length ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\t// Find the adjacent block of the same type whose attributes\n\t\t\t// should be copied: previous sibling when inserting next to\n\t\t\t// an existing block, otherwise the last child of the root.\n\t\t\tlet adjacentAttributes;\n\t\t\tif ( clientId ) {\n\t\t\t\tconst currentBlock = getBlock( clientId );\n\t\t\t\tconst previousBlock = getBlock(\n\t\t\t\t\tgetPreviousBlockClientId( clientId )\n\t\t\t\t);\n\t\t\t\tif ( currentBlock?.name === previousBlock?.name ) {\n\t\t\t\t\tadjacentAttributes = previousBlock?.attributes;\n\t\t\t\t}\n\t\t\t} else if ( targetRootClientId ) {\n\t\t\t\tconst lastInnerBlock =\n\t\t\t\t\tgetBlock( targetRootClientId )?.innerBlocks?.at( -1 );\n\t\t\t\tif ( lastInnerBlock?.name === blockName ) {\n\t\t\t\t\tadjacentAttributes = lastInnerBlock.attributes;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! adjacentAttributes ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\treturn Object.fromEntries(\n\t\t\t\tattributesToCopy\n\t\t\t\t\t.filter( ( attr ) => attr in adjacentAttributes )\n\t\t\t\t\t.map( ( attr ) => [ attr, adjacentAttributes[ attr ] ] )\n\t\t\t);\n\t\t}\n\n\t\tfunction getInsertionIndex() {\n\t\t\t// If the clientId is defined, we insert at the position of the block.\n\t\t\tif ( clientId ) {\n\t\t\t\treturn getBlockIndex( clientId );\n\t\t\t}\n\n\t\t\t// If there a selected block, we insert after the selected block.\n\t\t\tconst end = getBlockSelectionEnd();\n\t\t\tif (\n\t\t\t\t! isAppender &&\n\t\t\t\tend &&\n\t\t\t\tgetBlockRootClientId( end ) === targetRootClientId\n\t\t\t) {\n\t\t\t\treturn getBlockIndex( end ) + 1;\n\t\t\t}\n\n\t\t\t// Otherwise, we insert at the end of the current rootClientId.\n\t\t\treturn getBlockOrder( targetRootClientId ).length;\n\t\t}\n\n\t\t// Attempt to augment the inserted block with attributes from an adjacent block.\n\t\t// This ensures styling from nearby blocks is preserved in the newly inserted block.\n\t\t// See: https://github.com/WordPress/gutenberg/issues/37904\n\t\tconst newAttributes = getAdjacentBlockAttributes(\n\t\t\tblockToInsert?.attributesToCopy\n\t\t);\n\n\t\tconst newBlock = createBlock( blockName, {\n\t\t\t...blockToInsert?.attributes,\n\t\t\t...newAttributes,\n\t\t} );\n\n\t\tinsertBlock(\n\t\t\tnewBlock,\n\t\t\tgetInsertionIndex(),\n\t\t\ttargetRootClientId,\n\t\t\tselectBlockOnInsert\n\t\t);\n\n\t\tonSelectOrClose?.( newBlock );\n\n\t\tconst blockTypeToInsert = getBlockType( blockName );\n\t\tlet blockLabelToInsert;\n\t\tif ( blockTypeToInsert ) {\n\t\t\tblockLabelToInsert = getBlockLabel(\n\t\t\t\tblockTypeToInsert,\n\t\t\t\tnewBlock.attributes\n\t\t\t);\n\n\t\t\tif ( blockLabelToInsert === blockTypeToInsert.title ) {\n\t\t\t\tblockLabelToInsert =\n\t\t\t\t\tgetActiveBlockVariation( blockName, newBlock.attributes )\n\t\t\t\t\t\t?.title || blockLabelToInsert;\n\t\t\t}\n\t\t}\n\n\t\tif ( blockLabelToInsert ) {\n\t\t\tconst message = sprintf(\n\t\t\t\t// translators: %s: the name of the block that has been added\n\t\t\t\t__( '%s block added' ),\n\t\t\t\tblockLabelToInsert\n\t\t\t);\n\t\t\tspeak( message );\n\t\t}\n\t}\n\n\tfunction renderToggle( { onToggle: dropdownOnToggle, isOpen } ) {\n\t\tconst toggleArgs = {\n\t\t\tonToggle: dropdownOnToggle,\n\t\t\tisOpen,\n\t\t\tdisabled: disabled || ! hasItems,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tappenderLabel,\n\t\t\ttoggleProps,\n\t\t};\n\n\t\tif ( renderToggleProp ) {\n\t\t\treturn renderToggleProp( toggleArgs );\n\t\t}\n\n\t\treturn <InserterToggle ref={ ref } { ...toggleArgs } />;\n\t}\n\n\tfunction renderContent( { onClose } ) {\n\t\tif ( isQuick ) {\n\t\t\treturn (\n\t\t\t\t<QuickInserter\n\t\t\t\t\tonSelect={ ( blocks ) => {\n\t\t\t\t\t\tconst firstBlock =\n\t\t\t\t\t\t\tArray.isArray( blocks ) && blocks?.length\n\t\t\t\t\t\t\t\t? blocks[ 0 ]\n\t\t\t\t\t\t\t\t: blocks;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tonSelectOrClose &&\n\t\t\t\t\t\t\ttypeof onSelectOrClose === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonSelectOrClose( firstBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\trootClientId={ targetRootClientId }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisAppender={ isAppender }\n\t\t\t\t\tselectBlockOnInsert={ selectBlockOnInsert }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<InserterMenu\n\t\t\t\tonSelect={ () => {\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t\tonClose={ onClose }\n\t\t\t\trootClientId={ targetRootClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisAppender={ isAppender }\n\t\t\t\tshowInserterHelpPanel={ showInserterHelpPanel }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( hasSingleBlockType || blockToInsert ) {\n\t\treturn renderToggle( { onToggle: insertOnlyAllowedBlock } );\n\t}\n\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName=\"block-editor-inserter\"\n\t\t\tcontentClassName={ clsx( 'block-editor-inserter__popover', {\n\t\t\t\t'is-quick': isQuick,\n\t\t\t} ) }\n\t\t\tpopoverProps={ { position, shift: true } }\n\t\t\tonToggle={ onToggle }\n\t\t\texpandOnMobile\n\t\t\theaderTitle={ __( 'Add a block' ) }\n\t\t\trenderToggle={ renderToggle }\n\t\t\trenderContent={ renderContent }\n\t\t\tonClose={ onSelectOrClose }\n\t\t/>\n\t);\n};\n\nconst Inserter = forwardRef( UnforwardedInserter );\n\nexport default Inserter;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAAsB;AACtB,kBAAgC;AAChC,wBAAiC;AACjC,kBAAuC;AACvC,oBAIO;AACP,qBAA2B;AAC3B,mBAAqB;AAKrB,kBAAyB;AACzB,4BAA0B;AAC1B,mBAA0C;AAC1C,gCAAiC;AA8C/B;AA5CF,IAAM,4BAA4B,CACjC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc,CAAC;AAChB,GACA,QACI;AACJ,QAAM;AAAA,IACL,IAAI,UAAU;AAAA,IACd,OAAO;AAAA,IACP;AAAA,IACA,GAAG;AAAA,EACJ,IAAI;AAEJ,MAAI,QAAQ;AACZ,MAAK,CAAE,SAAS,eAAgB;AAE/B,YAAQ;AAAA,EACT,WAAY,CAAE,SAAS,oBAAqB;AAC3C,gBAAQ;AAAA;AAAA,UAEP,gBAAI,UAAU,qCAAsC;AAAA,MACpD,WAAW,YAAY;AAAA,IACxB;AAAA,EACD,WAAY,CAAE,OAAQ;AACrB,gBAAQ,gBAAI,aAAa,yCAA0C;AAAA,EACpE;AAGA,WAAS,YAAa,OAAQ;AAC7B,QAAK,UAAW;AACf,e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lockType", "blocksStore", "getBlockLabel", "QuickInserter", "InserterMenu", "clsx"]
|
|
7
7
|
}
|
|
@@ -184,7 +184,7 @@ function InserterSearchResults({
|
|
|
184
184
|
const patternsUI = !!filteredBlockPatterns.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
185
185
|
import_panel.default,
|
|
186
186
|
{
|
|
187
|
-
title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.VisuallyHidden, { children: (0, import_i18n.__)("
|
|
187
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.VisuallyHidden, { children: (0, import_i18n.__)("Patterns") }),
|
|
188
188
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-editor-inserter__quick-inserter-patterns", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
189
189
|
import_block_patterns_list.default,
|
|
190
190
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/inserter/search-results.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo, useEffect } from '@wordpress/element';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { VisuallyHidden } from '@wordpress/ui';\nimport { useDebounce, useAsyncList } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport BlockPatternsList from '../block-patterns-list';\nimport __unstableInserterMenuExtension from '../inserter-menu-extension';\nimport InserterPanel from './panel';\nimport InserterNoResults from './no-results';\nimport useInsertionPoint from './hooks/use-insertion-point';\nimport usePatternsState from './hooks/use-patterns-state';\nimport useBlockTypesState from './hooks/use-block-types-state';\nimport { searchBlockItems, searchItems } from './search-items';\nimport InserterListbox from '../inserter-listbox';\nimport { orderBy } from '../../utils/sorting';\nimport { orderInserterBlockItems } from '../../utils/order-inserter-block-items';\nimport { store as blockEditorStore } from '../../store';\n\nconst INITIAL_INSERTER_RESULTS = 9;\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation and rerendering the component.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nfunction InserterSearchResults( {\n\tfilterValue,\n\tonSelect,\n\tonHover,\n\tonHoverPattern,\n\trootClientId,\n\tclientId,\n\tisAppender,\n\t__experimentalInsertionIndex,\n\tmaxBlockPatterns,\n\tmaxBlockTypes,\n\tshowBlockDirectory = false,\n\tisDraggable = true,\n\tshouldFocusBlock = true,\n\tprioritizePatterns,\n\tselectBlockOnInsert,\n\tisQuick,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\tconst { prioritizedBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst blockListSettings =\n\t\t\t\tselect( blockEditorStore ).getBlockListSettings( rootClientId );\n\n\t\t\treturn {\n\t\t\t\tprioritizedBlocks:\n\t\t\t\t\tblockListSettings?.prioritizedInserterBlocks || EMPTY_ARRAY,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\tconst [ destinationRootClientId, onInsertBlocks ] = useInsertionPoint( {\n\t\tonSelect,\n\t\trootClientId,\n\t\tclientId,\n\t\tisAppender,\n\t\tinsertionIndex: __experimentalInsertionIndex,\n\t\tshouldFocusBlock,\n\t\tselectBlockOnInsert,\n\t} );\n\tconst [\n\t\tblockTypes,\n\t\tblockTypeCategories,\n\t\tblockTypeCollections,\n\t\tonSelectBlockType,\n\t] = useBlockTypesState( destinationRootClientId, onInsertBlocks, isQuick );\n\tconst [ patterns, , onClickPattern ] = usePatternsState(\n\t\tonInsertBlocks,\n\t\tdestinationRootClientId,\n\t\tundefined,\n\t\tisQuick\n\t);\n\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\tif ( maxBlockPatterns === 0 ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst results = searchItems( patterns, filterValue );\n\t\treturn maxBlockPatterns !== undefined\n\t\t\t? results.slice( 0, maxBlockPatterns )\n\t\t\t: results;\n\t}, [ filterValue, patterns, maxBlockPatterns ] );\n\n\tlet maxBlockTypesToShow = maxBlockTypes;\n\tif ( prioritizePatterns && filteredBlockPatterns.length > 2 ) {\n\t\tmaxBlockTypesToShow = 0;\n\t}\n\n\tconst filteredBlockTypes = useMemo( () => {\n\t\tif ( maxBlockTypesToShow === 0 ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst nonPatternBlockTypes = blockTypes.filter(\n\t\t\t( blockType ) => blockType.name !== 'core/block'\n\t\t);\n\t\tlet orderedItems = orderBy( nonPatternBlockTypes, 'frecency', 'desc' );\n\n\t\tif ( ! filterValue && prioritizedBlocks.length ) {\n\t\t\torderedItems = orderInserterBlockItems(\n\t\t\t\torderedItems,\n\t\t\t\tprioritizedBlocks\n\t\t\t);\n\t\t}\n\n\t\tconst results = searchBlockItems(\n\t\t\torderedItems,\n\t\t\tblockTypeCategories,\n\t\t\tblockTypeCollections,\n\t\t\tfilterValue\n\t\t);\n\n\t\treturn maxBlockTypesToShow !== undefined\n\t\t\t? results.slice( 0, maxBlockTypesToShow )\n\t\t\t: results;\n\t}, [\n\t\tfilterValue,\n\t\tblockTypes,\n\t\tblockTypeCategories,\n\t\tblockTypeCollections,\n\t\tmaxBlockTypesToShow,\n\t\tprioritizedBlocks,\n\t] );\n\n\t// Announce search results on change.\n\tuseEffect( () => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = filteredBlockTypes.length + filteredBlockPatterns.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [\n\t\tfilterValue,\n\t\tdebouncedSpeak,\n\t\tfilteredBlockTypes,\n\t\tfilteredBlockPatterns,\n\t] );\n\n\tconst currentShownBlockTypes = useAsyncList( filteredBlockTypes, {\n\t\tstep: INITIAL_INSERTER_RESULTS,\n\t} );\n\n\tconst hasItems =\n\t\tfilteredBlockTypes.length > 0 || filteredBlockPatterns.length > 0;\n\n\tconst blocksUI = !! filteredBlockTypes.length && (\n\t\t<InserterPanel\n\t\t\ttitle={ <VisuallyHidden>{ __( 'Blocks' ) }</VisuallyHidden> }\n\t\t>\n\t\t\t<BlockTypesList\n\t\t\t\titems={ currentShownBlockTypes }\n\t\t\t\tonSelect={ onSelectBlockType }\n\t\t\t\tonHover={ onHover }\n\t\t\t\tlabel={ __( 'Blocks' ) }\n\t\t\t\tisDraggable={ isDraggable }\n\t\t\t/>\n\t\t</InserterPanel>\n\t);\n\n\tconst patternsUI = !! filteredBlockPatterns.length && (\n\t\t<InserterPanel\n\t\t\ttitle={
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAmC;AACnC,kBAAgC;AAChC,gBAA+B;AAC/B,qBAA0C;AAC1C,kBAAsB;AACtB,kBAA0B;AAK1B,8BAA2B;AAC3B,iCAA8B;AAC9B,qCAA4C;AAC5C,mBAA0B;AAC1B,wBAA8B;AAC9B,iCAA8B;AAC9B,gCAA6B;AAC7B,mCAA+B;AAC/B,0BAA8C;AAC9C,8BAA4B;AAC5B,qBAAwB;AACxB,wCAAwC;AACxC,mBAA0C;AAgJ/B;AA9IX,IAAM,2BAA2B;AAOjC,IAAM,cAAc,CAAC;AAErB,SAAS,sBAAuB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,qBAAiB,4BAAa,mBAAO,GAAI;AAE/C,QAAM,EAAE,kBAAkB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AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAEA,WAAO,wBAAwB,SAC5B,QAAQ,MAAO,GAAG,mBAAoB,IACtC;AAAA,EACJ,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAGF,gCAAW,MAAM;AAChB,QAAK,CAAE,aAAc;AACpB;AAAA,IACD;AACA,UAAM,QAAQ,mBAAmB,SAAS,sBAAsB;AAChE,UAAM,0BAAsB;AAAA;AAAA,UAE3B,gBAAI,oBAAoB,qBAAqB,KAAM;AAAA,MACnD;AAAA,IACD;AACA,mBAAgB,mBAAoB;AAAA,EACrC,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAEF,QAAM,6BAAyB,6BAAc,oBAAoB;AAAA,IAChE,MAAM;AAAA,EACP,CAAE;AAEF,QAAM,WACL,mBAAmB,SAAS,KAAK,sBAAsB,SAAS;AAEjE,QAAM,WAAW,CAAC,CAAE,mBAAmB,UACtC;AAAA,IAAC,aAAAC;AAAA,IAAA;AAAA,MACA,OAAQ,4CAAC,4BAAiB,8BAAI,QAAS,GAAG;AAAA,MAE1C;AAAA,QAAC,wBAAAC;AAAA,QAAA;AAAA,UACA,OAAQ;AAAA,UACR,UAAW;AAAA,UACX;AAAA,UACA,WAAQ,gBAAI,QAAS;AAAA,UACrB;AAAA;AAAA,MACD;AAAA;AAAA,EACD;AAGD,QAAM,aAAa,CAAC,CAAE,sBAAsB,UAC3C;AAAA,IAAC,aAAAD;AAAA,IAAA;AAAA,MACA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo, useEffect } from '@wordpress/element';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { VisuallyHidden } from '@wordpress/ui';\nimport { useDebounce, useAsyncList } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport BlockPatternsList from '../block-patterns-list';\nimport __unstableInserterMenuExtension from '../inserter-menu-extension';\nimport InserterPanel from './panel';\nimport InserterNoResults from './no-results';\nimport useInsertionPoint from './hooks/use-insertion-point';\nimport usePatternsState from './hooks/use-patterns-state';\nimport useBlockTypesState from './hooks/use-block-types-state';\nimport { searchBlockItems, searchItems } from './search-items';\nimport InserterListbox from '../inserter-listbox';\nimport { orderBy } from '../../utils/sorting';\nimport { orderInserterBlockItems } from '../../utils/order-inserter-block-items';\nimport { store as blockEditorStore } from '../../store';\n\nconst INITIAL_INSERTER_RESULTS = 9;\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation and rerendering the component.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nfunction InserterSearchResults( {\n\tfilterValue,\n\tonSelect,\n\tonHover,\n\tonHoverPattern,\n\trootClientId,\n\tclientId,\n\tisAppender,\n\t__experimentalInsertionIndex,\n\tmaxBlockPatterns,\n\tmaxBlockTypes,\n\tshowBlockDirectory = false,\n\tisDraggable = true,\n\tshouldFocusBlock = true,\n\tprioritizePatterns,\n\tselectBlockOnInsert,\n\tisQuick,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\tconst { prioritizedBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst blockListSettings =\n\t\t\t\tselect( blockEditorStore ).getBlockListSettings( rootClientId );\n\n\t\t\treturn {\n\t\t\t\tprioritizedBlocks:\n\t\t\t\t\tblockListSettings?.prioritizedInserterBlocks || EMPTY_ARRAY,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\tconst [ destinationRootClientId, onInsertBlocks ] = useInsertionPoint( {\n\t\tonSelect,\n\t\trootClientId,\n\t\tclientId,\n\t\tisAppender,\n\t\tinsertionIndex: __experimentalInsertionIndex,\n\t\tshouldFocusBlock,\n\t\tselectBlockOnInsert,\n\t} );\n\tconst [\n\t\tblockTypes,\n\t\tblockTypeCategories,\n\t\tblockTypeCollections,\n\t\tonSelectBlockType,\n\t] = useBlockTypesState( destinationRootClientId, onInsertBlocks, isQuick );\n\tconst [ patterns, , onClickPattern ] = usePatternsState(\n\t\tonInsertBlocks,\n\t\tdestinationRootClientId,\n\t\tundefined,\n\t\tisQuick\n\t);\n\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\tif ( maxBlockPatterns === 0 ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst results = searchItems( patterns, filterValue );\n\t\treturn maxBlockPatterns !== undefined\n\t\t\t? results.slice( 0, maxBlockPatterns )\n\t\t\t: results;\n\t}, [ filterValue, patterns, maxBlockPatterns ] );\n\n\tlet maxBlockTypesToShow = maxBlockTypes;\n\tif ( prioritizePatterns && filteredBlockPatterns.length > 2 ) {\n\t\tmaxBlockTypesToShow = 0;\n\t}\n\n\tconst filteredBlockTypes = useMemo( () => {\n\t\tif ( maxBlockTypesToShow === 0 ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst nonPatternBlockTypes = blockTypes.filter(\n\t\t\t( blockType ) => blockType.name !== 'core/block'\n\t\t);\n\t\tlet orderedItems = orderBy( nonPatternBlockTypes, 'frecency', 'desc' );\n\n\t\tif ( ! filterValue && prioritizedBlocks.length ) {\n\t\t\torderedItems = orderInserterBlockItems(\n\t\t\t\torderedItems,\n\t\t\t\tprioritizedBlocks\n\t\t\t);\n\t\t}\n\n\t\tconst results = searchBlockItems(\n\t\t\torderedItems,\n\t\t\tblockTypeCategories,\n\t\t\tblockTypeCollections,\n\t\t\tfilterValue\n\t\t);\n\n\t\treturn maxBlockTypesToShow !== undefined\n\t\t\t? results.slice( 0, maxBlockTypesToShow )\n\t\t\t: results;\n\t}, [\n\t\tfilterValue,\n\t\tblockTypes,\n\t\tblockTypeCategories,\n\t\tblockTypeCollections,\n\t\tmaxBlockTypesToShow,\n\t\tprioritizedBlocks,\n\t] );\n\n\t// Announce search results on change.\n\tuseEffect( () => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = filteredBlockTypes.length + filteredBlockPatterns.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [\n\t\tfilterValue,\n\t\tdebouncedSpeak,\n\t\tfilteredBlockTypes,\n\t\tfilteredBlockPatterns,\n\t] );\n\n\tconst currentShownBlockTypes = useAsyncList( filteredBlockTypes, {\n\t\tstep: INITIAL_INSERTER_RESULTS,\n\t} );\n\n\tconst hasItems =\n\t\tfilteredBlockTypes.length > 0 || filteredBlockPatterns.length > 0;\n\n\tconst blocksUI = !! filteredBlockTypes.length && (\n\t\t<InserterPanel\n\t\t\ttitle={ <VisuallyHidden>{ __( 'Blocks' ) }</VisuallyHidden> }\n\t\t>\n\t\t\t<BlockTypesList\n\t\t\t\titems={ currentShownBlockTypes }\n\t\t\t\tonSelect={ onSelectBlockType }\n\t\t\t\tonHover={ onHover }\n\t\t\t\tlabel={ __( 'Blocks' ) }\n\t\t\t\tisDraggable={ isDraggable }\n\t\t\t/>\n\t\t</InserterPanel>\n\t);\n\n\tconst patternsUI = !! filteredBlockPatterns.length && (\n\t\t<InserterPanel\n\t\t\ttitle={ <VisuallyHidden>{ __( 'Patterns' ) }</VisuallyHidden> }\n\t\t>\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-patterns\">\n\t\t\t\t<BlockPatternsList\n\t\t\t\t\tblockPatterns={ filteredBlockPatterns }\n\t\t\t\t\tonClickPattern={ onClickPattern }\n\t\t\t\t\tonHover={ onHoverPattern }\n\t\t\t\t\tisDraggable={ isDraggable }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</InserterPanel>\n\t);\n\n\treturn (\n\t\t<InserterListbox>\n\t\t\t{ ! showBlockDirectory && ! hasItems && <InserterNoResults /> }\n\n\t\t\t{ prioritizePatterns ? patternsUI : blocksUI }\n\n\t\t\t{ !! filteredBlockTypes.length &&\n\t\t\t\t!! filteredBlockPatterns.length && (\n\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t) }\n\n\t\t\t{ prioritizePatterns ? blocksUI : patternsUI }\n\n\t\t\t{ showBlockDirectory && (\n\t\t\t\t<__unstableInserterMenuExtension.Slot\n\t\t\t\t\tfillProps={ {\n\t\t\t\t\t\tonSelect: onSelectBlockType,\n\t\t\t\t\t\tonHover,\n\t\t\t\t\t\tfilterValue,\n\t\t\t\t\t\thasItems,\n\t\t\t\t\t\trootClientId: destinationRootClientId,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ ( fills ) => {\n\t\t\t\t\t\tif ( fills.length ) {\n\t\t\t\t\t\t\treturn fills;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! hasItems ) {\n\t\t\t\t\t\t\treturn <InserterNoResults />;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t} }\n\t\t\t\t</__unstableInserterMenuExtension.Slot>\n\t\t\t) }\n\t\t</InserterListbox>\n\t);\n}\n\nexport default InserterSearchResults;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAmC;AACnC,kBAAgC;AAChC,gBAA+B;AAC/B,qBAA0C;AAC1C,kBAAsB;AACtB,kBAA0B;AAK1B,8BAA2B;AAC3B,iCAA8B;AAC9B,qCAA4C;AAC5C,mBAA0B;AAC1B,wBAA8B;AAC9B,iCAA8B;AAC9B,gCAA6B;AAC7B,mCAA+B;AAC/B,0BAA8C;AAC9C,8BAA4B;AAC5B,qBAAwB;AACxB,wCAAwC;AACxC,mBAA0C;AAgJ/B;AA9IX,IAAM,2BAA2B;AAOjC,IAAM,cAAc,CAAC;AAErB,SAAS,sBAAuB;AAAA,EAC/B;AAAA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AAC,aAAAD;AAAA,IAAA;AAAA,MACA,OAAQ,4CAAC,4BAAiB,8BAAI,UAAW,GAAG;AAAA,MAE5C,sDAAC,SAAI,WAAU,kDACd;AAAA,QAAC,2BAAAE;AAAA,QAAA;AAAA,UACA,eAAgB;AAAA,UAChB;AAAA,UACA,SAAU;AAAA,UACV;AAAA;AAAA,MACD,GACD;AAAA;AAAA,EACD;AAGD,SACC,6CAAC,wBAAAC,SAAA,EACE;AAAA,KAAE,sBAAsB,CAAE,YAAY,4CAAC,kBAAAC,SAAA,EAAkB;AAAA,IAEzD,qBAAqB,aAAa;AAAA,IAElC,CAAC,CAAE,mBAAmB,UACvB,CAAC,CAAE,sBAAsB,UACxB,4CAAC,SAAI,WAAU,mDAAkD;AAAA,IAGjE,qBAAqB,WAAW;AAAA,IAEhC,sBACD;AAAA,MAAC,+BAAAC,QAAgC;AAAA,MAAhC;AAAA,QACA,WAAY;AAAA,UACX,UAAU;AAAA,UACV;AAAA,UACA;AAAA,UACA;AAAA,UACA,cAAc;AAAA,QACf;AAAA,QAEE,WAAE,UAAW;AACd,cAAK,MAAM,QAAS;AACnB,mBAAO;AAAA,UACR;AACA,cAAK,CAAE,UAAW;AACjB,mBAAO,4CAAC,kBAAAD,SAAA,EAAkB;AAAA,UAC3B;AACA,iBAAO;AAAA,QACR;AAAA;AAAA,IACD;AAAA,KAEF;AAEF;AAEA,IAAO,yBAAQ;",
|
|
6
6
|
"names": ["blockEditorStore", "useInsertionPoint", "useBlockTypesState", "usePatternsState", "InserterPanel", "BlockTypesList", "BlockPatternsList", "InserterListbox", "InserterNoResults", "__unstableInserterMenuExtension"]
|
|
7
7
|
}
|