@wordpress/block-editor 14.11.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 +4 -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 +11 -20
- 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 +6 -5
- 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/menu.js +13 -2
- package/build/components/inserter/menu.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-controls-tabs/position-controls-panel.js +49 -21
- package/build/components/inspector-controls-tabs/position-controls-panel.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/index.js +44 -2
- package/build/components/spacing-sizes-control/index.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/linked-button.js +6 -9
- package/build/components/spacing-sizes-control/linked-button.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +0 -109
- 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 +40 -22
- package/build/hooks/contrast-checker.js.map +1 -1
- package/build/hooks/custom-class-name.js +2 -1
- package/build/hooks/custom-class-name.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 +13 -3
- 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 +11 -20
- 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 +6 -5
- 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/menu.js +13 -2
- package/build-module/components/inserter/menu.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-controls-tabs/position-controls-panel.js +51 -23
- package/build-module/components/inspector-controls-tabs/position-controls-panel.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/index.js +45 -1
- package/build-module/components/spacing-sizes-control/index.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/linked-button.js +7 -10
- package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +0 -105
- 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 +41 -23
- package/build-module/hooks/contrast-checker.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +2 -1
- package/build-module/hooks/custom-class-name.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 +13 -3
- 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 +131 -104
- package/build-style/style.css +131 -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/grid-visualizer.js +10 -21
- package/src/components/grid/style.scss +6 -4
- package/src/components/grid/utils.js +6 -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/menu.js +11 -9
- 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/inspector-controls-tabs/position-controls-panel.js +62 -27
- 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/spacing-sizes-control/README.md +93 -0
- package/src/components/spacing-sizes-control/index.js +44 -1
- package/src/components/spacing-sizes-control/linked-button.js +8 -10
- package/src/components/spacing-sizes-control/test/utils.js +0 -151
- package/src/components/spacing-sizes-control/utils.js +0 -106
- 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/src/hooks/contrast-checker.js +64 -30
- package/src/hooks/custom-class-name.js +2 -1
- package/src/store/selectors.js +15 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_element","_data","_buttonBlockAppender","_interopRequireDefault","_defaultBlockAppender","_useNestedSettingsUpdate","_useInnerBlockTemplateSync","_useBlockContext","_blockList","_context","_useBlockSync","_blockContext","_layout","_store","_warningMaxDepthExceeded","_constants","_jsxRuntime","useInnerBlocksProps","props","options","fallbackRef","useRef","clientId","useBlockEditContext","ref","InnerBlocks","value","onChange","ControlledInnerBlocks","UncontrolledInnerBlocks","children","jsx","wrapperRef","allowedBlocks","prioritizedInserterBlocks","defaultBlock","directInsert","__experimentalDefaultBlock","__experimentalDirectInsert","template","templateLock","templateInsertUpdatesSelection","__experimentalCaptureToolbars","captureToolbars","orientation","renderAppender","renderFooterAppender","parentWidth","horizontal","contentResizeMode","contentStyle","onAddBlock","onDeleteBlock","marginVertical","marginHorizontal","horizontalAlignment","filterInnerBlocks","blockWidth","layout","defaultLayout","gridProperties","context","useBlockContext","nestingLevel","parentLock","useSelect","select","getBlockParents","getTemplateLock","getBlockRootClientId","blockEditorStore","length","useNestedSettingsUpdate","useInnerBlockTemplateSync","MAX_NESTING_DEPTH","default","LayoutProvider","BlockContextProvider","rootClientId","withFooter","useBlockSync","allProps","DefaultBlockAppender","ButtonBlockAppender","save","getInnerBlocksProps","Content","_default","exports"],"sources":["@wordpress/block-editor/src/components/inner-blocks/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableGetInnerBlocksProps as getInnerBlocksProps } from '@wordpress/blocks';\nimport { useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport ButtonBlockAppender from './button-block-appender';\nimport DefaultBlockAppender from './default-block-appender';\nimport useNestedSettingsUpdate from './use-nested-settings-update';\nimport useInnerBlockTemplateSync from './use-inner-block-template-sync';\nimport useBlockContext from './use-block-context';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport { useBlockEditContext } from '../block-edit/context';\nimport useBlockSync from '../provider/use-block-sync';\nimport { BlockContextProvider } from '../block-context';\nimport { defaultLayout, LayoutProvider } from '../block-list/layout';\nimport { store as blockEditorStore } from '../../store';\nimport WarningMaxDepthExceeded from './warning-max-depth-exceeded';\nimport { MAX_NESTING_DEPTH } from './constants';\n\n/**\n * This hook is used to lightly mark an element as an inner blocks wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * an inner blocks wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Optional. Inner blocks options.\n *\n * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport function useInnerBlocksProps( props = {}, options = {} ) {\n\tconst fallbackRef = useRef();\n\tconst { clientId } = useBlockEditContext();\n\n\tconst ref = props.ref || fallbackRef;\n\tconst InnerBlocks =\n\t\toptions.value && options.onChange\n\t\t\t? ControlledInnerBlocks\n\t\t\t: UncontrolledInnerBlocks;\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tchildren: (\n\t\t\t<InnerBlocks\n\t\t\t\t{ ...options }\n\t\t\t\tclientId={ clientId }\n\t\t\t\twrapperRef={ ref }\n\t\t\t/>\n\t\t),\n\t};\n}\n\n/**\n * InnerBlocks is a component which allows a single block to have multiple blocks\n * as children. The UncontrolledInnerBlocks component is used whenever the inner\n * blocks are not controlled by another entity. In other words, it is normally\n * used for inner blocks in the post editor\n *\n * @param {Object} props The component props.\n */\nfunction UncontrolledInnerBlocks( props ) {\n\tconst {\n\t\tclientId,\n\t\tallowedBlocks,\n\t\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection,\n\t\t__experimentalCaptureToolbars: captureToolbars,\n\t\torientation,\n\t\trenderAppender,\n\t\trenderFooterAppender,\n\t\tparentWidth,\n\t\thorizontal,\n\t\tcontentResizeMode,\n\t\tcontentStyle,\n\t\tonAddBlock,\n\t\tonDeleteBlock,\n\t\tmarginVertical,\n\t\tmarginHorizontal,\n\t\thorizontalAlignment,\n\t\tfilterInnerBlocks,\n\t\tblockWidth,\n\t\tlayout = defaultLayout,\n\t\tgridProperties,\n\t} = props;\n\n\tconst context = useBlockContext( clientId );\n\n\tconst { nestingLevel, parentLock } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParents, getTemplateLock, getBlockRootClientId } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tnestingLevel: getBlockParents( clientId )?.length,\n\t\t\t\tparentLock: getTemplateLock( getBlockRootClientId( clientId ) ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tuseNestedSettingsUpdate(\n\t\tclientId,\n\t\tparentLock,\n\t\tallowedBlocks,\n\t\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplateLock,\n\t\tcaptureToolbars,\n\t\torientation,\n\t\tlayout\n\t);\n\n\tuseInnerBlockTemplateSync(\n\t\tclientId,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection\n\t);\n\n\tif ( nestingLevel >= MAX_NESTING_DEPTH ) {\n\t\treturn <WarningMaxDepthExceeded clientId={ clientId } />;\n\t}\n\n\treturn (\n\t\t<LayoutProvider value={ layout }>\n\t\t\t<BlockContextProvider value={ context }>\n\t\t\t\t<BlockList\n\t\t\t\t\tmarginVertical={ marginVertical }\n\t\t\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\t\t\trootClientId={ clientId }\n\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\trenderFooterAppender={ renderFooterAppender }\n\t\t\t\t\twithFooter={ false }\n\t\t\t\t\torientation={ orientation }\n\t\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\t\thorizontalAlignment={ horizontalAlignment }\n\t\t\t\t\thorizontal={ horizontal }\n\t\t\t\t\tcontentResizeMode={ contentResizeMode }\n\t\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\t\tonAddBlock={ onAddBlock }\n\t\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\t\tfilterInnerBlocks={ filterInnerBlocks }\n\t\t\t\t\tgridProperties={ gridProperties }\n\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t/>\n\t\t\t</BlockContextProvider>\n\t\t</LayoutProvider>\n\t);\n}\n\n/**\n * The controlled inner blocks component wraps the uncontrolled inner blocks\n * component with the blockSync hook. This keeps the innerBlocks of the block in\n * the block-editor store in sync with the blocks of the controlling entity. An\n * example of an inner block controller is a template part block, which provides\n * its own blocks from the template part entity data source.\n *\n * @param {Object} props The component props.\n */\nfunction ControlledInnerBlocks( props ) {\n\tuseBlockSync( props );\n\treturn <UncontrolledInnerBlocks { ...props } />;\n}\n\n/**\n * Wrapped InnerBlocks component which detects whether to use the controlled or\n * uncontrolled variations of the InnerBlocks component. This is the component\n * which should be used throughout the application.\n *\n * @param {Object} props The component props.\n */\nconst InnerBlocks = ( props ) => {\n\tconst { clientId } = useBlockEditContext();\n\n\tconst allProps = {\n\t\tclientId,\n\t\t...props,\n\t};\n\n\t// Detects if the InnerBlocks should be controlled by an incoming value.\n\treturn props.value && props.onChange ? (\n\t\t<ControlledInnerBlocks { ...allProps } />\n\t) : (\n\t\t<UncontrolledInnerBlocks { ...allProps } />\n\t);\n};\n\n// Expose default appender placeholders as components.\nInnerBlocks.DefaultBlockAppender = DefaultBlockAppender;\nInnerBlocks.ButtonBlockAppender = ButtonBlockAppender;\n\nuseInnerBlocksProps.save = getInnerBlocksProps;\n\nInnerBlocks.Content = () => useInnerBlocksProps.save().children;\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport default InnerBlocks;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,oBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,wBAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,0BAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,gBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AAKA,IAAAS,UAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAP,sBAAA,CAAAJ,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAC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6BAAoB;AACvDzD,WAAW,CAAC0D,mBAAmB,GAAGA,4BAAmB;AAErDlE,mBAAmB,CAACmE,IAAI,GAAGC,qCAAmB;AAE9C5D,WAAW,CAAC6D,OAAO,GAAG,MAAMrE,mBAAmB,CAACmE,IAAI,CAAC,CAAC,CAACtD,QAAQ;;AAE/D;AACA;AACA;AAFA,IAAAyD,QAAA,GAAAC,OAAA,CAAAb,OAAA,GAGelD,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_element","_data","_buttonBlockAppender","_interopRequireDefault","_defaultBlockAppender","_useNestedSettingsUpdate","_useInnerBlockTemplateSync","_useBlockContext","_blockList","_context","_useBlockSync","_blockContext","_layout","_store","_warningMaxDepthExceeded","_constants","_jsxRuntime","useInnerBlocksProps","props","options","fallbackRef","useRef","clientId","useBlockEditContext","ref","InnerBlocks","value","onChange","ControlledInnerBlocks","UncontrolledInnerBlocks","children","jsx","wrapperRef","allowedBlocks","prioritizedInserterBlocks","defaultBlock","directInsert","__experimentalDefaultBlock","__experimentalDirectInsert","template","templateLock","templateInsertUpdatesSelection","__experimentalCaptureToolbars","captureToolbars","orientation","renderAppender","renderFooterAppender","parentWidth","horizontal","contentResizeMode","contentStyle","onAddBlock","onDeleteBlock","marginVertical","marginHorizontal","horizontalAlignment","filterInnerBlocks","blockWidth","layout","defaultLayout","gridProperties","context","useBlockContext","nestingLevel","parentLock","useSelect","select","getBlockParents","getTemplateLock","getBlockRootClientId","blockEditorStore","length","useNestedSettingsUpdate","useInnerBlockTemplateSync","MAX_NESTING_DEPTH","default","LayoutProvider","BlockContextProvider","rootClientId","withFooter","useBlockSync","allProps","DefaultBlockAppender","ButtonBlockAppender","save","getInnerBlocksProps","Content","_default","exports"],"sources":["@wordpress/block-editor/src/components/inner-blocks/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableGetInnerBlocksProps as getInnerBlocksProps } from '@wordpress/blocks';\nimport { useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport ButtonBlockAppender from './button-block-appender';\nimport DefaultBlockAppender from './default-block-appender';\nimport useNestedSettingsUpdate from './use-nested-settings-update';\nimport useInnerBlockTemplateSync from './use-inner-block-template-sync';\nimport useBlockContext from './use-block-context';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport { useBlockEditContext } from '../block-edit/context';\nimport useBlockSync from '../provider/use-block-sync';\nimport { BlockContextProvider } from '../block-context';\nimport { defaultLayout, LayoutProvider } from '../block-list/layout';\nimport { store as blockEditorStore } from '../../store';\nimport WarningMaxDepthExceeded from './warning-max-depth-exceeded';\nimport { MAX_NESTING_DEPTH } from './constants';\n\n/**\n * This hook is used to lightly mark an element as an inner blocks wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * an inner blocks wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Optional. Inner blocks options.\n */\nexport function useInnerBlocksProps( props = {}, options = {} ) {\n\tconst fallbackRef = useRef();\n\tconst { clientId } = useBlockEditContext();\n\n\tconst ref = props.ref || fallbackRef;\n\tconst InnerBlocks =\n\t\toptions.value && options.onChange\n\t\t\t? ControlledInnerBlocks\n\t\t\t: UncontrolledInnerBlocks;\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tchildren: (\n\t\t\t<InnerBlocks\n\t\t\t\t{ ...options }\n\t\t\t\tclientId={ clientId }\n\t\t\t\twrapperRef={ ref }\n\t\t\t/>\n\t\t),\n\t};\n}\n\n/**\n * InnerBlocks is a component which allows a single block to have multiple blocks\n * as children. The UncontrolledInnerBlocks component is used whenever the inner\n * blocks are not controlled by another entity. In other words, it is normally\n * used for inner blocks in the post editor\n *\n * @param {Object} props The component props.\n */\nfunction UncontrolledInnerBlocks( props ) {\n\tconst {\n\t\tclientId,\n\t\tallowedBlocks,\n\t\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection,\n\t\t__experimentalCaptureToolbars: captureToolbars,\n\t\torientation,\n\t\trenderAppender,\n\t\trenderFooterAppender,\n\t\tparentWidth,\n\t\thorizontal,\n\t\tcontentResizeMode,\n\t\tcontentStyle,\n\t\tonAddBlock,\n\t\tonDeleteBlock,\n\t\tmarginVertical,\n\t\tmarginHorizontal,\n\t\thorizontalAlignment,\n\t\tfilterInnerBlocks,\n\t\tblockWidth,\n\t\tlayout = defaultLayout,\n\t\tgridProperties,\n\t} = props;\n\n\tconst context = useBlockContext( clientId );\n\n\tconst { nestingLevel, parentLock } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParents, getTemplateLock, getBlockRootClientId } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tnestingLevel: getBlockParents( clientId )?.length,\n\t\t\t\tparentLock: getTemplateLock( getBlockRootClientId( clientId ) ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tuseNestedSettingsUpdate(\n\t\tclientId,\n\t\tparentLock,\n\t\tallowedBlocks,\n\t\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplateLock,\n\t\tcaptureToolbars,\n\t\torientation,\n\t\tlayout\n\t);\n\n\tuseInnerBlockTemplateSync(\n\t\tclientId,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection\n\t);\n\n\tif ( nestingLevel >= MAX_NESTING_DEPTH ) {\n\t\treturn <WarningMaxDepthExceeded clientId={ clientId } />;\n\t}\n\n\treturn (\n\t\t<LayoutProvider value={ layout }>\n\t\t\t<BlockContextProvider value={ context }>\n\t\t\t\t<BlockList\n\t\t\t\t\tmarginVertical={ marginVertical }\n\t\t\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\t\t\trootClientId={ clientId }\n\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\trenderFooterAppender={ renderFooterAppender }\n\t\t\t\t\twithFooter={ false }\n\t\t\t\t\torientation={ orientation }\n\t\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\t\thorizontalAlignment={ horizontalAlignment }\n\t\t\t\t\thorizontal={ horizontal }\n\t\t\t\t\tcontentResizeMode={ contentResizeMode }\n\t\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\t\tonAddBlock={ onAddBlock }\n\t\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\t\tfilterInnerBlocks={ filterInnerBlocks }\n\t\t\t\t\tgridProperties={ gridProperties }\n\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t/>\n\t\t\t</BlockContextProvider>\n\t\t</LayoutProvider>\n\t);\n}\n\n/**\n * The controlled inner blocks component wraps the uncontrolled inner blocks\n * component with the blockSync hook. This keeps the innerBlocks of the block in\n * the block-editor store in sync with the blocks of the controlling entity. An\n * example of an inner block controller is a template part block, which provides\n * its own blocks from the template part entity data source.\n *\n * @param {Object} props The component props.\n */\nfunction ControlledInnerBlocks( props ) {\n\tuseBlockSync( props );\n\treturn <UncontrolledInnerBlocks { ...props } />;\n}\n\n/**\n * Wrapped InnerBlocks component which detects whether to use the controlled or\n * uncontrolled variations of the InnerBlocks component. This is the component\n * which should be used throughout the application.\n *\n * @param {Object} props The component props.\n */\nconst InnerBlocks = ( props ) => {\n\tconst { clientId } = useBlockEditContext();\n\n\tconst allProps = {\n\t\tclientId,\n\t\t...props,\n\t};\n\n\t// Detects if the InnerBlocks should be controlled by an incoming value.\n\treturn props.value && props.onChange ? (\n\t\t<ControlledInnerBlocks { ...allProps } />\n\t) : (\n\t\t<UncontrolledInnerBlocks { ...allProps } />\n\t);\n};\n\n// Expose default appender placeholders as components.\nInnerBlocks.DefaultBlockAppender = DefaultBlockAppender;\nInnerBlocks.ButtonBlockAppender = ButtonBlockAppender;\n\nuseInnerBlocksProps.save = getInnerBlocksProps;\n\nInnerBlocks.Content = () => useInnerBlocksProps.save().children;\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport default InnerBlocks;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,oBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,wBAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,0BAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,gBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AAKA,IAAAS,UAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAP,sBAAA,CAAAJ,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,wBAAA,GAAAX,sBAAA,CAAAJ,OAAA;AACA,IAAAgB,UAAA,GAAAhB,OAAA;AAAgD,IAAAiB,WAAA,GAAAjB,OAAA;AA1BhD;AACA;AACA;;AAKA;AACA;AACA;;AAOA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASkB,mBAAmBA,CAAEC,KAAK,GAAG,CAAC,CAAC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1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_data","_store","useBlockContext","clientId","useSelect","select","block","blockEditorStore","getBlock","undefined","blockType","blocksStore","getBlockType","name","Object","keys","providesContext","length","fromEntries","entries","map","contextName","attributeName","attributes"],"sources":["@wordpress/block-editor/src/components/inner-blocks/use-block-context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Returns a context object for a given block.\n *\n * @param {string} clientId The block client ID.\n *\n * @return {Record<string,*>} Context value.\n */\nexport default function useBlockContext( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst block = select( blockEditorStore ).getBlock( clientId );\n\t\t\tif ( ! block ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst blockType = select( blocksStore ).getBlockType( block.name );\n\t\t\tif ( ! blockType ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif ( Object.keys( blockType.providesContext ).length === 0 ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn Object.fromEntries(\n\t\t\t\tObject.entries( blockType.providesContext ).map(\n\t\t\t\t\t( [ contextName, attributeName ] ) => [\n\t\t\t\t\t\tcontextName,\n\t\t\t\t\t\tblock.attributes[ attributeName ],\n\t\t\t\t\t]\n\t\t\t\t)\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_store","useBlockContext","clientId","useSelect","select","block","blockEditorStore","getBlock","undefined","blockType","blocksStore","getBlockType","name","Object","keys","providesContext","length","fromEntries","entries","map","contextName","attributeName","attributes"],"sources":["@wordpress/block-editor/src/components/inner-blocks/use-block-context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Returns a context object for a given block.\n *\n * @param {string} clientId The block client ID.\n *\n * @return {Record<string,*>} Context value.\n */\nexport default function useBlockContext( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst block = select( blockEditorStore ).getBlock( clientId );\n\t\t\tif ( ! block ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst blockType = select( blocksStore ).getBlockType( block.name );\n\t\t\tif ( ! blockType ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif ( Object.keys( blockType.providesContext ).length === 0 ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn Object.fromEntries(\n\t\t\t\tObject.entries( blockType.providesContext ).map(\n\t\t\t\t\t( [ contextName, attributeName ] ) => [\n\t\t\t\t\t\tcontextName,\n\t\t\t\t\t\tblock.attributes[ attributeName ],\n\t\t\t\t\t]\n\t\t\t\t)\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,eAAeA,CAAEC,QAAQ,EAAG;EACnD,OAAO,IAAAC,eAAS,EACbC,MAAM,IAAM;IACb,MAAMC,KAAK,GAAGD,MAAM,CAAEE,YAAiB,CAAC,CAACC,QAAQ,CAAEL,QAAS,CAAC;IAC7D,IAAK,CAAEG,KAAK,EAAG;MACd,OAAOG,SAAS;IACjB;IAEA,MAAMC,SAAS,GAAGL,MAAM,CAAEM,aAAY,CAAC,CAACC,YAAY,CAAEN,KAAK,CAACO,IAAK,CAAC;IAClE,IAAK,CAAEH,SAAS,EAAG;MAClB,OAAOD,SAAS;IACjB;IAEA,IAAKK,MAAM,CAACC,IAAI,CAAEL,SAAS,CAACM,eAAgB,CAAC,CAACC,MAAM,KAAK,CAAC,EAAG;MAC5D,OAAOR,SAAS;IACjB;IAEA,OAAOK,MAAM,CAACI,WAAW,CACxBJ,MAAM,CAACK,OAAO,CAAET,SAAS,CAACM,eAAgB,CAAC,CAACI,GAAG,CAC9C,CAAE,CAAEC,WAAW,EAAEC,aAAa,CAAE,KAAM,CACrCD,WAAW,EACXf,KAAK,CAACiB,UAAU,CAAED,aAAa,CAAE,CAEnC,CACD,CAAC;EACF,CAAC,EACD,CAAEnB,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_jsxRuntime","PatternCategoriesList","selectedCategory","patternCategories","onClickCategory","baseClassName","jsx","className","children","map","name","label","Button","__next40pxDefaultSize","isPressed","onClick","PatternsExplorerSearch","searchValue","setSearchValue","SearchControl","__nextHasNoMarginBottom","onChange","value","__","placeholder","PatternExplorerSidebar","jsxs","_default","exports","default"],"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":["_components","require","_i18n","_jsxRuntime","PatternCategoriesList","selectedCategory","patternCategories","onClickCategory","baseClassName","jsx","className","children","map","name","label","Button","__next40pxDefaultSize","isPressed","onClick","PatternsExplorerSearch","searchValue","setSearchValue","SearchControl","__nextHasNoMarginBottom","onChange","value","__","placeholder","PatternExplorerSidebar","jsxs","_default","exports","default"],"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":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,SAASG,qBAAqBA,CAAE;EAC/BC,gBAAgB;EAChBC,iBAAiB;EACjBC;AACD,CAAC,EAAG;EACH,MAAMC,aAAa,GAAG,+CAA+C;EACrE,oBACC,IAAAL,WAAA,CAAAM,GAAA;IAAKC,SAAS,EAAG,GAAIF,aAAa,mBAAsB;IAAAG,QAAA,EACrDL,iBAAiB,CAACM,GAAG,CAAE,CAAE;MAAEC,IAAI;MAAEC;IAAM,CAAC,KAAM;MAC/C,oBACC,IAAAX,WAAA,CAAAM,GAAA,EAACT,WAAA,CAAAe,MAAM;QACNC,qBAAqB;QAErBF,KAAK,EAAGA,KAAO;QACfJ,SAAS,EAAG,GAAIF,aAAa,yBAA4B;QACzDS,SAAS,EAAGZ,gBAAgB,KAAKQ,IAAM;QACvCK,OAAO,EAAGA,CAAA,KAAM;UACfX,eAAe,CAAEM,IAAK,CAAC;QACxB,CAAG;QAAAF,QAAA,EAEDG;MAAK,GARDD,IASC,CAAC;IAEX,CAAE;EAAC,CACC,CAAC;AAER;AAEA,SAASM,sBAAsBA,CAAE;EAAEC,WAAW;EAAEC;AAAe,CAAC,EAAG;EAClE,MAAMb,aAAa,GAAG,8CAA8C;EACpE,oBACC,IAAAL,WAAA,CAAAM,GAAA;IAAKC,SAAS,EAAGF,aAAe;IAAAG,QAAA,eAC/B,IAAAR,WAAA,CAAAM,GAAA,EAACT,WAAA,CAAAsB,aAAa;MACbC,uBAAuB;MACvBC,QAAQ,EAAGH,cAAgB;MAC3BI,KAAK,EAAGL,WAAa;MACrBN,KAAK,EAAG,IAAAY,QAAE,EAAE,QAAS,CAAG;MACxBC,WAAW,EAAG,IAAAD,QAAE,EAAE,QAAS;IAAG,CAC9B;EAAC,CACE,CAAC;AAER;AAEA,SAASE,sBAAsBA,CAAE;EAChCvB,gBAAgB;EAChBC,iBAAiB;EACjBC,eAAe;EACfa,WAAW;EACXC;AACD,CAAC,EAAG;EACH,MAAMb,aAAa,GAAG,+CAA+C;EACrE,oBACC,IAAAL,WAAA,CAAA0B,IAAA;IAAKnB,SAAS,EAAGF,aAAe;IAAAG,QAAA,gBAC/B,IAAAR,WAAA,CAAAM,GAAA,EAACU,sBAAsB;MACtBC,WAAW,EAAGA,WAAa;MAC3BC,cAAc,EAAGA;IAAgB,CACjC,CAAC,EACA,CAAED,WAAW,iBACd,IAAAjB,WAAA,CAAAM,GAAA,EAACL,qBAAqB;MACrBC,gBAAgB,EAAGA,gBAAkB;MACrCC,iBAAiB,EAAGA,iBAAmB;MACvCC,eAAe,EAAGA;IAAiB,CACnC,CACD;EAAA,CACG,CAAC;AAER;AAAC,IAAAuB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcJ,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_compose","_components","_a11y","_blockPatternsList","_interopRequireDefault","_useInsertionPoint","_usePatternsState","_inserterListbox","_searchItems","_blockPatternsPaging","_usePatternsPaging","_utils","_jsxRuntime","PatternsListHeader","filterValue","filteredBlockPatternsLength","jsx","__experimentalHeading","level","lineHeight","className","children","sprintf","_n","PatternList","searchValue","selectedCategory","patternCategories","rootClientId","container","useRef","debouncedSpeak","useDebounce","speak","destinationRootClientId","onInsertBlocks","useInsertionPoint","shouldFocusBlock","patterns","onClickPattern","usePatternsState","registeredPatternCategories","useMemo","map","patternCategory","name","filteredBlockPatterns","filteredPatterns","filter","pattern","allPatternsCategory","myPatternsCategory","type","INSERTER_PATTERN_TYPES","user","_pattern$categories$s","hasKnownCategory","categories","some","category","includes","length","searchItems","useEffect","count","resultsFoundMessage","pagingProps","usePatternsPaging","previousSearchValue","setPreviousSearchValue","useState","changePage","hasItems","jsxs","ref","default","Fragment","blockPatterns","categoryPatterns","isDraggable","_default","exports"],"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":["_element","require","_i18n","_compose","_components","_a11y","_blockPatternsList","_interopRequireDefault","_useInsertionPoint","_usePatternsState","_inserterListbox","_searchItems","_blockPatternsPaging","_usePatternsPaging","_utils","_jsxRuntime","PatternsListHeader","filterValue","filteredBlockPatternsLength","jsx","__experimentalHeading","level","lineHeight","className","children","sprintf","_n","PatternList","searchValue","selectedCategory","patternCategories","rootClientId","container","useRef","debouncedSpeak","useDebounce","speak","destinationRootClientId","onInsertBlocks","useInsertionPoint","shouldFocusBlock","patterns","onClickPattern","usePatternsState","registeredPatternCategories","useMemo","map","patternCategory","name","filteredBlockPatterns","filteredPatterns","filter","pattern","allPatternsCategory","myPatternsCategory","type","INSERTER_PATTERN_TYPES","user","_pattern$categories$s","hasKnownCategory","categories","some","category","includes","length","searchItems","useEffect","count","resultsFoundMessage","pagingProps","usePatternsPaging","previousSearchValue","setPreviousSearchValue","useState","changePage","hasItems","jsxs","ref","default","Fragment","blockPatterns","categoryPatterns","isDraggable","_default","exports"],"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":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,kBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAA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AAnE,WAAA,CAAAI,GAAA,EAACP,oBAAA,CAAAkE,OAAmB;UAAA,GAAMT;QAAW,CAAI,CAAC;MAAA,CACzC;IACF,CACe,CAAC;EAAA,CACd,CAAC;AAER;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEcnD,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_components","_usePatternsState","_interopRequireDefault","_blockPatternsList","_usePatternsPaging","_patternsFilter","_usePatternCategories","_utils","_jsxRuntime","noop","PatternCategoryPreviews","rootClientId","onInsert","onHover","category","showTitlesAsTooltip","allPatterns","onClickPattern","usePatternsState","name","patternSyncFilter","setPatternSyncFilter","useState","patternSourceFilter","setPatternSourceFilter","availableCategories","usePatternCategories","scrollContainerRef","useRef","currentCategoryPatterns","useMemo","filter","pattern","isPatternFiltered","allPatternsCategory","myPatternsCategory","type","INSERTER_PATTERN_TYPES","user","starterPatternsCategory","blockTypes","includes","categories","some","catName","c","pagingProps","usePatternsPaging","changePage","useEffect","onSetPatternSyncFilter","useCallback","value","onSetPatternSourceFilter","jsxs","Fragment","children","__experimentalVStack","spacing","className","__experimentalHStack","jsx","FlexBlock","__experimentalHeading","size","level","as","label","PatternsFilter","length","__experimentalText","variant","__","default","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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OAAO,EAAC,OAAO;QACfZ,SAAS,EAAC,qDAAqD;QAAAH,QAAA,EAE7D,IAAAgB,QAAE,EAAE,kBAAmB;MAAC,CACrB,CACN;IAAA,CACM,CAAC,EACP3C,uBAAuB,CAACwC,MAAM,GAAG,CAAC,iBACnC,IAAA7D,WAAA,CAAA8C,IAAA,EAAA9C,WAAA,CAAA+C,QAAA;MAAAC,QAAA,gBACC,IAAAhD,WAAA,CAAAqD,GAAA,EAAC7D,WAAA,CAAAsE,kBAAI;QACJN,IAAI,EAAC,IAAI;QACTE,EAAE,EAAC,GAAG;QACNP,SAAS,EAAC,kCAAkC;QAAAH,QAAA,EAE1C,IAAAgB,QAAE,EAAE,yCAA0C;MAAC,CAC5C,CAAC,eACP,IAAAhE,WAAA,CAAAqD,GAAA,EAAC1D,kBAAA,CAAAsE,OAAiB;QACjBC,GAAG,EAAG/C,kBAAoB;QAC1BgD,aAAa,EAAG7B,WAAW,CAAC8B,gBAAkB;QAC9C3D,cAAc,EAAGA,cAAgB;QACjCJ,OAAO,EAAGA,OAAS;QACnBsD,KAAK,EAAGrD,QAAQ,CAACqD,KAAO;QACxBU,WAAW,EAAC,UAAU;QACtB/D,QAAQ,EAAGA,QAAQ,CAACK,IAAM;QAC1B2D,WAAW;QACX/D,mBAAmB,EAAGA,mBAAqB;QAC3CgE,aAAa,EAAGxD,mBAAqB;QACrCuB,WAAW,EAAGA;MAAa,CAC3B,CAAC;IAAA,CACD,CACF;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_usePatternsState","_interopRequireDefault","_blockPatternsList","_usePatternsPaging","_patternsFilter","_usePatternCategories","_utils","_jsxRuntime","noop","PatternCategoryPreviews","rootClientId","onInsert","onHover","category","showTitlesAsTooltip","allPatterns","onClickPattern","usePatternsState","name","patternSyncFilter","setPatternSyncFilter","useState","patternSourceFilter","setPatternSourceFilter","availableCategories","usePatternCategories","scrollContainerRef","useRef","currentCategoryPatterns","useMemo","filter","pattern","isPatternFiltered","allPatternsCategory","myPatternsCategory","type","INSERTER_PATTERN_TYPES","user","starterPatternsCategory","blockTypes","includes","categories","some","catName","c","pagingProps","usePatternsPaging","changePage","useEffect","onSetPatternSyncFilter","useCallback","value","onSetPatternSourceFilter","jsxs","Fragment","children","__experimentalVStack","spacing","className","__experimentalHStack","jsx","FlexBlock","__experimentalHeading","size","level","as","label","PatternsFilter","length","__experimentalText","variant","__","default","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":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAWA,IAAAG,iBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,kBAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAMiB,IAAAU,WAAA,GAAAV,OAAA;AAlCjB;AACA;AACA;;AAkBA;AACA;AACA;;AAcA,MAAMW,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEd,SAASC,uBAAuBA,CAAE;EACxCC,YAAY;EACZC,QAAQ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BC,GAAG,EAAG/C,kBAAoB;QAC1BgD,aAAa,EAAG7B,WAAW,CAAC8B,gBAAkB;QAC9C3D,cAAc,EAAGA,cAAgB;QACjCJ,OAAO,EAAGA,OAAS;QACnBsD,KAAK,EAAGrD,QAAQ,CAACqD,KAAO;QACxBU,WAAW,EAAC,UAAU;QACtB/D,QAAQ,EAAGA,QAAQ,CAACK,IAAM;QAC1B2D,WAAW;QACX/D,mBAAmB,EAAGA,mBAAqB;QAC3CgE,aAAa,EAAGxD,mBAAqB;QACrCuB,WAAW,EAAGA;MAAa,CAC3B,CAAC;IAAA,CACD,CACF;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_a11y","_usePatternsState","_interopRequireDefault","_utils","hasRegisteredCategory","pattern","allCategories","categories","length","some","cat","category","name","usePatternCategories","rootClientId","sourceFilter","patterns","usePatternsState","undefined","filteredPatterns","useMemo","filter","isPatternFiltered","populatedCategories","includes","sort","a","b","label","localeCompare","find","push","_x","blockTypes","unshift","starterPatternsCategory","type","INSERTER_PATTERN_TYPES","user","myPatternsCategory","allPatternsCategory","speak","sprintf","_n"],"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":["_element","require","_i18n","_a11y","_usePatternsState","_interopRequireDefault","_utils","hasRegisteredCategory","pattern","allCategories","categories","length","some","cat","category","name","usePatternCategories","rootClientId","sourceFilter","patterns","usePatternsState","undefined","filteredPatterns","useMemo","filter","isPatternFiltered","populatedCategories","includes","sort","a","b","label","localeCompare","find","push","_x","blockTypes","unshift","starterPatternsCategory","type","INSERTER_PATTERN_TYPES","user","myPatternsCategory","allPatternsCategory","speak","sprintf","_n"],"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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B,CAAG,CAAC;EAExC,OAAOI,mBAAmB;AAC3B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_element","_compose","_blockTypesList","_interopRequireDefault","_panel","_useBlockTypesState","_inserterListbox","_sorting","_noResults","_jsxRuntime","getBlockNamespace","item","name","split","MAX_SUGGESTED_ITEMS","EMPTY_ARRAY","BlockTypesTabPanel","items","collections","categories","onSelectItem","onHover","showMostUsedBlocks","className","suggestedItems","useMemo","orderBy","slice","uncategorizedItems","filter","category","itemsPerCollection","result","Object","keys","forEach","namespace","length","useEffect","currentlyRenderedCategories","useAsyncList","didRenderAllCategories","collectionEntries","entries","currentlyRenderedCollections","jsxs","children","jsx","default","title","_x","onSelect","label","map","categoryItems","slug","icon","__","collection","collectionItems","BlockTypesTab","rootClientId","onInsert","ref","useBlockTypesState","itemsForCurrentRoot","itemsRemaining","isAllowedInCurrentRoot","push","Fragment","_default","exports","forwardRef"],"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":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,eAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,mBAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,gBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAL,sBAAA,CAAAJ,OAAA;AAA6C,IAAAU,WAAA,GAAAV,OAAA;AAf7C;AACA;AACA;;AAKA;AACA;AACA;;AAQA,MAAMW,iBAAiB,GAAKC,IAAI,IAAMA,IAAI,CAACC,IAAI,CAACC,KAAK,CAAE,GAAI,CAAC,CAAE,CAAC,CAAE;AAEjE,MAAMC,mBAAmB,GAAG,CAAC;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAG,EAAE;AAEf,SAASC,kBAAkBA,CAAE;EACnCC,KAAK;EACLC,WAAW;EACXC,UAAU;EACVC,YAAY;EACZC,OAAO;EACPC,kBAAkB;EAClBC;AACD,C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BC,OAAO,EAAGA,OAAS;UACnBC,kBAAkB,EAAGA,kBAAoB;UACzCC,SAAS,EAAC;QAAuD,CACjE;MAAC,CACD,CACF,eACD,IAAAd,WAAA,CAAAsC,GAAA,EAAC/B,kBAAkB;QAClBC,KAAK,EAAGiD,cAAgB;QACxB/C,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;AAAC,IAAA+C,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEc,IAAAwB,mBAAU,EAAEZ,aAAc,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_element","_compose","_blockTypesList","_interopRequireDefault","_panel","_useBlockTypesState","_inserterListbox","_sorting","_noResults","_jsxRuntime","getBlockNamespace","item","name","split","MAX_SUGGESTED_ITEMS","EMPTY_ARRAY","BlockTypesTabPanel","items","collections","categories","onSelectItem","onHover","showMostUsedBlocks","className","suggestedItems","useMemo","orderBy","slice","uncategorizedItems","filter","category","itemsPerCollection","result","Object","keys","forEach","namespace","length","useEffect","currentlyRenderedCategories","useAsyncList","didRenderAllCategories","collectionEntries","entries","currentlyRenderedCollections","jsxs","children","jsx","default","title","_x","onSelect","label","map","categoryItems","slug","icon","__","collection","collectionItems","BlockTypesTab","rootClientId","onInsert","ref","useBlockTypesState","itemsForCurrentRoot","itemsRemaining","isAllowedInCurrentRoot","push","Fragment","_default","exports","forwardRef"],"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":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,eAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,mBAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,gBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,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AAAsC,GAAA,EAACzC,gBAAA,CAAA0C,OAAe;IAAAF,QAAA,eACf,IAAArC,WAAA,CAAAoC,IAAA;MAAKkB,GAAG,EAAGA,GAAK;MAAAjB,QAAA,GACb,CAAC,CAAEmB,mBAAmB,CAAC5B,MAAM,iBAC9B,IAAA5B,WAAA,CAAAsC,GAAA,EAAAtC,WAAA,CAAA4D,QAAA;QAAAvB,QAAA,eACC,IAAArC,WAAA,CAAAsC,GAAA,EAAC/B,kBAAkB;UAClBC,KAAK,EAAGgD,mBAAqB;UAC7B9C,UAAU,EAAGA,UAAY;UACzBD,WAAW,EAAGA,WAAa;UAC3BE,YAAY,EAAGA,YAAc;UAC7BC,OAAO,EAAGA,OAAS;UACnBC,kBAAkB,EAAGA,kBAAoB;UACzCC,SAAS,EAAC;QAAuD,CACjE;MAAC,CACD,CACF,eACD,IAAAd,WAAA,CAAAsC,GAAA,EAAC/B,kBAAkB;QAClBC,KAAK,EAAGiD,cAAgB;QACxB/C,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;AAAC,IAAA+C,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEc,IAAAwB,mBAAU,EAAEZ,aAAc,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_blockTypesList","_interopRequireDefault","_useClipboardBlock","_useBlockTypeImpressions","_utils","_useBlockTypesState","_jsxRuntime","getBlockNamespace","item","name","split","BlockTypesTab","onSelect","rootClientId","listProps","rawBlockTypes","collections","useBlockTypesState","clipboardBlock","useClipboardBlock","filteredBlockTypes","filterInserterItems","blockTypes","items","trackBlockTypeSelected","useBlockTypeImpressions","handleSelect","args","collectionSections","useMemo","result","Object","keys","forEach","namespace","data","filter","length","push","createInserterSection","key","metadata","icon","title","sections","jsx","default","label","__","_default","exports"],"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":["_element","require","_i18n","_blockTypesList","_interopRequireDefault","_useClipboardBlock","_useBlockTypeImpressions","_utils","_useBlockTypesState","_jsxRuntime","getBlockNamespace","item","name","split","BlockTypesTab","onSelect","rootClientId","listProps","rawBlockTypes","collections","useBlockTypesState","clipboardBlock","useClipboardBlock","filteredBlockTypes","filterInserterItems","blockTypes","items","trackBlockTypeSelected","useBlockTypeImpressions","handleSelect","args","collectionSections","useMemo","result","Object","keys","forEach","namespace","data","filter","length","push","createInserterSection","key","metadata","icon","title","sections","jsx","default","label","__","_default","exports"],"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":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,wBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,mBAAA,GAAAJ,s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G,EAAE,cAAeN,SAAS,EAAG;UAChCO,QAAQ,EAAE;YACTC,IAAI,EAAE1B,WAAW,CAAEkB,SAAS,CAAE,CAACQ,IAAI;YACnCC,KAAK,EAAE3B,WAAW,CAAEkB,SAAS,CAAE,CAACS;UACjC,CAAC;UACDpB,KAAK,EAAEY;QACR,CAAE,CACH,CAAC;MACF;IACD,CAAE,CAAC;IAEH,OAAOL,MAAM;EACd,CAAC,EAAE,CAAEP,KAAK,EAAEP,WAAW,CAAG,CAAC;EAE3B,MAAM4B,QAAQ,GAAG,CAChB,IAAAL,4BAAqB,EAAE;IAAEC,GAAG,EAAE,SAAS;IAAEjB;EAAM,CAAE,CAAC,EAClD,GAAGK,kBAAkB,CACrB;EAED,oBACC,IAAAtB,WAAA,CAAAuC,GAAA,EAAC7C,eAAA,CAAA8C,OAAc;IACdrC,IAAI,EAAC,QAAQ;IACbmC,QAAQ,EAAGA,QAAU;IACrBhC,QAAQ,EAAGc,YAAc;IACzBZ,SAAS,EAAGA,SAAW;IACvBiC,KAAK,EAAG,IAAAC,QAAE,EAAE,aAAc;EAAG,CAC7B,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAEcnC,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_components","_element","_lockUnlock","_jsxRuntime","Tabs","unlock","componentsPrivateApis","CategoryTabs","categories","selectedCategory","onSelectCategory","children","ANIMATION_DURATION","disableMotion","useReducedMotion","defaultTransition","type","duration","ease","previousSelectedCategory","usePrevious","selectedTabId","name","activeTabId","setActiveId","useState","firstTabId","jsxs","selectOnMove","orientation","onSelect","categoryId","find","category","onActiveTabIdChange","jsx","TabList","className","map","Tab","tabId","undefined","label","TabPanel","focusable","__unstableMotion","div","initial","animate","variants","open","transform","transitionEnd","zIndex","closed","transition","_default","exports","default"],"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":["_compose","require","_components","_element","_lockUnlock","_jsxRuntime","Tabs","unlock","componentsPrivateApis","CategoryTabs","categories","selectedCategory","onSelectCategory","children","ANIMATION_DURATION","disableMotion","useReducedMotion","defaultTransition","type","duration","ease","previousSelectedCategory","usePrevious","selectedTabId","name","activeTabId","setActiveId","useState","firstTabId","jsxs","selectOnMove","orientation","onSelect","categoryId","find","category","onActiveTabIdChange","jsx","TabList","className","map","Tab","tabId","undefined","label","TabPanel","focusable","__unstableMotion","div","initial","animate","variants","open","transform","transitionEnd","zIndex","closed","transition","_default","exports","default"],"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\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,MAAM,EAAE;YACPH,SAAS,EAAE,qBAAqB;YAChCE,MAAM,EAAE;UACT;QACD,CAAG;QACHE,UAAU,EAAGxC,iBAAmB;QAAAJ,QAAA,EAE9BA;MAAQ,CACC;IAAC,GAzBPsB,QAAQ,CAACX,IA0BD,CACd,CAAC;EAAA,CACE,CAAC;AAET;AAAC,IAAAkC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnD,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_reactNativeBridge","_store","useBlockTypeImpressions","blockTypes","blockTypeImpressions","useSelect","select","getSettings","getBlockEditorSettings","blockEditorStore","impressions","updateSettings","useDispatch","items","map","blockType","isNew","name","trackBlockTypeSelected","updatedBlockTypeImpressions","setBlockTypeImpressions","_default","exports","default"],"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":["_data","require","_reactNativeBridge","_store","useBlockTypeImpressions","blockTypes","blockTypeImpressions","useSelect","select","getSettings","getBlockEditorSettings","blockEditorStore","impressions","updateSettings","useDispatch","items","map","blockType","isNew","name","trackBlockTypeSelected","updatedBlockTypeImpressions","setBlockTypeImpressions","_default","exports","default"],"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":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASG,uBAAuBA,CAAEC,UAAU,EAAG;EAC9C,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzD,MAAM;MAAEC,WAAW,EAAEC;IAAuB,CAAC,GAC5CF,MAAM,CAAEG,YAAiB,CAAC;IAC3B,MAAM;MAAEC;IAAY,CAAC,GAAGF,sBAAsB,CAAC,CAAC;IAEhD,OAAO;MACNJ,oBAAoB,EAAEM;IACvB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAe,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAiB,CAAC;EAE1D,MAAMI,KAAK,GAAGV,UAAU,CAACW,GAAG,CAAIC,SAAS,KAAQ;IAChD,GAAGA,SAAS;IACZC,KAAK,EAAEZ,oBAAoB,CAAEW,SAAS,CAACE,IAAI,CAAE,GAAG;EACjD,CAAC,CAAG,CAAC;EACL,MAAMC,sBAAsB,GAAGA,CAAE;IAAED;EAAK,CAAC,KAAM;IAC9C,IAAKb,oBAAoB,CAAEa,IAAI,CAAE,GAAG,CAAC,EAAG;MACvC,MAAME,2BAA2B,GAAG;QACnC,GAAGf,oBAAoB;QACvB,CAAEa,IAAI,GAAI;MACX,CAAC;MACD;MACAN,cAAc,CAAE;QACfD,WAAW,EAAES;MACd,CAAE,CAAC;;MAEH;MACA,IAAAC,0CAAuB,EAAED,2BAA4B,CAAC;IACvD;EACD,CAAC;EAED,OAAO;IAAEN,KAAK;IAAEK;EAAuB,CAAC;AACzC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrB,uBAAuB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_blocks","_data","_i18n","_notices","_store","_lockUnlock","_utils","_utils2","usePatternsState","onInsert","rootClientId","selectedCategory","isQuick","options","useMemo","isFiltered","patternCategories","patterns","userPatternCategories","useSelect","select","getSettings","__experimentalGetAllowedPatterns","unlock","blockEditorStore","__experimentalUserPatternCategories","__experimentalBlockPatternCategories","getClosestAllowedInsertionPointForPattern","allCategories","categories","forEach","userCategory","find","existingCategory","name","push","createSuccessNotice","useDispatch","noticesStore","onClickPattern","useCallback","pattern","blocks","destinationRootClientId","patternBlocks","type","INSERTER_PATTERN_TYPES","user","syncStatus","createBlock","ref","id","map","block","clonedBlock","cloneBlock","attributes","metadata","includes","sprintf","__","title","_default","exports","default"],"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":["_element","require","_blocks","_data","_i18n","_notices","_store","_lockUnlock","_utils","_utils2","usePatternsState","onInsert","rootClientId","selectedCategory","isQuick","options","useMemo","isFiltered","patternCategories","patterns","userPatternCategories","useSelect","select","getSettings","__experimentalGetAllowedPatterns","unlock","blockEditorStore","__experimentalUserPatternCategories","__experimentalBlockPatternCategories","getClosestAllowedInsertionPointForPattern","allCategories","categories","forEach","userCategory","find","existingCategory","name","push","createSuccessNotice","useDispatch","noticesStore","onClickPattern","useCallback","pattern","blocks","destinationRootClientId","patternBlocks","type","INSERTER_PATTERN_TYPES","user","syncStatus","createBlock","ref","id","map","block","clonedBlock","cloneBlock","attributes","metadata","includes","sprintf","__","title","_default","exports","default"],"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":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAfA;AACA;AACA;;AAOA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMS,gBAAgB,GAAGA,CACxBC,QAAQ,EACRC,YAAY,EACZC,gBAAgB,EAChBC,OAAO,KACH;EACJ,MAAMC,OAAO,GAAG,IAAAC,gBAAO,EACtB,OAAQ;IAAE,CAAEC,kBAAU,GAAI,CAAC,CAAEH;EAAQ,CAAC,CAAE,EACxC,CAAEA,OAAO,CACV,CAAC;EACD,MAAM;IAAEI,iBAAiB;IAAEC,QAAQ;IAAEC;EAAsB,CAAC,GAAG,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