@wordpress/block-editor 15.8.1-next.dc3f6d3c1.0 → 15.9.1-next.6deb34194.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +12 -0
- package/build/components/block-alignment-matrix-control/index.js +1 -8
- package/build/components/block-alignment-matrix-control/index.js.map +2 -2
- package/build/components/block-bindings/attribute-control.js +172 -0
- package/build/components/block-bindings/attribute-control.js.map +7 -0
- package/build/components/block-bindings/index.js +47 -0
- package/build/components/block-bindings/index.js.map +7 -0
- package/build/components/block-bindings/source-fields-list.js +135 -0
- package/build/components/block-bindings/source-fields-list.js.map +7 -0
- package/build/components/block-bindings/use-block-bindings-utils.js +66 -0
- package/build/components/block-bindings/use-block-bindings-utils.js.map +7 -0
- package/build/components/block-edit/edit.js +1 -3
- package/build/components/block-edit/edit.js.map +2 -2
- package/build/components/block-list/index.js +2 -1
- package/build/components/block-list/index.js.map +2 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
- package/build/components/block-lock/modal.js +5 -5
- package/build/components/block-lock/modal.js.map +2 -2
- package/build/components/block-lock/use-block-lock.js +10 -13
- package/build/components/block-lock/use-block-lock.js.map +2 -2
- package/build/components/block-settings-menu-controls/index.js +1 -1
- package/build/components/block-settings-menu-controls/index.js.map +2 -2
- package/build/components/block-styles/preview-panel.js +3 -5
- package/build/components/block-styles/preview-panel.js.map +2 -2
- package/build/components/block-styles/use-styles-for-block.js +2 -2
- package/build/components/block-styles/use-styles-for-block.js.map +2 -2
- package/build/components/block-toolbar/index.js +1 -8
- package/build/components/block-toolbar/index.js.map +3 -3
- package/build/components/block-tools/index.js +56 -45
- package/build/components/block-tools/index.js.map +3 -3
- package/build/components/block-visibility/toolbar.js +1 -1
- package/build/components/block-visibility/toolbar.js.map +1 -1
- package/build/components/content-only-controls/fields-dropdown-menu.js +66 -0
- package/build/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
- package/build/components/content-only-controls/index.js +202 -44
- package/build/components/content-only-controls/index.js.map +3 -3
- package/build/components/content-only-controls/link/index.js +92 -103
- package/build/components/content-only-controls/link/index.js.map +3 -3
- package/build/components/content-only-controls/media/index.js +134 -134
- package/build/components/content-only-controls/media/index.js.map +3 -3
- package/build/components/content-only-controls/rich-text/index.js +66 -74
- package/build/components/content-only-controls/rich-text/index.js.map +3 -3
- package/build/components/dimensions-tool/width-height-tool.js +4 -16
- package/build/components/dimensions-tool/width-height-tool.js.map +3 -3
- package/build/components/font-family/index.js +1 -15
- package/build/components/font-family/index.js.map +2 -2
- package/build/components/global-styles/dimensions-panel.js +35 -2
- package/build/components/global-styles/dimensions-panel.js.map +2 -2
- package/build/components/global-styles/hooks.js +1 -1
- package/build/components/global-styles/hooks.js.map +2 -2
- package/build/components/global-styles/typography-panel.js +1 -2
- package/build/components/global-styles/typography-panel.js.map +2 -2
- package/build/components/image-editor/cropper.js +3 -34
- package/build/components/image-editor/cropper.js.map +3 -3
- package/build/components/image-editor/index.js +9 -3
- package/build/components/image-editor/index.js.map +2 -2
- package/build/components/image-editor/use-transform-image.js +62 -32
- package/build/components/image-editor/use-transform-image.js.map +2 -2
- package/build/components/image-editor/zoom-dropdown.js +2 -2
- package/build/components/image-editor/zoom-dropdown.js.map +2 -2
- package/build/components/index.js +10 -3
- package/build/components/index.js.map +2 -2
- package/build/components/inserter-draggable-blocks/index.js +8 -4
- package/build/components/inserter-draggable-blocks/index.js.map +2 -2
- package/build/components/inspector-controls-tabs/content-tab.js +3 -2
- package/build/components/inspector-controls-tabs/content-tab.js.map +2 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
- package/build/components/link-control/index.js +15 -7
- package/build/components/link-control/index.js.map +2 -2
- package/build/components/list-view/block-select-button.js +3 -11
- package/build/components/list-view/block-select-button.js.map +2 -2
- package/build/components/list-view/block.js +9 -7
- package/build/components/list-view/block.js.map +2 -2
- package/build/components/media-placeholder/index.js +17 -4
- package/build/components/media-placeholder/index.js.map +2 -2
- package/build/components/media-placeholder/utils.js +60 -0
- package/build/components/media-placeholder/utils.js.map +7 -0
- package/build/components/media-replace-flow/index.js +20 -3
- package/build/components/media-replace-flow/index.js.map +2 -2
- package/build/components/tool-selector/index.js +46 -0
- package/build/components/tool-selector/index.js.map +7 -0
- package/build/components/use-block-commands/index.js +1 -1
- package/build/components/use-block-commands/index.js.map +2 -2
- package/build/components/use-block-drop-zone/index.js +1 -5
- package/build/components/use-block-drop-zone/index.js.map +2 -2
- package/build/hooks/block-bindings.js +22 -260
- package/build/hooks/block-bindings.js.map +3 -3
- package/build/hooks/dimensions.js +3 -3
- package/build/hooks/dimensions.js.map +2 -2
- package/build/hooks/metadata.js +1 -1
- package/build/hooks/metadata.js.map +2 -2
- package/build/hooks/utils.js +5 -1
- package/build/hooks/utils.js.map +2 -2
- package/build/layouts/grid.js +23 -28
- package/build/layouts/grid.js.map +2 -2
- package/build/store/private-selectors.js +43 -3
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/reducer.js +2 -1
- package/build/store/reducer.js.map +2 -2
- package/build/store/selectors.js +6 -4
- package/build/store/selectors.js.map +2 -2
- package/build/utils/block-bindings.js +2 -44
- package/build/utils/block-bindings.js.map +3 -3
- package/build/utils/index.js +2 -5
- package/build/utils/index.js.map +2 -2
- package/build-module/components/block-alignment-matrix-control/index.js +1 -8
- package/build-module/components/block-alignment-matrix-control/index.js.map +2 -2
- package/build-module/components/block-bindings/attribute-control.js +150 -0
- package/build-module/components/block-bindings/attribute-control.js.map +7 -0
- package/build-module/components/block-bindings/index.js +10 -0
- package/build-module/components/block-bindings/index.js.map +7 -0
- package/build-module/components/block-bindings/source-fields-list.js +104 -0
- package/build-module/components/block-bindings/source-fields-list.js.map +7 -0
- package/build-module/components/block-bindings/use-block-bindings-utils.js +45 -0
- package/build-module/components/block-bindings/use-block-bindings-utils.js.map +7 -0
- package/build-module/components/block-edit/edit.js +1 -3
- package/build-module/components/block-edit/edit.js.map +2 -2
- package/build-module/components/block-list/index.js +2 -1
- package/build-module/components/block-list/index.js.map +2 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
- package/build-module/components/block-lock/modal.js +5 -5
- package/build-module/components/block-lock/modal.js.map +2 -2
- package/build-module/components/block-lock/use-block-lock.js +10 -13
- package/build-module/components/block-lock/use-block-lock.js.map +2 -2
- package/build-module/components/block-settings-menu-controls/index.js +1 -1
- package/build-module/components/block-settings-menu-controls/index.js.map +2 -2
- package/build-module/components/block-styles/preview-panel.js +3 -5
- package/build-module/components/block-styles/preview-panel.js.map +2 -2
- package/build-module/components/block-styles/use-styles-for-block.js +2 -2
- package/build-module/components/block-styles/use-styles-for-block.js.map +2 -2
- package/build-module/components/block-toolbar/index.js +1 -8
- package/build-module/components/block-toolbar/index.js.map +2 -2
- package/build-module/components/block-tools/index.js +56 -45
- package/build-module/components/block-tools/index.js.map +2 -2
- package/build-module/components/block-visibility/toolbar.js +1 -1
- package/build-module/components/block-visibility/toolbar.js.map +1 -1
- package/build-module/components/content-only-controls/fields-dropdown-menu.js +45 -0
- package/build-module/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
- package/build-module/components/content-only-controls/index.js +206 -46
- package/build-module/components/content-only-controls/index.js.map +2 -2
- package/build-module/components/content-only-controls/link/index.js +92 -104
- package/build-module/components/content-only-controls/link/index.js.map +2 -2
- package/build-module/components/content-only-controls/media/index.js +134 -135
- package/build-module/components/content-only-controls/media/index.js.map +2 -2
- package/build-module/components/content-only-controls/rich-text/index.js +68 -81
- package/build-module/components/content-only-controls/rich-text/index.js.map +2 -2
- package/build-module/components/dimensions-tool/width-height-tool.js +4 -6
- package/build-module/components/dimensions-tool/width-height-tool.js.map +2 -2
- package/build-module/components/font-family/index.js +1 -15
- package/build-module/components/font-family/index.js.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.js +35 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +2 -2
- package/build-module/components/global-styles/hooks.js +1 -1
- package/build-module/components/global-styles/hooks.js.map +2 -2
- package/build-module/components/global-styles/typography-panel.js +1 -2
- package/build-module/components/global-styles/typography-panel.js.map +2 -2
- package/build-module/components/image-editor/cropper.js +3 -34
- package/build-module/components/image-editor/cropper.js.map +2 -2
- package/build-module/components/image-editor/index.js +9 -3
- package/build-module/components/image-editor/index.js.map +2 -2
- package/build-module/components/image-editor/use-transform-image.js +63 -33
- package/build-module/components/image-editor/use-transform-image.js.map +2 -2
- package/build-module/components/image-editor/zoom-dropdown.js +2 -2
- package/build-module/components/image-editor/zoom-dropdown.js.map +2 -2
- package/build-module/components/index.js +74 -66
- package/build-module/components/index.js.map +2 -2
- package/build-module/components/inserter-draggable-blocks/index.js +8 -4
- package/build-module/components/inserter-draggable-blocks/index.js.map +2 -2
- package/build-module/components/inspector-controls-tabs/content-tab.js +3 -2
- package/build-module/components/inspector-controls-tabs/content-tab.js.map +2 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
- package/build-module/components/link-control/index.js +16 -8
- package/build-module/components/link-control/index.js.map +2 -2
- package/build-module/components/list-view/block-select-button.js +3 -11
- package/build-module/components/list-view/block-select-button.js.map +2 -2
- package/build-module/components/list-view/block.js +9 -7
- package/build-module/components/list-view/block.js.map +2 -2
- package/build-module/components/media-placeholder/index.js +18 -5
- package/build-module/components/media-placeholder/index.js.map +2 -2
- package/build-module/components/media-placeholder/utils.js +35 -0
- package/build-module/components/media-placeholder/utils.js.map +7 -0
- package/build-module/components/media-replace-flow/index.js +20 -3
- package/build-module/components/media-replace-flow/index.js.map +2 -2
- package/build-module/components/tool-selector/index.js +15 -0
- package/build-module/components/tool-selector/index.js.map +7 -0
- package/build-module/components/use-block-commands/index.js +1 -1
- package/build-module/components/use-block-commands/index.js.map +2 -2
- package/build-module/components/use-block-drop-zone/index.js +1 -5
- package/build-module/components/use-block-drop-zone/index.js.map +2 -2
- package/build-module/hooks/block-bindings.js +27 -270
- package/build-module/hooks/block-bindings.js.map +2 -2
- package/build-module/hooks/dimensions.js +3 -3
- package/build-module/hooks/dimensions.js.map +2 -2
- package/build-module/hooks/metadata.js +1 -1
- package/build-module/hooks/metadata.js.map +2 -2
- package/build-module/hooks/utils.js +5 -1
- package/build-module/hooks/utils.js.map +2 -2
- package/build-module/layouts/grid.js +23 -28
- package/build-module/layouts/grid.js.map +2 -2
- package/build-module/store/private-selectors.js +39 -3
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/reducer.js +2 -1
- package/build-module/store/reducer.js.map +2 -2
- package/build-module/store/selectors.js +6 -4
- package/build-module/store/selectors.js.map +2 -2
- package/build-module/utils/block-bindings.js +1 -42
- package/build-module/utils/block-bindings.js.map +2 -2
- package/build-module/utils/index.js +1 -3
- package/build-module/utils/index.js.map +2 -2
- package/build-style/content-rtl.css +3 -0
- package/build-style/content.css +3 -0
- package/build-style/style-rtl.css +20 -11
- package/build-style/style.css +20 -11
- package/package.json +39 -39
- package/src/components/block-alignment-matrix-control/index.js +1 -5
- package/src/components/block-bindings/attribute-control.js +174 -0
- package/src/components/block-bindings/index.js +6 -0
- package/src/components/block-bindings/source-fields-list.js +130 -0
- package/src/components/block-bindings/use-block-bindings-utils.js +156 -0
- package/src/components/block-edit/edit.js +1 -3
- package/src/components/block-list/content.scss +5 -0
- package/src/components/block-list/index.js +3 -1
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +34 -3
- package/src/components/block-lock/modal.js +6 -5
- package/src/components/block-lock/use-block-lock.js +10 -14
- package/src/components/block-patterns-list/stories/{index.story.js → index.story.jsx} +3 -1
- package/src/components/block-settings-menu-controls/index.js +1 -1
- package/src/components/block-styles/preview-panel.js +3 -5
- package/src/components/block-styles/use-styles-for-block.js +2 -2
- package/src/components/block-toolbar/index.js +1 -6
- package/src/components/block-toolbar/style.scss +6 -6
- package/src/components/block-tools/index.js +15 -2
- package/src/components/block-tools/style.scss +4 -0
- package/src/components/block-visibility/toolbar.js +1 -1
- package/src/components/content-only-controls/fields-dropdown-menu.js +53 -0
- package/src/components/content-only-controls/index.js +289 -50
- package/src/components/content-only-controls/link/index.js +62 -57
- package/src/components/content-only-controls/media/index.js +177 -156
- package/src/components/content-only-controls/rich-text/index.js +31 -44
- package/src/components/content-only-controls/styles.scss +10 -1
- package/src/components/dimensions-tool/width-height-tool.js +6 -13
- package/src/components/font-family/README.md +0 -9
- package/src/components/font-family/index.js +1 -16
- package/src/components/font-family/stories/{index.story.js → index.story.jsx} +0 -1
- package/src/components/global-styles/dimensions-panel.js +36 -0
- package/src/components/global-styles/hooks.js +1 -1
- package/src/components/global-styles/typography-panel.js +0 -1
- package/src/components/image-editor/cropper.js +3 -32
- package/src/components/image-editor/index.js +34 -29
- package/src/components/image-editor/use-transform-image.js +80 -34
- package/src/components/image-editor/zoom-dropdown.js +2 -2
- package/src/components/index.js +9 -1
- package/src/components/inserter/style.scss +1 -1
- package/src/components/inserter-draggable-blocks/index.js +19 -8
- package/src/components/inspector-controls-tabs/content-tab.js +6 -2
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -5
- package/src/components/link-control/index.js +36 -12
- package/src/components/list-view/block-select-button.js +22 -30
- package/src/components/list-view/block.js +9 -7
- package/src/components/media-placeholder/index.js +20 -5
- package/src/components/media-placeholder/test/get-computed-accept-attribute.js +164 -0
- package/src/components/media-placeholder/utils.js +65 -0
- package/src/components/media-replace-flow/index.js +22 -3
- package/src/components/tool-selector/index.js +19 -0
- package/src/components/use-block-commands/index.js +1 -1
- package/src/components/use-block-drop-zone/index.js +1 -5
- package/src/hooks/block-bindings.js +27 -347
- package/src/hooks/dimensions.js +8 -3
- package/src/hooks/metadata.js +1 -1
- package/src/hooks/test/metadata.js +1 -1
- package/src/hooks/utils.js +4 -0
- package/src/layouts/grid.js +40 -72
- package/src/layouts/test/grid.js +14 -0
- package/src/store/private-selectors.js +123 -6
- package/src/store/reducer.js +3 -0
- package/src/store/selectors.js +6 -4
- package/src/store/test/private-selectors.js +242 -0
- package/src/store/test/reducer.js +17 -7
- package/src/style.scss +0 -1
- package/src/utils/block-bindings.js +0 -157
- package/src/utils/index.js +0 -1
- package/tsconfig.json +2 -0
- package/build/components/block-toolbar/block-name-context.js +0 -30
- package/build/components/block-toolbar/block-name-context.js.map +0 -7
- package/build/components/content-only-controls/plain-text/index.js +0 -68
- package/build/components/content-only-controls/plain-text/index.js.map +0 -7
- package/build-module/components/block-toolbar/block-name-context.js +0 -9
- package/build-module/components/block-toolbar/block-name-context.js.map +0 -7
- package/build-module/components/content-only-controls/plain-text/index.js +0 -50
- package/build-module/components/content-only-controls/plain-text/index.js.map +0 -7
- package/src/components/block-toolbar/block-name-context.js +0 -9
- package/src/components/content-only-controls/plain-text/index.js +0 -49
- package/src/components/font-family/style.scss +0 -7
- /package/src/components/alignment-control/stories/{aliginment-toolbar.story.js → aliginment-toolbar.story.jsx} +0 -0
- /package/src/components/alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-alignment-matrix-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/{utils → components/block-bindings}/test/use-block-bindings-utils.js +0 -0
- /package/src/components/block-draggable/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-heading-level-dropdown/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-mover/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-title/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/border-radius-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/date-format-picker/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{aspect-ratio-tool.story.js → aspect-ratio-tool.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{scale-tool.story.js → scale-tool.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{width-height-tool.story.js → width-height-tool.story.jsx} +0 -0
- /package/src/components/height-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/inserter/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/line-height-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/plain-text/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/resolution-tool/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/tabbed-sidebar/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/text-alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/text-decoration-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/text-transform-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/unit-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/url-popover/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/warning/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/writing-mode-control/stories/{index.story.js → index.story.jsx} +0 -0
|
@@ -22,7 +22,6 @@ import { BlockGroupToolbar } from "../convert-to-group-buttons";
|
|
|
22
22
|
import BlockEditVisuallyButton from "../block-edit-visually-button";
|
|
23
23
|
import { useShowHoveredOrFocusedGestures } from "./utils";
|
|
24
24
|
import { store as blockEditorStore } from "../../store";
|
|
25
|
-
import __unstableBlockNameContext from "./block-name-context";
|
|
26
25
|
import NavigableToolbar from "../navigable-toolbar";
|
|
27
26
|
import { useHasBlockToolbar } from "./use-has-block-toolbar";
|
|
28
27
|
import ChangeDesign from "./change-design";
|
|
@@ -210,13 +209,7 @@ function PrivateBlockToolbar({
|
|
|
210
209
|
className: "block-editor-block-toolbar__slot"
|
|
211
210
|
}
|
|
212
211
|
),
|
|
213
|
-
/* @__PURE__ */ jsx(
|
|
214
|
-
__unstableBlockNameContext.Provider,
|
|
215
|
-
{
|
|
216
|
-
value: blockType?.name,
|
|
217
|
-
children: /* @__PURE__ */ jsx(__unstableBlockToolbarLastItem.Slot, {})
|
|
218
|
-
}
|
|
219
|
-
)
|
|
212
|
+
/* @__PURE__ */ jsx(__unstableBlockToolbarLastItem.Slot, {})
|
|
220
213
|
] }),
|
|
221
214
|
/* @__PURE__ */ jsx(BlockEditVisuallyButton, { clientIds: blockClientIds }),
|
|
222
215
|
/* @__PURE__ */ jsx(BlockSettingsMenu, { clientIds: blockClientIds })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/block-toolbar/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tgetBlockType,\n\thasBlockSupport,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { ToolbarGroup } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockMover from '../block-mover';\nimport BlockParentSelector from '../block-parent-selector';\nimport BlockControls from '../block-controls';\nimport __unstableBlockToolbarLastItem from './block-toolbar-last-item';\nimport BlockSettingsMenu from '../block-settings-menu';\nimport { BlockLockToolbar } from '../block-lock';\nimport { BlockVisibilityToolbar } from '../block-visibility';\nimport { BlockGroupToolbar } from '../convert-to-group-buttons';\nimport BlockEditVisuallyButton from '../block-edit-visually-button';\nimport { useShowHoveredOrFocusedGestures } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport __unstableBlockNameContext from './block-name-context';\nimport NavigableToolbar from '../navigable-toolbar';\nimport { useHasBlockToolbar } from './use-has-block-toolbar';\nimport ChangeDesign from './change-design';\nimport SwitchSectionStyle from './switch-section-style';\nimport { unlock } from '../../lock-unlock';\nimport BlockToolbarIcon from './block-toolbar-icon';\n\n/**\n * Renders the block toolbar.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md\n *\n * @param {Object} props Components props.\n * @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality.\n * @param {boolean} props.focusOnMount Focus the toolbar when mounted.\n * @param {number} props.__experimentalInitialIndex The initial index of the toolbar item to focus.\n * @param {Function} props.__experimentalOnIndexChange Callback function to be called when the index of the focused toolbar item changes.\n * @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons.\n */\nexport function PrivateBlockToolbar( {\n\thideDragHandle,\n\tfocusOnMount,\n\t__experimentalInitialIndex,\n\t__experimentalOnIndexChange,\n\tvariant = 'unstyled',\n} ) {\n\tconst {\n\t\tblockClientId,\n\t\tblockClientIds,\n\t\tisDefaultEditingMode,\n\t\tblockType,\n\t\ttoolbarKey,\n\t\tshouldShowVisualToolbar,\n\t\tshowParentSelector,\n\t\tisUsingBindings,\n\t\tisSectionContainer,\n\t\thasContentOnlyLocking,\n\t\tshowShuffleButton,\n\t\tshowSlots,\n\t\tshowGroupButtons,\n\t\tshowLockButtons,\n\t\tshowBlockVisibilityButton,\n\t\tshowSwitchSectionStyleButton,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockName,\n\t\t\tgetBlockMode,\n\t\t\tgetBlockParents,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisBlockValid,\n\t\t\tgetBlockEditingMode,\n\t\t\tgetBlockAttributes,\n\t\t\tgetTemplateLock,\n\t\t\tgetParentSectionBlock,\n\t\t\tisZoomOut,\n\t\t\tisSectionBlock,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst selectedBlockClientId = selectedBlockClientIds[ 0 ];\n\t\tconst parents = getBlockParents( selectedBlockClientId );\n\t\tconst parentSection = getParentSectionBlock( selectedBlockClientId );\n\t\tconst parentClientId = parentSection ?? parents[ parents.length - 1 ];\n\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\tconst parentBlockType = getBlockType( parentBlockName );\n\t\tconst editingMode = getBlockEditingMode( selectedBlockClientId );\n\t\tconst _isDefaultEditingMode = editingMode === 'default';\n\t\tconst _blockName = getBlockName( selectedBlockClientId );\n\t\tconst isValid = selectedBlockClientIds.every( ( id ) =>\n\t\t\tisBlockValid( id )\n\t\t);\n\t\tconst isVisual = selectedBlockClientIds.every(\n\t\t\t( id ) => getBlockMode( id ) === 'visual'\n\t\t);\n\t\tconst _isUsingBindings = selectedBlockClientIds.every(\n\t\t\t( clientId ) =>\n\t\t\t\t!! getBlockAttributes( clientId )?.metadata?.bindings\n\t\t);\n\n\t\t// If one or more selected blocks are locked, do not show the BlockGroupToolbar.\n\t\tconst _hasTemplateLock = selectedBlockClientIds.some(\n\t\t\t( id ) => getTemplateLock( id ) === 'contentOnly'\n\t\t);\n\n\t\tconst _isZoomOut = isZoomOut();\n\n\t\tconst _isSectionBlock = isSectionBlock( selectedBlockClientId );\n\n\t\t// The switch style button appears more prominently with the\n\t\t// content only pattern experiment.\n\t\tconst _showSwitchSectionStyleButton =\n\t\t\twindow?.__experimentalContentOnlyPatternInsertion &&\n\t\t\t( _isZoomOut || _isSectionBlock );\n\n\t\treturn {\n\t\t\tblockClientId: selectedBlockClientId,\n\t\t\tblockClientIds: selectedBlockClientIds,\n\t\t\tisDefaultEditingMode: _isDefaultEditingMode,\n\t\t\tblockType: selectedBlockClientId && getBlockType( _blockName ),\n\t\t\tshouldShowVisualToolbar: isValid && isVisual,\n\t\t\ttoolbarKey: `${ selectedBlockClientId }${ parentClientId }`,\n\t\t\tshowParentSelector:\n\t\t\t\t! _isZoomOut &&\n\t\t\t\tparentBlockType &&\n\t\t\t\teditingMode !== 'contentOnly' &&\n\t\t\t\tgetBlockEditingMode( parentClientId ) !== 'disabled' &&\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\tisUsingBindings: _isUsingBindings,\n\t\t\tisSectionContainer: _isSectionBlock,\n\t\t\thasContentOnlyLocking: _hasTemplateLock,\n\t\t\tshowShuffleButton: _isZoomOut,\n\t\t\tshowSlots: ! _isZoomOut,\n\t\t\tshowGroupButtons: ! _isZoomOut,\n\t\t\tshowLockButtons: ! _isZoomOut,\n\t\t\tshowBlockVisibilityButton: ! _isZoomOut,\n\t\t\tshowSwitchSectionStyleButton: _showSwitchSectionStyleButton,\n\t\t};\n\t}, [] );\n\n\tconst toolbarWrapperRef = useRef( null );\n\n\t// Handles highlighting the current block outline on hover or focus of the\n\t// block type toolbar area.\n\tconst nodeRef = useRef();\n\tconst showHoveredOrFocusedGestures = useShowHoveredOrFocusedGestures( {\n\t\tref: nodeRef,\n\t} );\n\n\tconst isLargeViewport = ! useViewportMatch( 'medium', '<' );\n\n\tconst hasBlockToolbar = useHasBlockToolbar();\n\tif ( ! hasBlockToolbar ) {\n\t\treturn null;\n\t}\n\n\tconst isMultiToolbar = blockClientIds.length > 1;\n\tconst isSynced =\n\t\tisReusableBlock( blockType ) || isTemplatePart( blockType );\n\n\t// Shifts the toolbar to make room for the parent block selector.\n\tconst classes = clsx( 'block-editor-block-contextual-toolbar', {\n\t\t'has-parent': showParentSelector,\n\t} );\n\n\tconst innerClasses = clsx( 'block-editor-block-toolbar', {\n\t\t'is-synced': isSynced,\n\t\t'is-connected': isUsingBindings,\n\t} );\n\n\treturn (\n\t\t<NavigableToolbar\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\t// The variant is applied as \"toolbar\" when undefined, which is the black border style of the dropdown from the toolbar popover.\n\t\t\tvariant={ variant === 'toolbar' ? undefined : variant }\n\t\t\tfocusOnMount={ focusOnMount }\n\t\t\t__experimentalInitialIndex={ __experimentalInitialIndex }\n\t\t\t__experimentalOnIndexChange={ __experimentalOnIndexChange }\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={ toolbarKey }\n\t\t>\n\t\t\t<div ref={ toolbarWrapperRef } className={ innerClasses }>\n\t\t\t\t{ showParentSelector && ! isMultiToolbar && isLargeViewport && (\n\t\t\t\t\t<BlockParentSelector />\n\t\t\t\t) }\n\t\t\t\t{ ( shouldShowVisualToolbar || isMultiToolbar ) && (\n\t\t\t\t\t<div ref={ nodeRef } { ...showHoveredOrFocusedGestures }>\n\t\t\t\t\t\t<ToolbarGroup className=\"block-editor-block-toolbar__block-controls\">\n\t\t\t\t\t\t\t<BlockToolbarIcon\n\t\t\t\t\t\t\t\tclientIds={ blockClientIds }\n\t\t\t\t\t\t\t\tisSynced={ isSynced }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isDefaultEditingMode &&\n\t\t\t\t\t\t\t\tshowBlockVisibilityButton && (\n\t\t\t\t\t\t\t\t\t<BlockVisibilityToolbar\n\t\t\t\t\t\t\t\t\t\tclientIds={ blockClientIds }\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{ ! isMultiToolbar &&\n\t\t\t\t\t\t\t\tisDefaultEditingMode &&\n\t\t\t\t\t\t\t\tshowLockButtons && (\n\t\t\t\t\t\t\t\t\t<BlockLockToolbar\n\t\t\t\t\t\t\t\t\t\tclientId={ blockClientId }\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<BlockMover\n\t\t\t\t\t\t\t\tclientIds={ blockClientIds }\n\t\t\t\t\t\t\t\thideDragHandle={ hideDragHandle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ ! hasContentOnlyLocking &&\n\t\t\t\t\tshouldShowVisualToolbar &&\n\t\t\t\t\tisMultiToolbar &&\n\t\t\t\t\tshowGroupButtons && <BlockGroupToolbar /> }\n\t\t\t\t{ showShuffleButton && (\n\t\t\t\t\t<ChangeDesign clientId={ blockClientIds[ 0 ] } />\n\t\t\t\t) }\n\t\t\t\t{ showSwitchSectionStyleButton && (\n\t\t\t\t\t<SwitchSectionStyle clientId={ blockClientIds[ 0 ] } />\n\t\t\t\t) }\n\t\t\t\t{ shouldShowVisualToolbar && showSlots && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isSectionContainer && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\t\t\tgroup=\"parent\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\t\t\tgroup=\"block\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<BlockControls.Slot className=\"block-editor-block-toolbar__slot\" />\n\t\t\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\t\t\tgroup=\"inline\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\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\t<BlockControls.Slot\n\t\t\t\t\t\t\tgroup=\"other\"\n\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<__unstableBlockNameContext.Provider\n\t\t\t\t\t\t\tvalue={ blockType?.name }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<__unstableBlockToolbarLastItem.Slot />\n\t\t\t\t\t\t</__unstableBlockNameContext.Provider>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEditVisuallyButton clientIds={ blockClientIds } />\n\t\t\t\t<BlockSettingsMenu clientIds={ blockClientIds } />\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\n/**\n * Renders the block toolbar.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md\n *\n * @param {Object} props Components props.\n * @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality.\n * @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons.\n */\nexport default function BlockToolbar( { hideDragHandle, variant } ) {\n\treturn (\n\t\t<PrivateBlockToolbar\n\t\t\thideDragHandle={ hideDragHandle }\n\t\t\tvariant={ variant }\n\t\t\tfocusOnMount={ undefined }\n\t\t\t__experimentalInitialIndex={ undefined }\n\t\t\t__experimentalOnIndexChange={ undefined }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AACvB,SAAS,wBAAwB;AACjC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,oBAAoB;AAK7B,OAAO,gBAAgB;AACvB,OAAO,yBAAyB;AAChC,OAAO,mBAAmB;AAC1B,OAAO,oCAAoC;AAC3C,OAAO,uBAAuB;AAC9B,SAAS,wBAAwB;AACjC,SAAS,8BAA8B;AACvC,SAAS,yBAAyB;AAClC,OAAO,6BAA6B;AACpC,SAAS,uCAAuC;AAChD,SAAS,SAAS,wBAAwB;AAC1C,OAAO,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tgetBlockType,\n\thasBlockSupport,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { ToolbarGroup } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockMover from '../block-mover';\nimport BlockParentSelector from '../block-parent-selector';\nimport BlockControls from '../block-controls';\nimport __unstableBlockToolbarLastItem from './block-toolbar-last-item';\nimport BlockSettingsMenu from '../block-settings-menu';\nimport { BlockLockToolbar } from '../block-lock';\nimport { BlockVisibilityToolbar } from '../block-visibility';\nimport { BlockGroupToolbar } from '../convert-to-group-buttons';\nimport BlockEditVisuallyButton from '../block-edit-visually-button';\nimport { useShowHoveredOrFocusedGestures } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport NavigableToolbar from '../navigable-toolbar';\nimport { useHasBlockToolbar } from './use-has-block-toolbar';\nimport ChangeDesign from './change-design';\nimport SwitchSectionStyle from './switch-section-style';\nimport { unlock } from '../../lock-unlock';\nimport BlockToolbarIcon from './block-toolbar-icon';\n\n/**\n * Renders the block toolbar.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md\n *\n * @param {Object} props Components props.\n * @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality.\n * @param {boolean} props.focusOnMount Focus the toolbar when mounted.\n * @param {number} props.__experimentalInitialIndex The initial index of the toolbar item to focus.\n * @param {Function} props.__experimentalOnIndexChange Callback function to be called when the index of the focused toolbar item changes.\n * @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons.\n */\nexport function PrivateBlockToolbar( {\n\thideDragHandle,\n\tfocusOnMount,\n\t__experimentalInitialIndex,\n\t__experimentalOnIndexChange,\n\tvariant = 'unstyled',\n} ) {\n\tconst {\n\t\tblockClientId,\n\t\tblockClientIds,\n\t\tisDefaultEditingMode,\n\t\tblockType,\n\t\ttoolbarKey,\n\t\tshouldShowVisualToolbar,\n\t\tshowParentSelector,\n\t\tisUsingBindings,\n\t\tisSectionContainer,\n\t\thasContentOnlyLocking,\n\t\tshowShuffleButton,\n\t\tshowSlots,\n\t\tshowGroupButtons,\n\t\tshowLockButtons,\n\t\tshowBlockVisibilityButton,\n\t\tshowSwitchSectionStyleButton,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockName,\n\t\t\tgetBlockMode,\n\t\t\tgetBlockParents,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisBlockValid,\n\t\t\tgetBlockEditingMode,\n\t\t\tgetBlockAttributes,\n\t\t\tgetTemplateLock,\n\t\t\tgetParentSectionBlock,\n\t\t\tisZoomOut,\n\t\t\tisSectionBlock,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst selectedBlockClientId = selectedBlockClientIds[ 0 ];\n\t\tconst parents = getBlockParents( selectedBlockClientId );\n\t\tconst parentSection = getParentSectionBlock( selectedBlockClientId );\n\t\tconst parentClientId = parentSection ?? parents[ parents.length - 1 ];\n\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\tconst parentBlockType = getBlockType( parentBlockName );\n\t\tconst editingMode = getBlockEditingMode( selectedBlockClientId );\n\t\tconst _isDefaultEditingMode = editingMode === 'default';\n\t\tconst _blockName = getBlockName( selectedBlockClientId );\n\t\tconst isValid = selectedBlockClientIds.every( ( id ) =>\n\t\t\tisBlockValid( id )\n\t\t);\n\t\tconst isVisual = selectedBlockClientIds.every(\n\t\t\t( id ) => getBlockMode( id ) === 'visual'\n\t\t);\n\t\tconst _isUsingBindings = selectedBlockClientIds.every(\n\t\t\t( clientId ) =>\n\t\t\t\t!! getBlockAttributes( clientId )?.metadata?.bindings\n\t\t);\n\n\t\t// If one or more selected blocks are locked, do not show the BlockGroupToolbar.\n\t\tconst _hasTemplateLock = selectedBlockClientIds.some(\n\t\t\t( id ) => getTemplateLock( id ) === 'contentOnly'\n\t\t);\n\n\t\tconst _isZoomOut = isZoomOut();\n\n\t\tconst _isSectionBlock = isSectionBlock( selectedBlockClientId );\n\n\t\t// The switch style button appears more prominently with the\n\t\t// content only pattern experiment.\n\t\tconst _showSwitchSectionStyleButton =\n\t\t\twindow?.__experimentalContentOnlyPatternInsertion &&\n\t\t\t( _isZoomOut || _isSectionBlock );\n\n\t\treturn {\n\t\t\tblockClientId: selectedBlockClientId,\n\t\t\tblockClientIds: selectedBlockClientIds,\n\t\t\tisDefaultEditingMode: _isDefaultEditingMode,\n\t\t\tblockType: selectedBlockClientId && getBlockType( _blockName ),\n\t\t\tshouldShowVisualToolbar: isValid && isVisual,\n\t\t\ttoolbarKey: `${ selectedBlockClientId }${ parentClientId }`,\n\t\t\tshowParentSelector:\n\t\t\t\t! _isZoomOut &&\n\t\t\t\tparentBlockType &&\n\t\t\t\teditingMode !== 'contentOnly' &&\n\t\t\t\tgetBlockEditingMode( parentClientId ) !== 'disabled' &&\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\tisUsingBindings: _isUsingBindings,\n\t\t\tisSectionContainer: _isSectionBlock,\n\t\t\thasContentOnlyLocking: _hasTemplateLock,\n\t\t\tshowShuffleButton: _isZoomOut,\n\t\t\tshowSlots: ! _isZoomOut,\n\t\t\tshowGroupButtons: ! _isZoomOut,\n\t\t\tshowLockButtons: ! _isZoomOut,\n\t\t\tshowBlockVisibilityButton: ! _isZoomOut,\n\t\t\tshowSwitchSectionStyleButton: _showSwitchSectionStyleButton,\n\t\t};\n\t}, [] );\n\n\tconst toolbarWrapperRef = useRef( null );\n\n\t// Handles highlighting the current block outline on hover or focus of the\n\t// block type toolbar area.\n\tconst nodeRef = useRef();\n\tconst showHoveredOrFocusedGestures = useShowHoveredOrFocusedGestures( {\n\t\tref: nodeRef,\n\t} );\n\n\tconst isLargeViewport = ! useViewportMatch( 'medium', '<' );\n\n\tconst hasBlockToolbar = useHasBlockToolbar();\n\tif ( ! hasBlockToolbar ) {\n\t\treturn null;\n\t}\n\n\tconst isMultiToolbar = blockClientIds.length > 1;\n\tconst isSynced =\n\t\tisReusableBlock( blockType ) || isTemplatePart( blockType );\n\n\t// Shifts the toolbar to make room for the parent block selector.\n\tconst classes = clsx( 'block-editor-block-contextual-toolbar', {\n\t\t'has-parent': showParentSelector,\n\t} );\n\n\tconst innerClasses = clsx( 'block-editor-block-toolbar', {\n\t\t'is-synced': isSynced,\n\t\t'is-connected': isUsingBindings,\n\t} );\n\n\treturn (\n\t\t<NavigableToolbar\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\t// The variant is applied as \"toolbar\" when undefined, which is the black border style of the dropdown from the toolbar popover.\n\t\t\tvariant={ variant === 'toolbar' ? undefined : variant }\n\t\t\tfocusOnMount={ focusOnMount }\n\t\t\t__experimentalInitialIndex={ __experimentalInitialIndex }\n\t\t\t__experimentalOnIndexChange={ __experimentalOnIndexChange }\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={ toolbarKey }\n\t\t>\n\t\t\t<div ref={ toolbarWrapperRef } className={ innerClasses }>\n\t\t\t\t{ showParentSelector && ! isMultiToolbar && isLargeViewport && (\n\t\t\t\t\t<BlockParentSelector />\n\t\t\t\t) }\n\t\t\t\t{ ( shouldShowVisualToolbar || isMultiToolbar ) && (\n\t\t\t\t\t<div ref={ nodeRef } { ...showHoveredOrFocusedGestures }>\n\t\t\t\t\t\t<ToolbarGroup className=\"block-editor-block-toolbar__block-controls\">\n\t\t\t\t\t\t\t<BlockToolbarIcon\n\t\t\t\t\t\t\t\tclientIds={ blockClientIds }\n\t\t\t\t\t\t\t\tisSynced={ isSynced }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isDefaultEditingMode &&\n\t\t\t\t\t\t\t\tshowBlockVisibilityButton && (\n\t\t\t\t\t\t\t\t\t<BlockVisibilityToolbar\n\t\t\t\t\t\t\t\t\t\tclientIds={ blockClientIds }\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{ ! isMultiToolbar &&\n\t\t\t\t\t\t\t\tisDefaultEditingMode &&\n\t\t\t\t\t\t\t\tshowLockButtons && (\n\t\t\t\t\t\t\t\t\t<BlockLockToolbar\n\t\t\t\t\t\t\t\t\t\tclientId={ blockClientId }\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<BlockMover\n\t\t\t\t\t\t\t\tclientIds={ blockClientIds }\n\t\t\t\t\t\t\t\thideDragHandle={ hideDragHandle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ ! hasContentOnlyLocking &&\n\t\t\t\t\tshouldShowVisualToolbar &&\n\t\t\t\t\tisMultiToolbar &&\n\t\t\t\t\tshowGroupButtons && <BlockGroupToolbar /> }\n\t\t\t\t{ showShuffleButton && (\n\t\t\t\t\t<ChangeDesign clientId={ blockClientIds[ 0 ] } />\n\t\t\t\t) }\n\t\t\t\t{ showSwitchSectionStyleButton && (\n\t\t\t\t\t<SwitchSectionStyle clientId={ blockClientIds[ 0 ] } />\n\t\t\t\t) }\n\t\t\t\t{ shouldShowVisualToolbar && showSlots && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isSectionContainer && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\t\t\tgroup=\"parent\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\t\t\tgroup=\"block\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<BlockControls.Slot className=\"block-editor-block-toolbar__slot\" />\n\t\t\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\t\t\tgroup=\"inline\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\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\t<BlockControls.Slot\n\t\t\t\t\t\t\tgroup=\"other\"\n\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<__unstableBlockToolbarLastItem.Slot />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEditVisuallyButton clientIds={ blockClientIds } />\n\t\t\t\t<BlockSettingsMenu clientIds={ blockClientIds } />\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\n/**\n * Renders the block toolbar.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md\n *\n * @param {Object} props Components props.\n * @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality.\n * @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons.\n */\nexport default function BlockToolbar( { hideDragHandle, variant } ) {\n\treturn (\n\t\t<PrivateBlockToolbar\n\t\t\thideDragHandle={ hideDragHandle }\n\t\t\tvariant={ variant }\n\t\t\tfocusOnMount={ undefined }\n\t\t\t__experimentalInitialIndex={ undefined }\n\t\t\t__experimentalOnIndexChange={ undefined }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;A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AW,eAAgB,CAAE,GAAI;AAAA,QAE9C,gCACD,oBAAC,sBAAmB,UAAW,eAAgB,CAAE,GAAI;AAAA,QAEpD,2BAA2B,aAC5B,iCACG;AAAA,WAAE,sBACH,iCACC;AAAA;AAAA,cAAC,cAAc;AAAA,cAAd;AAAA,gBACA,OAAM;AAAA,gBACN,WAAU;AAAA;AAAA,YACX;AAAA,YACA;AAAA,cAAC,cAAc;AAAA,cAAd;AAAA,gBACA,OAAM;AAAA,gBACN,WAAU;AAAA;AAAA,YACX;AAAA,YACA,oBAAC,cAAc,MAAd,EAAmB,WAAU,oCAAmC;AAAA,YACjE;AAAA,cAAC,cAAc;AAAA,cAAd;AAAA,gBACA,OAAM;AAAA,gBACN,WAAU;AAAA;AAAA,YACX;AAAA,aACD;AAAA,UAED;AAAA,YAAC,cAAc;AAAA,YAAd;AAAA,cACA,OAAM;AAAA,cACN,WAAU;AAAA;AAAA,UACX;AAAA,UACA,oBAAC,+BAA+B,MAA/B,EAAoC;AAAA,WACtC;AAAA,QAED,oBAAC,2BAAwB,WAAY,gBAAiB;AAAA,QACtD,oBAAC,qBAAkB,WAAY,gBAAiB;AAAA,SACjD;AAAA;AAAA,IAvEM;AAAA,EAwEP;AAEF;AAWe,SAAR,aAA+B,EAAE,gBAAgB,QAAQ,GAAI;AACnE,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAe;AAAA,MACf,4BAA6B;AAAA,MAC7B,6BAA8B;AAAA;AAAA,EAC/B;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// packages/block-editor/src/components/block-tools/index.js
|
|
2
|
+
import clsx from "clsx";
|
|
2
3
|
import { useSelect, useDispatch } from "@wordpress/data";
|
|
3
4
|
import { isTextField } from "@wordpress/dom";
|
|
4
5
|
import { Popover } from "@wordpress/components";
|
|
@@ -170,7 +171,7 @@ function BlockTools({
|
|
|
170
171
|
const canToggleBlockVisibility = blocks.every(
|
|
171
172
|
(block) => hasBlockSupport(
|
|
172
173
|
getBlockName(block.clientId),
|
|
173
|
-
"
|
|
174
|
+
"visibility",
|
|
174
175
|
true
|
|
175
176
|
)
|
|
176
177
|
);
|
|
@@ -206,50 +207,60 @@ function BlockTools({
|
|
|
206
207
|
const blockToolbarAfterRef = usePopoverScroll(__unstableContentRef);
|
|
207
208
|
return (
|
|
208
209
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
209
|
-
/* @__PURE__ */ jsx(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
210
|
+
/* @__PURE__ */ jsx(
|
|
211
|
+
"div",
|
|
212
|
+
{
|
|
213
|
+
...props,
|
|
214
|
+
onKeyDown,
|
|
215
|
+
className: clsx(props.className, {
|
|
216
|
+
"block-editor-block-tools--is-dragging": isDragging
|
|
217
|
+
}),
|
|
218
|
+
children: /* @__PURE__ */ jsxs(InsertionPointOpenRef.Provider, { value: useRef(false), children: [
|
|
219
|
+
!isTyping && !isZoomOutMode && /* @__PURE__ */ jsx(
|
|
220
|
+
InsertionPoint,
|
|
221
|
+
{
|
|
222
|
+
__unstableContentRef
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
showEmptyBlockSideInserter && /* @__PURE__ */ jsx(
|
|
226
|
+
EmptyBlockInserter,
|
|
227
|
+
{
|
|
228
|
+
__unstableContentRef,
|
|
229
|
+
clientId
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
showBlockToolbarPopover && /* @__PURE__ */ jsx(
|
|
233
|
+
BlockToolbarPopover,
|
|
234
|
+
{
|
|
235
|
+
__unstableContentRef,
|
|
236
|
+
clientId,
|
|
237
|
+
isTyping
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
!isZoomOutMode && !hasFixedToolbar && /* @__PURE__ */ jsx(
|
|
241
|
+
Popover.Slot,
|
|
242
|
+
{
|
|
243
|
+
name: "block-toolbar",
|
|
244
|
+
ref: blockToolbarRef
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
children,
|
|
248
|
+
/* @__PURE__ */ jsx(
|
|
249
|
+
Popover.Slot,
|
|
250
|
+
{
|
|
251
|
+
name: "__unstable-block-tools-after",
|
|
252
|
+
ref: blockToolbarAfterRef
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
isZoomOutMode && !isDragging && /* @__PURE__ */ jsx(
|
|
256
|
+
ZoomOutModeInserters,
|
|
257
|
+
{
|
|
258
|
+
__unstableContentRef
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
] })
|
|
262
|
+
}
|
|
263
|
+
)
|
|
253
264
|
);
|
|
254
265
|
}
|
|
255
266
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/block-tools/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isTextField } from '@wordpress/dom';\nimport { Popover } from '@wordpress/components';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { useRef } from '@wordpress/element';\nimport {\n\tswitchToBlockType,\n\tstore as blocksStore,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { speak } from '@wordpress/a11y';\nimport { __, sprintf, _n } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport EmptyBlockInserter from './empty-block-inserter';\nimport {\n\tInsertionPointOpenRef,\n\tdefault as InsertionPoint,\n} from './insertion-point';\nimport BlockToolbarPopover from './block-toolbar-popover';\nimport { store as blockEditorStore } from '../../store';\nimport usePopoverScroll from '../block-popover/use-popover-scroll';\nimport ZoomOutModeInserters from './zoom-out-mode-inserters';\nimport { useShowBlockTools } from './use-show-block-tools';\nimport { unlock } from '../../lock-unlock';\nimport { cleanEmptyObject } from '../../hooks/utils';\nimport usePasteStyles from '../use-paste-styles';\n\nfunction selector( select ) {\n\tconst {\n\t\tgetSelectedBlockClientId,\n\t\tgetFirstMultiSelectedBlockClientId,\n\t\tgetSettings,\n\t\tisTyping,\n\t\tisDragging,\n\t\tisZoomOut,\n\t} = unlock( select( blockEditorStore ) );\n\n\tconst clientId =\n\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\treturn {\n\t\tclientId,\n\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\tisTyping: isTyping(),\n\t\tisZoomOutMode: isZoomOut(),\n\t\tisDragging: isDragging(),\n\t};\n}\n\n/**\n * Renders block tools (the block toolbar, select/navigation mode toolbar, the\n * insertion point and a slot for the inline rich text toolbar). Must be wrapped\n * around the block content and editor styles wrapper or iframe.\n *\n * @param {Object} $0 Props.\n * @param {Object} $0.children The block content and style container.\n * @param {Object} $0.__unstableContentRef Ref holding the content scroll container.\n */\nexport default function BlockTools( {\n\tchildren,\n\t__unstableContentRef,\n\t...props\n} ) {\n\tconst { clientId, hasFixedToolbar, isTyping, isZoomOutMode, isDragging } =\n\t\tuseSelect( selector, [] );\n\n\tconst isMatch = useShortcutEventMatch();\n\tconst {\n\t\tgetBlocksByClientId,\n\t\tgetSelectedBlockClientIds,\n\t\tgetBlockRootClientId,\n\t\tisGroupable,\n\t\tgetBlockName,\n\t\tgetEditedContentOnlySection,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { getGroupingBlockName } = useSelect( blocksStore );\n\tconst { showEmptyBlockSideInserter, showBlockToolbarPopover } =\n\t\tuseShowBlockTools();\n\tconst pasteStyles = usePasteStyles();\n\n\tconst {\n\t\tduplicateBlocks,\n\t\tremoveBlocks,\n\t\treplaceBlocks,\n\t\tinsertAfterBlock,\n\t\tinsertBeforeBlock,\n\t\tselectBlock,\n\t\tmoveBlocksUp,\n\t\tmoveBlocksDown,\n\t\texpandBlock,\n\t\tupdateBlockAttributes,\n\t\tstopEditingContentOnlySection,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tisMatch( 'core/block-editor/move-up', event ) ||\n\t\t\tisMatch( 'core/block-editor/move-down', event )\n\t\t) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\t\tconst direction = isMatch( 'core/block-editor/move-up', event )\n\t\t\t\t\t? 'up'\n\t\t\t\t\t: 'down';\n\t\t\t\tif ( direction === 'up' ) {\n\t\t\t\t\tmoveBlocksUp( clientIds, rootClientId );\n\t\t\t\t} else {\n\t\t\t\t\tmoveBlocksDown( clientIds, rootClientId );\n\t\t\t\t}\n\t\t\t\tconst blockLength = Array.isArray( clientIds )\n\t\t\t\t\t? clientIds.length\n\t\t\t\t\t: 1;\n\t\t\t\tconst message = sprintf(\n\t\t\t\t\t// translators: %d: the name of the block that has been moved\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'%d block moved.',\n\t\t\t\t\t\t'%d blocks moved.',\n\t\t\t\t\t\tclientIds.length\n\t\t\t\t\t),\n\t\t\t\t\tblockLength\n\t\t\t\t);\n\t\t\t\tspeak( message );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tduplicateBlocks( clientIds );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/remove', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tremoveBlocks( clientIds );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/paste-styles', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst blocks = getBlocksByClientId( clientIds );\n\t\t\t\tpasteStyles( blocks );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/insert-after', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tinsertAfterBlock( clientIds[ clientIds.length - 1 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/insert-before', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tinsertBeforeBlock( clientIds[ 0 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/unselect', event ) ) {\n\t\t\tif ( event.target.closest( '[role=toolbar]' ) ) {\n\t\t\t\t// This shouldn't be necessary, but we have a combination of a few things all combining to create a situation where:\n\t\t\t\t// - Because the block toolbar uses createPortal to populate the block toolbar fills, we can't rely on the React event bubbling to hit the onKeyDown listener for the block toolbar\n\t\t\t\t// - Since we can't use the React tree, we use the DOM tree which _should_ handle the event bubbling correctly from a `createPortal` element.\n\t\t\t\t// - This bubbles via the React tree, which hits this `unselect` escape keypress before the block toolbar DOM event listener has access to it.\n\t\t\t\t// An alternative would be to remove the addEventListener on the navigableToolbar and use this event to handle it directly right here. That feels hacky too though.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length > 1 ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// If there is more than one block selected, select the first\n\t\t\t\t// block so that focus is directed back to the beginning of the selection.\n\t\t\t\t// In effect, to the user this feels like deselecting the multi-selection.\n\t\t\t\tselectBlock( clientIds[ 0 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/collapse-list-view', event ) ) {\n\t\t\t// If focus is currently within a text field, such as a rich text block or other editable field,\n\t\t\t// skip collapsing the list view, and allow the keyboard shortcut to be handled by the text field.\n\t\t\t// This condition checks for both the active element and the active element within an iframed editor.\n\t\t\tif (\n\t\t\t\tisTextField( event.target ) ||\n\t\t\t\tisTextField(\n\t\t\t\t\tevent.target?.contentWindow?.document?.activeElement\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\texpandBlock( clientId );\n\t\t} else if ( isMatch( 'core/block-editor/group', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length > 1 && isGroupable( clientIds ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst blocks = getBlocksByClientId( clientIds );\n\t\t\t\tconst groupingBlockName = getGroupingBlockName();\n\t\t\t\tconst newBlocks = switchToBlockType(\n\t\t\t\t\tblocks,\n\t\t\t\t\tgroupingBlockName\n\t\t\t\t);\n\t\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t\t\tspeak( __( 'Selected blocks are grouped.' ) );\n\t\t\t}\n\t\t} else if (\n\t\t\tisMatch( 'core/block-editor/toggle-block-visibility', event )\n\t\t) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst blocks = getBlocksByClientId( clientIds );\n\t\t\t\tconst canToggleBlockVisibility = blocks.every( ( block ) =>\n\t\t\t\t\thasBlockSupport(\n\t\t\t\t\t\tgetBlockName( block.clientId ),\n\t\t\t\t\t\t'blockVisibility',\n\t\t\t\t\t\ttrue\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif ( ! canToggleBlockVisibility ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst hasHiddenBlock = blocks.some(\n\t\t\t\t\t( block ) =>\n\t\t\t\t\t\tblock.attributes.metadata?.blockVisibility === false\n\t\t\t\t);\n\t\t\t\tconst attributesByClientId = Object.fromEntries(\n\t\t\t\t\tblocks.map( ( { clientId: mapClientId, attributes } ) => [\n\t\t\t\t\t\tmapClientId,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmetadata: cleanEmptyObject( {\n\t\t\t\t\t\t\t\t...attributes?.metadata,\n\t\t\t\t\t\t\t\tblockVisibility: hasHiddenBlock\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: false,\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\t\t\t\tupdateBlockAttributes( clientIds, attributesByClientId, {\n\t\t\t\t\tuniqueByBlock: true,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t// Has the same keyboard shortcut as 'unselect', so can't be within the\n\t\t// if/else chain above.\n\t\tif ( isMatch( 'core/block-editor/stop-editing-as-blocks', event ) ) {\n\t\t\tif ( getEditedContentOnlySection() ) {\n\t\t\t\tstopEditingContentOnlySection();\n\t\t\t}\n\t\t}\n\t}\n\tconst blockToolbarRef = usePopoverScroll( __unstableContentRef );\n\tconst blockToolbarAfterRef = usePopoverScroll( __unstableContentRef );\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div { ...props } onKeyDown={ onKeyDown }>\n\t\t\t<InsertionPointOpenRef.Provider value={ useRef( false ) }>\n\t\t\t\t{ ! isTyping && ! isZoomOutMode && (\n\t\t\t\t\t<InsertionPoint\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showEmptyBlockSideInserter && (\n\t\t\t\t\t<EmptyBlockInserter\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showBlockToolbarPopover && (\n\t\t\t\t\t<BlockToolbarPopover\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tisTyping={ isTyping }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ /* Used for the inline rich text toolbar. Until this toolbar is combined into BlockToolbar, someone implementing their own BlockToolbar will also need to use this to see the image caption toolbar. */ }\n\t\t\t\t{ ! isZoomOutMode && ! hasFixedToolbar && (\n\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ /* Used for inline rich text popovers. */ }\n\t\t\t\t<Popover.Slot\n\t\t\t\t\tname=\"__unstable-block-tools-after\"\n\t\t\t\t\tref={ blockToolbarAfterRef }\n\t\t\t\t/>\n\t\t\t\t{ isZoomOutMode && ! isDragging && (\n\t\t\t\t\t<ZoomOutModeInserters\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InsertionPointOpenRef.Provider>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,mCAAmC,6BAA6B;AACzE,SAAS,cAAc;AACvB;AAAA,EACC;AAAA,EACA,SAAS;AAAA,EACT;AAAA,OACM;AACP,SAAS,aAAa;AACtB,SAAS,IAAI,SAAS,UAAU;AAKhC,OAAO,wBAAwB;AAC/B;AAAA,EACC;AAAA,EACA,WAAW;AAAA,OACL;AACP,OAAO,yBAAyB;AAChC,SAAS,SAAS,wBAAwB;AAC1C,OAAO,sBAAsB;AAC7B,OAAO,0BAA0B;AACjC,SAAS,yBAAyB;AAClC,SAAS,cAAc;AACvB,SAAS,wBAAwB;AACjC,OAAO,oBAAoB;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isTextField } from '@wordpress/dom';\nimport { Popover } from '@wordpress/components';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { useRef } from '@wordpress/element';\nimport {\n\tswitchToBlockType,\n\tstore as blocksStore,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { speak } from '@wordpress/a11y';\nimport { __, sprintf, _n } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport EmptyBlockInserter from './empty-block-inserter';\nimport {\n\tInsertionPointOpenRef,\n\tdefault as InsertionPoint,\n} from './insertion-point';\nimport BlockToolbarPopover from './block-toolbar-popover';\nimport { store as blockEditorStore } from '../../store';\nimport usePopoverScroll from '../block-popover/use-popover-scroll';\nimport ZoomOutModeInserters from './zoom-out-mode-inserters';\nimport { useShowBlockTools } from './use-show-block-tools';\nimport { unlock } from '../../lock-unlock';\nimport { cleanEmptyObject } from '../../hooks/utils';\nimport usePasteStyles from '../use-paste-styles';\n\nfunction selector( select ) {\n\tconst {\n\t\tgetSelectedBlockClientId,\n\t\tgetFirstMultiSelectedBlockClientId,\n\t\tgetSettings,\n\t\tisTyping,\n\t\tisDragging,\n\t\tisZoomOut,\n\t} = unlock( select( blockEditorStore ) );\n\n\tconst clientId =\n\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\treturn {\n\t\tclientId,\n\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\tisTyping: isTyping(),\n\t\tisZoomOutMode: isZoomOut(),\n\t\tisDragging: isDragging(),\n\t};\n}\n\n/**\n * Renders block tools (the block toolbar, select/navigation mode toolbar, the\n * insertion point and a slot for the inline rich text toolbar). Must be wrapped\n * around the block content and editor styles wrapper or iframe.\n *\n * @param {Object} $0 Props.\n * @param {Object} $0.children The block content and style container.\n * @param {Object} $0.__unstableContentRef Ref holding the content scroll container.\n */\nexport default function BlockTools( {\n\tchildren,\n\t__unstableContentRef,\n\t...props\n} ) {\n\tconst { clientId, hasFixedToolbar, isTyping, isZoomOutMode, isDragging } =\n\t\tuseSelect( selector, [] );\n\n\tconst isMatch = useShortcutEventMatch();\n\tconst {\n\t\tgetBlocksByClientId,\n\t\tgetSelectedBlockClientIds,\n\t\tgetBlockRootClientId,\n\t\tisGroupable,\n\t\tgetBlockName,\n\t\tgetEditedContentOnlySection,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { getGroupingBlockName } = useSelect( blocksStore );\n\tconst { showEmptyBlockSideInserter, showBlockToolbarPopover } =\n\t\tuseShowBlockTools();\n\tconst pasteStyles = usePasteStyles();\n\n\tconst {\n\t\tduplicateBlocks,\n\t\tremoveBlocks,\n\t\treplaceBlocks,\n\t\tinsertAfterBlock,\n\t\tinsertBeforeBlock,\n\t\tselectBlock,\n\t\tmoveBlocksUp,\n\t\tmoveBlocksDown,\n\t\texpandBlock,\n\t\tupdateBlockAttributes,\n\t\tstopEditingContentOnlySection,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tisMatch( 'core/block-editor/move-up', event ) ||\n\t\t\tisMatch( 'core/block-editor/move-down', event )\n\t\t) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\t\tconst direction = isMatch( 'core/block-editor/move-up', event )\n\t\t\t\t\t? 'up'\n\t\t\t\t\t: 'down';\n\t\t\t\tif ( direction === 'up' ) {\n\t\t\t\t\tmoveBlocksUp( clientIds, rootClientId );\n\t\t\t\t} else {\n\t\t\t\t\tmoveBlocksDown( clientIds, rootClientId );\n\t\t\t\t}\n\t\t\t\tconst blockLength = Array.isArray( clientIds )\n\t\t\t\t\t? clientIds.length\n\t\t\t\t\t: 1;\n\t\t\t\tconst message = sprintf(\n\t\t\t\t\t// translators: %d: the name of the block that has been moved\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'%d block moved.',\n\t\t\t\t\t\t'%d blocks moved.',\n\t\t\t\t\t\tclientIds.length\n\t\t\t\t\t),\n\t\t\t\t\tblockLength\n\t\t\t\t);\n\t\t\t\tspeak( message );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tduplicateBlocks( clientIds );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/remove', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tremoveBlocks( clientIds );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/paste-styles', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst blocks = getBlocksByClientId( clientIds );\n\t\t\t\tpasteStyles( blocks );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/insert-after', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tinsertAfterBlock( clientIds[ clientIds.length - 1 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/insert-before', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tinsertBeforeBlock( clientIds[ 0 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/unselect', event ) ) {\n\t\t\tif ( event.target.closest( '[role=toolbar]' ) ) {\n\t\t\t\t// This shouldn't be necessary, but we have a combination of a few things all combining to create a situation where:\n\t\t\t\t// - Because the block toolbar uses createPortal to populate the block toolbar fills, we can't rely on the React event bubbling to hit the onKeyDown listener for the block toolbar\n\t\t\t\t// - Since we can't use the React tree, we use the DOM tree which _should_ handle the event bubbling correctly from a `createPortal` element.\n\t\t\t\t// - This bubbles via the React tree, which hits this `unselect` escape keypress before the block toolbar DOM event listener has access to it.\n\t\t\t\t// An alternative would be to remove the addEventListener on the navigableToolbar and use this event to handle it directly right here. That feels hacky too though.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length > 1 ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// If there is more than one block selected, select the first\n\t\t\t\t// block so that focus is directed back to the beginning of the selection.\n\t\t\t\t// In effect, to the user this feels like deselecting the multi-selection.\n\t\t\t\tselectBlock( clientIds[ 0 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/collapse-list-view', event ) ) {\n\t\t\t// If focus is currently within a text field, such as a rich text block or other editable field,\n\t\t\t// skip collapsing the list view, and allow the keyboard shortcut to be handled by the text field.\n\t\t\t// This condition checks for both the active element and the active element within an iframed editor.\n\t\t\tif (\n\t\t\t\tisTextField( event.target ) ||\n\t\t\t\tisTextField(\n\t\t\t\t\tevent.target?.contentWindow?.document?.activeElement\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\texpandBlock( clientId );\n\t\t} else if ( isMatch( 'core/block-editor/group', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length > 1 && isGroupable( clientIds ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst blocks = getBlocksByClientId( clientIds );\n\t\t\t\tconst groupingBlockName = getGroupingBlockName();\n\t\t\t\tconst newBlocks = switchToBlockType(\n\t\t\t\t\tblocks,\n\t\t\t\t\tgroupingBlockName\n\t\t\t\t);\n\t\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t\t\tspeak( __( 'Selected blocks are grouped.' ) );\n\t\t\t}\n\t\t} else if (\n\t\t\tisMatch( 'core/block-editor/toggle-block-visibility', event )\n\t\t) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst blocks = getBlocksByClientId( clientIds );\n\t\t\t\tconst canToggleBlockVisibility = blocks.every( ( block ) =>\n\t\t\t\t\thasBlockSupport(\n\t\t\t\t\t\tgetBlockName( block.clientId ),\n\t\t\t\t\t\t'visibility',\n\t\t\t\t\t\ttrue\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif ( ! canToggleBlockVisibility ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst hasHiddenBlock = blocks.some(\n\t\t\t\t\t( block ) =>\n\t\t\t\t\t\tblock.attributes.metadata?.blockVisibility === false\n\t\t\t\t);\n\t\t\t\tconst attributesByClientId = Object.fromEntries(\n\t\t\t\t\tblocks.map( ( { clientId: mapClientId, attributes } ) => [\n\t\t\t\t\t\tmapClientId,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmetadata: cleanEmptyObject( {\n\t\t\t\t\t\t\t\t...attributes?.metadata,\n\t\t\t\t\t\t\t\tblockVisibility: hasHiddenBlock\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: false,\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\t\t\t\tupdateBlockAttributes( clientIds, attributesByClientId, {\n\t\t\t\t\tuniqueByBlock: true,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t// Has the same keyboard shortcut as 'unselect', so can't be within the\n\t\t// if/else chain above.\n\t\tif ( isMatch( 'core/block-editor/stop-editing-as-blocks', event ) ) {\n\t\t\tif ( getEditedContentOnlySection() ) {\n\t\t\t\tstopEditingContentOnlySection();\n\t\t\t}\n\t\t}\n\t}\n\tconst blockToolbarRef = usePopoverScroll( __unstableContentRef );\n\tconst blockToolbarAfterRef = usePopoverScroll( __unstableContentRef );\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\t{ ...props }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\t// Popover slots cannot be unmounted during dragging because the\n\t\t\t// will just be rendered in a fallback popover slot instead.\n\t\t\tclassName={ clsx( props.className, {\n\t\t\t\t'block-editor-block-tools--is-dragging': isDragging,\n\t\t\t} ) }\n\t\t>\n\t\t\t<InsertionPointOpenRef.Provider value={ useRef( false ) }>\n\t\t\t\t{ ! isTyping && ! isZoomOutMode && (\n\t\t\t\t\t<InsertionPoint\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showEmptyBlockSideInserter && (\n\t\t\t\t\t<EmptyBlockInserter\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showBlockToolbarPopover && (\n\t\t\t\t\t<BlockToolbarPopover\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tisTyping={ isTyping }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ /* Used for the inline rich text toolbar. Until this toolbar is combined into BlockToolbar, someone implementing their own BlockToolbar will also need to use this to see the image caption toolbar. */ }\n\t\t\t\t{ ! isZoomOutMode && ! hasFixedToolbar && (\n\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ /* Used for inline rich text popovers. */ }\n\t\t\t\t<Popover.Slot\n\t\t\t\t\tname=\"__unstable-block-tools-after\"\n\t\t\t\t\tref={ blockToolbarAfterRef }\n\t\t\t\t/>\n\t\t\t\t{ isZoomOutMode && ! isDragging && (\n\t\t\t\t\t<ZoomOutModeInserters\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InsertionPointOpenRef.Provider>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,WAAW,mBAAmB;AACvC,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,mCAAmC,6BAA6B;AACzE,SAAS,cAAc;AACvB;AAAA,EACC;AAAA,EACA,SAAS;AAAA,EACT;AAAA,OACM;AACP,SAAS,aAAa;AACtB,SAAS,IAAI,SAAS,UAAU;AAKhC,OAAO,wBAAwB;AAC/B;AAAA,EACC;AAAA,EACA,WAAW;AAAA,OACL;AACP,OAAO,yBAAyB;AAChC,SAAS,SAAS,wBAAwB;AAC1C,OAAO,sBAAsB;AAC7B,OAAO,0BAA0B;AACjC,SAAS,yBAAyB;AAClC,SAAS,cAAc;AACvB,SAAS,wBAAwB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
3
|
"sources": ["../../../src/components/block-visibility/toolbar.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { seen, unseen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { cleanEmptyObject } from '../../hooks/utils';\n\nexport default function BlockVisibilityToolbar( { clientIds } ) {\n\tconst { blocks, canToggleBlockVisibility } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockName, getBlocksByClientId } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst _blocks = getBlocksByClientId( clientIds );\n\t\t\treturn {\n\t\t\t\tblocks: _blocks,\n\t\t\t\tcanToggleBlockVisibility: _blocks.every( ( { clientId } ) =>\n\t\t\t\t\thasBlockSupport(\n\t\t\t\t\t\tgetBlockName( clientId ),\n\t\t\t\t\t\t'
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { seen, unseen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { cleanEmptyObject } from '../../hooks/utils';\n\nexport default function BlockVisibilityToolbar( { clientIds } ) {\n\tconst { blocks, canToggleBlockVisibility } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockName, getBlocksByClientId } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst _blocks = getBlocksByClientId( clientIds );\n\t\t\treturn {\n\t\t\t\tblocks: _blocks,\n\t\t\t\tcanToggleBlockVisibility: _blocks.every( ( { clientId } ) =>\n\t\t\t\t\thasBlockSupport(\n\t\t\t\t\t\tgetBlockName( clientId ),\n\t\t\t\t\t\t'visibility',\n\t\t\t\t\t\ttrue\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\tconst hasHiddenBlock = blocks.some(\n\t\t( block ) => block.attributes.metadata?.blockVisibility === false\n\t);\n\n\tconst hasBlockVisibilityButtonShownRef = useRef( false );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\t// If the block visibility button has been shown, we don't want to\n\t// remove it from the toolbar until the toolbar is rendered again\n\t// without it. Removing it beforehand can cause focus loss issues.\n\t// It needs to return focus from whence it came, and to do that,\n\t// we need to leave the button in the toolbar.\n\tuseEffect( () => {\n\t\tif ( hasHiddenBlock ) {\n\t\t\thasBlockVisibilityButtonShownRef.current = true;\n\t\t}\n\t}, [ hasHiddenBlock ] );\n\n\tif ( ! hasHiddenBlock && ! hasBlockVisibilityButtonShownRef.current ) {\n\t\treturn null;\n\t}\n\n\tconst toggleBlockVisibility = () => {\n\t\tconst attributesByClientId = Object.fromEntries(\n\t\t\tblocks?.map( ( { clientId, attributes } ) => [\n\t\t\t\tclientId,\n\t\t\t\t{\n\t\t\t\t\tmetadata: cleanEmptyObject( {\n\t\t\t\t\t\t...attributes?.metadata,\n\t\t\t\t\t\tblockVisibility: hasHiddenBlock ? undefined : false,\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t] )\n\t\t);\n\t\tupdateBlockAttributes( clientIds, attributesByClientId, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarGroup className=\"block-editor-block-lock-toolbar\">\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tdisabled={ ! canToggleBlockVisibility }\n\t\t\t\t\ticon={ hasHiddenBlock ? unseen : seen }\n\t\t\t\t\tlabel={ hasHiddenBlock ? __( 'Hidden' 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AA,QACA;AAAA,UACC,UAAU,iBAAkB;AAAA,YAC3B,GAAG,YAAY;AAAA,YACf,iBAAiB,iBAAiB,SAAY;AAAA,UAC/C,CAAE;AAAA,QACH;AAAA,MACD,CAAE;AAAA,IACH;AACA,0BAAuB,WAAW,sBAAsB;AAAA,MACvD,eAAe;AAAA,IAChB,CAAE;AAAA,EACH;AAEA,SACC,gCACC,8BAAC,gBAAa,WAAU,mCACvB;AAAA,IAAC;AAAA;AAAA,MACA,UAAW,CAAE;AAAA,MACb,MAAO,iBAAiB,SAAS;AAAA,MACjC,OAAQ,iBAAiB,GAAI,QAAS,IAAI,GAAI,SAAU;AAAA,MACxD,SAAU;AAAA;AAAA,EACX,GACD,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// packages/block-editor/src/components/content-only-controls/fields-dropdown-menu.js
|
|
2
|
+
import { DropdownMenu, MenuGroup, MenuItem } from "@wordpress/components";
|
|
3
|
+
import { moreVertical, check } from "@wordpress/icons";
|
|
4
|
+
import { __ } from "@wordpress/i18n";
|
|
5
|
+
import { useInspectorPopoverPlacement } from "./use-inspector-popover-placement";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function FieldsDropdownMenu({
|
|
8
|
+
fields,
|
|
9
|
+
visibleFields,
|
|
10
|
+
onToggleField
|
|
11
|
+
}) {
|
|
12
|
+
const { popoverProps } = useInspectorPopoverPlacement();
|
|
13
|
+
if (!fields || fields.length === 0) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
DropdownMenu,
|
|
18
|
+
{
|
|
19
|
+
icon: moreVertical,
|
|
20
|
+
label: __("Options"),
|
|
21
|
+
popoverProps,
|
|
22
|
+
children: ({ onClose }) => /* @__PURE__ */ jsx(MenuGroup, { label: __("Show / Hide"), children: fields.map((field) => {
|
|
23
|
+
const isVisible = visibleFields.includes(field.id);
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
MenuItem,
|
|
26
|
+
{
|
|
27
|
+
isSelected: isVisible,
|
|
28
|
+
onClick: () => {
|
|
29
|
+
onToggleField(field.id);
|
|
30
|
+
onClose();
|
|
31
|
+
},
|
|
32
|
+
role: "menuitemcheckbox",
|
|
33
|
+
icon: isVisible ? check : null,
|
|
34
|
+
children: field.label
|
|
35
|
+
},
|
|
36
|
+
field.id
|
|
37
|
+
);
|
|
38
|
+
}) })
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
FieldsDropdownMenu as default
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=fields-dropdown-menu.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/content-only-controls/fields-dropdown-menu.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { moreVertical, check } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useInspectorPopoverPlacement } from './use-inspector-popover-placement';\n\nexport default function FieldsDropdownMenu( {\n\tfields,\n\tvisibleFields,\n\tonToggleField,\n} ) {\n\tconst { popoverProps } = useInspectorPopoverPlacement();\n\n\tif ( ! fields || fields.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tpopoverProps={ popoverProps }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<MenuGroup label={ __( 'Show / Hide' ) }>\n\t\t\t\t\t{ fields.map( ( field ) => {\n\t\t\t\t\t\tconst isVisible = visibleFields.includes( field.id );\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tkey={ field.id }\n\t\t\t\t\t\t\t\tisSelected={ isVisible }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonToggleField( field.id );\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t\t\t\ticon={ isVisible ? check : null }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ field.label }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,cAAc,WAAW,gBAAgB;AAClD,SAAS,cAAc,aAAa;AACpC,SAAS,UAAU;AAKnB,SAAS,oCAAoC;AAwBtC;AAtBQ,SAAR,mBAAqC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,aAAa,IAAI,6BAA6B;AAEtD,MAAK,CAAE,UAAU,OAAO,WAAW,GAAI;AACtC,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO;AAAA,MACP,OAAQ,GAAI,SAAU;AAAA,MACtB;AAAA,MAEE,WAAE,EAAE,QAAQ,MACb,oBAAC,aAAU,OAAQ,GAAI,aAAc,GAClC,iBAAO,IAAK,CAAE,UAAW;AAC1B,cAAM,YAAY,cAAc,SAAU,MAAM,EAAG;AACnD,eACC;AAAA,UAAC;AAAA;AAAA,YAEA,YAAa;AAAA,YACb,SAAU,MAAM;AACf,4BAAe,MAAM,EAAG;AACxB,sBAAQ;AAAA,YACT;AAAA,YACA,MAAK;AAAA,YACL,MAAO,YAAY,QAAQ;AAAA,YAEzB,gBAAM;AAAA;AAAA,UATF,MAAM;AAAA,QAUb;AAAA,MAEF,CAAE,GACH;AAAA;AAAA,EAEF;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|