@wordpress/block-editor 12.14.0 → 12.16.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/README.md +10 -5
- package/build/components/block-canvas/index.js +22 -6
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-card/index.js +1 -1
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-controls/hook.js +3 -23
- package/build/components/block-controls/hook.js.map +1 -1
- package/build/components/block-edit/context.js +5 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +18 -9
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +3 -4
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-list/block.js +28 -9
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +16 -5
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +61 -18
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-parent-selector/index.js +1 -1
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +25 -16
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-list/index.js +37 -20
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +2 -9
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-rename/index.js +28 -0
- package/build/components/block-rename/index.js.map +1 -0
- package/build/components/block-rename/is-empty-string.js +10 -0
- package/build/components/block-rename/is-empty-string.js.map +1 -0
- package/build/components/block-rename/modal.js +90 -0
- package/build/components/block-rename/modal.js.map +1 -0
- package/build/components/block-rename/rename-control.js +74 -0
- package/build/components/block-rename/rename-control.js.map +1 -0
- package/build/components/block-rename/use-block-rename.js +17 -0
- package/build/components/block-rename/use-block-rename.js.map +1 -0
- package/build/components/block-settings/container.native.js +6 -4
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +33 -20
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +7 -0
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +1 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +3 -2
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/index.js +89 -27
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build/components/block-tools/block-toolbar-popover.js +86 -0
- package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build/components/block-tools/index.js +27 -24
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-types-list/index.js +6 -2
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +4 -3
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +2 -1
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/colors-gradients/control.js +28 -17
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/date-format-picker/index.js +8 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/duotone-control/index.js +1 -4
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +1 -1
- package/build/components/global-styles/advanced-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +22 -20
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +9 -3
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +20 -31
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/image-link-destinations/index.native.js +118 -0
- package/build/components/image-link-destinations/index.native.js.map +1 -0
- package/build/components/image-size-control/index.js +0 -5
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.native.js +8 -0
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +3 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +29 -31
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -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 +1 -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 +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +3 -4
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +2 -2
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/menu.js +14 -7
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +2 -2
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter-button/index.native.js +98 -0
- package/build/components/inserter-button/index.native.js.map +1 -0
- package/build/components/inserter-button/sparkles.js +23 -0
- package/build/components/inserter-button/sparkles.js.map +1 -0
- package/build/components/inserter-draggable-blocks/index.js +8 -4
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-listbox/index.js +11 -6
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +24 -23
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inserter-listbox/row.js +5 -5
- package/build/components/inserter-listbox/row.js.map +1 -1
- package/build/components/inspector-controls/fill.js +3 -3
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +3 -3
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +2 -2
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/preview-options/index.js +6 -60
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/rich-text/content.js +26 -23
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +2 -1
- package/build/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build/components/rich-text/index.js +2 -30
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +10 -17
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js +22 -24
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +41 -37
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +35 -2
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/with-deprecations.js +50 -0
- package/build/components/rich-text/with-deprecations.js.map +1 -0
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +74 -9
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +2 -1
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +1 -1
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +4 -1
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-settings/index.js +16 -2
- package/build/components/use-settings/index.js.map +1 -1
- package/build/hooks/align.js +20 -68
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +11 -1
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +13 -29
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +28 -31
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +24 -32
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-renaming.js +38 -0
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/border.js +58 -80
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +76 -89
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +29 -29
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +12 -29
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-fields.js +64 -73
- package/build/hooks/custom-fields.js.map +1 -1
- package/build/hooks/dimensions.js +21 -17
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +31 -61
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +16 -25
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +51 -119
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +25 -15
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +10 -3
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout-child.js +68 -0
- package/build/hooks/layout-child.js.map +1 -0
- package/build/hooks/layout.js +29 -108
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/padding.js +2 -2
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +40 -62
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +51 -88
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +34 -14
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +154 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +4 -3
- package/build/layouts/constrained.js.map +1 -1
- package/build/private-apis.js +0 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/private-actions.js +8 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +34 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +8 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +10 -58
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +66 -0
- package/build/store/utils.js.map +1 -0
- package/build/utils/object.js +21 -61
- package/build/utils/object.js.map +1 -1
- package/build/utils/selection.js +9 -1
- package/build/utils/selection.js.map +1 -1
- package/build/utils/transform-styles/index.js +26 -6
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-canvas/index.js +23 -7
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +1 -1
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-controls/hook.js +4 -24
- package/build-module/components/block-controls/hook.js.map +1 -1
- package/build-module/components/block-edit/context.js +2 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +19 -10
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-info-slot-fill/index.js +3 -3
- package/build-module/components/block-info-slot-fill/index.js.map +1 -1
- package/build-module/components/block-list/block.js +29 -10
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +16 -5
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +62 -19
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +1 -1
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +24 -15
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +37 -20
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -10
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/index.js +4 -0
- package/build-module/components/block-rename/index.js.map +1 -0
- package/build-module/components/block-rename/is-empty-string.js +4 -0
- package/build-module/components/block-rename/is-empty-string.js.map +1 -0
- package/build-module/components/block-rename/modal.js +82 -0
- package/build-module/components/block-rename/modal.js.map +1 -0
- package/build-module/components/block-rename/rename-control.js +66 -0
- package/build-module/components/block-rename/rename-control.js.map +1 -0
- package/build-module/components/block-rename/use-block-rename.js +10 -0
- package/build-module/components/block-rename/use-block-rename.js.map +1 -0
- package/build-module/components/block-settings/container.native.js +4 -2
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +34 -21
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +7 -0
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +3 -2
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +88 -25
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build-module/components/block-tools/block-toolbar-popover.js +76 -0
- package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build-module/components/block-tools/index.js +27 -24
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-types-list/index.js +6 -2
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +2 -1
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +2 -1
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +29 -18
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +8 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/duotone-control/index.js +1 -4
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +1 -1
- package/build-module/components/global-styles/advanced-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +23 -21
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +10 -4
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +20 -31
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/image-link-destinations/index.native.js +109 -0
- package/build-module/components/image-link-destinations/index.native.js.map +1 -0
- package/build-module/components/image-size-control/index.js +0 -5
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -0
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +3 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +30 -32
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- 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 +4 -4
- 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 +2 -2
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +3 -4
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +14 -7
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +2 -2
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter-button/index.native.js +89 -0
- package/build-module/components/inserter-button/index.native.js.map +1 -0
- package/build-module/components/inserter-button/sparkles.js +15 -0
- package/build-module/components/inserter-button/sparkles.js.map +1 -0
- package/build-module/components/inserter-draggable-blocks/index.js +9 -5
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inserter-listbox/index.js +13 -8
- package/build-module/components/inserter-listbox/index.js.map +1 -1
- package/build-module/components/inserter-listbox/item.js +25 -23
- package/build-module/components/inserter-listbox/item.js.map +1 -1
- package/build-module/components/inserter-listbox/row.js +6 -5
- package/build-module/components/inserter-listbox/row.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +3 -3
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +3 -3
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +2 -2
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/preview-options/index.js +6 -60
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/rich-text/content.js +25 -21
- package/build-module/components/rich-text/content.js.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +2 -1
- package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build-module/components/rich-text/index.js +4 -32
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +11 -19
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
- 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 +41 -37
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +36 -3
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/with-deprecations.js +42 -0
- package/build-module/components/rich-text/with-deprecations.js.map +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +73 -9
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +2 -1
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +1 -1
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +4 -1
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +15 -3
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/hooks/align.js +19 -66
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -0
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/anchor.js +11 -26
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +26 -28
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +22 -30
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-renaming.js +36 -0
- package/build-module/hooks/block-renaming.js.map +1 -1
- package/build-module/hooks/border.js +57 -78
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +74 -86
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +27 -27
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +11 -27
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-fields.js +60 -74
- package/build-module/hooks/custom-fields.js.map +1 -1
- package/build-module/hooks/dimensions.js +21 -16
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +30 -61
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +14 -23
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +49 -119
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +18 -15
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +5 -3
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout-child.js +60 -0
- package/build-module/hooks/layout-child.js.map +1 -0
- package/build-module/hooks/layout.js +26 -105
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/padding.js +2 -2
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/position.js +38 -59
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +51 -84
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +33 -12
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +149 -6
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +4 -3
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/private-apis.js +0 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-actions.js +7 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +33 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +8 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +3 -51
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +56 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-module/utils/object.js +21 -60
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/selection.js +9 -1
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +24 -7
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +6 -6
- package/build-style/content.css +6 -6
- package/build-style/style-rtl.css +123 -298
- package/build-style/style.css +123 -298
- package/package.json +31 -31
- package/src/components/block-canvas/index.js +31 -17
- package/src/components/block-caption/README.md +2 -2
- package/src/components/block-card/index.js +5 -3
- package/src/components/block-card/style.scss +7 -3
- package/src/components/block-controls/hook.js +8 -30
- package/src/components/block-controls/test/index.js +3 -3
- package/src/components/block-edit/context.js +3 -0
- package/src/components/block-edit/index.js +36 -10
- package/src/components/block-info-slot-fill/index.js +6 -3
- package/src/components/block-inspector/style.scss +0 -4
- package/src/components/block-list/block.js +39 -5
- package/src/components/block-list/block.native.js +20 -4
- package/src/components/block-list/use-block-props/index.js +74 -21
- package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
- package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
- package/src/components/block-parent-selector/index.js +1 -1
- package/src/components/block-pattern-setup/index.js +38 -22
- package/src/components/block-pattern-setup/setup-toolbar.js +2 -0
- package/src/components/block-pattern-setup/style.scss +4 -1
- package/src/components/block-patterns-list/README.md +4 -4
- package/src/components/block-patterns-list/index.js +61 -35
- package/src/components/block-patterns-list/style.scss +7 -0
- package/src/components/block-removal-warning-modal/index.js +7 -14
- package/src/components/block-rename/index.js +3 -0
- package/src/components/block-rename/is-empty-string.js +3 -0
- package/src/components/block-rename/modal.js +121 -0
- package/src/components/block-rename/rename-control.js +80 -0
- package/src/components/block-rename/use-block-rename.js +10 -0
- package/src/components/block-settings/container.native.js +3 -5
- package/src/components/block-settings-menu/block-settings-dropdown.js +38 -34
- package/src/components/block-settings-menu-controls/index.js +9 -0
- package/src/components/block-styles/index.js +1 -1
- package/src/components/block-styles/index.native.js +4 -2
- package/src/components/block-styles/style.scss +0 -11
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
- package/src/components/block-toolbar/block-toolbar-menu.native.js +1 -4
- package/src/components/block-toolbar/index.js +180 -95
- package/src/components/block-toolbar/style.scss +50 -66
- package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
- package/src/components/block-tools/block-toolbar-popover.js +90 -0
- package/src/components/block-tools/index.js +42 -29
- package/src/components/block-tools/style.scss +60 -172
- package/src/components/block-types-list/index.js +5 -4
- package/src/components/block-types-list/index.native.js +2 -1
- package/src/components/block-variation-picker/index.native.js +1 -1
- package/src/components/button-block-appender/content.scss +2 -2
- package/src/components/colors-gradients/control.js +49 -30
- package/src/components/colors-gradients/style.scss +0 -7
- package/src/components/date-format-picker/index.js +7 -0
- package/src/components/duotone-control/index.js +2 -5
- package/src/components/duotone-control/style.scss +1 -6
- package/src/components/editable-text/README.md +0 -36
- package/src/components/global-styles/advanced-panel.js +1 -1
- package/src/components/global-styles/color-panel.js +34 -25
- package/src/components/global-styles/filters-panel.js +8 -4
- package/src/components/global-styles/typography-panel.js +23 -43
- package/src/components/image-link-destinations/index.native.js +152 -0
- package/src/components/image-link-destinations/style.native.scss +16 -0
- package/src/components/image-size-control/index.js +0 -6
- package/src/components/index.native.js +1 -0
- package/src/components/inner-blocks/README.md +13 -2
- package/src/components/inner-blocks/index.js +6 -2
- package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +57 -33
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +5 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +7 -3
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +6 -1
- package/src/components/inserter/block-patterns-tab/utils.js +6 -4
- package/src/components/inserter/hooks/use-patterns-state.js +3 -1
- package/src/components/inserter/media-tab/media-panel.js +1 -1
- package/src/components/inserter/menu.js +16 -8
- package/src/components/inserter/preview-panel.js +2 -2
- package/src/components/inserter/style.scss +15 -17
- package/src/components/inserter-button/README.md +62 -0
- package/src/components/inserter-button/index.native.js +116 -0
- package/src/components/inserter-button/sparkles.js +15 -0
- package/src/components/inserter-button/style.native.scss +72 -0
- package/src/components/inserter-draggable-blocks/index.js +18 -5
- package/src/components/inserter-listbox/index.js +11 -7
- package/src/components/inserter-listbox/item.js +11 -12
- package/src/components/inserter-listbox/row.js +6 -12
- package/src/components/inspector-controls/fill.js +6 -3
- package/src/components/inspector-controls/fill.native.js +6 -3
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/use-list-view-expand-selected-item.js +7 -8
- package/src/components/navigable-toolbar/README.md +2 -0
- package/src/components/navigable-toolbar/index.js +2 -2
- package/src/components/plain-text/README.md +0 -28
- package/src/components/preview-options/index.js +6 -84
- package/src/components/rich-text/README.md +0 -58
- package/src/components/rich-text/content.js +27 -20
- package/src/components/rich-text/get-rich-text-values.js +6 -1
- package/src/components/rich-text/index.js +5 -46
- package/src/components/rich-text/index.native.js +9 -26
- package/src/components/rich-text/native/get-format-colors.native.js +33 -40
- package/src/components/rich-text/native/index.native.js +52 -50
- package/src/components/rich-text/use-input-rules.js +36 -3
- package/src/components/rich-text/with-deprecations.js +51 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/src/components/url-input/README.md +1 -74
- package/src/components/use-block-drop-zone/index.js +118 -15
- package/src/components/use-moving-animation/index.js +1 -1
- package/src/components/use-on-block-drop/index.js +2 -1
- package/src/components/use-resize-canvas/README.md +3 -3
- package/src/components/use-resize-canvas/index.js +4 -1
- package/src/components/use-settings/index.js +17 -3
- package/src/components/use-settings/test/index.js +1 -1
- package/src/hooks/align.js +15 -76
- package/src/hooks/align.native.js +1 -0
- package/src/hooks/anchor.js +13 -33
- package/src/hooks/background.js +28 -23
- package/src/hooks/block-hooks.js +22 -51
- package/src/hooks/block-renaming.js +33 -0
- package/src/hooks/border.js +67 -118
- package/src/hooks/color.js +100 -132
- package/src/hooks/content-lock-ui.js +110 -122
- package/src/hooks/custom-class-name.js +8 -40
- package/src/hooks/custom-fields.js +70 -94
- package/src/hooks/dimensions.js +20 -16
- package/src/hooks/duotone.js +70 -127
- package/src/hooks/font-family.js +10 -29
- package/src/hooks/font-size.js +66 -162
- package/src/hooks/index.js +42 -15
- package/src/hooks/index.native.js +6 -3
- package/src/hooks/layout-child.js +53 -0
- package/src/hooks/layout.js +25 -110
- package/src/hooks/padding.js +2 -2
- package/src/hooks/position.js +50 -90
- package/src/hooks/style.js +117 -187
- package/src/hooks/test/__snapshots__/align.native.js.snap +5 -5
- package/src/hooks/test/align.js +1 -178
- package/src/hooks/typography.js +20 -16
- package/src/hooks/utils.js +187 -6
- package/src/layouts/constrained.js +57 -50
- package/src/private-apis.js +0 -2
- package/src/store/private-actions.js +8 -0
- package/src/store/private-selectors.js +45 -0
- package/src/store/reducer.js +8 -0
- package/src/store/selectors.js +5 -67
- package/src/store/utils.js +74 -0
- package/src/style.scss +1 -3
- package/src/utils/object.js +18 -69
- package/src/utils/selection.js +9 -2
- package/src/utils/test/transform-styles.js +49 -0
- package/src/utils/transform-styles/index.js +39 -13
- package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
- package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build/components/block-tools/back-compat.js +0 -45
- package/build/components/block-tools/back-compat.js.map +0 -1
- package/build/components/block-tools/block-contextual-toolbar.js +0 -91
- package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build/components/block-tools/selected-block-tools.js +0 -113
- package/build/components/block-tools/selected-block-tools.js.map +0 -1
- package/build/components/inserter/hooks/use-debounced-input.js +0 -22
- package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build/components/use-display-block-controls/index.js +0 -39
- package/build/components/use-display-block-controls/index.js.map +0 -1
- package/build/components/use-display-block-controls/index.native.js +0 -39
- package/build/components/use-display-block-controls/index.native.js.map +0 -1
- package/build/hooks/block-rename-ui.js +0 -167
- package/build/hooks/block-rename-ui.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build-module/components/block-tools/back-compat.js +0 -35
- package/build-module/components/block-tools/back-compat.js.map +0 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build-module/components/block-tools/selected-block-tools.js +0 -105
- package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.js +0 -32
- package/build-module/components/use-display-block-controls/index.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.native.js +0 -32
- package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
- package/build-module/hooks/block-rename-ui.js +0 -159
- package/build-module/hooks/block-rename-ui.js.map +0 -1
- package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
- package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
- package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
- package/src/components/block-parent-selector/style.scss +0 -11
- package/src/components/block-tools/back-compat.js +0 -35
- package/src/components/block-tools/block-contextual-toolbar.js +0 -100
- package/src/components/block-tools/selected-block-tools.js +0 -127
- package/src/components/inserter/hooks/use-debounced-input.js +0 -18
- package/src/components/preview-options/README.md +0 -94
- package/src/components/preview-options/style.scss +0 -64
- package/src/components/use-display-block-controls/index.js +0 -36
- package/src/components/use-display-block-controls/index.native.js +0 -37
- package/src/hooks/block-rename-ui.js +0 -228
- package/src/hooks/test/color.js +0 -112
- /package/src/{hooks/block-rename-ui.scss → components/block-rename/style.scss} +0 -0
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = BlockToolsBackCompat;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _element = require("@wordpress/element");
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
12
|
-
var _insertionPoint = _interopRequireWildcard(require("./insertion-point"));
|
|
13
|
-
var _selectedBlockTools = _interopRequireDefault(require("./selected-block-tools"));
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
/**
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
function BlockToolsBackCompat({
|
|
25
|
-
children
|
|
26
|
-
}) {
|
|
27
|
-
const openRef = (0, _element.useContext)(_insertionPoint.InsertionPointOpenRef);
|
|
28
|
-
const isDisabled = (0, _element.useContext)(_components.Disabled.Context);
|
|
29
|
-
|
|
30
|
-
// If context is set, `BlockTools` is a parent component.
|
|
31
|
-
if (openRef || isDisabled) {
|
|
32
|
-
return children;
|
|
33
|
-
}
|
|
34
|
-
(0, _deprecated.default)('wp.components.Popover.Slot name="block-toolbar"', {
|
|
35
|
-
alternative: 'wp.blockEditor.BlockTools',
|
|
36
|
-
since: '5.8',
|
|
37
|
-
version: '6.3'
|
|
38
|
-
});
|
|
39
|
-
return (0, _react.createElement)(_insertionPoint.default, {
|
|
40
|
-
__unstablePopoverSlot: "block-toolbar"
|
|
41
|
-
}, (0, _react.createElement)(_selectedBlockTools.default, {
|
|
42
|
-
__unstablePopoverSlot: "block-toolbar"
|
|
43
|
-
}), children);
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=back-compat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_deprecated","_interopRequireDefault","_insertionPoint","_interopRequireWildcard","_selectedBlockTools","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","BlockToolsBackCompat","children","openRef","useContext","InsertionPointOpenRef","isDisabled","Disabled","Context","deprecated","alternative","since","version","_react","createElement","__unstablePopoverSlot"],"sources":["@wordpress/block-editor/src/components/block-tools/back-compat.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { Disabled } from '@wordpress/components';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport InsertionPoint, { InsertionPointOpenRef } from './insertion-point';\nimport BlockPopover from './selected-block-tools';\n\nexport default function BlockToolsBackCompat( { children } ) {\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst isDisabled = useContext( Disabled.Context );\n\n\t// If context is set, `BlockTools` is a parent component.\n\tif ( openRef || isDisabled ) {\n\t\treturn children;\n\t}\n\n\tdeprecated( 'wp.components.Popover.Slot name=\"block-toolbar\"', {\n\t\talternative: 'wp.blockEditor.BlockTools',\n\t\tsince: '5.8',\n\t\tversion: '6.3',\n\t} );\n\n\treturn (\n\t\t<InsertionPoint __unstablePopoverSlot=\"block-toolbar\">\n\t\t\t<BlockPopover __unstablePopoverSlot=\"block-toolb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AW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAXlD;AACA;AACA;;AAKA;AACA;AACA;;AAIe,SAASW,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5D,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EAAEC,qCAAsB,CAAC;EACnD,MAAMC,UAAU,GAAG,IAAAF,mBAAU,EAAEG,oBAAQ,CAACC,OAAQ,CAAC;;EAEjD;EACA,IAAKL,OAAO,IAAIG,UAAU,EAAG;IAC5B,OAAOJ,QAAQ;EAChB;EAEA,IAAAO,mBAAU,EAAE,iDAAiD,EAAE;IAC9DC,WAAW,EAAE,2BAA2B;IACxCC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACtC,eAAA,CAAAU,OAAc;IAAC6B,qBAAqB,EAAC;EAAe,GACpD,IAAAF,MAAA,CAAAC,aAAA,EAACpC,mBAAA,CAAAQ,OAAY;IAAC6B,qBAAqB,EAAC;EAAe,CAAE,CAAC,EACpDb,QACa,CAAC;AAEnB"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = BlockContextualToolbar;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
var _blocks = require("@wordpress/blocks");
|
|
12
|
-
var _data = require("@wordpress/data");
|
|
13
|
-
var _navigableToolbar = _interopRequireDefault(require("../navigable-toolbar"));
|
|
14
|
-
var _blockToolbar = _interopRequireDefault(require("../block-toolbar"));
|
|
15
|
-
var _store = require("../../store");
|
|
16
|
-
var _useHasBlockControls = require("../block-controls/use-has-block-controls");
|
|
17
|
-
/**
|
|
18
|
-
* External dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* WordPress dependencies
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Internal dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
function BlockContextualToolbar({
|
|
30
|
-
focusOnMount,
|
|
31
|
-
isFixed,
|
|
32
|
-
...props
|
|
33
|
-
}) {
|
|
34
|
-
const {
|
|
35
|
-
blockType,
|
|
36
|
-
blockEditingMode,
|
|
37
|
-
hasParents,
|
|
38
|
-
showParentSelector,
|
|
39
|
-
selectedBlockClientId
|
|
40
|
-
} = (0, _data.useSelect)(select => {
|
|
41
|
-
const {
|
|
42
|
-
getBlockName,
|
|
43
|
-
getBlockParents,
|
|
44
|
-
getSelectedBlockClientIds,
|
|
45
|
-
getBlockEditingMode
|
|
46
|
-
} = select(_store.store);
|
|
47
|
-
const {
|
|
48
|
-
getBlockType
|
|
49
|
-
} = select(_blocks.store);
|
|
50
|
-
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
51
|
-
const _selectedBlockClientId = selectedBlockClientIds[0];
|
|
52
|
-
const parents = getBlockParents(_selectedBlockClientId);
|
|
53
|
-
const firstParentClientId = parents[parents.length - 1];
|
|
54
|
-
const parentBlockName = getBlockName(firstParentClientId);
|
|
55
|
-
const parentBlockType = getBlockType(parentBlockName);
|
|
56
|
-
return {
|
|
57
|
-
selectedBlockClientId: _selectedBlockClientId,
|
|
58
|
-
blockType: _selectedBlockClientId && getBlockType(getBlockName(_selectedBlockClientId)),
|
|
59
|
-
blockEditingMode: getBlockEditingMode(_selectedBlockClientId),
|
|
60
|
-
hasParents: parents.length,
|
|
61
|
-
showParentSelector: parentBlockType && getBlockEditingMode(firstParentClientId) === 'default' && (0, _blocks.hasBlockSupport)(parentBlockType, '__experimentalParentSelector', true) && selectedBlockClientIds.length <= 1 && getBlockEditingMode(_selectedBlockClientId) === 'default'
|
|
62
|
-
};
|
|
63
|
-
}, []);
|
|
64
|
-
const isToolbarEnabled = blockType && (0, _blocks.hasBlockSupport)(blockType, '__experimentalToolbar', true);
|
|
65
|
-
const hasAnyBlockControls = (0, _useHasBlockControls.useHasAnyBlockControls)();
|
|
66
|
-
if (!isToolbarEnabled || blockEditingMode !== 'default' && !hasAnyBlockControls) {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Shifts the toolbar to make room for the parent block selector.
|
|
71
|
-
const classes = (0, _classnames.default)('block-editor-block-contextual-toolbar', {
|
|
72
|
-
'has-parent': hasParents && showParentSelector,
|
|
73
|
-
'is-fixed': isFixed
|
|
74
|
-
});
|
|
75
|
-
return (0, _react.createElement)(_navigableToolbar.default, {
|
|
76
|
-
focusOnMount: focusOnMount,
|
|
77
|
-
focusEditorOnEscape: true,
|
|
78
|
-
className: classes
|
|
79
|
-
/* translators: accessibility text for the block toolbar */,
|
|
80
|
-
"aria-label": (0, _i18n.__)('Block tools'),
|
|
81
|
-
variant: isFixed ? 'unstyled' : undefined
|
|
82
|
-
// Resets the index whenever the active block changes so
|
|
83
|
-
// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169
|
|
84
|
-
,
|
|
85
|
-
key: selectedBlockClientId,
|
|
86
|
-
...props
|
|
87
|
-
}, (0, _react.createElement)(_blockToolbar.default, {
|
|
88
|
-
hideDragHandle: isFixed
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=block-contextual-toolbar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_blocks","_data","_navigableToolbar","_blockToolbar","_store","_useHasBlockControls","BlockContextualToolbar","focusOnMount","isFixed","props","blockType","blockEditingMode","hasParents","showParentSelector","selectedBlockClientId","useSelect","select","getBlockName","getBlockParents","getSelectedBlockClientIds","getBlockEditingMode","blockEditorStore","getBlockType","blocksStore","selectedBlockClientIds","_selectedBlockClientId","parents","firstParentClientId","length","parentBlockName","parentBlockType","hasBlockSupport","isToolbarEnabled","hasAnyBlockControls","useHasAnyBlockControls","classes","classnames","_react","createElement","default","focusEditorOnEscape","className","__","variant","undefined","key","hideDragHandle"],"sources":["@wordpress/block-editor/src/components/block-tools/block-contextual-toolbar.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { hasBlockSupport, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport NavigableToolbar from '../navigable-toolbar';\nimport BlockToolbar from '../block-toolbar';\nimport { store as blockEditorStore } from '../../store';\nimport { useHasAnyBlockControls } from '../block-controls/use-has-block-controls';\n\nexport default function BlockContextualToolbar( {\n\tfocusOnMount,\n\tisFixed,\n\t...props\n} ) {\n\tconst {\n\t\tblockType,\n\t\tblockEditingMode,\n\t\thasParents,\n\t\tshowParentSelector,\n\t\tselectedBlockClientId,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockName,\n\t\t\tgetBlockParents,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tgetBlockEditingMode,\n\t\t} = select( blockEditorStore );\n\t\tconst { getBlockType } = select( blocksStore );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst _selectedBlockClientId = selectedBlockClientIds[ 0 ];\n\t\tconst parents = getBlockParents( _selectedBlockClientId );\n\t\tconst firstParentClientId = parents[ parents.length - 1 ];\n\t\tconst parentBlockName = getBlockName( firstParentClientId );\n\t\tconst parentBlockType = getBlockType( parentBlockName );\n\n\t\treturn {\n\t\t\tselectedBlockClientId: _selectedBlockClientId,\n\t\t\tblockType:\n\t\t\t\t_selectedBlockClientId &&\n\t\t\t\tgetBlockType( getBlockName( _selectedBlockClientId ) ),\n\t\t\tblockEditingMode: getBlockEditingMode( _selectedBlockClientId ),\n\t\t\thasParents: parents.length,\n\t\t\tshowParentSelector:\n\t\t\t\tparentBlockType &&\n\t\t\t\tgetBlockEditingMode( firstParentClientId ) === 'default' &&\n\t\t\t\thasBlockSupport(\n\t\t\t\t\tparentBlockType,\n\t\t\t\t\t'__experimentalParentSelector',\n\t\t\t\t\ttrue\n\t\t\t\t) &&\n\t\t\t\tselectedBlockClientIds.length <= 1 &&\n\t\t\t\tgetBlockEditingMode( _selectedBlockClientId ) === 'default',\n\t\t};\n\t}, [] );\n\n\tconst isToolbarEnabled =\n\t\tblockType &&\n\t\thasBlockSupport( blockType, '__experimentalToolbar', true );\n\tconst hasAnyBlockControls = useHasAnyBlockControls();\n\tif (\n\t\t! isToolbarEnabled ||\n\t\t( blockEditingMode !== 'default' && ! hasAnyBlockControls )\n\t) {\n\t\treturn null;\n\t}\n\n\t// Shifts the toolbar to make room for the parent block selector.\n\tconst classes = classnames( 'block-editor-block-contextual-toolbar', {\n\t\t'has-parent': hasParents && showParentSelector,\n\t\t'is-fixed': isFixed,\n\t} );\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tfocusOnMount={ focusOnMount }\n\t\t\tfocusEditorOnEscape\n\t\t\tclassName={ classes }\n\t\t\t/* translators: accessibility text for the block toolbar */\n\t\t\taria-label={ __( 'Block tools' ) }\n\t\t\tvariant={ isFixed ? 'unstyled' : undefined }\n\t\t\t// Resets the index whenever the active block changes so\n\t\t\t// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\t\tkey={ selectedBlockClientId }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<BlockToolbar hideDragHandle={ isFixed } />\n\t\t</NavigableToolbar>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IA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E,MAAM;MAC1Bf,kBAAkB,EACjBiB,eAAe,IACfV,mBAAmB,CAAEO,mBAAoB,CAAC,KAAK,SAAS,IACxD,IAAAI,uBAAe,EACdD,eAAe,EACf,8BAA8B,EAC9B,IACD,CAAC,IACDN,sBAAsB,CAACI,MAAM,IAAI,CAAC,IAClCR,mBAAmB,CAAEK,sBAAuB,CAAC,KAAK;IACpD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMO,gBAAgB,GACrBtB,SAAS,IACT,IAAAqB,uBAAe,EAAErB,SAAS,EAAE,uBAAuB,EAAE,IAAK,CAAC;EAC5D,MAAMuB,mBAAmB,GAAG,IAAAC,2CAAsB,EAAC,CAAC;EACpD,IACC,CAAEF,gBAAgB,IAChBrB,gBAAgB,KAAK,SAAS,IAAI,CAAEsB,mBAAqB,EAC1D;IACD,OAAO,IAAI;EACZ;;EAEA;EACA,MAAME,OAAO,GAAG,IAAAC,mBAAU,EAAE,uCAAuC,EAAE;IACpE,YAAY,EAAExB,UAAU,IAAIC,kBAAkB;IAC9C,UAAU,EAAEL;EACb,CAAE,CAAC;EAEH,OACC,IAAA6B,MAAA,CAAAC,aAAA,EAACpC,iBAAA,CAAAqC,OAAgB;IAChBhC,YAAY,EAAGA,YAAc;IAC7BiC,mBAAmB;IACnBC,SAAS,EAAGN;IACZ;IACA,cAAa,IAAAO,QAAE,EAAE,aAAc,CAAG;IAClCC,OAAO,EAAGnC,OAAO,GAAG,UAAU,GAAGoC;IACjC;IACA;IAAA;IACAC,GAAG,EAAG/B,qBAAuB;IAAA,GACxBL;EAAK,GAEV,IAAA4B,MAAA,CAAAC,aAAA,EAACnC,aAAA,CAAAoC,OAAY;IAACO,cAAc,EAAGtC;EAAS,CAAE,CACzB,CAAC;AAErB"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = SelectedBlockTools;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
var _data = require("@wordpress/data");
|
|
12
|
-
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
13
|
-
var _blockSelectionButton = _interopRequireDefault(require("./block-selection-button"));
|
|
14
|
-
var _blockContextualToolbar = _interopRequireDefault(require("./block-contextual-toolbar"));
|
|
15
|
-
var _store = require("../../store");
|
|
16
|
-
var _blockPopover = _interopRequireDefault(require("../block-popover"));
|
|
17
|
-
var _useBlockToolbarPopoverProps = _interopRequireDefault(require("./use-block-toolbar-popover-props"));
|
|
18
|
-
var _useSelectedBlockToolProps = _interopRequireDefault(require("./use-selected-block-tool-props"));
|
|
19
|
-
var _useShouldContextualToolbarShow = require("../../utils/use-should-contextual-toolbar-show");
|
|
20
|
-
/**
|
|
21
|
-
* External dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* WordPress dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Internal dependencies
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
function SelectedBlockTools({
|
|
33
|
-
clientId,
|
|
34
|
-
showEmptyBlockSideInserter,
|
|
35
|
-
__unstableContentRef
|
|
36
|
-
}) {
|
|
37
|
-
const {
|
|
38
|
-
capturingClientId,
|
|
39
|
-
isInsertionPointVisible,
|
|
40
|
-
lastClientId,
|
|
41
|
-
rootClientId
|
|
42
|
-
} = (0, _useSelectedBlockToolProps.default)(clientId);
|
|
43
|
-
const {
|
|
44
|
-
shouldShowBreadcrumb
|
|
45
|
-
} = (0, _data.useSelect)(select => {
|
|
46
|
-
const {
|
|
47
|
-
hasMultiSelection,
|
|
48
|
-
__unstableGetEditorMode
|
|
49
|
-
} = select(_store.store);
|
|
50
|
-
const editorMode = __unstableGetEditorMode();
|
|
51
|
-
return {
|
|
52
|
-
shouldShowBreadcrumb: !hasMultiSelection() && (editorMode === 'navigation' || editorMode === 'zoom-out')
|
|
53
|
-
};
|
|
54
|
-
}, []);
|
|
55
|
-
const isToolbarForced = (0, _element.useRef)(false);
|
|
56
|
-
const {
|
|
57
|
-
shouldShowContextualToolbar,
|
|
58
|
-
canFocusHiddenToolbar
|
|
59
|
-
} = (0, _useShouldContextualToolbarShow.useShouldContextualToolbarShow)();
|
|
60
|
-
const {
|
|
61
|
-
stopTyping
|
|
62
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
63
|
-
(0, _keyboardShortcuts.useShortcut)('core/block-editor/focus-toolbar', () => {
|
|
64
|
-
isToolbarForced.current = true;
|
|
65
|
-
stopTyping(true);
|
|
66
|
-
}, {
|
|
67
|
-
isDisabled: !canFocusHiddenToolbar
|
|
68
|
-
});
|
|
69
|
-
(0, _element.useEffect)(() => {
|
|
70
|
-
isToolbarForced.current = false;
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
// Stores the active toolbar item index so the block toolbar can return focus
|
|
74
|
-
// to it when re-mounting.
|
|
75
|
-
const initialToolbarItemIndexRef = (0, _element.useRef)();
|
|
76
|
-
(0, _element.useEffect)(() => {
|
|
77
|
-
// Resets the index whenever the active block changes so this is not
|
|
78
|
-
// persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169
|
|
79
|
-
initialToolbarItemIndexRef.current = undefined;
|
|
80
|
-
}, [clientId]);
|
|
81
|
-
const popoverProps = (0, _useBlockToolbarPopoverProps.default)({
|
|
82
|
-
contentElement: __unstableContentRef?.current,
|
|
83
|
-
clientId
|
|
84
|
-
});
|
|
85
|
-
if (showEmptyBlockSideInserter) {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
if (shouldShowBreadcrumb || shouldShowContextualToolbar) {
|
|
89
|
-
return (0, _react.createElement)(_blockPopover.default, {
|
|
90
|
-
clientId: capturingClientId || clientId,
|
|
91
|
-
bottomClientId: lastClientId,
|
|
92
|
-
className: (0, _classnames.default)('block-editor-block-list__block-popover', {
|
|
93
|
-
'is-insertion-point-visible': isInsertionPointVisible
|
|
94
|
-
}),
|
|
95
|
-
resize: false,
|
|
96
|
-
...popoverProps
|
|
97
|
-
}, shouldShowContextualToolbar && (0, _react.createElement)(_blockContextualToolbar.default
|
|
98
|
-
// If the toolbar is being shown because of being forced
|
|
99
|
-
// it should focus the toolbar right after the mount.
|
|
100
|
-
, {
|
|
101
|
-
focusOnMount: isToolbarForced.current,
|
|
102
|
-
__experimentalInitialIndex: initialToolbarItemIndexRef.current,
|
|
103
|
-
__experimentalOnIndexChange: index => {
|
|
104
|
-
initialToolbarItemIndexRef.current = index;
|
|
105
|
-
}
|
|
106
|
-
}), shouldShowBreadcrumb && (0, _react.createElement)(_blockSelectionButton.default, {
|
|
107
|
-
clientId: clientId,
|
|
108
|
-
rootClientId: rootClientId
|
|
109
|
-
}));
|
|
110
|
-
}
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=selected-block-tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_data","_keyboardShortcuts","_blockSelectionButton","_blockContextualToolbar","_store","_blockPopover","_useBlockToolbarPopoverProps","_useSelectedBlockToolProps","_useShouldContextualToolbarShow","SelectedBlockTools","clientId","showEmptyBlockSideInserter","__unstableContentRef","capturingClientId","isInsertionPointVisible","lastClientId","rootClientId","useSelectedBlockToolProps","shouldShowBreadcrumb","useSelect","select","hasMultiSelection","__unstableGetEditorMode","blockEditorStore","editorMode","isToolbarForced","useRef","shouldShowContextualToolbar","canFocusHiddenToolbar","useShouldContextualToolbarShow","stopTyping","useDispatch","useShortcut","current","isDisabled","useEffect","initialToolbarItemIndexRef","undefined","popoverProps","useBlockToolbarPopoverProps","contentElement","_react","createElement","default","bottomClientId","className","classnames","resize","focusOnMount","__experimentalInitialIndex","__experimentalOnIndexChange","index"],"sources":["@wordpress/block-editor/src/components/block-tools/selected-block-tools.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport BlockSelectionButton from './block-selection-button';\nimport BlockContextualToolbar from './block-contextual-toolbar';\nimport { store as blockEditorStore } from '../../store';\nimport BlockPopover from '../block-popover';\nimport useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';\nimport useSelectedBlockToolProps from './use-selected-block-tool-props';\nimport { useShouldContextualToolbarShow } from '../../utils/use-should-contextual-toolbar-show';\n\nexport default function SelectedBlockTools( {\n\tclientId,\n\tshowEmptyBlockSideInserter,\n\t__unstableContentRef,\n} ) {\n\tconst {\n\t\tcapturingClientId,\n\t\tisInsertionPointVisible,\n\t\tlastClientId,\n\t\trootClientId,\n\t} = useSelectedBlockToolProps( clientId );\n\n\tconst { shouldShowBreadcrumb } = useSelect( ( select ) => {\n\t\tconst { hasMultiSelection, __unstableGetEditorMode } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst editorMode = __unstableGetEditorMode();\n\n\t\treturn {\n\t\t\tshouldShowBreadcrumb:\n\t\t\t\t! hasMultiSelection() &&\n\t\t\t\t( editorMode === 'navigation' || editorMode === 'zoom-out' ),\n\t\t};\n\t}, [] );\n\n\tconst isToolbarForced = useRef( false );\n\tconst { shouldShowContextualToolbar, canFocusHiddenToolbar } =\n\t\tuseShouldContextualToolbarShow();\n\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\tuseShortcut(\n\t\t'core/block-editor/focus-toolbar',\n\t\t() => {\n\t\t\tisToolbarForced.current = true;\n\t\t\tstopTyping( true );\n\t\t},\n\t\t{\n\t\t\tisDisabled: ! canFocusHiddenToolbar,\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tisToolbarForced.current = false;\n\t} );\n\n\t// Stores the active toolbar item index so the block toolbar can return focus\n\t// to it when re-mounting.\n\tconst initialToolbarItemIndexRef = useRef();\n\n\tuseEffect( () => {\n\t\t// Resets the index whenever the active block changes so this is not\n\t\t// persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\tinitialToolbarItemIndexRef.current = undefined;\n\t}, [ clientId ] );\n\n\tconst popoverProps = useBlockToolbarPopoverProps( {\n\t\tcontentElement: __unstableContentRef?.current,\n\t\tclientId,\n\t} );\n\n\tif ( showEmptyBlockSideInserter ) {\n\t\treturn null;\n\t}\n\n\tif ( shouldShowBreadcrumb || shouldShowContextualToolbar ) {\n\t\treturn (\n\t\t\t<BlockPopover\n\t\t\t\tclientId={ capturingClientId || clientId }\n\t\t\t\tbottomClientId={ lastClientId }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-block-list__block-popover',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\tresize={ false }\n\t\t\t\t{ ...popoverProps }\n\t\t\t>\n\t\t\t\t{ shouldShowContextualToolbar && (\n\t\t\t\t\t<BlockContextualToolbar\n\t\t\t\t\t\t// If the toolbar is being shown because of being forced\n\t\t\t\t\t\t// it should focus the toolbar right after the mount.\n\t\t\t\t\t\tfocusOnMount={ isToolbarForced.current }\n\t\t\t\t\t\t__experimentalInitialIndex={\n\t\t\t\t\t\t\tinitialToolbarItemIndexRef.current\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__experimentalOnIndexChange={ ( index ) => {\n\t\t\t\t\t\t\tinitialToolbarItemIndexRef.current = index;\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ shouldShowBreadcrumb && (\n\t\t\t\t\t<BlockSelectionButton\n\t\t\t\t\t\tclientId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AACQ,OAAS;MACxCgB,0BAA0B,EACzBb,0BAA0B,CAACH,OAC3B;MACDiB,2BAA2B,EAAKC,KAAK,IAAM;QAC1Cf,0BAA0B,CAACH,OAAO,GAAGkB,KAAK;MAC3C;IAAG,CACH,CACD,EACCjC,oBAAoB,IACrB,IAAAuB,MAAA,CAAAC,aAAA,EAACxC,qBAAA,CAAAyC,OAAoB;MACpBjC,QAAQ,EAAGA,QAAU;MACrBM,YAAY,EAAGA;IAAc,CAC7B,CAEW,CAAC;EAEjB;EAEA,OAAO,IAAI;AACZ"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = useDebouncedInput;
|
|
7
|
-
var _element = require("@wordpress/element");
|
|
8
|
-
var _compose = require("@wordpress/compose");
|
|
9
|
-
/**
|
|
10
|
-
* WordPress dependencies
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
function useDebouncedInput(defaultValue = '') {
|
|
14
|
-
const [input, setInput] = (0, _element.useState)(defaultValue);
|
|
15
|
-
const [debouncedInput, setDebouncedState] = (0, _element.useState)(defaultValue);
|
|
16
|
-
const setDebouncedInput = (0, _compose.useDebounce)(setDebouncedState, 250);
|
|
17
|
-
(0, _element.useEffect)(() => {
|
|
18
|
-
setDebouncedInput(input);
|
|
19
|
-
}, [input]);
|
|
20
|
-
return [input, setInput, debouncedInput];
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=use-debounced-input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_compose","useDebouncedInput","defaultValue","input","setInput","useState","debouncedInput","setDebouncedState","setDebouncedInput","useDebounce","useEffect"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-debounced-input.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\n\nexport default function useDebouncedInput( defaultValue = '' ) {\n\tconst [ input, setInput ] = useState( defaultValue );\n\tconst [ debouncedInput, setDebouncedState ] = useState( defaultValue );\n\n\tconst setDebouncedInput = useDebounce( setDebouncedState, 250 );\n\n\tuseEffect( () => {\n\t\tsetDebouncedInput( input );\n\t}, [ input ] );\n\n\treturn [ input, setInput, debouncedInput ];\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIe,SAASE,iBAAiBA,CAAEC,YAAY,GAAG,EAAE,EAAG;EAC9D,MAAM,CAAEC,KAAK,EAAEC,QAAQ,CAAE,GAAG,IAAAC,iBAAQ,EAAEH,YAAa,CAAC;EACpD,MAAM,CAAEI,cAAc,EAAEC,iBAAiB,CAAE,GAAG,IAAAF,iBAAQ,EAAEH,YAAa,CAAC;EAEtE,MAAMM,iBAAiB,GAAG,IAAAC,oBAAW,EAAEF,iBAAiB,EAAE,GAAI,CAAC;EAE/D,IAAAG,kBAAS,EAAE,MAAM;IAChBF,iBAAiB,CAAEL,KAAM,CAAC;EAC3B,CAAC,EAAE,CAAEA,KAAK,CAAG,CAAC;EAEd,OAAO,CAAEA,KAAK,EAAEC,QAAQ,EAAEE,cAAc,CAAE;AAC3C"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = useDisplayBlockControls;
|
|
7
|
-
var _data = require("@wordpress/data");
|
|
8
|
-
var _context = require("../block-edit/context");
|
|
9
|
-
var _store = require("../../store");
|
|
10
|
-
/**
|
|
11
|
-
* WordPress dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
function useDisplayBlockControls() {
|
|
19
|
-
const {
|
|
20
|
-
isSelected,
|
|
21
|
-
clientId,
|
|
22
|
-
name
|
|
23
|
-
} = (0, _context.useBlockEditContext)();
|
|
24
|
-
return (0, _data.useSelect)(select => {
|
|
25
|
-
if (isSelected) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
const {
|
|
29
|
-
getBlockName,
|
|
30
|
-
isFirstMultiSelectedBlock,
|
|
31
|
-
getMultiSelectedBlockClientIds
|
|
32
|
-
} = select(_store.store);
|
|
33
|
-
if (isFirstMultiSelectedBlock(clientId)) {
|
|
34
|
-
return getMultiSelectedBlockClientIds().every(id => getBlockName(id) === name);
|
|
35
|
-
}
|
|
36
|
-
return false;
|
|
37
|
-
}, [clientId, isSelected, name]);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_context","_store","useDisplayBlockControls","isSelected","clientId","name","useBlockEditContext","useSelect","select","getBlockName","isFirstMultiSelectedBlock","getMultiSelectedBlockClientIds","blockEditorStore","every","id"],"sources":["@wordpress/block-editor/src/components/use-display-block-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit/context';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function useDisplayBlockControls() {\n\tconst { isSelected, clientId, name } = useBlockEditContext();\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tif ( isSelected ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tisFirstMultiSelectedBlock,\n\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tif ( isFirstMultiSelectedBlock( clientId ) ) {\n\t\t\t\treturn getMultiSelectedBlockClientIds().every(\n\t\t\t\t\t( id ) => getBlockName( id ) === name\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn false;\n\t\t},\n\t\t[ clientId, isSelected, name ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIe,SAASG,uBAAuBA,CAAA,EAAG;EACjD,MAAM;IAAEC,UAAU;IAAEC,QAAQ;IAAEC;EAAK,CAAC,GAAG,IAAAC,4BAAmB,EAAC,CAAC;EAC5D,OAAO,IAAAC,eAAS,EACbC,MAAM,IAAM;IACb,IAAKL,UAAU,EAAG;MACjB,OAAO,IAAI;IACZ;IAEA,MAAM;MACLM,YAAY;MACZC,yBAAyB;MACzBC;IACD,CAAC,GAAGH,MAAM,CAAEI,YAAiB,CAAC;IAE9B,IAAKF,yBAAyB,CAAEN,QAAS,CAAC,EAAG;MAC5C,OAAOO,8BAA8B,CAAC,CAAC,CAACE,KAAK,CAC1CC,EAAE,IAAML,YAAY,CAAEK,EAAG,CAAC,KAAKT,IAClC,CAAC;IACF;IAEA,OAAO,KAAK;EACb,CAAC,EACD,CAAED,QAAQ,EAAED,UAAU,EAAEE,IAAI,CAC7B,CAAC;AACF"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = useDisplayBlockControls;
|
|
7
|
-
var _data = require("@wordpress/data");
|
|
8
|
-
var _blocks = require("@wordpress/blocks");
|
|
9
|
-
var _context = require("../block-edit/context");
|
|
10
|
-
var _store = require("../../store");
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
function useDisplayBlockControls() {
|
|
20
|
-
const {
|
|
21
|
-
isSelected,
|
|
22
|
-
clientId,
|
|
23
|
-
name
|
|
24
|
-
} = (0, _context.useBlockEditContext)();
|
|
25
|
-
return (0, _data.useSelect)(select => {
|
|
26
|
-
const {
|
|
27
|
-
getBlockName,
|
|
28
|
-
getBlockRootClientId
|
|
29
|
-
} = select(_store.store);
|
|
30
|
-
const parentId = getBlockRootClientId(clientId);
|
|
31
|
-
const parentBlockName = getBlockName(parentId);
|
|
32
|
-
const hideControls = (0, _blocks.hasBlockSupport)(parentBlockName, '__experimentalHideChildBlockControls', false);
|
|
33
|
-
if (!hideControls && isSelected) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
return false;
|
|
37
|
-
}, [clientId, isSelected, name]);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_blocks","_context","_store","useDisplayBlockControls","isSelected","clientId","name","useBlockEditContext","useSelect","select","getBlockName","getBlockRootClientId","blockEditorStore","parentId","parentBlockName","hideControls","hasBlockSupport"],"sources":["@wordpress/block-editor/src/components/use-display-block-controls/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit/context';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function useDisplayBlockControls() {\n\tconst { isSelected, clientId, name } = useBlockEditContext();\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockName, getBlockRootClientId } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst parentId = getBlockRootClientId( clientId );\n\t\t\tconst parentBlockName = getBlockName( parentId );\n\n\t\t\tconst hideControls = hasBlockSupport(\n\t\t\t\tparentBlockName,\n\t\t\t\t'__experimentalHideChildBlockControls',\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tif ( ! hideControls && isSelected ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t},\n\t\t[ clientId, isSelected, name ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIe,SAASI,uBAAuBA,CAAA,EAAG;EACjD,MAAM;IAAEC,UAAU;IAAEC,QAAQ;IAAEC;EAAK,CAAC,GAAG,IAAAC,4BAAmB,EAAC,CAAC;EAC5D,OAAO,IAAAC,eAAS,EACbC,MAAM,IAAM;IACb,MAAM;MAAEC,YAAY;MAAEC;IAAqB,CAAC,GAC3CF,MAAM,CAAEG,YAAiB,CAAC;IAE3B,MAAMC,QAAQ,GAAGF,oBAAoB,CAAEN,QAAS,CAAC;IACjD,MAAMS,eAAe,GAAGJ,YAAY,CAAEG,QAAS,CAAC;IAEhD,MAAME,YAAY,GAAG,IAAAC,uBAAe,EACnCF,eAAe,EACf,sCAAsC,EACtC,KACD,CAAC;IAED,IAAK,CAAEC,YAAY,IAAIX,UAAU,EAAG;MACnC,OAAO,IAAI;IACZ;IAEA,OAAO,KAAK;EACb,CAAC,EACD,CAAEC,QAAQ,EAAED,UAAU,EAAEE,IAAI,CAC7B,CAAC;AACF"}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.withBlockRenameControls = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _compose = require("@wordpress/compose");
|
|
9
|
-
var _hooks = require("@wordpress/hooks");
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
var _blocks = require("@wordpress/blocks");
|
|
12
|
-
var _components = require("@wordpress/components");
|
|
13
|
-
var _element = require("@wordpress/element");
|
|
14
|
-
var _a11y = require("@wordpress/a11y");
|
|
15
|
-
var _components2 = require("../components");
|
|
16
|
-
/**
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const emptyString = testString => testString?.trim()?.length === 0;
|
|
25
|
-
function RenameModal({
|
|
26
|
-
blockName,
|
|
27
|
-
originalBlockName,
|
|
28
|
-
onClose,
|
|
29
|
-
onSave
|
|
30
|
-
}) {
|
|
31
|
-
const [editedBlockName, setEditedBlockName] = (0, _element.useState)(blockName);
|
|
32
|
-
const nameHasChanged = editedBlockName !== blockName;
|
|
33
|
-
const nameIsOriginal = editedBlockName === originalBlockName;
|
|
34
|
-
const nameIsEmpty = emptyString(editedBlockName);
|
|
35
|
-
const isNameValid = nameHasChanged || nameIsOriginal;
|
|
36
|
-
const autoSelectInputText = event => event.target.select();
|
|
37
|
-
const dialogDescription = (0, _compose.useInstanceId)(RenameModal, `block-editor-rename-modal__description`);
|
|
38
|
-
const handleSubmit = () => {
|
|
39
|
-
const message = nameIsOriginal || nameIsEmpty ? (0, _i18n.sprintf)( /* translators: %s: new name/label for the block */
|
|
40
|
-
(0, _i18n.__)('Block name reset to: "%s".'), editedBlockName) : (0, _i18n.sprintf)( /* translators: %s: new name/label for the block */
|
|
41
|
-
(0, _i18n.__)('Block name changed to: "%s".'), editedBlockName);
|
|
42
|
-
|
|
43
|
-
// Must be assertive to immediately announce change.
|
|
44
|
-
(0, _a11y.speak)(message, 'assertive');
|
|
45
|
-
onSave(editedBlockName);
|
|
46
|
-
|
|
47
|
-
// Immediate close avoids ability to hit save multiple times.
|
|
48
|
-
onClose();
|
|
49
|
-
};
|
|
50
|
-
return (0, _react.createElement)(_components.Modal, {
|
|
51
|
-
title: (0, _i18n.__)('Rename'),
|
|
52
|
-
onRequestClose: onClose,
|
|
53
|
-
overlayClassName: "block-editor-block-rename-modal",
|
|
54
|
-
aria: {
|
|
55
|
-
describedby: dialogDescription
|
|
56
|
-
},
|
|
57
|
-
focusOnMount: "firstContentElement"
|
|
58
|
-
}, (0, _react.createElement)("p", {
|
|
59
|
-
id: dialogDescription
|
|
60
|
-
}, (0, _i18n.__)('Enter a custom name for this block.')), (0, _react.createElement)("form", {
|
|
61
|
-
onSubmit: e => {
|
|
62
|
-
e.preventDefault();
|
|
63
|
-
if (!isNameValid) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
handleSubmit();
|
|
67
|
-
}
|
|
68
|
-
}, (0, _react.createElement)(_components.__experimentalVStack, {
|
|
69
|
-
spacing: "3"
|
|
70
|
-
}, (0, _react.createElement)(_components.TextControl, {
|
|
71
|
-
__nextHasNoMarginBottom: true,
|
|
72
|
-
__next40pxDefaultSize: true,
|
|
73
|
-
value: editedBlockName,
|
|
74
|
-
label: (0, _i18n.__)('Block name'),
|
|
75
|
-
hideLabelFromVision: true,
|
|
76
|
-
placeholder: originalBlockName,
|
|
77
|
-
onChange: setEditedBlockName,
|
|
78
|
-
onFocus: autoSelectInputText
|
|
79
|
-
}), (0, _react.createElement)(_components.__experimentalHStack, {
|
|
80
|
-
justify: "right"
|
|
81
|
-
}, (0, _react.createElement)(_components.Button, {
|
|
82
|
-
variant: "tertiary",
|
|
83
|
-
onClick: onClose
|
|
84
|
-
}, (0, _i18n.__)('Cancel')), (0, _react.createElement)(_components.Button, {
|
|
85
|
-
"aria-disabled": !isNameValid,
|
|
86
|
-
variant: "primary",
|
|
87
|
-
type: "submit"
|
|
88
|
-
}, (0, _i18n.__)('Save'))))));
|
|
89
|
-
}
|
|
90
|
-
function BlockRenameControl(props) {
|
|
91
|
-
const [renamingBlock, setRenamingBlock] = (0, _element.useState)(false);
|
|
92
|
-
const {
|
|
93
|
-
clientId,
|
|
94
|
-
customName,
|
|
95
|
-
onChange
|
|
96
|
-
} = props;
|
|
97
|
-
const blockInformation = (0, _components2.useBlockDisplayInformation)(clientId);
|
|
98
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components2.InspectorControls, {
|
|
99
|
-
group: "advanced"
|
|
100
|
-
}, (0, _react.createElement)(_components.TextControl, {
|
|
101
|
-
__nextHasNoMarginBottom: true,
|
|
102
|
-
__next40pxDefaultSize: true,
|
|
103
|
-
label: (0, _i18n.__)('Block name'),
|
|
104
|
-
value: customName || '',
|
|
105
|
-
onChange: onChange
|
|
106
|
-
})), (0, _react.createElement)(_components2.BlockSettingsMenuControls, null, ({
|
|
107
|
-
selectedClientIds
|
|
108
|
-
}) => {
|
|
109
|
-
// Only enabled for single selections.
|
|
110
|
-
const canRename = selectedClientIds.length === 1 && clientId === selectedClientIds[0];
|
|
111
|
-
|
|
112
|
-
// This check ensures the `BlockSettingsMenuControls` fill
|
|
113
|
-
// doesn't render multiple times and also that it renders for
|
|
114
|
-
// the block from which the menu was triggered.
|
|
115
|
-
if (!canRename) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
return (0, _react.createElement)(_components.MenuItem, {
|
|
119
|
-
onClick: () => {
|
|
120
|
-
setRenamingBlock(true);
|
|
121
|
-
},
|
|
122
|
-
"aria-expanded": renamingBlock,
|
|
123
|
-
"aria-haspopup": "dialog"
|
|
124
|
-
}, (0, _i18n.__)('Rename'));
|
|
125
|
-
}), renamingBlock && (0, _react.createElement)(RenameModal, {
|
|
126
|
-
blockName: customName || '',
|
|
127
|
-
originalBlockName: blockInformation?.title,
|
|
128
|
-
onClose: () => setRenamingBlock(false),
|
|
129
|
-
onSave: newName => {
|
|
130
|
-
// If the new value is the block's original name (e.g. `Group`)
|
|
131
|
-
// or it is an empty string then assume the intent is to reset
|
|
132
|
-
// the value. Therefore reset the metadata.
|
|
133
|
-
if (newName === blockInformation?.title || emptyString(newName)) {
|
|
134
|
-
newName = undefined;
|
|
135
|
-
}
|
|
136
|
-
onChange(newName);
|
|
137
|
-
}
|
|
138
|
-
}));
|
|
139
|
-
}
|
|
140
|
-
const withBlockRenameControls = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
|
|
141
|
-
const {
|
|
142
|
-
clientId,
|
|
143
|
-
name,
|
|
144
|
-
attributes,
|
|
145
|
-
setAttributes,
|
|
146
|
-
isSelected
|
|
147
|
-
} = props;
|
|
148
|
-
const supportsBlockNaming = (0, _blocks.hasBlockSupport)(name, 'renaming', true);
|
|
149
|
-
return (0, _react.createElement)(_react.Fragment, null, isSelected && supportsBlockNaming && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(BlockRenameControl, {
|
|
150
|
-
clientId: clientId,
|
|
151
|
-
customName: attributes?.metadata?.name,
|
|
152
|
-
onChange: newName => {
|
|
153
|
-
setAttributes({
|
|
154
|
-
metadata: {
|
|
155
|
-
...attributes?.metadata,
|
|
156
|
-
name: newName
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
})), (0, _react.createElement)(BlockEdit, {
|
|
161
|
-
key: "edit",
|
|
162
|
-
...props
|
|
163
|
-
}));
|
|
164
|
-
}, 'withBlockRenameControls');
|
|
165
|
-
exports.withBlockRenameControls = withBlockRenameControls;
|
|
166
|
-
(0, _hooks.addFilter)('editor.BlockEdit', 'core/block-rename-ui/with-block-rename-controls', withBlockRenameControls);
|
|
167
|
-
//# sourceMappingURL=block-rename-ui.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_hooks","_i18n","_blocks","_components","_element","_a11y","_components2","emptyString","testString","trim","length","RenameModal","blockName","originalBlockName","onClose","onSave","editedBlockName","setEditedBlockName","useState","nameHasChanged","nameIsOriginal","nameIsEmpty","isNameValid","autoSelectInputText","event","target","select","dialogDescription","useInstanceId","handleSubmit","message","sprintf","__","speak","_react","createElement","Modal","title","onRequestClose","overlayClassName","aria","describedby","focusOnMount","id","onSubmit","e","preventDefault","__experimentalVStack","spacing","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","value","label","hideLabelFromVision","placeholder","onChange","onFocus","__experimentalHStack","justify","Button","variant","onClick","type","BlockRenameControl","props","renamingBlock","setRenamingBlock","clientId","customName","blockInformation","useBlockDisplayInformation","Fragment","InspectorControls","group","BlockSettingsMenuControls","selectedClientIds","canRename","MenuItem","newName","undefined","withBlockRenameControls","createHigherOrderComponent","BlockEdit","name","attributes","setAttributes","isSelected","supportsBlockNaming","hasBlockSupport","metadata","key","exports","addFilter"],"sources":["@wordpress/block-editor/src/hooks/block-rename-ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tMenuItem,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBlockSettingsMenuControls,\n\tuseBlockDisplayInformation,\n\tInspectorControls,\n} from '../components';\n\nconst emptyString = ( testString ) => testString?.trim()?.length === 0;\n\nfunction RenameModal( { blockName, originalBlockName, onClose, onSave } ) {\n\tconst [ editedBlockName, setEditedBlockName ] = useState( blockName );\n\n\tconst nameHasChanged = editedBlockName !== blockName;\n\tconst nameIsOriginal = editedBlockName === originalBlockName;\n\tconst nameIsEmpty = emptyString( editedBlockName );\n\n\tconst isNameValid = nameHasChanged || nameIsOriginal;\n\n\tconst autoSelectInputText = ( event ) => event.target.select();\n\n\tconst dialogDescription = useInstanceId(\n\t\tRenameModal,\n\t\t`block-editor-rename-modal__description`\n\t);\n\n\tconst handleSubmit = () => {\n\t\tconst message =\n\t\t\tnameIsOriginal || nameIsEmpty\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: new name/label for the block */\n\t\t\t\t\t\t__( 'Block name reset to: \"%s\".' ),\n\t\t\t\t\t\teditedBlockName\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: new name/label for the block */\n\t\t\t\t\t\t__( 'Block name changed to: \"%s\".' ),\n\t\t\t\t\t\teditedBlockName\n\t\t\t\t );\n\n\t\t// Must be assertive to immediately announce change.\n\t\tspeak( message, 'assertive' );\n\t\tonSave( editedBlockName );\n\n\t\t// Immediate close avoids ability to hit save multiple times.\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\toverlayClassName=\"block-editor-block-rename-modal\"\n\t\t\taria={ {\n\t\t\t\tdescribedby: dialogDescription,\n\t\t\t} }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t>\n\t\t\t<p id={ dialogDescription }>\n\t\t\t\t{ __( 'Enter a custom name for this block.' ) }\n\t\t\t</p>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( e ) => {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tif ( ! isNameValid ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\thandleSubmit();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ editedBlockName }\n\t\t\t\t\t\tlabel={ __( 'Block name' ) }\n\t\t\t\t\t\thideLabelFromVision={ true }\n\t\t\t\t\t\tplaceholder={ originalBlockName }\n\t\t\t\t\t\tonChange={ setEditedBlockName }\n\t\t\t\t\t\tonFocus={ autoSelectInputText }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button variant=\"tertiary\" onClick={ onClose }>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\taria-disabled={ ! isNameValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n\nfunction BlockRenameControl( props ) {\n\tconst [ renamingBlock, setRenamingBlock ] = useState( false );\n\n\tconst { clientId, customName, onChange } = props;\n\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Block name' ) }\n\t\t\t\t\tvalue={ customName || '' }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t{ ( { selectedClientIds } ) => {\n\t\t\t\t\t// Only enabled for single selections.\n\t\t\t\t\tconst canRename =\n\t\t\t\t\t\tselectedClientIds.length === 1 &&\n\t\t\t\t\t\tclientId === selectedClientIds[ 0 ];\n\n\t\t\t\t\t// This check ensures the `BlockSettingsMenuControls` fill\n\t\t\t\t\t// doesn't render multiple times and also that it renders for\n\t\t\t\t\t// the block from which the menu was triggered.\n\t\t\t\t\tif ( ! canRename ) {\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<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetRenamingBlock( true );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\taria-expanded={ renamingBlock }\n\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t</BlockSettingsMenuControls>\n\n\t\t\t{ renamingBlock && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tblockName={ customName || '' }\n\t\t\t\t\toriginalBlockName={ blockInformation?.title }\n\t\t\t\t\tonClose={ () => setRenamingBlock( false ) }\n\t\t\t\t\tonSave={ ( newName ) => {\n\t\t\t\t\t\t// If the new value is the block's original name (e.g. `Group`)\n\t\t\t\t\t\t// or it is an empty string then assume the intent is to reset\n\t\t\t\t\t\t// the value. Therefore reset the metadata.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tnewName === blockInformation?.title ||\n\t\t\t\t\t\t\temptyString( newName )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnewName = undefined;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tonChange( newName );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport const withBlockRenameControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { clientId, name, attributes, setAttributes, isSelected } = props;\n\n\t\tconst supportsBlockNaming = hasBlockSupport( name, 'renaming', true );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ isSelected && supportsBlockNaming && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockRenameControl\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tcustomName={ attributes?.metadata?.name }\n\t\t\t\t\t\t\tonChange={ ( newName ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\t\t\t\t...attributes?.metadata,\n\t\t\t\t\t\t\t\t\t\tname: newName,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withBlockRenameControls'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/block-rename-ui/with-block-rename-controls',\n\twithBlockRenameControls\n);\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAQA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,YAAA,GAAAP,OAAA;AArBA;AACA;AACA;;AAgBA;AACA;AACA;;AAOA,MAAMQ,WAAW,GAAKC,UAAU,IAAMA,UAAU,EAAEC,IAAI,CAAC,CAAC,EAAEC,MAAM,KAAK,CAAC;AAEtE,SAASC,WAAWA,CAAE;EAAEC,SAAS;EAAEC,iBAAiB;EAAEC,OAAO;EAAEC;AAAO,CAAC,EAAG;EACzE,MAAM,CAAEC,eAAe,EAAEC,kBAAkB,CAAE,GAAG,IAAAC,iBAAQ,EAAEN,SAAU,CAAC;EAErE,MAAMO,cAAc,GAAGH,eAAe,KAAKJ,SAAS;EACpD,MAAMQ,cAAc,GAAGJ,eAAe,KAAKH,iBAAiB;EAC5D,MAAMQ,WAAW,GAAGd,WAAW,CAAES,eAAgB,CAAC;EAElD,MAAMM,WAAW,GAAGH,cAAc,IAAIC,cAAc;EAEpD,MAAMG,mBAAmB,GAAKC,KAAK,IAAMA,KAAK,CAACC,MAAM,CAACC,MAAM,CAAC,CAAC;EAE9D,MAAMC,iBAAiB,GAAG,IAAAC,sBAAa,EACtCjB,WAAW,EACV,wCACF,CAAC;EAED,MAAMkB,YAAY,GAAGA,CAAA,KAAM;IAC1B,MAAMC,OAAO,GACZV,cAAc,IAAIC,WAAW,GAC1B,IA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