@wordpress/block-editor 14.12.0 → 14.13.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/build/autocompleters/block.js +0 -1
- package/build/autocompleters/block.js.map +1 -1
- package/build/autocompleters/link.js +0 -1
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/alignment-control/ui.js +0 -1
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/autocomplete/index.js +0 -1
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/background-image-control/index.js +0 -1
- package/build/components/background-image-control/index.js.map +1 -1
- package/build/components/block-actions/index.js +0 -1
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +0 -1
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +0 -1
- package/build/components/block-alignment-control/ui.native.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +0 -1
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +0 -1
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-compare/index.js +0 -1
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-controls/fill.js +0 -1
- package/build/components/block-controls/fill.js.map +1 -1
- package/build/components/block-edit/edit.js +0 -1
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-edit/edit.native.js +0 -1
- package/build/components/block-edit/edit.native.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.js +0 -1
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.native.js +0 -1
- package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build/components/block-inspector/index.js +0 -1
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.js +0 -1
- package/build/components/block-list/block-invalid-warning.js.map +1 -1
- package/build/components/block-list/block-list-context.native.js +0 -1
- package/build/components/block-list/block-list-context.native.js.map +1 -1
- package/build/components/block-list/block.js +0 -1
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +0 -1
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +9 -6
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js +0 -1
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +0 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +0 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/modal.js +0 -1
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-manager/category.js +0 -1
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +0 -1
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +0 -1
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-media-update-progress/index.native.js +0 -1
- package/build/components/block-media-update-progress/index.native.js.map +1 -1
- package/build/components/block-mover/index.native.js +0 -1
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-mover/mover-description.native.js +0 -1
- package/build/components/block-mover/mover-description.native.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +0 -1
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/use-patterns-setup.js +0 -1
- package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build/components/block-patterns-list/index.js +0 -1
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/use-popover-scroll.js +13 -7
- package/build/components/block-popover/use-popover-scroll.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +0 -1
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-rename/modal.js +0 -1
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +0 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/index.js +0 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +0 -1
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-styles/menu-items.js +0 -1
- package/build/components/block-styles/menu-items.js.map +1 -1
- package/build/components/block-styles/preview.native.js +0 -1
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +0 -1
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js +0 -1
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +0 -1
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build/components/block-switcher/index.js +0 -1
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +0 -1
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +0 -1
- package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build/components/block-switcher/utils.js +0 -1
- package/build/components/block-switcher/utils.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +0 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/change-design.js +0 -1
- package/build/components/block-toolbar/change-design.js.map +1 -1
- package/build/components/block-toolbar/index.js +0 -1
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-toolbar-popover.js +3 -2
- package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
- package/build/components/block-tools/use-selected-block-tool-props.js +0 -1
- package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -1
- package/build/components/block-types-list/index.js +0 -1
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-variation-picker/index.js +0 -1
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +0 -1
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +0 -1
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +0 -1
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/index.js +0 -1
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +0 -1
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/border-radius-control/utils.js +0 -1
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/colors/utils.js +0 -1
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +0 -1
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +0 -1
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +0 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js +0 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +0 -1
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/date-format-picker/index.js +0 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/dimensions-tool/scale-tool.js +0 -1
- package/build/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build/components/duotone/utils.js +0 -1
- package/build/components/duotone/utils.js.map +1 -1
- package/build/components/editor-styles/index.js +0 -1
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +0 -1
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +0 -1
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +0 -1
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/border-panel.js +0 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +0 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.native.js +0 -1
- package/build/components/global-styles/color-panel.native.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +0 -1
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +42 -25
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +0 -1
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +41 -17
- package/build/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +0 -1
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-context.native.js +0 -1
- package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +0 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +0 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +0 -1
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/use-grid-layout-sync.js +0 -1
- package/build/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build/components/grid/utils.js +0 -1
- package/build/components/grid/utils.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +0 -1
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +1 -2
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/inner-blocks/index.js +2 -2
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +2 -2
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-block-context.js +0 -1
- package/build/components/inner-blocks/use-block-context.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +0 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +0 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +0 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +0 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +0 -1
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +0 -1
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +0 -1
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js +0 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +0 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +0 -1
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +0 -1
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +0 -1
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +0 -1
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +0 -1
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +0 -1
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/no-results.js +3 -7
- package/build/components/inserter/no-results.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -1
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/search-items.js +0 -1
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +1 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/tabs.native.js +0 -1
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter/utils.native.js +0 -1
- package/build/components/inserter/utils.native.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +0 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +0 -1
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +0 -1
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-popover-header/index.js +0 -1
- package/build/components/inspector-popover-header/index.js.map +1 -1
- package/build/components/justify-content-control/ui.js +0 -1
- package/build/components/justify-content-control/ui.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/link-control/index.js +0 -1
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-results.js +0 -1
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/settings.js +0 -1
- package/build/components/link-control/settings.js.map +1 -1
- package/build/components/link-control/use-internal-value.js +0 -1
- package/build/components/link-control/use-internal-value.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +0 -1
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/block-select-button.js +0 -1
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +0 -1
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +0 -1
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +0 -1
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +0 -1
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/list-view/use-clipboard-handler.js +0 -1
- package/build/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build/components/list-view/use-list-view-block-indexes.js +0 -1
- package/build/components/list-view/use-list-view-block-indexes.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +0 -1
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/utils.js +0 -1
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.js +0 -1
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +0 -1
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +0 -1
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +0 -1
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +0 -1
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/panel-color-settings/index.js +0 -1
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +0 -1
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/responsive-block-control/index.js +0 -1
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/rich-text/embed-handler-picker.native.js +0 -1
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build/components/rich-text/event-listeners/before-input-rules.js +0 -1
- package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
- package/build/components/rich-text/event-listeners/delete.js +5 -3
- package/build/components/rich-text/event-listeners/delete.js.map +1 -1
- package/build/components/rich-text/event-listeners/index.js +0 -1
- package/build/components/rich-text/event-listeners/index.js.map +1 -1
- package/build/components/rich-text/event-listeners/input-rules.js +0 -1
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build/components/rich-text/event-listeners/paste-handler.js +0 -1
- package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
- package/build/components/rich-text/file-paste-handler.native.js +0 -1
- package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
- package/build/components/rich-text/format-edit.js +0 -1
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +0 -1
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/index.js +0 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +0 -1
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/multiline.js +0 -1
- package/build/components/rich-text/multiline.js.map +1 -1
- package/build/components/rich-text/native/format-edit.js +0 -1
- package/build/components/rich-text/native/format-edit.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js +0 -1
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +0 -1
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/native/toolbar-button-with-options.native.js +0 -1
- package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
- package/build/components/rich-text/native/use-format-types.js +0 -1
- package/build/components/rich-text/native/use-format-types.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +0 -1
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +0 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/axial.js +0 -1
- package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js +0 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/single.js +0 -1
- package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +0 -1
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +0 -1
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/text-alignment-control/index.js +0 -1
- package/build/components/text-alignment-control/index.js.map +1 -1
- package/build/components/text-decoration-control/index.js +0 -1
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +0 -1
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/unsupported-block-details/index.native.js +0 -1
- package/build/components/unsupported-block-details/index.native.js.map +1 -1
- package/build/components/url-input/index.js +0 -1
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +0 -1
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/use-block-commands/index.js +0 -1
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +0 -1
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +0 -1
- package/build/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build/components/use-flash-editable-blocks/index.js +0 -1
- package/build/components/use-flash-editable-blocks/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +0 -1
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.native.js +0 -1
- package/build/components/use-on-block-drop/index.native.js.map +1 -1
- package/build/components/use-paste-styles/index.js +0 -1
- package/build/components/use-paste-styles/index.js.map +1 -1
- package/build/components/warning/index.js +0 -1
- package/build/components/warning/index.js.map +1 -1
- package/build/components/writing-flow/use-arrow-nav.js +0 -1
- package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build/components/writing-flow/use-clipboard-handler.js +0 -1
- package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build/components/writing-flow/use-input.js +0 -1
- package/build/components/writing-flow/use-input.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +3 -1
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/components/writing-flow/utils.js +0 -1
- package/build/components/writing-flow/utils.js.map +1 -1
- package/build/components/writing-mode-control/index.js +0 -1
- package/build/components/writing-mode-control/index.js.map +1 -1
- package/build/hooks/align.js +0 -1
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +0 -1
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/aria-label.js +3 -8
- package/build/hooks/aria-label.js.map +1 -1
- package/build/hooks/block-bindings.js +0 -1
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/block-hooks.js +0 -1
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-style-variation.js +0 -1
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/border.js +0 -1
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/contrast-checker.js +0 -1
- package/build/hooks/contrast-checker.js.map +1 -1
- package/build/hooks/duotone.js +0 -1
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout.js +0 -1
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +0 -1
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +0 -1
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +0 -1
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/text-align.js +0 -1
- package/build/hooks/text-align.js.map +1 -1
- package/build/hooks/typography.js +0 -1
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +0 -1
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +0 -1
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js +0 -1
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +0 -1
- package/build/layouts/flow.js.map +1 -1
- package/build/layouts/index.js +0 -1
- package/build/layouts/index.js.map +1 -1
- package/build/layouts/utils.js +0 -1
- package/build/layouts/utils.js.map +1 -1
- package/build/store/actions.js +0 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/get-block-settings.js +0 -1
- package/build/store/get-block-settings.js.map +1 -1
- package/build/store/private-actions.js +0 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +0 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +0 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +0 -1
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +0 -1
- package/build/store/utils.js.map +1 -1
- package/build/utils/block-bindings.js +0 -1
- package/build/utils/block-bindings.js.map +1 -1
- package/build/utils/get-editor-region.js +0 -1
- package/build/utils/get-editor-region.js.map +1 -1
- package/build/utils/get-font-styles-and-weights.js +0 -1
- package/build/utils/get-font-styles-and-weights.js.map +1 -1
- package/build/utils/math.js +0 -1
- package/build/utils/math.js.map +1 -1
- package/build/utils/object.js +0 -1
- package/build/utils/object.js.map +1 -1
- package/build/utils/selection.js +0 -1
- package/build/utils/selection.js.map +1 -1
- package/build/utils/transform-styles/index.js +0 -1
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/autocompleters/block.js +0 -1
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/autocompleters/link.js +0 -1
- package/build-module/autocompleters/link.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +0 -1
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/autocomplete/index.js +0 -1
- package/build-module/components/autocomplete/index.js.map +1 -1
- package/build-module/components/background-image-control/index.js +0 -1
- package/build-module/components/background-image-control/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +0 -1
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +0 -1
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +0 -1
- package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +0 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +0 -1
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-compare/index.js +0 -1
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-controls/fill.js +0 -1
- package/build-module/components/block-controls/fill.js.map +1 -1
- package/build-module/components/block-edit/edit.js +0 -1
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-edit/edit.native.js +0 -1
- package/build-module/components/block-edit/edit.native.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +0 -1
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.native.js +0 -1
- package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build-module/components/block-inspector/index.js +0 -1
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.js +0 -1
- package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
- package/build-module/components/block-list/block-list-context.native.js +0 -1
- package/build-module/components/block-list/block-list-context.native.js.map +1 -1
- package/build-module/components/block-list/block.js +0 -1
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +0 -1
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +9 -6
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +0 -1
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +0 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +0 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/modal.js +0 -1
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-manager/category.js +0 -1
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +0 -1
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +0 -1
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-media-update-progress/index.native.js +0 -1
- package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +0 -1
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-mover/mover-description.native.js +0 -1
- package/build-module/components/block-mover/mover-description.native.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +0 -1
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/use-patterns-setup.js +0 -1
- package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +0 -1
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/use-popover-scroll.js +12 -7
- package/build-module/components/block-popover/use-popover-scroll.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +0 -1
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js +0 -1
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +0 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/index.js +0 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +0 -1
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-styles/menu-items.js +0 -1
- package/build-module/components/block-styles/menu-items.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +0 -1
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +0 -1
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js +0 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +0 -1
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build-module/components/block-switcher/index.js +0 -1
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +0 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js +0 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build-module/components/block-switcher/utils.js +0 -1
- package/build-module/components/block-switcher/utils.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +0 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/change-design.js +0 -1
- package/build-module/components/block-toolbar/change-design.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +0 -1
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-popover.js +3 -2
- package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
- package/build-module/components/block-tools/use-selected-block-tool-props.js +0 -1
- package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -1
- package/build-module/components/block-types-list/index.js +0 -1
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +0 -1
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +0 -1
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +0 -1
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +0 -1
- package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +0 -1
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +0 -1
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js +0 -1
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/colors/utils.js +0 -1
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +0 -1
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +0 -1
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +0 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +0 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +0 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +0 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/dimensions-tool/scale-tool.js +0 -1
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build-module/components/duotone/utils.js +0 -1
- package/build-module/components/duotone/utils.js.map +1 -1
- package/build-module/components/editor-styles/index.js +0 -1
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +0 -1
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +0 -1
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +0 -1
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +0 -1
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +0 -1
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.native.js +0 -1
- package/build-module/components/global-styles/color-panel.native.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +0 -1
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +45 -28
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +0 -1
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +44 -20
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +0 -1
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-context.native.js +0 -1
- package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +0 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +0 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +0 -1
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/use-grid-layout-sync.js +0 -1
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build-module/components/grid/utils.js +0 -1
- package/build-module/components/grid/utils.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +0 -1
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -2
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +2 -2
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +2 -2
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-block-context.js +0 -1
- package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +0 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +0 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +0 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +0 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +0 -1
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +0 -1
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +0 -1
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +0 -1
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +0 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +0 -1
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +0 -1
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +0 -1
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.js +0 -1
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +0 -1
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +0 -1
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/no-results.js +4 -8
- package/build-module/components/inserter/no-results.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-items.js +0 -1
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.js +1 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +0 -1
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inserter/utils.native.js +0 -1
- package/build-module/components/inserter/utils.native.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +0 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +0 -1
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +0 -1
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-popover-header/index.js +0 -1
- package/build-module/components/inspector-popover-header/index.js.map +1 -1
- package/build-module/components/justify-content-control/ui.js +0 -1
- package/build-module/components/justify-content-control/ui.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/link-control/index.js +0 -1
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-results.js +0 -1
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/settings.js +0 -1
- package/build-module/components/link-control/settings.js.map +1 -1
- package/build-module/components/link-control/use-internal-value.js +0 -1
- package/build-module/components/link-control/use-internal-value.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +0 -1
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +0 -1
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +0 -1
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +0 -1
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +0 -1
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +0 -1
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/list-view/use-clipboard-handler.js +0 -1
- package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build-module/components/list-view/use-list-view-block-indexes.js +0 -1
- package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +0 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/utils.js +0 -1
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +0 -1
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +0 -1
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +0 -1
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +0 -1
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +0 -1
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/panel-color-settings/index.js +0 -1
- package/build-module/components/panel-color-settings/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +0 -1
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +0 -1
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/rich-text/embed-handler-picker.native.js +0 -1
- package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/before-input-rules.js +0 -1
- package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/delete.js +5 -3
- package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/index.js +0 -1
- package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +0 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/paste-handler.js +0 -1
- package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
- package/build-module/components/rich-text/file-paste-handler.native.js +0 -1
- package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
- package/build-module/components/rich-text/format-edit.js +0 -1
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +0 -1
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +0 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +0 -1
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/multiline.js +0 -1
- package/build-module/components/rich-text/multiline.js.map +1 -1
- package/build-module/components/rich-text/native/format-edit.js +0 -1
- package/build-module/components/rich-text/native/format-edit.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js +0 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +0 -1
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +0 -1
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
- package/build-module/components/rich-text/native/use-format-types.js +0 -1
- package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +0 -1
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +0 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.js +0 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/separated.js +0 -1
- package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/single.js +0 -1
- package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +0 -1
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +0 -1
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/text-alignment-control/index.js +0 -1
- package/build-module/components/text-alignment-control/index.js.map +1 -1
- package/build-module/components/text-decoration-control/index.js +0 -1
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +0 -1
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/unsupported-block-details/index.native.js +0 -1
- package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
- package/build-module/components/url-input/index.js +0 -1
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +0 -1
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +0 -1
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +0 -1
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +0 -1
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build-module/components/use-flash-editable-blocks/index.js +0 -1
- package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +0 -1
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.native.js +0 -1
- package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
- package/build-module/components/use-paste-styles/index.js +0 -1
- package/build-module/components/use-paste-styles/index.js.map +1 -1
- package/build-module/components/warning/index.js +0 -1
- package/build-module/components/warning/index.js.map +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.js +0 -1
- package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js +0 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build-module/components/writing-flow/use-input.js +0 -1
- package/build-module/components/writing-flow/use-input.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +3 -1
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/components/writing-flow/utils.js +0 -1
- package/build-module/components/writing-flow/utils.js.map +1 -1
- package/build-module/components/writing-mode-control/index.js +0 -1
- package/build-module/components/writing-mode-control/index.js.map +1 -1
- package/build-module/hooks/align.js +0 -1
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +0 -1
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/aria-label.js +3 -7
- package/build-module/hooks/aria-label.js.map +1 -1
- package/build-module/hooks/block-bindings.js +0 -1
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/block-hooks.js +0 -1
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +0 -1
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/border.js +0 -1
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/contrast-checker.js +0 -1
- package/build-module/hooks/contrast-checker.js.map +1 -1
- package/build-module/hooks/duotone.js +0 -1
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout.js +0 -1
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +0 -1
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +0 -1
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +0 -1
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/text-align.js +0 -1
- package/build-module/hooks/text-align.js.map +1 -1
- package/build-module/hooks/typography.js +0 -1
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +0 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +0 -1
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flex.js +0 -1
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +0 -1
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/layouts/index.js +0 -1
- package/build-module/layouts/index.js.map +1 -1
- package/build-module/layouts/utils.js +0 -1
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/store/actions.js +0 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/get-block-settings.js +0 -1
- package/build-module/store/get-block-settings.js.map +1 -1
- package/build-module/store/private-actions.js +0 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +0 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +0 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +0 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +0 -1
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/block-bindings.js +0 -1
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-module/utils/get-editor-region.js +0 -1
- package/build-module/utils/get-editor-region.js.map +1 -1
- package/build-module/utils/get-font-styles-and-weights.js +0 -1
- package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
- package/build-module/utils/math.js +0 -1
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/object.js +0 -1
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/selection.js +0 -1
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +0 -1
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +22 -25
- package/build-style/content.css +22 -25
- package/build-style/style-rtl.css +130 -104
- package/build-style/style.css +130 -104
- package/package.json +34 -34
- package/src/components/block-canvas/style.scss +3 -2
- package/src/components/block-draggable/style.scss +3 -1
- package/src/components/block-list/content.scss +19 -12
- package/src/components/block-list/index.js +21 -7
- package/src/components/block-mover/style.scss +5 -4
- package/src/components/block-pattern-setup/style.scss +3 -1
- package/src/components/block-patterns-list/style.scss +3 -3
- package/src/components/block-popover/use-popover-scroll.js +13 -8
- package/src/components/block-switcher/style.scss +3 -1
- package/src/components/block-toolbar/style.scss +5 -3
- package/src/components/block-tools/block-toolbar-popover.js +4 -3
- package/src/components/block-tools/style.scss +6 -3
- package/src/components/button-block-appender/content.scss +2 -4
- package/src/components/colors-gradients/style.scss +3 -2
- package/src/components/global-styles/filters-panel.js +48 -21
- package/src/components/global-styles/shadow-panel-components.js +44 -13
- package/src/components/global-styles/style.scss +53 -1
- package/src/components/grid/style.scss +5 -4
- package/src/components/iframe/content.scss +5 -2
- package/src/components/image-editor/aspect-ratio-dropdown.js +1 -1
- package/src/components/inner-blocks/index.js +2 -2
- package/src/components/inner-blocks/index.native.js +2 -2
- package/src/components/inserter/no-results.js +0 -5
- package/src/components/inserter/quick-inserter.js +4 -1
- package/src/components/inserter/search-results.js +3 -1
- package/src/components/inserter/style.scss +6 -8
- package/src/components/inserter-list-item/style.scss +9 -6
- package/src/components/keyboard-shortcuts/index.js +1 -1
- package/src/components/link-control/style.scss +11 -6
- package/src/components/list-view/style.scss +34 -17
- package/src/components/rich-text/event-listeners/delete.js +3 -3
- package/src/components/url-input/style.scss +3 -2
- package/src/components/writing-flow/use-tab-nav.js +4 -0
- package/src/hooks/aria-label.js +3 -8
package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","SearchControl","__","jsx","_jsx","jsxs","_jsxs","PatternCategoriesList","selectedCategory","patternCategories","onClickCategory","baseClassName","className","children","map","name","label","__next40pxDefaultSize","isPressed","onClick","PatternsExplorerSearch","searchValue","setSearchValue","__nextHasNoMarginBottom","onChange","value","placeholder","PatternExplorerSidebar"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, SearchControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nfunction PatternCategoriesList( {\n\tselectedCategory,\n\tpatternCategories,\n\tonClickCategory,\n} ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__sidebar';\n\treturn (\n\t\t<div className={ `${ baseClassName }__categories-list` }>\n\t\t\t{ patternCategories.map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tclassName={ `${ baseClassName }__categories-list__item` }\n\t\t\t\t\t\tisPressed={ selectedCategory === name }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonClickCategory( name );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nfunction PatternsExplorerSearch( { searchValue, setSearchValue } ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__search';\n\treturn (\n\t\t<div className={ baseClassName }>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tonChange={ setSearchValue }\n\t\t\t\tvalue={ searchValue }\n\t\t\t\tlabel={ __( 'Search' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction PatternExplorerSidebar( {\n\tselectedCategory,\n\tpatternCategories,\n\tonClickCategory,\n\tsearchValue,\n\tsetSearchValue,\n} ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__sidebar';\n\treturn (\n\t\t<div className={ baseClassName }>\n\t\t\t<PatternsExplorerSearch\n\t\t\t\tsearchValue={ searchValue }\n\t\t\t\tsetSearchValue={ setSearchValue }\n\t\t\t/>\n\t\t\t{ ! searchValue && (\n\t\t\t\t<PatternCategoriesList\n\t\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\t\tonClickCategory={ onClickCategory }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default PatternExplorerSidebar;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["Button","SearchControl","__","jsx","_jsx","jsxs","_jsxs","PatternCategoriesList","selectedCategory","patternCategories","onClickCategory","baseClassName","className","children","map","name","label","__next40pxDefaultSize","isPressed","onClick","PatternsExplorerSearch","searchValue","setSearchValue","__nextHasNoMarginBottom","onChange","value","placeholder","PatternExplorerSidebar"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, SearchControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nfunction PatternCategoriesList( {\n\tselectedCategory,\n\tpatternCategories,\n\tonClickCategory,\n} ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__sidebar';\n\treturn (\n\t\t<div className={ `${ baseClassName }__categories-list` }>\n\t\t\t{ patternCategories.map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tclassName={ `${ baseClassName }__categories-list__item` }\n\t\t\t\t\t\tisPressed={ selectedCategory === name }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonClickCategory( name );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nfunction PatternsExplorerSearch( { searchValue, setSearchValue } ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__search';\n\treturn (\n\t\t<div className={ baseClassName }>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tonChange={ setSearchValue }\n\t\t\t\tvalue={ searchValue }\n\t\t\t\tlabel={ __( 'Search' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction PatternExplorerSidebar( {\n\tselectedCategory,\n\tpatternCategories,\n\tonClickCategory,\n\tsearchValue,\n\tsetSearchValue,\n} ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__sidebar';\n\treturn (\n\t\t<div className={ baseClassName }>\n\t\t\t<PatternsExplorerSearch\n\t\t\t\tsearchValue={ searchValue }\n\t\t\t\tsetSearchValue={ setSearchValue }\n\t\t\t/>\n\t\t\t{ ! searchValue && (\n\t\t\t\t<PatternCategoriesList\n\t\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\t\tonClickCategory={ onClickCategory }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default PatternExplorerSidebar;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,aAAa,QAAQ,uBAAuB;AAC7D,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErC,SAASC,qBAAqBA,CAAE;EAC/BC,gBAAgB;EAChBC,iBAAiB;EACjBC;AACD,CAAC,EAAG;EACH,MAAMC,aAAa,GAAG,+CAA+C;EACrE,oBACCP,IAAA;IAAKQ,SAAS,EAAG,GAAID,aAAa,mBAAsB;IAAAE,QAAA,EACrDJ,iBAAiB,CAACK,GAAG,CAAE,CAAE;MAAEC,IAAI;MAAEC;IAAM,CAAC,KAAM;MAC/C,oBACCZ,IAAA,CAACJ,MAAM;QACNiB,qBAAqB;QAErBD,KAAK,EAAGA,KAAO;QACfJ,SAAS,EAAG,GAAID,aAAa,yBAA4B;QACzDO,SAAS,EAAGV,gBAAgB,KAAKO,IAAM;QACvCI,OAAO,EAAGA,CAAA,KAAM;UACfT,eAAe,CAAEK,IAAK,CAAC;QACxB,CAAG;QAAAF,QAAA,EAEDG;MAAK,GARDD,IASC,CAAC;IAEX,CAAE;EAAC,CACC,CAAC;AAER;AAEA,SAASK,sBAAsBA,CAAE;EAAEC,WAAW;EAAEC;AAAe,CAAC,EAAG;EAClE,MAAMX,aAAa,GAAG,8CAA8C;EACpE,oBACCP,IAAA;IAAKQ,SAAS,EAAGD,aAAe;IAAAE,QAAA,eAC/BT,IAAA,CAACH,aAAa;MACbsB,uBAAuB;MACvBC,QAAQ,EAAGF,cAAgB;MAC3BG,KAAK,EAAGJ,WAAa;MACrBL,KAAK,EAAGd,EAAE,CAAE,QAAS,CAAG;MACxBwB,WAAW,EAAGxB,EAAE,CAAE,QAAS;IAAG,CAC9B;EAAC,CACE,CAAC;AAER;AAEA,SAASyB,sBAAsBA,CAAE;EAChCnB,gBAAgB;EAChBC,iBAAiB;EACjBC,eAAe;EACfW,WAAW;EACXC;AACD,CAAC,EAAG;EACH,MAAMX,aAAa,GAAG,+CAA+C;EACrE,oBACCL,KAAA;IAAKM,SAAS,EAAGD,aAAe;IAAAE,QAAA,gBAC/BT,IAAA,CAACgB,sBAAsB;MACtBC,WAAW,EAAGA,WAAa;MAC3BC,cAAc,EAAGA;IAAgB,CACjC,CAAC,EACA,CAAED,WAAW,iBACdjB,IAAA,CAACG,qBAAqB;MACrBC,gBAAgB,EAAGA,gBAAkB;MACrCC,iBAAiB,EAAGA,iBAAmB;MACvCC,eAAe,EAAGA;IAAiB,CACnC,CACD;EAAA,CACG,CAAC;AAER;AAEA,eAAeiB,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useEffect","useRef","useState","_n","sprintf","useDebounce","__experimentalHeading","Heading","speak","BlockPatternsList","useInsertionPoint","usePatternsState","InserterListbox","searchItems","BlockPatternsPaging","usePatternsPaging","INSERTER_PATTERN_TYPES","allPatternsCategory","myPatternsCategory","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PatternsListHeader","filterValue","filteredBlockPatternsLength","level","lineHeight","className","children","PatternList","searchValue","selectedCategory","patternCategories","rootClientId","container","debouncedSpeak","destinationRootClientId","onInsertBlocks","shouldFocusBlock","patterns","onClickPattern","registeredPatternCategories","map","patternCategory","name","filteredBlockPatterns","filteredPatterns","filter","pattern","type","user","_pattern$categories$s","hasKnownCategory","categories","some","category","includes","length","count","resultsFoundMessage","pagingProps","previousSearchValue","setPreviousSearchValue","changePage","hasItems","ref","blockPatterns","categoryPatterns","isDraggable"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-explorer/pattern-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useEffect, useRef, useState } from '@wordpress/element';\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { useDebounce } from '@wordpress/compose';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport BlockPatternsList from '../../block-patterns-list';\nimport useInsertionPoint from '../hooks/use-insertion-point';\nimport usePatternsState from '../hooks/use-patterns-state';\nimport InserterListbox from '../../inserter-listbox';\nimport { searchItems } from '../search-items';\nimport BlockPatternsPaging from '../../block-patterns-paging';\nimport usePatternsPaging from '../hooks/use-patterns-paging';\nimport {\n\tINSERTER_PATTERN_TYPES,\n\tallPatternsCategory,\n\tmyPatternsCategory,\n} from '../block-patterns-tab/utils';\n\nfunction PatternsListHeader( { filterValue, filteredBlockPatternsLength } ) {\n\tif ( ! filterValue ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Heading\n\t\t\tlevel={ 2 }\n\t\t\tlineHeight=\"48px\"\n\t\t\tclassName=\"block-editor-block-patterns-explorer__search-results-count\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %d: number of patterns. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d pattern found',\n\t\t\t\t\t'%d patterns found',\n\t\t\t\t\tfilteredBlockPatternsLength\n\t\t\t\t),\n\t\t\t\tfilteredBlockPatternsLength\n\t\t\t) }\n\t\t</Heading>\n\t);\n}\n\nfunction PatternList( {\n\tsearchValue,\n\tselectedCategory,\n\tpatternCategories,\n\trootClientId,\n} ) {\n\tconst container = useRef();\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ destinationRootClientId, onInsertBlocks ] = useInsertionPoint( {\n\t\trootClientId,\n\t\tshouldFocusBlock: true,\n\t} );\n\tconst [ patterns, , onClickPattern ] = usePatternsState(\n\t\tonInsertBlocks,\n\t\tdestinationRootClientId,\n\t\tselectedCategory\n\t);\n\n\tconst registeredPatternCategories = useMemo(\n\t\t() =>\n\t\t\tpatternCategories.map(\n\t\t\t\t( patternCategory ) => patternCategory.name\n\t\t\t),\n\t\t[ patternCategories ]\n\t);\n\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\tconst filteredPatterns = patterns.filter( ( pattern ) => {\n\t\t\tif ( selectedCategory === allPatternsCategory.name ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tselectedCategory === myPatternsCategory.name &&\n\t\t\t\tpattern.type === INSERTER_PATTERN_TYPES.user\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( selectedCategory === 'uncategorized' ) {\n\t\t\t\tconst hasKnownCategory =\n\t\t\t\t\tpattern.categories?.some( ( category ) =>\n\t\t\t\t\t\tregisteredPatternCategories.includes( category )\n\t\t\t\t\t) ?? false;\n\n\t\t\t\treturn ! pattern.categories?.length || ! hasKnownCategory;\n\t\t\t}\n\n\t\t\treturn pattern.categories?.includes( selectedCategory );\n\t\t} );\n\n\t\tif ( ! searchValue ) {\n\t\t\treturn filteredPatterns;\n\t\t}\n\n\t\treturn searchItems( filteredPatterns, searchValue );\n\t}, [\n\t\tsearchValue,\n\t\tpatterns,\n\t\tselectedCategory,\n\t\tregisteredPatternCategories,\n\t] );\n\n\t// Announce search results on change.\n\tuseEffect( () => {\n\t\tif ( ! searchValue ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = 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}, [ searchValue, debouncedSpeak, filteredBlockPatterns.length ] );\n\n\tconst pagingProps = usePatternsPaging(\n\t\tfilteredBlockPatterns,\n\t\tselectedCategory,\n\t\tcontainer\n\t);\n\n\t// Reset page when search value changes.\n\tconst [ previousSearchValue, setPreviousSearchValue ] =\n\t\tuseState( searchValue );\n\tif ( searchValue !== previousSearchValue ) {\n\t\tsetPreviousSearchValue( searchValue );\n\t\tpagingProps.changePage( 1 );\n\t}\n\n\tconst hasItems = !! filteredBlockPatterns?.length;\n\treturn (\n\t\t<div\n\t\t\tclassName=\"block-editor-block-patterns-explorer__list\"\n\t\t\tref={ container }\n\t\t>\n\t\t\t<PatternsListHeader\n\t\t\t\tfilterValue={ searchValue }\n\t\t\t\tfilteredBlockPatternsLength={ filteredBlockPatterns.length }\n\t\t\t/>\n\n\t\t\t<InserterListbox>\n\t\t\t\t{ hasItems && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\t\tblockPatterns={ pagingProps.categoryPatterns }\n\t\t\t\t\t\t\tonClickPattern={ onClickPattern }\n\t\t\t\t\t\t\tisDraggable={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BlockPatternsPaging { ...pagingProps } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</InserterListbox>\n\t\t</div>\n\t);\n}\n\nexport default PatternList;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["useMemo","useEffect","useRef","useState","_n","sprintf","useDebounce","__experimentalHeading","Heading","speak","BlockPatternsList","useInsertionPoint","usePatternsState","InserterListbox","searchItems","BlockPatternsPaging","usePatternsPaging","INSERTER_PATTERN_TYPES","allPatternsCategory","myPatternsCategory","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PatternsListHeader","filterValue","filteredBlockPatternsLength","level","lineHeight","className","children","PatternList","searchValue","selectedCategory","patternCategories","rootClientId","container","debouncedSpeak","destinationRootClientId","onInsertBlocks","shouldFocusBlock","patterns","onClickPattern","registeredPatternCategories","map","patternCategory","name","filteredBlockPatterns","filteredPatterns","filter","pattern","type","user","_pattern$categories$s","hasKnownCategory","categories","some","category","includes","length","count","resultsFoundMessage","pagingProps","previousSearchValue","setPreviousSearchValue","changePage","hasItems","ref","blockPatterns","categoryPatterns","isDraggable"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-explorer/pattern-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useEffect, useRef, useState } from '@wordpress/element';\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { useDebounce } from '@wordpress/compose';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport BlockPatternsList from '../../block-patterns-list';\nimport useInsertionPoint from '../hooks/use-insertion-point';\nimport usePatternsState from '../hooks/use-patterns-state';\nimport InserterListbox from '../../inserter-listbox';\nimport { searchItems } from '../search-items';\nimport BlockPatternsPaging from '../../block-patterns-paging';\nimport usePatternsPaging from '../hooks/use-patterns-paging';\nimport {\n\tINSERTER_PATTERN_TYPES,\n\tallPatternsCategory,\n\tmyPatternsCategory,\n} from '../block-patterns-tab/utils';\n\nfunction PatternsListHeader( { filterValue, filteredBlockPatternsLength } ) {\n\tif ( ! filterValue ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Heading\n\t\t\tlevel={ 2 }\n\t\t\tlineHeight=\"48px\"\n\t\t\tclassName=\"block-editor-block-patterns-explorer__search-results-count\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %d: number of patterns. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d pattern found',\n\t\t\t\t\t'%d patterns found',\n\t\t\t\t\tfilteredBlockPatternsLength\n\t\t\t\t),\n\t\t\t\tfilteredBlockPatternsLength\n\t\t\t) }\n\t\t</Heading>\n\t);\n}\n\nfunction PatternList( {\n\tsearchValue,\n\tselectedCategory,\n\tpatternCategories,\n\trootClientId,\n} ) {\n\tconst container = useRef();\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ destinationRootClientId, onInsertBlocks ] = useInsertionPoint( {\n\t\trootClientId,\n\t\tshouldFocusBlock: true,\n\t} );\n\tconst [ patterns, , onClickPattern ] = usePatternsState(\n\t\tonInsertBlocks,\n\t\tdestinationRootClientId,\n\t\tselectedCategory\n\t);\n\n\tconst registeredPatternCategories = useMemo(\n\t\t() =>\n\t\t\tpatternCategories.map(\n\t\t\t\t( patternCategory ) => patternCategory.name\n\t\t\t),\n\t\t[ patternCategories ]\n\t);\n\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\tconst filteredPatterns = patterns.filter( ( pattern ) => {\n\t\t\tif ( selectedCategory === allPatternsCategory.name ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tselectedCategory === myPatternsCategory.name &&\n\t\t\t\tpattern.type === INSERTER_PATTERN_TYPES.user\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( selectedCategory === 'uncategorized' ) {\n\t\t\t\tconst hasKnownCategory =\n\t\t\t\t\tpattern.categories?.some( ( category ) =>\n\t\t\t\t\t\tregisteredPatternCategories.includes( category )\n\t\t\t\t\t) ?? false;\n\n\t\t\t\treturn ! pattern.categories?.length || ! hasKnownCategory;\n\t\t\t}\n\n\t\t\treturn pattern.categories?.includes( selectedCategory );\n\t\t} );\n\n\t\tif ( ! searchValue ) {\n\t\t\treturn filteredPatterns;\n\t\t}\n\n\t\treturn searchItems( filteredPatterns, searchValue );\n\t}, [\n\t\tsearchValue,\n\t\tpatterns,\n\t\tselectedCategory,\n\t\tregisteredPatternCategories,\n\t] );\n\n\t// Announce search results on change.\n\tuseEffect( () => {\n\t\tif ( ! searchValue ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = 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}, [ searchValue, debouncedSpeak, filteredBlockPatterns.length ] );\n\n\tconst pagingProps = usePatternsPaging(\n\t\tfilteredBlockPatterns,\n\t\tselectedCategory,\n\t\tcontainer\n\t);\n\n\t// Reset page when search value changes.\n\tconst [ previousSearchValue, setPreviousSearchValue ] =\n\t\tuseState( searchValue );\n\tif ( searchValue !== previousSearchValue ) {\n\t\tsetPreviousSearchValue( searchValue );\n\t\tpagingProps.changePage( 1 );\n\t}\n\n\tconst hasItems = !! filteredBlockPatterns?.length;\n\treturn (\n\t\t<div\n\t\t\tclassName=\"block-editor-block-patterns-explorer__list\"\n\t\t\tref={ container }\n\t\t>\n\t\t\t<PatternsListHeader\n\t\t\t\tfilterValue={ searchValue }\n\t\t\t\tfilteredBlockPatternsLength={ filteredBlockPatterns.length }\n\t\t\t/>\n\n\t\t\t<InserterListbox>\n\t\t\t\t{ hasItems && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\t\tblockPatterns={ pagingProps.categoryPatterns }\n\t\t\t\t\t\t\tonClickPattern={ onClickPattern }\n\t\t\t\t\t\t\tisDraggable={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BlockPatternsPaging { ...pagingProps } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</InserterListbox>\n\t\t</div>\n\t);\n}\n\nexport default PatternList;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AACzE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,qBAAqB,IAAIC,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]}
|
package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useState","useCallback","useRef","useEffect","__","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalHeading","Heading","__experimentalText","Text","FlexBlock","usePatternsState","BlockPatternsList","usePatternsPaging","PatternsFilter","usePatternCategories","isPatternFiltered","allPatternsCategory","myPatternsCategory","starterPatternsCategory","INSERTER_PATTERN_TYPES","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","noop","PatternCategoryPreviews","rootClientId","onInsert","onHover","category","showTitlesAsTooltip","allPatterns","onClickPattern","name","patternSyncFilter","setPatternSyncFilter","patternSourceFilter","setPatternSourceFilter","availableCategories","scrollContainerRef","currentCategoryPatterns","filter","pattern","type","user","blockTypes","includes","categories","some","catName","c","pagingProps","changePage","onSetPatternSyncFilter","value","onSetPatternSourceFilter","children","spacing","className","size","level","as","label","length","variant","ref","blockPatterns","categoryPatterns","orientation","isDraggable","patternFilter"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-tab/pattern-category-previews.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tuseRef,\n\tuseEffect,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n\tFlexBlock,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport usePatternsState from '../hooks/use-patterns-state';\nimport BlockPatternsList from '../../block-patterns-list';\nimport usePatternsPaging from '../hooks/use-patterns-paging';\nimport { PatternsFilter } from './patterns-filter';\nimport { usePatternCategories } from './use-pattern-categories';\nimport {\n\tisPatternFiltered,\n\tallPatternsCategory,\n\tmyPatternsCategory,\n\tstarterPatternsCategory,\n\tINSERTER_PATTERN_TYPES,\n} from './utils';\n\nconst noop = () => {};\n\nexport function PatternCategoryPreviews( {\n\trootClientId,\n\tonInsert,\n\tonHover = noop,\n\tcategory,\n\tshowTitlesAsTooltip,\n} ) {\n\tconst [ allPatterns, , onClickPattern ] = usePatternsState(\n\t\tonInsert,\n\t\trootClientId,\n\t\tcategory?.name\n\t);\n\tconst [ patternSyncFilter, setPatternSyncFilter ] = useState( 'all' );\n\tconst [ patternSourceFilter, setPatternSourceFilter ] = useState( 'all' );\n\n\tconst availableCategories = usePatternCategories(\n\t\trootClientId,\n\t\tpatternSourceFilter\n\t);\n\tconst scrollContainerRef = useRef();\n\tconst currentCategoryPatterns = useMemo(\n\t\t() =>\n\t\t\tallPatterns.filter( ( pattern ) => {\n\t\t\t\tif (\n\t\t\t\t\tisPatternFiltered(\n\t\t\t\t\t\tpattern,\n\t\t\t\t\t\tpatternSourceFilter,\n\t\t\t\t\t\tpatternSyncFilter\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif ( category.name === allPatternsCategory?.name ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tcategory.name === myPatternsCategory?.name &&\n\t\t\t\t\tpattern.type === INSERTER_PATTERN_TYPES.user\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tcategory.name === starterPatternsCategory?.name &&\n\t\t\t\t\tpattern.blockTypes?.includes( 'core/post-content' )\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif ( category.name === 'uncategorized' ) {\n\t\t\t\t\t// The uncategorized category should show all the patterns without any category...\n\t\t\t\t\tif ( ! pattern.categories ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// ...or with no available category.\n\t\t\t\t\treturn ! pattern.categories.some( ( catName ) =>\n\t\t\t\t\t\tavailableCategories.some( ( c ) => c.name === catName )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn pattern.categories?.includes( category.name );\n\t\t\t} ),\n\t\t[\n\t\t\tallPatterns,\n\t\t\tavailableCategories,\n\t\t\tcategory.name,\n\t\t\tpatternSourceFilter,\n\t\t\tpatternSyncFilter,\n\t\t]\n\t);\n\n\tconst pagingProps = usePatternsPaging(\n\t\tcurrentCategoryPatterns,\n\t\tcategory,\n\t\tscrollContainerRef\n\t);\n\tconst { changePage } = pagingProps;\n\n\t// Hide block pattern preview on unmount.\n\tuseEffect( () => () => onHover( null ), [] );\n\n\tconst onSetPatternSyncFilter = useCallback(\n\t\t( value ) => {\n\t\t\tsetPatternSyncFilter( value );\n\t\t\tchangePage( 1 );\n\t\t},\n\t\t[ setPatternSyncFilter, changePage ]\n\t);\n\tconst onSetPatternSourceFilter = useCallback(\n\t\t( value ) => {\n\t\t\tsetPatternSourceFilter( value );\n\t\t\tchangePage( 1 );\n\t\t},\n\t\t[ setPatternSourceFilter, changePage ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tspacing={ 2 }\n\t\t\t\tclassName=\"block-editor-inserter__patterns-category-panel-header\"\n\t\t\t>\n\t\t\t\t<HStack>\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\tclassName=\"block-editor-inserter__patterns-category-panel-title\"\n\t\t\t\t\t\t\tsize={ 13 }\n\t\t\t\t\t\t\tlevel={ 4 }\n\t\t\t\t\t\t\tas=\"div\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ category?.label }\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<PatternsFilter\n\t\t\t\t\t\tpatternSyncFilter={ patternSyncFilter }\n\t\t\t\t\t\tpatternSourceFilter={ patternSourceFilter }\n\t\t\t\t\t\tsetPatternSyncFilter={ onSetPatternSyncFilter }\n\t\t\t\t\t\tsetPatternSourceFilter={ onSetPatternSourceFilter }\n\t\t\t\t\t\tscrollContainerRef={ scrollContainerRef }\n\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t/>\n\t\t\t\t</HStack>\n\t\t\t\t{ ! currentCategoryPatterns.length && (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\t\tclassName=\"block-editor-inserter__patterns-category-no-results\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'No results found' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t\t{ currentCategoryPatterns.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tsize=\"12\"\n\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t\tclassName=\"block-editor-inserter__help-text\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Drag and drop patterns into the canvas.' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\tref={ scrollContainerRef }\n\t\t\t\t\t\tblockPatterns={ pagingProps.categoryPatterns }\n\t\t\t\t\t\tonClickPattern={ onClickPattern }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tlabel={ category.label }\n\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\tcategory={ category.name }\n\t\t\t\t\t\tisDraggable\n\t\t\t\t\t\tshowTitlesAsTooltip={ showTitlesAsTooltip }\n\t\t\t\t\t\tpatternFilter={ patternSourceFilter }\n\t\t\t\t\t\tpagingProps={ pagingProps }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,MAAM,EACNC,SAAS,QACH,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC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,EAAC,GAAG;QACNH,SAAS,EAAC,kCAAkC;QAAAF,QAAA,EAE1C1D,EAAE,CAAE,yCAA0C;MAAC,CAC5C,CAAC,eACPqB,IAAA,CAACV,iBAAiB;QACjBwD,GAAG,EAAG1B,kBAAoB;QAC1B2B,aAAa,EAAGf,WAAW,CAACgB,gBAAkB;QAC9CnC,cAAc,EAAGA,cAAgB;QACjCJ,OAAO,EAAGA,OAAS;QACnBkC,KAAK,EAAGjC,QAAQ,CAACiC,KAAO;QACxBM,WAAW,EAAC,UAAU;QACtBvC,QAAQ,EAAGA,QAAQ,CAACI,IAAM;QAC1BoC,WAAW;QACXvC,mBAAmB,EAAGA,mBAAqB;QAC3CwC,aAAa,EAAGlC,mBAAqB;QACrCe,WAAW,EAAGA;MAAa,CAC3B,CAAC;IAAA,CACD,CACF;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useMemo","useState","useCallback","useRef","useEffect","__","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalHeading","Heading","__experimentalText","Text","FlexBlock","usePatternsState","BlockPatternsList","usePatternsPaging","PatternsFilter","usePatternCategories","isPatternFiltered","allPatternsCategory","myPatternsCategory","starterPatternsCategory","INSERTER_PATTERN_TYPES","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","noop","PatternCategoryPreviews","rootClientId","onInsert","onHover","category","showTitlesAsTooltip","allPatterns","onClickPattern","name","patternSyncFilter","setPatternSyncFilter","patternSourceFilter","setPatternSourceFilter","availableCategories","scrollContainerRef","currentCategoryPatterns","filter","pattern","type","user","blockTypes","includes","categories","some","catName","c","pagingProps","changePage","onSetPatternSyncFilter","value","onSetPatternSourceFilter","children","spacing","className","size","level","as","label","length","variant","ref","blockPatterns","categoryPatterns","orientation","isDraggable","patternFilter"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-tab/pattern-category-previews.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tuseRef,\n\tuseEffect,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n\tFlexBlock,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport usePatternsState from '../hooks/use-patterns-state';\nimport BlockPatternsList from '../../block-patterns-list';\nimport usePatternsPaging from '../hooks/use-patterns-paging';\nimport { PatternsFilter } from './patterns-filter';\nimport { usePatternCategories } from './use-pattern-categories';\nimport {\n\tisPatternFiltered,\n\tallPatternsCategory,\n\tmyPatternsCategory,\n\tstarterPatternsCategory,\n\tINSERTER_PATTERN_TYPES,\n} from './utils';\n\nconst noop = () => {};\n\nexport function PatternCategoryPreviews( {\n\trootClientId,\n\tonInsert,\n\tonHover = noop,\n\tcategory,\n\tshowTitlesAsTooltip,\n} ) {\n\tconst [ allPatterns, , onClickPattern ] = usePatternsState(\n\t\tonInsert,\n\t\trootClientId,\n\t\tcategory?.name\n\t);\n\tconst [ patternSyncFilter, setPatternSyncFilter ] = useState( 'all' );\n\tconst [ patternSourceFilter, setPatternSourceFilter ] = useState( 'all' );\n\n\tconst availableCategories = usePatternCategories(\n\t\trootClientId,\n\t\tpatternSourceFilter\n\t);\n\tconst scrollContainerRef = useRef();\n\tconst currentCategoryPatterns = useMemo(\n\t\t() =>\n\t\t\tallPatterns.filter( ( pattern ) => {\n\t\t\t\tif (\n\t\t\t\t\tisPatternFiltered(\n\t\t\t\t\t\tpattern,\n\t\t\t\t\t\tpatternSourceFilter,\n\t\t\t\t\t\tpatternSyncFilter\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif ( category.name === allPatternsCategory?.name ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tcategory.name === myPatternsCategory?.name &&\n\t\t\t\t\tpattern.type === INSERTER_PATTERN_TYPES.user\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tcategory.name === starterPatternsCategory?.name &&\n\t\t\t\t\tpattern.blockTypes?.includes( 'core/post-content' )\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif ( category.name === 'uncategorized' ) {\n\t\t\t\t\t// The uncategorized category should show all the patterns without any category...\n\t\t\t\t\tif ( ! pattern.categories ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// ...or with no available category.\n\t\t\t\t\treturn ! pattern.categories.some( ( catName ) =>\n\t\t\t\t\t\tavailableCategories.some( ( c ) => c.name === catName )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn pattern.categories?.includes( category.name );\n\t\t\t} ),\n\t\t[\n\t\t\tallPatterns,\n\t\t\tavailableCategories,\n\t\t\tcategory.name,\n\t\t\tpatternSourceFilter,\n\t\t\tpatternSyncFilter,\n\t\t]\n\t);\n\n\tconst pagingProps = usePatternsPaging(\n\t\tcurrentCategoryPatterns,\n\t\tcategory,\n\t\tscrollContainerRef\n\t);\n\tconst { changePage } = pagingProps;\n\n\t// Hide block pattern preview on unmount.\n\tuseEffect( () => () => onHover( null ), [] );\n\n\tconst onSetPatternSyncFilter = useCallback(\n\t\t( value ) => {\n\t\t\tsetPatternSyncFilter( value );\n\t\t\tchangePage( 1 );\n\t\t},\n\t\t[ setPatternSyncFilter, changePage ]\n\t);\n\tconst onSetPatternSourceFilter = useCallback(\n\t\t( value ) => {\n\t\t\tsetPatternSourceFilter( value );\n\t\t\tchangePage( 1 );\n\t\t},\n\t\t[ setPatternSourceFilter, changePage ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tspacing={ 2 }\n\t\t\t\tclassName=\"block-editor-inserter__patterns-category-panel-header\"\n\t\t\t>\n\t\t\t\t<HStack>\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\tclassName=\"block-editor-inserter__patterns-category-panel-title\"\n\t\t\t\t\t\t\tsize={ 13 }\n\t\t\t\t\t\t\tlevel={ 4 }\n\t\t\t\t\t\t\tas=\"div\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ category?.label }\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<PatternsFilter\n\t\t\t\t\t\tpatternSyncFilter={ patternSyncFilter }\n\t\t\t\t\t\tpatternSourceFilter={ patternSourceFilter }\n\t\t\t\t\t\tsetPatternSyncFilter={ onSetPatternSyncFilter }\n\t\t\t\t\t\tsetPatternSourceFilter={ onSetPatternSourceFilter }\n\t\t\t\t\t\tscrollContainerRef={ scrollContainerRef }\n\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t/>\n\t\t\t\t</HStack>\n\t\t\t\t{ ! currentCategoryPatterns.length && (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\t\tclassName=\"block-editor-inserter__patterns-category-no-results\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'No results found' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t\t{ currentCategoryPatterns.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tsize=\"12\"\n\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t\tclassName=\"block-editor-inserter__help-text\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Drag and drop patterns into the canvas.' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\tref={ scrollContainerRef }\n\t\t\t\t\t\tblockPatterns={ pagingProps.categoryPatterns }\n\t\t\t\t\t\tonClickPattern={ onClickPattern }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tlabel={ category.label }\n\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\tcategory={ category.name }\n\t\t\t\t\t\tisDraggable\n\t\t\t\t\t\tshowTitlesAsTooltip={ showTitlesAsTooltip }\n\t\t\t\t\t\tpatternFilter={ patternSourceFilter }\n\t\t\t\t\t\tpagingProps={ pagingProps }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,MAAM,EACNC,SAAS,QACH,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,EAChCC,kBAAkB,IAAIC,IAAI,EAC1BC,SAAS,QACH,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,iBAAiB,MAAM,2BAA2B;AACzD,OAAOC,iBAAiB,MAAM,8BAA8B;AAC5D,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,oBAAoB,QAAQ,0BAA0B;AAC/D,SACCC,iBAAiB,EACjBC,mBAAmB,EACnBC,kBAAkB,EAClBC,uBAAuB,EACvBC,sBAAsB,QAChB,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAEjB,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,OAAO,SAASC,uBAAuBA,CAAE;EACxCC,YAAY;EACZC,QAAQ;EACRC,OAAO,GAAGJ,IAAI;EACdK,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,WAAW,GAAIC,cAAc,CAAE,GAAGxB,gBAAgB,CACzDmB,QAAQ,EACRD,YAAY,EACZG,QAAQ,EAAEI,IACX,CAAC;EACD,MAAM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sBAAwB;UAC/ChB,sBAAsB,EAAGkB,wBAA0B;UACnDhB,kBAAkB,EAAGA,kBAAoB;UACzCV,QAAQ,EAAGA;QAAU,CACrB,CAAC;MAAA,CACK,CAAC,EACP,CAAEW,uBAAuB,CAACuB,MAAM,iBACjC5C,IAAA,CAACb,IAAI;QACJ0D,OAAO,EAAC,OAAO;QACfN,SAAS,EAAC,qDAAqD;QAAAF,QAAA,EAE7D1D,EAAE,CAAE,kBAAmB;MAAC,CACrB,CACN;IAAA,CACM,CAAC,EACP0C,uBAAuB,CAACuB,MAAM,GAAG,CAAC,iBACnC1C,KAAA,CAAAE,SAAA;MAAAiC,QAAA,gBACCrC,IAAA,CAACb,IAAI;QACJqD,IAAI,EAAC,IAAI;QACTE,EAAE,EAAC,GAAG;QACNH,SAAS,EAAC,kCAAkC;QAAAF,QAAA,EAE1C1D,EAAE,CAAE,yCAA0C;MAAC,CAC5C,CAAC,eACPqB,IAAA,CAACV,iBAAiB;QACjBwD,GAAG,EAAG1B,kBAAoB;QAC1B2B,aAAa,EAAGf,WAAW,CAACgB,gBAAkB;QAC9CnC,cAAc,EAAGA,cAAgB;QACjCJ,OAAO,EAAGA,OAAS;QACnBkC,KAAK,EAAGjC,QAAQ,CAACiC,KAAO;QACxBM,WAAW,EAAC,UAAU;QACtBvC,QAAQ,EAAGA,QAAQ,CAACI,IAAM;QAC1BoC,WAAW;QACXvC,mBAAmB,EAAGA,mBAAqB;QAC3CwC,aAAa,EAAGlC,mBAAqB;QACrCe,WAAW,EAAGA;MAAa,CAC3B,CAAC;IAAA,CACD,CACF;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","_x","_n","sprintf","speak","usePatternsState","isPatternFiltered","allPatternsCategory","myPatternsCategory","starterPatternsCategory","INSERTER_PATTERN_TYPES","hasRegisteredCategory","pattern","allCategories","categories","length","some","cat","category","name","usePatternCategories","rootClientId","sourceFilter","patterns","undefined","filteredPatterns","filter","populatedCategories","includes","sort","a","b","label","localeCompare","find","push","blockTypes","unshift","type","user"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-tab/use-pattern-categories.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { _x, _n, sprintf } from '@wordpress/i18n';\n\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport usePatternsState from '../hooks/use-patterns-state';\nimport {\n\tisPatternFiltered,\n\tallPatternsCategory,\n\tmyPatternsCategory,\n\tstarterPatternsCategory,\n\tINSERTER_PATTERN_TYPES,\n} from './utils';\n\nfunction hasRegisteredCategory( pattern, allCategories ) {\n\tif ( ! pattern.categories || ! pattern.categories.length ) {\n\t\treturn false;\n\t}\n\n\treturn pattern.categories.some( ( cat ) =>\n\t\tallCategories.some( ( category ) => category.name === cat )\n\t);\n}\n\nexport function usePatternCategories( rootClientId, sourceFilter = 'all' ) {\n\tconst [ patterns, allCategories ] = usePatternsState(\n\t\tundefined,\n\t\trootClientId\n\t);\n\n\tconst filteredPatterns = useMemo(\n\t\t() =>\n\t\t\tsourceFilter === 'all'\n\t\t\t\t? patterns\n\t\t\t\t: patterns.filter(\n\t\t\t\t\t\t( pattern ) =>\n\t\t\t\t\t\t\t! isPatternFiltered( pattern, sourceFilter )\n\t\t\t\t ),\n\t\t[ sourceFilter, patterns ]\n\t);\n\n\t// Remove any empty categories.\n\tconst populatedCategories = useMemo( () => {\n\t\tconst categories = allCategories\n\t\t\t.filter( ( category ) =>\n\t\t\t\tfilteredPatterns.some( ( pattern ) =>\n\t\t\t\t\tpattern.categories?.includes( category.name )\n\t\t\t\t)\n\t\t\t)\n\t\t\t.sort( ( a, b ) => a.label.localeCompare( b.label ) );\n\n\t\tif (\n\t\t\tfilteredPatterns.some(\n\t\t\t\t( pattern ) => ! hasRegisteredCategory( pattern, allCategories )\n\t\t\t) &&\n\t\t\t! categories.find(\n\t\t\t\t( category ) => category.name === 'uncategorized'\n\t\t\t)\n\t\t) {\n\t\t\tcategories.push( {\n\t\t\t\tname: 'uncategorized',\n\t\t\t\tlabel: _x( 'Uncategorized' ),\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tfilteredPatterns.some( ( pattern ) =>\n\t\t\t\tpattern.blockTypes?.includes( 'core/post-content' )\n\t\t\t)\n\t\t) {\n\t\t\tcategories.unshift( starterPatternsCategory );\n\t\t}\n\t\tif (\n\t\t\tfilteredPatterns.some(\n\t\t\t\t( pattern ) => pattern.type === INSERTER_PATTERN_TYPES.user\n\t\t\t)\n\t\t) {\n\t\t\tcategories.unshift( myPatternsCategory );\n\t\t}\n\t\tif ( filteredPatterns.length > 0 ) {\n\t\t\tcategories.unshift( {\n\t\t\t\tname: allPatternsCategory.name,\n\t\t\t\tlabel: allPatternsCategory.label,\n\t\t\t} );\n\t\t}\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of categories . */\n\t\t\t\t_n(\n\t\t\t\t\t'%d category button displayed.',\n\t\t\t\t\t'%d category buttons displayed.',\n\t\t\t\t\tcategories.length\n\t\t\t\t),\n\t\t\t\tcategories.length\n\t\t\t)\n\t\t);\n\t\treturn categories;\n\t}, [ allCategories, filteredPatterns ] );\n\n\treturn populatedCategories;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["useMemo","_x","_n","sprintf","speak","usePatternsState","isPatternFiltered","allPatternsCategory","myPatternsCategory","starterPatternsCategory","INSERTER_PATTERN_TYPES","hasRegisteredCategory","pattern","allCategories","categories","length","some","cat","category","name","usePatternCategories","rootClientId","sourceFilter","patterns","undefined","filteredPatterns","filter","populatedCategories","includes","sort","a","b","label","localeCompare","find","push","blockTypes","unshift","type","user"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-tab/use-pattern-categories.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { _x, _n, sprintf } from '@wordpress/i18n';\n\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport usePatternsState from '../hooks/use-patterns-state';\nimport {\n\tisPatternFiltered,\n\tallPatternsCategory,\n\tmyPatternsCategory,\n\tstarterPatternsCategory,\n\tINSERTER_PATTERN_TYPES,\n} from './utils';\n\nfunction hasRegisteredCategory( pattern, allCategories ) {\n\tif ( ! pattern.categories || ! pattern.categories.length ) {\n\t\treturn false;\n\t}\n\n\treturn pattern.categories.some( ( cat ) =>\n\t\tallCategories.some( ( category ) => category.name === cat )\n\t);\n}\n\nexport function usePatternCategories( rootClientId, sourceFilter = 'all' ) {\n\tconst [ patterns, allCategories ] = usePatternsState(\n\t\tundefined,\n\t\trootClientId\n\t);\n\n\tconst filteredPatterns = useMemo(\n\t\t() =>\n\t\t\tsourceFilter === 'all'\n\t\t\t\t? patterns\n\t\t\t\t: patterns.filter(\n\t\t\t\t\t\t( pattern ) =>\n\t\t\t\t\t\t\t! isPatternFiltered( pattern, sourceFilter )\n\t\t\t\t ),\n\t\t[ sourceFilter, patterns ]\n\t);\n\n\t// Remove any empty categories.\n\tconst populatedCategories = useMemo( () => {\n\t\tconst categories = allCategories\n\t\t\t.filter( ( category ) =>\n\t\t\t\tfilteredPatterns.some( ( pattern ) =>\n\t\t\t\t\tpattern.categories?.includes( category.name )\n\t\t\t\t)\n\t\t\t)\n\t\t\t.sort( ( a, b ) => a.label.localeCompare( b.label ) );\n\n\t\tif (\n\t\t\tfilteredPatterns.some(\n\t\t\t\t( pattern ) => ! hasRegisteredCategory( pattern, allCategories )\n\t\t\t) &&\n\t\t\t! categories.find(\n\t\t\t\t( category ) => category.name === 'uncategorized'\n\t\t\t)\n\t\t) {\n\t\t\tcategories.push( {\n\t\t\t\tname: 'uncategorized',\n\t\t\t\tlabel: _x( 'Uncategorized' ),\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tfilteredPatterns.some( ( pattern ) =>\n\t\t\t\tpattern.blockTypes?.includes( 'core/post-content' )\n\t\t\t)\n\t\t) {\n\t\t\tcategories.unshift( starterPatternsCategory );\n\t\t}\n\t\tif (\n\t\t\tfilteredPatterns.some(\n\t\t\t\t( pattern ) => pattern.type === INSERTER_PATTERN_TYPES.user\n\t\t\t)\n\t\t) {\n\t\t\tcategories.unshift( myPatternsCategory );\n\t\t}\n\t\tif ( filteredPatterns.length > 0 ) {\n\t\t\tcategories.unshift( {\n\t\t\t\tname: allPatternsCategory.name,\n\t\t\t\tlabel: allPatternsCategory.label,\n\t\t\t} );\n\t\t}\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of categories . */\n\t\t\t\t_n(\n\t\t\t\t\t'%d category button displayed.',\n\t\t\t\t\t'%d category buttons displayed.',\n\t\t\t\t\tcategories.length\n\t\t\t\t),\n\t\t\t\tcategories.length\n\t\t\t)\n\t\t);\n\t\treturn categories;\n\t}, [ allCategories, filteredPatterns ] );\n\n\treturn populatedCategories;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAEjD,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,SACCC,iBAAiB,EACjBC,mBAAmB,EACnBC,kBAAkB,EAClBC,uBAAuB,EACvBC,sBAAsB,QAChB,SAAS;AAEhB,SAASC,qBAAqBA,CAAEC,OAAO,EAAEC,aAAa,EAAG;EACxD,IAAK,CAAED,OAAO,CAACE,UAAU,IAAI,CAAEF,OAAO,CAACE,UAAU,CAACC,MAAM,EAAG;IAC1D,OAAO,KAAK;EACb;EAEA,OAAOH,OAAO,CAACE,UAAU,CAACE,IAAI,CAAIC,GAAG,IACpCJ,aAAa,CAACG,IAAI,CAAIE,QAAQ,IAAMA,QAAQ,CAACC,IAAI,KAAKF,GAAI,CAC3D,CAAC;AACF;AAEA,OAAO,SAASG,oBAAoBA,CAAEC,YAAY,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,CAACT,IAAI,CAClBJ,OAAO,IAAMA,OAAO,CAAC0B,IAAI,KAAK5B,sBAAsB,CAAC6B,IACxD,CAAC,EACA;MACDzB,UAAU,CAACuB,OAAO,CAAE7B,kBAAmB,CAAC;IACzC;IACA,IAAKiB,gBAAgB,CAACV,MAAM,GAAG,CAAC,EAAG;MAClCD,UAAU,CAACuB,OAAO,CAAE;QACnBlB,IAAI,EAAEZ,mBAAmB,CAACY,IAAI;QAC9Ba,KAAK,EAAEzB,mBAAmB,CAACyB;MAC5B,CAAE,CAAC;IACJ;IACA5B,KAAK,CACJD,OAAO,CACN;IACAD,EAAE,CACD,+BAA+B,EAC/B,gCAAgC,EAChCY,UAAU,CAACC,MACZ,CAAC,EACDD,UAAU,CAACC,MACZ,CACD,CAAC;IACD,OAAOD,UAAU;EAClB,CAAC,EAAE,CAAED,aAAa,EAAEY,gBAAgB,CAAG,CAAC;EAExC,OAAOE,mBAAmB;AAC3B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","_x","useMemo","useEffect","forwardRef","useAsyncList","BlockTypesList","InserterPanel","useBlockTypesState","InserterListbox","orderBy","InserterNoResults","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getBlockNamespace","item","name","split","MAX_SUGGESTED_ITEMS","EMPTY_ARRAY","BlockTypesTabPanel","items","collections","categories","onSelectItem","onHover","showMostUsedBlocks","className","suggestedItems","slice","uncategorizedItems","filter","category","itemsPerCollection","result","Object","keys","forEach","namespace","length","currentlyRenderedCategories","didRenderAllCategories","collectionEntries","entries","currentlyRenderedCollections","children","title","onSelect","label","map","categoryItems","slug","icon","collection","collectionItems","BlockTypesTab","rootClientId","onInsert","ref","itemsForCurrentRoot","itemsRemaining","isAllowedInCurrentRoot","push"],"sources":["@wordpress/block-editor/src/components/inserter/block-types-tab.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useMemo, useEffect, forwardRef } from '@wordpress/element';\nimport { useAsyncList } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport InserterPanel from './panel';\nimport useBlockTypesState from './hooks/use-block-types-state';\nimport InserterListbox from '../inserter-listbox';\nimport { orderBy } from '../../utils/sorting';\nimport InserterNoResults from './no-results';\n\nconst getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];\n\nconst MAX_SUGGESTED_ITEMS = 6;\n\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\nexport function BlockTypesTabPanel( {\n\titems,\n\tcollections,\n\tcategories,\n\tonSelectItem,\n\tonHover,\n\tshowMostUsedBlocks,\n\tclassName,\n} ) {\n\tconst suggestedItems = useMemo( () => {\n\t\treturn orderBy( items, 'frecency', 'desc' ).slice(\n\t\t\t0,\n\t\t\tMAX_SUGGESTED_ITEMS\n\t\t);\n\t}, [ items ] );\n\n\tconst uncategorizedItems = useMemo( () => {\n\t\treturn items.filter( ( item ) => ! item.category );\n\t}, [ items ] );\n\n\tconst itemsPerCollection = useMemo( () => {\n\t\t// Create a new Object to avoid mutating collection.\n\t\tconst result = { ...collections };\n\t\tObject.keys( collections ).forEach( ( namespace ) => {\n\t\t\tresult[ namespace ] = items.filter(\n\t\t\t\t( item ) => getBlockNamespace( item ) === namespace\n\t\t\t);\n\t\t\tif ( result[ namespace ].length === 0 ) {\n\t\t\t\tdelete result[ namespace ];\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ items, collections ] );\n\n\t// Hide block preview on unmount.\n\tuseEffect( () => () => onHover( null ), [] );\n\n\t/**\n\t * The inserter contains a big number of blocks and opening it is a costful operation.\n\t * The rendering is the most costful part of it, in order to improve the responsiveness\n\t * of the \"opening\" action, these lazy lists allow us to render the inserter category per category,\n\t * once all the categories are rendered, we start rendering the collections and the uncategorized block types.\n\t */\n\tconst currentlyRenderedCategories = useAsyncList( categories );\n\tconst didRenderAllCategories =\n\t\tcategories.length === currentlyRenderedCategories.length;\n\n\t// Async List requires an array.\n\tconst collectionEntries = useMemo( () => {\n\t\treturn Object.entries( collections );\n\t}, [ collections ] );\n\tconst currentlyRenderedCollections = useAsyncList(\n\t\tdidRenderAllCategories ? collectionEntries : EMPTY_ARRAY\n\t);\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ showMostUsedBlocks &&\n\t\t\t\t// Only show the most used blocks if the total amount of block\n\t\t\t\t// is larger than 1 row, otherwise it is not so useful.\n\t\t\t\titems.length > 3 &&\n\t\t\t\t!! suggestedItems.length && (\n\t\t\t\t\t<InserterPanel title={ _x( 'Most used', 'blocks' ) }>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ suggestedItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ _x( 'Most used', 'blocks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t) }\n\n\t\t\t{ currentlyRenderedCategories.map( ( category ) => {\n\t\t\t\tconst categoryItems = items.filter(\n\t\t\t\t\t( item ) => item.category === category.slug\n\t\t\t\t);\n\t\t\t\tif ( ! categoryItems || ! categoryItems.length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\ticon={ category.icon }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ categoryItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ category.title }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t);\n\t\t\t} ) }\n\n\t\t\t{ didRenderAllCategories && uncategorizedItems.length > 0 && (\n\t\t\t\t<InserterPanel\n\t\t\t\t\tclassName=\"block-editor-inserter__uncategorized-blocks-panel\"\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t>\n\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\titems={ uncategorizedItems }\n\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tlabel={ __( 'Uncategorized' ) }\n\t\t\t\t\t/>\n\t\t\t\t</InserterPanel>\n\t\t\t) }\n\n\t\t\t{ currentlyRenderedCollections.map(\n\t\t\t\t( [ namespace, collection ] ) => {\n\t\t\t\t\tconst collectionItems = itemsPerCollection[ namespace ];\n\t\t\t\t\tif ( ! collectionItems || ! collectionItems.length ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\t\tkey={ namespace }\n\t\t\t\t\t\t\ttitle={ collection.title }\n\t\t\t\t\t\t\ticon={ collection.icon }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\t\titems={ collectionItems }\n\t\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\t\tlabel={ collection.title }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</InserterPanel>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport function BlockTypesTab(\n\t{ rootClientId, onInsert, onHover, showMostUsedBlocks },\n\tref\n) {\n\tconst [ items, categories, collections, onSelectItem ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonInsert\n\t);\n\n\tif ( ! items.length ) {\n\t\treturn <InserterNoResults />;\n\t}\n\n\tconst itemsForCurrentRoot = [];\n\tconst itemsRemaining = [];\n\n\tfor ( const item of items ) {\n\t\t// Skip reusable blocks, they moved to the patterns tab.\n\t\tif ( item.category === 'reusable' ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( item.isAllowedInCurrentRoot ) {\n\t\t\titemsForCurrentRoot.push( item );\n\t\t} else {\n\t\t\titemsRemaining.push( item );\n\t\t}\n\t}\n\n\treturn (\n\t\t<InserterListbox>\n\t\t\t<div ref={ ref }>\n\t\t\t\t{ !! itemsForCurrentRoot.length && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockTypesTabPanel\n\t\t\t\t\t\t\titems={ itemsForCurrentRoot }\n\t\t\t\t\t\t\tcategories={ categories }\n\t\t\t\t\t\t\tcollections={ collections }\n\t\t\t\t\t\t\tonSelectItem={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\t\t\tclassName=\"block-editor-inserter__insertable-blocks-at-selection\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockTypesTabPanel\n\t\t\t\t\titems={ itemsRemaining }\n\t\t\t\t\tcategories={ categories }\n\t\t\t\t\tcollections={ collections }\n\t\t\t\t\tonSelectItem={ onSelectItem }\n\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\tclassName=\"block-editor-inserter__all-blocks\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</InserterListbox>\n\t);\n}\n\nexport default forwardRef( BlockTypesTab );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,OAAO,EAAEC,SAAS,EAAEC,UAAU,QAAQ,oBAAoB;AACnE,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,OAAOC,cAAc,MAAM,qBAAqB;AAChD,OAAOC,aAAa,MAAM,SAAS;AACnC,OAAOC,kBAAkB,MAAM,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AO,EAAGA,OAAS;UACnBC,kBAAkB,EAAGA,kBAAoB;UACzCC,SAAS,EAAC;QAAuD,CACjE;MAAC,CACD,CACF,eACDlB,IAAA,CAACW,kBAAkB;QAClBC,KAAK,EAAGuC,cAAgB;QACxBrC,UAAU,EAAGA,UAAY;QACzBD,WAAW,EAAGA,WAAa;QAC3BE,YAAY,EAAGA,YAAc;QAC7BC,OAAO,EAAGA,OAAS;QACnBC,kBAAkB,EAAGA,kBAAoB;QACzCC,SAAS,EAAC;MAAmC,CAC7C,CAAC;IAAA,CACE;EAAC,CACU,CAAC;AAEpB;AAEA,eAAe3B,UAAU,CAAEuD,aAAc,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","_x","useMemo","useEffect","forwardRef","useAsyncList","BlockTypesList","InserterPanel","useBlockTypesState","InserterListbox","orderBy","InserterNoResults","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getBlockNamespace","item","name","split","MAX_SUGGESTED_ITEMS","EMPTY_ARRAY","BlockTypesTabPanel","items","collections","categories","onSelectItem","onHover","showMostUsedBlocks","className","suggestedItems","slice","uncategorizedItems","filter","category","itemsPerCollection","result","Object","keys","forEach","namespace","length","currentlyRenderedCategories","didRenderAllCategories","collectionEntries","entries","currentlyRenderedCollections","children","title","onSelect","label","map","categoryItems","slug","icon","collection","collectionItems","BlockTypesTab","rootClientId","onInsert","ref","itemsForCurrentRoot","itemsRemaining","isAllowedInCurrentRoot","push"],"sources":["@wordpress/block-editor/src/components/inserter/block-types-tab.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useMemo, useEffect, forwardRef } from '@wordpress/element';\nimport { useAsyncList } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport InserterPanel from './panel';\nimport useBlockTypesState from './hooks/use-block-types-state';\nimport InserterListbox from '../inserter-listbox';\nimport { orderBy } from '../../utils/sorting';\nimport InserterNoResults from './no-results';\n\nconst getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];\n\nconst MAX_SUGGESTED_ITEMS = 6;\n\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\nexport function BlockTypesTabPanel( {\n\titems,\n\tcollections,\n\tcategories,\n\tonSelectItem,\n\tonHover,\n\tshowMostUsedBlocks,\n\tclassName,\n} ) {\n\tconst suggestedItems = useMemo( () => {\n\t\treturn orderBy( items, 'frecency', 'desc' ).slice(\n\t\t\t0,\n\t\t\tMAX_SUGGESTED_ITEMS\n\t\t);\n\t}, [ items ] );\n\n\tconst uncategorizedItems = useMemo( () => {\n\t\treturn items.filter( ( item ) => ! item.category );\n\t}, [ items ] );\n\n\tconst itemsPerCollection = useMemo( () => {\n\t\t// Create a new Object to avoid mutating collection.\n\t\tconst result = { ...collections };\n\t\tObject.keys( collections ).forEach( ( namespace ) => {\n\t\t\tresult[ namespace ] = items.filter(\n\t\t\t\t( item ) => getBlockNamespace( item ) === namespace\n\t\t\t);\n\t\t\tif ( result[ namespace ].length === 0 ) {\n\t\t\t\tdelete result[ namespace ];\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ items, collections ] );\n\n\t// Hide block preview on unmount.\n\tuseEffect( () => () => onHover( null ), [] );\n\n\t/**\n\t * The inserter contains a big number of blocks and opening it is a costful operation.\n\t * The rendering is the most costful part of it, in order to improve the responsiveness\n\t * of the \"opening\" action, these lazy lists allow us to render the inserter category per category,\n\t * once all the categories are rendered, we start rendering the collections and the uncategorized block types.\n\t */\n\tconst currentlyRenderedCategories = useAsyncList( categories );\n\tconst didRenderAllCategories =\n\t\tcategories.length === currentlyRenderedCategories.length;\n\n\t// Async List requires an array.\n\tconst collectionEntries = useMemo( () => {\n\t\treturn Object.entries( collections );\n\t}, [ collections ] );\n\tconst currentlyRenderedCollections = useAsyncList(\n\t\tdidRenderAllCategories ? collectionEntries : EMPTY_ARRAY\n\t);\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ showMostUsedBlocks &&\n\t\t\t\t// Only show the most used blocks if the total amount of block\n\t\t\t\t// is larger than 1 row, otherwise it is not so useful.\n\t\t\t\titems.length > 3 &&\n\t\t\t\t!! suggestedItems.length && (\n\t\t\t\t\t<InserterPanel title={ _x( 'Most used', 'blocks' ) }>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ suggestedItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ _x( 'Most used', 'blocks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t) }\n\n\t\t\t{ currentlyRenderedCategories.map( ( category ) => {\n\t\t\t\tconst categoryItems = items.filter(\n\t\t\t\t\t( item ) => item.category === category.slug\n\t\t\t\t);\n\t\t\t\tif ( ! categoryItems || ! categoryItems.length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\ticon={ category.icon }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ categoryItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ category.title }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t);\n\t\t\t} ) }\n\n\t\t\t{ didRenderAllCategories && uncategorizedItems.length > 0 && (\n\t\t\t\t<InserterPanel\n\t\t\t\t\tclassName=\"block-editor-inserter__uncategorized-blocks-panel\"\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t>\n\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\titems={ uncategorizedItems }\n\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tlabel={ __( 'Uncategorized' ) }\n\t\t\t\t\t/>\n\t\t\t\t</InserterPanel>\n\t\t\t) }\n\n\t\t\t{ currentlyRenderedCollections.map(\n\t\t\t\t( [ namespace, collection ] ) => {\n\t\t\t\t\tconst collectionItems = itemsPerCollection[ namespace ];\n\t\t\t\t\tif ( ! collectionItems || ! collectionItems.length ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\t\tkey={ namespace }\n\t\t\t\t\t\t\ttitle={ collection.title }\n\t\t\t\t\t\t\ticon={ collection.icon }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\t\titems={ collectionItems }\n\t\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\t\tlabel={ collection.title }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</InserterPanel>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport function BlockTypesTab(\n\t{ rootClientId, onInsert, onHover, showMostUsedBlocks },\n\tref\n) {\n\tconst [ items, categories, collections, onSelectItem ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonInsert\n\t);\n\n\tif ( ! items.length ) {\n\t\treturn <InserterNoResults />;\n\t}\n\n\tconst itemsForCurrentRoot = [];\n\tconst itemsRemaining = [];\n\n\tfor ( const item of items ) {\n\t\t// Skip reusable blocks, they moved to the patterns tab.\n\t\tif ( item.category === 'reusable' ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( item.isAllowedInCurrentRoot ) {\n\t\t\titemsForCurrentRoot.push( item );\n\t\t} else {\n\t\t\titemsRemaining.push( item );\n\t\t}\n\t}\n\n\treturn (\n\t\t<InserterListbox>\n\t\t\t<div ref={ ref }>\n\t\t\t\t{ !! itemsForCurrentRoot.length && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockTypesTabPanel\n\t\t\t\t\t\t\titems={ itemsForCurrentRoot }\n\t\t\t\t\t\t\tcategories={ categories }\n\t\t\t\t\t\t\tcollections={ collections }\n\t\t\t\t\t\t\tonSelectItem={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\t\t\tclassName=\"block-editor-inserter__insertable-blocks-at-selection\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockTypesTabPanel\n\t\t\t\t\titems={ itemsRemaining }\n\t\t\t\t\tcategories={ categories }\n\t\t\t\t\tcollections={ collections }\n\t\t\t\t\tonSelectItem={ onSelectItem }\n\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\tclassName=\"block-editor-inserter__all-blocks\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</InserterListbox>\n\t);\n}\n\nexport default forwardRef( BlockTypesTab );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,OAAO,EAAEC,SAAS,EAAEC,UAAU,QAAQ,oBAAoB;AACnE,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,OAAOC,cAAc,MAAM,qBAAqB;AAChD,OAAOC,aAAa,MAAM,SAAS;AACnC,OAAOC,kBAAkB,MAAM,+BAA+B;AAC9D,OAAOC,eAAe,MAAM,qBAAqB;AACjD,SAASC,OAAO,QAAQ,qBAAqB;AAC7C,OAAOC,iBAAiB,MAAM,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AA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,WAAa;QAC3BE,YAAY,EAAGA,YAAc;QAC7BC,OAAO,EAAGA,OAAS;QACnBC,kBAAkB,EAAGA,kBAAoB;QACzCC,SAAS,EAAC;MAAmC,CAC7C,CAAC;IAAA,CACE;EAAC,CACU,CAAC;AAEpB;AAEA,eAAe3B,UAAU,CAAEuD,aAAc,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","__","BlockTypesList","useClipboardBlock","useBlockTypeImpressions","createInserterSection","filterInserterItems","useBlockTypesState","jsx","_jsx","getBlockNamespace","item","name","split","BlockTypesTab","onSelect","rootClientId","listProps","rawBlockTypes","collections","clipboardBlock","filteredBlockTypes","blockTypes","items","trackBlockTypeSelected","handleSelect","args","collectionSections","result","Object","keys","forEach","namespace","data","filter","length","push","key","metadata","icon","title","sections","label"],"sources":["@wordpress/block-editor/src/components/inserter/block-types-tab.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport useClipboardBlock from './hooks/use-clipboard-block';\nimport useBlockTypeImpressions from './hooks/use-block-type-impressions';\nimport { createInserterSection, filterInserterItems } from './utils';\nimport useBlockTypesState from './hooks/use-block-types-state';\n\nconst getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];\n\nfunction BlockTypesTab( { onSelect, rootClientId, listProps } ) {\n\tconst [ rawBlockTypes, , collections ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonSelect,\n\t\ttrue\n\t);\n\tconst clipboardBlock = useClipboardBlock( rootClientId );\n\tconst filteredBlockTypes = filterInserterItems( rawBlockTypes );\n\tconst blockTypes = clipboardBlock\n\t\t? [ clipboardBlock, ...filteredBlockTypes ]\n\t\t: filteredBlockTypes;\n\tconst { items, trackBlockTypeSelected } =\n\t\tuseBlockTypeImpressions( blockTypes );\n\n\tconst handleSelect = ( ...args ) => {\n\t\ttrackBlockTypeSelected( ...args );\n\t\tonSelect( ...args );\n\t};\n\n\tconst collectionSections = useMemo( () => {\n\t\tconst result = [];\n\t\tObject.keys( collections ).forEach( ( namespace ) => {\n\t\t\tconst data = items.filter(\n\t\t\t\t( item ) => getBlockNamespace( item ) === namespace\n\t\t\t);\n\t\t\tif ( data.length > 0 ) {\n\t\t\t\tresult.push(\n\t\t\t\t\tcreateInserterSection( {\n\t\t\t\t\t\tkey: `collection-${ namespace }`,\n\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\ticon: collections[ namespace ].icon,\n\t\t\t\t\t\t\ttitle: collections[ namespace ].title,\n\t\t\t\t\t\t},\n\t\t\t\t\t\titems: data,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ items, collections ] );\n\n\tconst sections = [\n\t\tcreateInserterSection( { key: 'default', items } ),\n\t\t...collectionSections,\n\t];\n\n\treturn (\n\t\t<BlockTypesList\n\t\t\tname=\"Blocks\"\n\t\t\tsections={ sections }\n\t\t\tonSelect={ handleSelect }\n\t\t\tlistProps={ listProps }\n\t\t\tlabel={ __( 'Blocks menu' ) }\n\t\t/>\n\t);\n}\n\nexport default BlockTypesTab;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["useMemo","__","BlockTypesList","useClipboardBlock","useBlockTypeImpressions","createInserterSection","filterInserterItems","useBlockTypesState","jsx","_jsx","getBlockNamespace","item","name","split","BlockTypesTab","onSelect","rootClientId","listProps","rawBlockTypes","collections","clipboardBlock","filteredBlockTypes","blockTypes","items","trackBlockTypeSelected","handleSelect","args","collectionSections","result","Object","keys","forEach","namespace","data","filter","length","push","key","metadata","icon","title","sections","label"],"sources":["@wordpress/block-editor/src/components/inserter/block-types-tab.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport useClipboardBlock from './hooks/use-clipboard-block';\nimport useBlockTypeImpressions from './hooks/use-block-type-impressions';\nimport { createInserterSection, filterInserterItems } from './utils';\nimport useBlockTypesState from './hooks/use-block-types-state';\n\nconst getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];\n\nfunction BlockTypesTab( { onSelect, rootClientId, listProps } ) {\n\tconst [ rawBlockTypes, , collections ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonSelect,\n\t\ttrue\n\t);\n\tconst clipboardBlock = useClipboardBlock( rootClientId );\n\tconst filteredBlockTypes = filterInserterItems( rawBlockTypes );\n\tconst blockTypes = clipboardBlock\n\t\t? [ clipboardBlock, ...filteredBlockTypes ]\n\t\t: filteredBlockTypes;\n\tconst { items, trackBlockTypeSelected } =\n\t\tuseBlockTypeImpressions( blockTypes );\n\n\tconst handleSelect = ( ...args ) => {\n\t\ttrackBlockTypeSelected( ...args );\n\t\tonSelect( ...args );\n\t};\n\n\tconst collectionSections = useMemo( () => {\n\t\tconst result = [];\n\t\tObject.keys( collections ).forEach( ( namespace ) => {\n\t\t\tconst data = items.filter(\n\t\t\t\t( item ) => getBlockNamespace( item ) === namespace\n\t\t\t);\n\t\t\tif ( data.length > 0 ) {\n\t\t\t\tresult.push(\n\t\t\t\t\tcreateInserterSection( {\n\t\t\t\t\t\tkey: `collection-${ namespace }`,\n\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\ticon: collections[ namespace ].icon,\n\t\t\t\t\t\t\ttitle: collections[ namespace ].title,\n\t\t\t\t\t\t},\n\t\t\t\t\t\titems: data,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ items, collections ] );\n\n\tconst sections = [\n\t\tcreateInserterSection( { key: 'default', items } ),\n\t\t...collectionSections,\n\t];\n\n\treturn (\n\t\t<BlockTypesList\n\t\t\tname=\"Blocks\"\n\t\t\tsections={ sections }\n\t\t\tonSelect={ handleSelect }\n\t\t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;IACjBC,MAAM,CAACC,IAAI,CAAEX,WAAY,CAAC,CAACY,OAAO,CAAIC,SAAS,IAAM;MACpD,MAAMC,IAAI,GAAGV,KAAK,CAACW,MAAM,CACtBvB,IAAI,IAAMD,iBAAiB,CAAEC,IAAK,CAAC,KAAKqB,SAC3C,CAAC;MACD,IAAKC,IAAI,CAACE,MAAM,GAAG,CAAC,EAAG;QACtBP,MAAM,CAACQ,IAAI,CACV/B,qBAAqB,CAAE;UACtBgC,GAAG,EAAE,cAAeL,SAAS,EAAG;UAChCM,QAAQ,EAAE;YACTC,IAAI,EAAEpB,WAAW,CAAEa,SAAS,CAAE,CAACO,IAAI;YACnCC,KAAK,EAAErB,WAAW,CAAEa,SAAS,CAAE,CAACQ;UACjC,CAAC;UACDjB,KAAK,EAAEU;QACR,CAAE,CACH,CAAC;MACF;IACD,CAAE,CAAC;IAEH,OAAOL,MAAM;EACd,CAAC,EAAE,CAAEL,KAAK,EAAEJ,WAAW,CAAG,CAAC;EAE3B,MAAMsB,QAAQ,GAAG,CAChBpC,qBAAqB,CAAE;IAAEgC,GAAG,EAAE,SAAS;IAAEd;EAAM,CAAE,CAAC,EAClD,GAAGI,kBAAkB,CACrB;EAED,oBACClB,IAAA,CAACP,cAAc;IACdU,IAAI,EAAC,QAAQ;IACb6B,QAAQ,EAAGA,QAAU;IACrB1B,QAAQ,EAAGU,YAAc;IACzBR,SAAS,EAAGA,SAAW;IACvByB,KAAK,EAAGzC,EAAE,CAAE,aAAc;EAAG,CAC7B,CAAC;AAEJ;AAEA,eAAea,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["usePrevious","useReducedMotion","privateApis","componentsPrivateApis","__unstableMotion","motion","useState","unlock","jsx","_jsx","jsxs","_jsxs","Tabs","CategoryTabs","categories","selectedCategory","onSelectCategory","children","ANIMATION_DURATION","disableMotion","defaultTransition","type","duration","ease","previousSelectedCategory","selectedTabId","name","activeTabId","setActiveId","firstTabId","selectOnMove","orientation","onSelect","categoryId","find","category","onActiveTabIdChange","TabList","className","map","Tab","tabId","undefined","label","TabPanel","focusable","div","initial","animate","variants","open","transform","transitionEnd","zIndex","closed","transition"],"sources":["@wordpress/block-editor/src/components/inserter/category-tabs/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { usePrevious, useReducedMotion } from '@wordpress/compose';\nimport {\n\tprivateApis as componentsPrivateApis,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nfunction CategoryTabs( {\n\tcategories,\n\tselectedCategory,\n\tonSelectCategory,\n\tchildren,\n} ) {\n\t// Copied from InterfaceSkeleton.\n\tconst ANIMATION_DURATION = 0.25;\n\tconst disableMotion = useReducedMotion();\n\tconst defaultTransition = {\n\t\ttype: 'tween',\n\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t};\n\n\tconst previousSelectedCategory = usePrevious( selectedCategory );\n\n\tconst selectedTabId = selectedCategory ? selectedCategory.name : null;\n\tconst [ activeTabId, setActiveId ] = useState();\n\tconst firstTabId = categories?.[ 0 ]?.name;\n\n\t// If there is no active tab, make the first tab the active tab, so that\n\t// when focus is moved to the tablist, the first tab will be focused\n\t// despite not being selected\n\tif ( selectedTabId === null && ! activeTabId && firstTabId ) {\n\t\tsetActiveId( firstTabId );\n\t}\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectOnMove={ false }\n\t\t\tselectedTabId={ selectedTabId }\n\t\t\torientation=\"vertical\"\n\t\t\tonSelect={ ( categoryId ) => {\n\t\t\t\t// Pass the full category object\n\t\t\t\tonSelectCategory(\n\t\t\t\t\tcategories.find(\n\t\t\t\t\t\t( category ) => category.name === categoryId\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} }\n\t\t\tactiveTabId={ activeTabId }\n\t\t\tonActiveTabIdChange={ setActiveId }\n\t\t>\n\t\t\t<Tabs.TabList className=\"block-editor-inserter__category-tablist\">\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\tkey={ category.name }\n\t\t\t\t\t\ttabId={ category.name }\n\t\t\t\t\t\taria-current={\n\t\t\t\t\t\t\tcategory.name === selectedCategory?.name\n\t\t\t\t\t\t\t\t? 'true'\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ category.label }\n\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t) ) }\n\t\t\t</Tabs.TabList>\n\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\tkey={ category.name }\n\t\t\t\t\ttabId={ category.name }\n\t\t\t\t\tfocusable={ false }\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"block-editor-inserter__category-panel\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\t! previousSelectedCategory ? 'closed' : 'open'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate=\"open\"\n\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\topen: {\n\t\t\t\t\t\t\t\ttransform: 'translateX( 0 )',\n\t\t\t\t\t\t\t\ttransitionEnd: {\n\t\t\t\t\t\t\t\t\tzIndex: '1',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclosed: {\n\t\t\t\t\t\t\t\ttransform: 'translateX( -100% )',\n\t\t\t\t\t\t\t\tzIndex: '-1',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={ defaultTransition }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</motion.div>\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t) ) }\n\t\t</Tabs>\n\t);\n}\n\nexport default CategoryTabs;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["usePrevious","useReducedMotion","privateApis","componentsPrivateApis","__unstableMotion","motion","useState","unlock","jsx","_jsx","jsxs","_jsxs","Tabs","CategoryTabs","categories","selectedCategory","onSelectCategory","children","ANIMATION_DURATION","disableMotion","defaultTransition","type","duration","ease","previousSelectedCategory","selectedTabId","name","activeTabId","setActiveId","firstTabId","selectOnMove","orientation","onSelect","categoryId","find","category","onActiveTabIdChange","TabList","className","map","Tab","tabId","undefined","label","TabPanel","focusable","div","initial","animate","variants","open","transform","transitionEnd","zIndex","closed","transition"],"sources":["@wordpress/block-editor/src/components/inserter/category-tabs/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { usePrevious, useReducedMotion } from '@wordpress/compose';\nimport {\n\tprivateApis as componentsPrivateApis,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nfunction CategoryTabs( {\n\tcategories,\n\tselectedCategory,\n\tonSelectCategory,\n\tchildren,\n} ) {\n\t// Copied from InterfaceSkeleton.\n\tconst ANIMATION_DURATION = 0.25;\n\tconst disableMotion = useReducedMotion();\n\tconst defaultTransition = {\n\t\ttype: 'tween',\n\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t};\n\n\tconst previousSelectedCategory = usePrevious( selectedCategory );\n\n\tconst selectedTabId = selectedCategory ? selectedCategory.name : null;\n\tconst [ activeTabId, setActiveId ] = useState();\n\tconst firstTabId = categories?.[ 0 ]?.name;\n\n\t// If there is no active tab, make the first tab the active tab, so that\n\t// when focus is moved to the tablist, the first tab will be focused\n\t// despite not being selected\n\tif ( selectedTabId === null && ! activeTabId && firstTabId ) {\n\t\tsetActiveId( firstTabId );\n\t}\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectOnMove={ false }\n\t\t\tselectedTabId={ selectedTabId }\n\t\t\torientation=\"vertical\"\n\t\t\tonSelect={ ( categoryId ) => {\n\t\t\t\t// Pass the full category object\n\t\t\t\tonSelectCategory(\n\t\t\t\t\tcategories.find(\n\t\t\t\t\t\t( category ) => category.name === categoryId\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} }\n\t\t\tactiveTabId={ activeTabId }\n\t\t\tonActiveTabIdChange={ setActiveId }\n\t\t>\n\t\t\t<Tabs.TabList className=\"block-editor-inserter__category-tablist\">\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\tkey={ category.name }\n\t\t\t\t\t\ttabId={ category.name }\n\t\t\t\t\t\taria-current={\n\t\t\t\t\t\t\tcategory.name === selectedCategory?.name\n\t\t\t\t\t\t\t\t? 'true'\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ category.label }\n\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t) ) }\n\t\t\t</Tabs.TabList>\n\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\tkey={ category.name }\n\t\t\t\t\ttabId={ category.name }\n\t\t\t\t\tfocusable={ false }\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"block-editor-inserter__category-panel\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\t! previousSelectedCategory ? 'closed' : 'open'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate=\"open\"\n\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\topen: {\n\t\t\t\t\t\t\t\ttransform: 'translateX( 0 )',\n\t\t\t\t\t\t\t\ttransitionEnd: {\n\t\t\t\t\t\t\t\t\tzIndex: '1',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclosed: {\n\t\t\t\t\t\t\t\ttransform: 'translateX( -100% )',\n\t\t\t\t\t\t\t\tzIndex: '-1',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={ defaultTransition }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</motion.div>\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t) ) }\n\t\t</Tabs>\n\t);\n}\n\nexport default CategoryTabs;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,gBAAgB,QAAQ,oBAAoB;AAClE,SACCC,WAAW,IAAIC,qBAAqB,EACpCC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9C,MAAM;EAAEC;AAAK,CAAC,GAAGL,MAAM,CAAEJ,qBAAsB,CAAC;AAEhD,SAASU,YAAYA,CAAE;EACtBC,UAAU;EACVC,gBAAgB;EAChBC,gBAAgB;EAChBC;AACD,CAAC,EAAG;EACH;EACA,MAAMC,kBAAkB,GAAG,IAAI;EAC/B,MAAMC,aAAa,GAAGlB,gBAAgB,CAAC,CAAC;EACxC,MAAMmB,iBAAiB,GAAG;IACzBC,IAAI,EAAE,OAAO;IACbC,QAAQ,EAAEH,aAAa,GAAG,CAAC,GAAGD,kBAAkB;IAChDK,IAAI,EAAE,CAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;EACvB,CAAC;EAED,MAAMC,wBAAwB,GAAGxB,WAAW,CAAEe,gBAAiB,CAAC;EAEhE,MAAMU,aAAa,GAAGV,gBAAgB,GAAGA,gBAAgB,CAACW,IAAI,GAAG,IAAI;EACrE,MAAM,CAAEC,WAAW,EAAEC,WAAW,CAAE,GAAGtB,QAAQ,CAAC,CAAC;EAC/C,MAAMuB,UAAU,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AI,EAAE;YACLC,SAAS,EAAE,iBAAiB;YAC5BC,aAAa,EAAE;cACdC,MAAM,EAAE;YACT;UACD,CAAC;UACDC,MAAM,EAAE;YACPH,SAAS,EAAE,qBAAqB;YAChCE,MAAM,EAAE;UACT;QACD,CAAG;QACHE,UAAU,EAAGnC,iBAAmB;QAAAH,QAAA,EAE9BA;MAAQ,CACC;IAAC,GAzBPkB,QAAQ,CAACT,IA0BD,CACd,CAAC;EAAA,CACE,CAAC;AAET;AAEA,eAAeb,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","setBlockTypeImpressions","store","blockEditorStore","useBlockTypeImpressions","blockTypes","blockTypeImpressions","select","getSettings","getBlockEditorSettings","impressions","updateSettings","items","map","blockType","isNew","name","trackBlockTypeSelected","updatedBlockTypeImpressions"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-block-type-impressions.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { setBlockTypeImpressions } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\n\nfunction useBlockTypeImpressions( blockTypes ) {\n\tconst { blockTypeImpressions } = useSelect( ( select ) => {\n\t\tconst { getSettings: getBlockEditorSettings } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { impressions } = getBlockEditorSettings();\n\n\t\treturn {\n\t\t\tblockTypeImpressions: impressions,\n\t\t};\n\t}, [] );\n\tconst { updateSettings } = useDispatch( blockEditorStore );\n\n\tconst items = blockTypes.map( ( blockType ) => ( {\n\t\t...blockType,\n\t\tisNew: blockTypeImpressions[ blockType.name ] > 0,\n\t} ) );\n\tconst trackBlockTypeSelected = ( { name } ) => {\n\t\tif ( blockTypeImpressions[ name ] > 0 ) {\n\t\t\tconst updatedBlockTypeImpressions = {\n\t\t\t\t...blockTypeImpressions,\n\t\t\t\t[ name ]: 0,\n\t\t\t};\n\t\t\t// Persist block type impression to JavaScript store.\n\t\t\tupdateSettings( {\n\t\t\t\timpressions: updatedBlockTypeImpressions,\n\t\t\t} );\n\n\t\t\t// Persist block type impression count to native app store.\n\t\t\tsetBlockTypeImpressions( updatedBlockTypeImpressions );\n\t\t}\n\t};\n\n\treturn { items, trackBlockTypeSelected };\n}\n\nexport default useBlockTypeImpressions;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","setBlockTypeImpressions","store","blockEditorStore","useBlockTypeImpressions","blockTypes","blockTypeImpressions","select","getSettings","getBlockEditorSettings","impressions","updateSettings","items","map","blockType","isNew","name","trackBlockTypeSelected","updatedBlockTypeImpressions"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-block-type-impressions.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { setBlockTypeImpressions } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\n\nfunction useBlockTypeImpressions( blockTypes ) {\n\tconst { blockTypeImpressions } = useSelect( ( select ) => {\n\t\tconst { getSettings: getBlockEditorSettings } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { impressions } = getBlockEditorSettings();\n\n\t\treturn {\n\t\t\tblockTypeImpressions: impressions,\n\t\t};\n\t}, [] );\n\tconst { updateSettings } = useDispatch( blockEditorStore );\n\n\tconst items = blockTypes.map( ( blockType ) => ( {\n\t\t...blockType,\n\t\tisNew: blockTypeImpressions[ blockType.name ] > 0,\n\t} ) );\n\tconst trackBlockTypeSelected = ( { name } ) => {\n\t\tif ( blockTypeImpressions[ name ] > 0 ) {\n\t\t\tconst updatedBlockTypeImpressions = {\n\t\t\t\t...blockTypeImpressions,\n\t\t\t\t[ name ]: 0,\n\t\t\t};\n\t\t\t// Persist block type impression to JavaScript store.\n\t\t\tupdateSettings( {\n\t\t\t\timpressions: updatedBlockTypeImpressions,\n\t\t\t} );\n\n\t\t\t// Persist block type impression count to native app store.\n\t\t\tsetBlockTypeImpressions( updatedBlockTypeImpressions );\n\t\t}\n\t};\n\n\treturn { items, trackBlockTypeSelected };\n}\n\nexport default useBlockTypeImpressions;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,uBAAuB,QAAQ,gCAAgC;;AAExE;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,gBAAgB;AAE1D,SAASC,uBAAuBA,CAAEC,UAAU,EAAG;EAC9C,MAAM;IAAEC;EAAqB,CAAC,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IACzD,MAAM;MAAEC,WAAW,EAAEC;IAAuB,CAAC,GAC5CF,MAAM,CAAEJ,gBAAiB,CAAC;IAC3B,MAAM;MAAEO;IAAY,CAAC,GAAGD,sBAAsB,CAAC,CAAC;IAEhD,OAAO;MACNH,oBAAoB,EAAEI;IACvB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAe,CAAC,GAAGX,WAAW,CAAEG,gBAAiB,CAAC;EAE1D,MAAMS,KAAK,GAAGP,UAAU,CAACQ,GAAG,CAAIC,SAAS,KAAQ;IAChD,GAAGA,SAAS;IACZC,KAAK,EAAET,oBAAoB,CAAEQ,SAAS,CAACE,IAAI,CAAE,GAAG;EACjD,CAAC,CAAG,CAAC;EACL,MAAMC,sBAAsB,GAAGA,CAAE;IAAED;EAAK,CAAC,KAAM;IAC9C,IAAKV,oBAAoB,CAAEU,IAAI,CAAE,GAAG,CAAC,EAAG;MACvC,MAAME,2BAA2B,GAAG;QACnC,GAAGZ,oBAAoB;QACvB,CAAEU,IAAI,GAAI;MACX,CAAC;MACD;MACAL,cAAc,CAAE;QACfD,WAAW,EAAEQ;MACd,CAAE,CAAC;;MAEH;MACAjB,uBAAuB,CAAEiB,2BAA4B,CAAC;IACvD;EACD,CAAC;EAED,OAAO;IAAEN,KAAK;IAAEK;EAAuB,CAAC;AACzC;AAEA,eAAeb,uBAAuB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useMemo","cloneBlock","createBlock","useDispatch","useSelect","__","sprintf","store","noticesStore","blockEditorStore","unlock","INSERTER_PATTERN_TYPES","isFiltered","usePatternsState","onInsert","rootClientId","selectedCategory","isQuick","options","patternCategories","patterns","userPatternCategories","select","getSettings","__experimentalGetAllowedPatterns","__experimentalUserPatternCategories","__experimentalBlockPatternCategories","getClosestAllowedInsertionPointForPattern","allCategories","categories","forEach","userCategory","find","existingCategory","name","push","createSuccessNotice","onClickPattern","pattern","blocks","destinationRootClientId","patternBlocks","type","user","syncStatus","ref","id","map","block","clonedBlock","attributes","metadata","includes","title"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-patterns-state.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { cloneBlock, createBlock } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\nimport { INSERTER_PATTERN_TYPES } from '../block-patterns-tab/utils';\nimport { isFiltered } from '../../../store/utils';\n\n/**\n * Retrieves the block patterns inserter state.\n *\n * @param {Function} onInsert function called when inserter a list of blocks.\n * @param {string=} rootClientId Insertion's root client ID.\n * @param {string} selectedCategory The selected pattern category.\n * @param {boolean} isQuick For the quick inserter render only allowed patterns.\n *\n * @return {Array} Returns the patterns state. (patterns, categories, onSelect handler)\n */\nconst usePatternsState = (\n\tonInsert,\n\trootClientId,\n\tselectedCategory,\n\tisQuick\n) => {\n\tconst options = useMemo(\n\t\t() => ( { [ isFiltered ]: !! isQuick } ),\n\t\t[ isQuick ]\n\t);\n\tconst { patternCategories, patterns, userPatternCategories } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings, __experimentalGetAllowedPatterns } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst {\n\t\t\t\t__experimentalUserPatternCategories,\n\t\t\t\t__experimentalBlockPatternCategories,\n\t\t\t} = getSettings();\n\t\t\treturn {\n\t\t\t\tpatterns: __experimentalGetAllowedPatterns(\n\t\t\t\t\trootClientId,\n\t\t\t\t\toptions\n\t\t\t\t),\n\t\t\t\tuserPatternCategories: __experimentalUserPatternCategories,\n\t\t\t\tpatternCategories: __experimentalBlockPatternCategories,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId, options ]\n\t);\n\tconst { getClosestAllowedInsertionPointForPattern } = unlock(\n\t\tuseSelect( blockEditorStore )\n\t);\n\n\tconst allCategories = useMemo( () => {\n\t\tconst categories = [ ...patternCategories ];\n\t\tuserPatternCategories?.forEach( ( userCategory ) => {\n\t\t\tif (\n\t\t\t\t! categories.find(\n\t\t\t\t\t( existingCategory ) =>\n\t\t\t\t\t\texistingCategory.name === userCategory.name\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tcategories.push( userCategory );\n\t\t\t}\n\t\t} );\n\t\treturn categories;\n\t}, [ patternCategories, userPatternCategories ] );\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst onClickPattern = useCallback(\n\t\t( pattern, blocks ) => {\n\t\t\tconst destinationRootClientId = isQuick\n\t\t\t\t? rootClientId\n\t\t\t\t: getClosestAllowedInsertionPointForPattern(\n\t\t\t\t\t\tpattern,\n\t\t\t\t\t\trootClientId\n\t\t\t\t );\n\t\t\tif ( destinationRootClientId === null ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst patternBlocks =\n\t\t\t\tpattern.type === INSERTER_PATTERN_TYPES.user &&\n\t\t\t\tpattern.syncStatus !== 'unsynced'\n\t\t\t\t\t? [ createBlock( 'core/block', { ref: pattern.id } ) ]\n\t\t\t\t\t: blocks;\n\t\t\tonInsert(\n\t\t\t\t( patternBlocks ?? [] ).map( ( block ) => {\n\t\t\t\t\tconst clonedBlock = cloneBlock( block );\n\t\t\t\t\tif (\n\t\t\t\t\t\tclonedBlock.attributes.metadata?.categories?.includes(\n\t\t\t\t\t\t\tselectedCategory\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tclonedBlock.attributes.metadata.categories = [\n\t\t\t\t\t\t\tselectedCategory,\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn clonedBlock;\n\t\t\t\t} ),\n\t\t\t\tpattern.name,\n\t\t\t\tfalse,\n\t\t\t\tdestinationRootClientId\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: block pattern title. */\n\t\t\t\t\t__( 'Block pattern \"%s\" inserted.' ),\n\t\t\t\t\tpattern.title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'inserter-notice',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t\t[\n\t\t\tcreateSuccessNotice,\n\t\t\tonInsert,\n\t\t\tselectedCategory,\n\t\t\trootClientId,\n\t\t\tgetClosestAllowedInsertionPointForPattern,\n\t\t\tisQuick,\n\t\t]\n\t);\n\n\treturn [ patterns, allCategories, onClickPattern ];\n};\n\nexport default usePatternsState;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["useCallback","useMemo","cloneBlock","createBlock","useDispatch","useSelect","__","sprintf","store","noticesStore","blockEditorStore","unlock","INSERTER_PATTERN_TYPES","isFiltered","usePatternsState","onInsert","rootClientId","selectedCategory","isQuick","options","patternCategories","patterns","userPatternCategories","select","getSettings","__experimentalGetAllowedPatterns","__experimentalUserPatternCategories","__experimentalBlockPatternCategories","getClosestAllowedInsertionPointForPattern","allCategories","categories","forEach","userCategory","find","existingCategory","name","push","createSuccessNotice","onClickPattern","pattern","blocks","destinationRootClientId","patternBlocks","type","user","syncStatus","ref","id","map","block","clonedBlock","attributes","metadata","includes","title"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-patterns-state.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { cloneBlock, createBlock } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\nimport { INSERTER_PATTERN_TYPES } from '../block-patterns-tab/utils';\nimport { isFiltered } from '../../../store/utils';\n\n/**\n * Retrieves the block patterns inserter state.\n *\n * @param {Function} onInsert function called when inserter a list of blocks.\n * @param {string=} rootClientId Insertion's root client ID.\n * @param {string} selectedCategory The selected pattern category.\n * @param {boolean} isQuick For the quick inserter render only allowed patterns.\n *\n * @return {Array} Returns the patterns state. (patterns, categories, onSelect handler)\n */\nconst usePatternsState = (\n\tonInsert,\n\trootClientId,\n\tselectedCategory,\n\tisQuick\n) => {\n\tconst options = useMemo(\n\t\t() => ( { [ isFiltered ]: !! isQuick } ),\n\t\t[ isQuick ]\n\t);\n\tconst { patternCategories, patterns, userPatternCategories } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings, __experimentalGetAllowedPatterns } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst {\n\t\t\t\t__experimentalUserPatternCategories,\n\t\t\t\t__experimentalBlockPatternCategories,\n\t\t\t} = getSettings();\n\t\t\treturn {\n\t\t\t\tpatterns: __experimentalGetAllowedPatterns(\n\t\t\t\t\trootClientId,\n\t\t\t\t\toptions\n\t\t\t\t),\n\t\t\t\tuserPatternCategories: __experimentalUserPatternCategories,\n\t\t\t\tpatternCategories: __experimentalBlockPatternCategories,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId, options ]\n\t);\n\tconst { getClosestAllowedInsertionPointForPattern } = unlock(\n\t\tuseSelect( blockEditorStore )\n\t);\n\n\tconst allCategories = useMemo( () => {\n\t\tconst categories = [ ...patternCategories ];\n\t\tuserPatternCategories?.forEach( ( userCategory ) => {\n\t\t\tif (\n\t\t\t\t! categories.find(\n\t\t\t\t\t( existingCategory ) =>\n\t\t\t\t\t\texistingCategory.name === userCategory.name\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tcategories.push( userCategory );\n\t\t\t}\n\t\t} );\n\t\treturn categories;\n\t}, [ patternCategories, userPatternCategories ] );\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst onClickPattern = useCallback(\n\t\t( pattern, blocks ) => {\n\t\t\tconst destinationRootClientId = isQuick\n\t\t\t\t? rootClientId\n\t\t\t\t: getClosestAllowedInsertionPointForPattern(\n\t\t\t\t\t\tpattern,\n\t\t\t\t\t\trootClientId\n\t\t\t\t );\n\t\t\tif ( destinationRootClientId === null ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst patternBlocks =\n\t\t\t\tpattern.type === INSERTER_PATTERN_TYPES.user &&\n\t\t\t\tpattern.syncStatus !== 'unsynced'\n\t\t\t\t\t? [ createBlock( 'core/block', { ref: pattern.id } ) ]\n\t\t\t\t\t: blocks;\n\t\t\tonInsert(\n\t\t\t\t( patternBlocks ?? [] ).map( ( block ) => {\n\t\t\t\t\tconst clonedBlock = cloneBlock( block );\n\t\t\t\t\tif (\n\t\t\t\t\t\tclonedBlock.attributes.metadata?.categories?.includes(\n\t\t\t\t\t\t\tselectedCategory\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tclonedBlock.attributes.metadata.categories = [\n\t\t\t\t\t\t\tselectedCategory,\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn clonedBlock;\n\t\t\t\t} ),\n\t\t\t\tpattern.name,\n\t\t\t\tfalse,\n\t\t\t\tdestinationRootClientId\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: block pattern title. */\n\t\t\t\t\t__( 'Block pattern \"%s\" inserted.' ),\n\t\t\t\t\tpattern.title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'inserter-notice',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t\t[\n\t\t\tcreateSuccessNotice,\n\t\t\tonInsert,\n\t\t\tselectedCategory,\n\t\t\trootClientId,\n\t\t\tgetClosestAllowedInsertionPointForPattern,\n\t\t\tisQuick,\n\t\t]\n\t);\n\n\treturn [ patterns, allCategories, onClickPattern ];\n};\n\nexport default usePatternsState;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,WAAW,QAAQ,mBAAmB;AAC3D,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,gBAAgB;AAC1D,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,sBAAsB,QAAQ,6BAA6B;AACpE,SAASC,UAAU,QAAQ,sBAAsB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CACxBC,QAAQ,EACRC,YAAY,EACZC,gBAAgB,EAChBC,OAAO,KACH;EACJ,MAAMC,OAAO,GAAGlB,OAAO,CACtB,OAAQ;IAAE,CAAEY,UAAU,GAAI,CAAC,CAAEK;EAAQ,CAAC,CAAE,EACxC,CAAEA,OAAO,CACV,CAAC;EACD,MAAM;IAAEE,iBAAiB;IAAEC,QAAQ;IAAEC;EAAsB,CAAC,GAAGjB,SAAS,CACrEkB,MAAM,IAAM;IACb,MAAM;MAAEC,WAA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,UAAU,GAC9B,CAAE1C,WAAW,CAAE,YAAY,EAAE;MAAE2C,GAAG,EAAEP,OAAO,CAACQ;IAAG,CAAE,CAAC,CAAE,GACpDP,MAAM;IACVzB,QAAQ,CACP,CAAE2B,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAI,EAAE,EAAGM,GAAG,CAAIC,KAAK,IAAM;MACzC,MAAMC,WAAW,GAAGhD,UAAU,CAAE+C,KAAM,CAAC;MACvC,IACCC,WAAW,CAACC,UAAU,CAACC,QAAQ,EAAEtB,UAAU,EAAEuB,QAAQ,CACpDpC,gBACD,CAAC,EACA;QACDiC,WAAW,CAACC,UAAU,CAACC,QAAQ,CAACtB,UAAU,GAAG,CAC5Cb,gBAAgB,CAChB;MACF;MACA,OAAOiC,WAAW;IACnB,CAAE,CAAC,EACHX,OAAO,CAACJ,IAAI,EACZ,KAAK,EACLM,uBACD,CAAC;IACDJ,mBAAmB,CAClB9B,OAAO,CACN;IACAD,EAAE,CAAE,8BAA+B,CAAC,EACpCiC,OAAO,CAACe,KACT,CAAC,EACD;MACCX,IAAI,EAAE,UAAU;MAChBI,EAAE,EAAE;IACL,CACD,CAAC;EACF,CAAC,EACD,CACCV,mBAAmB,EACnBtB,QAAQ,EACRE,gBAAgB,EAChBD,YAAY,EACZY,yCAAyC,EACzCV,OAAO,CAET,CAAC;EAED,OAAO,CAAEG,QAAQ,EAAEQ,aAAa,EAAES,cAAc,CAAE;AACnD,CAAC;AAED,eAAexB,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","speak","__","_x","sprintf","Dropdown","Button","Component","withDispatch","withSelect","compose","ifCondition","createBlock","store","blocksStore","plus","InserterMenu","QuickInserter","blockEditorStore","jsx","_jsx","defaultRenderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","toggleProps","as","Wrapper","label","labelProp","onClick","rest","handleClick","event","__next40pxDefaultSize","undefined","icon","tooltipPosition","className","Inserter","constructor","arguments","bind","renderToggle","renderContent","props","directInsertBlock","hasItems","onClose","rootClientId","clientId","isAppender","showInserterHelpPanel","__experimentalIsQuick","isQuick","onSelectOrClose","selectBlockOnInsert","onSelect","blocks","firstBlock","Array","isArray","length","render","position","insertOnlyAllowedBlock","contentClassName","popoverProps","shift","expandOnMobile","headerTitle","select","shouldDirectInsert","getBlockRootClientId","hasInserterItems","getAllowedBlocks","getDirectInsertBlock","getBlockVariations","allowedBlocks","name","allowedBlockType","title","dispatch","ownProps","getAdjacentBlockAttributes","attributesToCopy","getBlock","getPreviousBlockClientId","result","adjacentAttributes","parentBlock","innerBlocks","lastInnerBlock","attributes","currentBlock","previousBlock","forEach","attribute","hasOwnProperty","getInsertionIndex","getBlockIndex","getBlockSelectionEnd","getBlockOrder","end","insertBlock","blockToInsert","newAttributes","message"],"sources":["@wordpress/block-editor/src/components/inserter/index.js"],"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';\n\nconst defaultRenderToggle = ( {\n\tonToggle,\n\tdisabled,\n\tisOpen,\n\tblockTitle,\n\thasSingleBlockType,\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 && 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\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\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\tdirectInsertBlock,\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\tdirectInsertBlock,\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\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\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\tdirectInsertBlock,\n\t\t\tinsertOnlyAllowedBlock,\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t} = this.props;\n\n\t\tif ( hasSingleBlockType || directInsertBlock ) {\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} = select( blockEditorStore );\n\n\t\t\tconst { getBlockVariations } = select( blocksStore );\n\n\t\t\trootClientId =\n\t\t\t\trootClientId || getBlockRootClientId( clientId ) || undefined;\n\n\t\t\tconst allowedBlocks = getAllowedBlocks( rootClientId );\n\n\t\t\tconst directInsertBlock =\n\t\t\t\tshouldDirectInsert && getDirectInsertBlock( 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\n\t\t\tlet allowedBlockType = false;\n\t\t\tif ( hasSingleBlockType ) {\n\t\t\t\tallowedBlockType = allowedBlocks[ 0 ];\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\tdirectInsertBlock,\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\tdirectInsertBlock,\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 && ! directInsertBlock ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfunction getAdjacentBlockAttributes( attributesToCopy ) {\n\t\t\t\t\tconst { getBlock, getPreviousBlockClientId } =\n\t\t\t\t\t\tselect( blockEditorStore );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! attributesToCopy ||\n\t\t\t\t\t\t( ! clientId && ! rootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = {};\n\t\t\t\t\tlet adjacentAttributes = {};\n\n\t\t\t\t\t// If there is no clientId, then attempt to get attributes\n\t\t\t\t\t// from the last block within innerBlocks of the root block.\n\t\t\t\t\tif ( ! clientId ) {\n\t\t\t\t\t\tconst parentBlock = getBlock( rootClientId );\n\n\t\t\t\t\t\tif ( parentBlock?.innerBlocks?.length ) {\n\t\t\t\t\t\t\tconst lastInnerBlock =\n\t\t\t\t\t\t\t\tparentBlock.innerBlocks[\n\t\t\t\t\t\t\t\t\tparentBlock.innerBlocks.length - 1\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdirectInsertBlock &&\n\t\t\t\t\t\t\t\tdirectInsertBlock?.name === lastInnerBlock.name\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tadjacentAttributes = lastInnerBlock.attributes;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Otherwise, attempt to get attributes from the\n\t\t\t\t\t\t// previous block relative to the current 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\n\t\t\t\t\t\tif ( currentBlock?.name === previousBlock?.name ) {\n\t\t\t\t\t\t\tadjacentAttributes =\n\t\t\t\t\t\t\t\tpreviousBlock?.attributes || {};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Copy over only those attributes flagged to be copied.\n\t\t\t\t\tattributesToCopy.forEach( ( attribute ) => {\n\t\t\t\t\t\tif ( adjacentAttributes.hasOwnProperty( attribute ) ) {\n\t\t\t\t\t\t\tresult[ attribute ] =\n\t\t\t\t\t\t\t\tadjacentAttributes[ attribute ];\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn result;\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\tlet blockToInsert;\n\n\t\t\t\t// Attempt to augment the directInsertBlock 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\tif ( directInsertBlock ) {\n\t\t\t\t\tconst newAttributes = getAdjacentBlockAttributes(\n\t\t\t\t\t\tdirectInsertBlock.attributesToCopy\n\t\t\t\t\t);\n\n\t\t\t\t\tblockToInsert = createBlock( directInsertBlock.name, {\n\t\t\t\t\t\t...( directInsertBlock.attributes || {} ),\n\t\t\t\t\t\t...newAttributes,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tblockToInsert = createBlock( allowedBlockType.name );\n\t\t\t\t}\n\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblockToInsert,\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( {\n\t\t\t\t\t\tclientId: blockToInsert?.clientId,\n\t\t\t\t\t} );\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"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,WAAW,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACrE,SAASC,IAAI,QAAQ,kBAAkB;;AAEvC;AACA;AACA;AACA,OAAOC,YAAY,MAAM,QAAQ;AACjC,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExD,MAAMC,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,kBAAkB;EAClBC,WAAW,GAAG,CAAC;AAChB,CAAC,KAAM;EACN,MAAM;IACLC,EAAE,EAAEC,OAAO,GAAGvB,MAAM;IACpBwB,KAAK,EAAEC,SAAS;IAChBC,OAAO;IACP,GAAGC;EACJ,CAAC,GAAGN,WAAW;EAEf,I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C;MACDlF,KAAK,CAAE4G,OAAQ,CAAC;IACjB;EACD,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACAlG,WAAW,CACV,CAAE;EAAEsC,QAAQ;EAAEI,UAAU;EAAEF,YAAY;EAAEC;AAAS,CAAC,KACjDH,QAAQ,IAAM,CAAEI,UAAU,IAAI,CAAEF,YAAY,IAAI,CAAEC,QACpD,CAAC,CACA,CAAC,CAAEX,QAAS,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","speak","__","_x","sprintf","Dropdown","Button","Component","withDispatch","withSelect","compose","ifCondition","createBlock","store","blocksStore","plus","InserterMenu","QuickInserter","blockEditorStore","jsx","_jsx","defaultRenderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","toggleProps","as","Wrapper","label","labelProp","onClick","rest","handleClick","event","__next40pxDefaultSize","undefined","icon","tooltipPosition","className","Inserter","constructor","arguments","bind","renderToggle","renderContent","props","directInsertBlock","hasItems","onClose","rootClientId","clientId","isAppender","showInserterHelpPanel","__experimentalIsQuick","isQuick","onSelectOrClose","selectBlockOnInsert","onSelect","blocks","firstBlock","Array","isArray","length","render","position","insertOnlyAllowedBlock","contentClassName","popoverProps","shift","expandOnMobile","headerTitle","select","shouldDirectInsert","getBlockRootClientId","hasInserterItems","getAllowedBlocks","getDirectInsertBlock","getBlockVariations","allowedBlocks","name","allowedBlockType","title","dispatch","ownProps","getAdjacentBlockAttributes","attributesToCopy","getBlock","getPreviousBlockClientId","result","adjacentAttributes","parentBlock","innerBlocks","lastInnerBlock","attributes","currentBlock","previousBlock","forEach","attribute","hasOwnProperty","getInsertionIndex","getBlockIndex","getBlockSelectionEnd","getBlockOrder","end","insertBlock","blockToInsert","newAttributes","message"],"sources":["@wordpress/block-editor/src/components/inserter/index.js"],"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';\n\nconst defaultRenderToggle = ( {\n\tonToggle,\n\tdisabled,\n\tisOpen,\n\tblockTitle,\n\thasSingleBlockType,\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 && 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\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\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\tdirectInsertBlock,\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\tdirectInsertBlock,\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\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\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\tdirectInsertBlock,\n\t\t\tinsertOnlyAllowedBlock,\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t} = this.props;\n\n\t\tif ( hasSingleBlockType || directInsertBlock ) {\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} = select( blockEditorStore );\n\n\t\t\tconst { getBlockVariations } = select( blocksStore );\n\n\t\t\trootClientId =\n\t\t\t\trootClientId || getBlockRootClientId( clientId ) || undefined;\n\n\t\t\tconst allowedBlocks = getAllowedBlocks( rootClientId );\n\n\t\t\tconst directInsertBlock =\n\t\t\t\tshouldDirectInsert && getDirectInsertBlock( 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\n\t\t\tlet allowedBlockType = false;\n\t\t\tif ( hasSingleBlockType ) {\n\t\t\t\tallowedBlockType = allowedBlocks[ 0 ];\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\tdirectInsertBlock,\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\tdirectInsertBlock,\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 && ! directInsertBlock ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfunction getAdjacentBlockAttributes( attributesToCopy ) {\n\t\t\t\t\tconst { getBlock, getPreviousBlockClientId } =\n\t\t\t\t\t\tselect( blockEditorStore );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! attributesToCopy ||\n\t\t\t\t\t\t( ! clientId && ! rootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = {};\n\t\t\t\t\tlet adjacentAttributes = {};\n\n\t\t\t\t\t// If there is no clientId, then attempt to get attributes\n\t\t\t\t\t// from the last block within innerBlocks of the root block.\n\t\t\t\t\tif ( ! clientId ) {\n\t\t\t\t\t\tconst parentBlock = getBlock( rootClientId );\n\n\t\t\t\t\t\tif ( parentBlock?.innerBlocks?.length ) {\n\t\t\t\t\t\t\tconst lastInnerBlock =\n\t\t\t\t\t\t\t\tparentBlock.innerBlocks[\n\t\t\t\t\t\t\t\t\tparentBlock.innerBlocks.length - 1\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdirectInsertBlock &&\n\t\t\t\t\t\t\t\tdirectInsertBlock?.name === lastInnerBlock.name\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tadjacentAttributes = lastInnerBlock.attributes;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Otherwise, attempt to get attributes from the\n\t\t\t\t\t\t// previous block relative to the current 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\n\t\t\t\t\t\tif ( currentBlock?.name === previousBlock?.name ) {\n\t\t\t\t\t\t\tadjacentAttributes =\n\t\t\t\t\t\t\t\tpreviousBlock?.attributes || {};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Copy over only those attributes flagged to be copied.\n\t\t\t\t\tattributesToCopy.forEach( ( attribute ) => {\n\t\t\t\t\t\tif ( adjacentAttributes.hasOwnProperty( attribute ) ) {\n\t\t\t\t\t\t\tresult[ attribute ] =\n\t\t\t\t\t\t\t\tadjacentAttributes[ attribute ];\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn result;\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\tlet blockToInsert;\n\n\t\t\t\t// Attempt to augment the directInsertBlock 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\tif ( directInsertBlock ) {\n\t\t\t\t\tconst newAttributes = getAdjacentBlockAttributes(\n\t\t\t\t\t\tdirectInsertBlock.attributesToCopy\n\t\t\t\t\t);\n\n\t\t\t\t\tblockToInsert = createBlock( directInsertBlock.name, {\n\t\t\t\t\t\t...( directInsertBlock.attributes || {} ),\n\t\t\t\t\t\t...newAttributes,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tblockToInsert = createBlock( allowedBlockType.name );\n\t\t\t\t}\n\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblockToInsert,\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( {\n\t\t\t\t\t\tclientId: blockToInsert?.clientId,\n\t\t\t\t\t} );\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,EAAE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