@wordpress/block-editor 14.3.6 → 14.3.7
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/README.md +2 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-list/zoom-out-separator.js +10 -7
- package/build/components/block-list/zoom-out-separator.js.map +1 -1
- package/build/components/block-popover/index.js +1 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +28 -16
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/use-has-block-toolbar.js +3 -3
- package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
- package/build/components/block-tools/index.js +1 -6
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +4 -6
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +22 -36
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/iframe/index.js +40 -10
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +4 -0
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +16 -4
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +4 -0
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/menu.js +5 -2
- package/build/components/inserter/menu.js.map +1 -1
- package/build/hooks/block-bindings.js +12 -1
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/use-zoom-out.js +24 -16
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/store/private-selectors.js +37 -2
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +15 -8
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-list/zoom-out-separator.js +10 -7
- package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
- package/build-module/components/block-popover/index.js +1 -1
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +30 -18
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/use-has-block-toolbar.js +3 -3
- package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
- package/build-module/components/block-tools/index.js +1 -6
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +4 -6
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +22 -36
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/iframe/index.js +40 -10
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +5 -1
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +16 -4
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +5 -1
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build-module/components/inserter/menu.js +5 -2
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/hooks/block-bindings.js +13 -2
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +24 -17
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/store/private-selectors.js +35 -2
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/selectors.js +15 -8
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/content-rtl.css +14 -20
- package/build-style/content.css +14 -20
- package/build-style/style-rtl.css +28 -21
- package/build-style/style.css +28 -21
- package/package.json +6 -6
- package/src/components/block-canvas/style.scss +1 -0
- package/src/components/block-list/content.scss +3 -2
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +25 -4
- package/src/components/block-list/zoom-out-separator.js +8 -6
- package/src/components/block-popover/index.js +2 -2
- package/src/components/block-toolbar/index.js +37 -24
- package/src/components/block-toolbar/style.scss +10 -1
- package/src/components/block-toolbar/use-has-block-toolbar.js +19 -28
- package/src/components/block-tools/index.js +0 -9
- package/src/components/block-tools/style.scss +2 -26
- package/src/components/block-tools/use-show-block-tools.js +2 -10
- package/src/components/block-tools/zoom-out-mode-inserters.js +26 -50
- package/src/components/iframe/content.scss +16 -24
- package/src/components/iframe/index.js +53 -12
- package/src/components/iframe/style.scss +6 -5
- package/src/components/inserter/block-patterns-tab/index.js +6 -1
- package/src/components/inserter/hooks/use-insertion-point.js +23 -5
- package/src/components/inserter/media-tab/media-tab.js +6 -1
- package/src/components/inserter/menu.js +7 -1
- package/src/components/inserter/style.scss +6 -0
- package/src/components/rich-text/style.scss +5 -0
- package/src/hooks/block-bindings.js +40 -23
- package/src/hooks/use-zoom-out.js +36 -20
- package/src/store/private-selectors.js +40 -1
- package/src/store/selectors.js +16 -8
- package/src/style.scss +1 -0
- package/build/components/block-tools/zoom-out-popover.js +0 -57
- package/build/components/block-tools/zoom-out-popover.js.map +0 -1
- package/build/components/block-tools/zoom-out-toolbar.js +0 -159
- package/build/components/block-tools/zoom-out-toolbar.js.map +0 -1
- package/build-module/components/block-tools/zoom-out-popover.js +0 -48
- package/build-module/components/block-tools/zoom-out-popover.js.map +0 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +0 -152
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +0 -1
- package/src/components/block-tools/zoom-out-popover.js +0 -46
- package/src/components/block-tools/zoom-out-toolbar.js +0 -167
|
@@ -5,6 +5,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
5
5
|
import {
|
|
6
6
|
getBlockBindingsSource,
|
|
7
7
|
getBlockBindingsSources,
|
|
8
|
+
getBlockType,
|
|
8
9
|
} from '@wordpress/blocks';
|
|
9
10
|
import {
|
|
10
11
|
__experimentalItemGroup as ItemGroup,
|
|
@@ -29,6 +30,7 @@ import {
|
|
|
29
30
|
import { unlock } from '../lock-unlock';
|
|
30
31
|
import InspectorControls from '../components/inspector-controls';
|
|
31
32
|
import BlockContext from '../components/block-context';
|
|
33
|
+
import { useBlockEditContext } from '../components/block-edit';
|
|
32
34
|
import { useBlockBindingsUtils } from '../utils/block-bindings';
|
|
33
35
|
import { store as blockEditorStore } from '../store';
|
|
34
36
|
|
|
@@ -50,9 +52,20 @@ const useToolsPanelDropdownMenuProps = () => {
|
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
function BlockBindingsPanelDropdown( { fieldsList, attribute, binding } ) {
|
|
55
|
+
const { clientId } = useBlockEditContext();
|
|
53
56
|
const registeredSources = getBlockBindingsSources();
|
|
54
57
|
const { updateBlockBindings } = useBlockBindingsUtils();
|
|
55
58
|
const currentKey = binding?.args?.key;
|
|
59
|
+
const attributeType = useSelect(
|
|
60
|
+
( select ) => {
|
|
61
|
+
const { name: blockName } =
|
|
62
|
+
select( blockEditorStore ).getBlock( clientId );
|
|
63
|
+
const _attributeType =
|
|
64
|
+
getBlockType( blockName ).attributes?.[ attribute ]?.type;
|
|
65
|
+
return _attributeType === 'rich-text' ? 'string' : _attributeType;
|
|
66
|
+
},
|
|
67
|
+
[ clientId, attribute ]
|
|
68
|
+
);
|
|
56
69
|
return (
|
|
57
70
|
<>
|
|
58
71
|
{ Object.entries( fieldsList ).map( ( [ name, fields ], i ) => (
|
|
@@ -63,29 +76,33 @@ function BlockBindingsPanelDropdown( { fieldsList, attribute, binding } ) {
|
|
|
63
76
|
{ registeredSources[ name ].label }
|
|
64
77
|
</DropdownMenuV2.GroupLabel>
|
|
65
78
|
) }
|
|
66
|
-
{ Object.entries( fields )
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
{ Object.entries( fields )
|
|
80
|
+
.filter(
|
|
81
|
+
( [ , args ] ) => args?.type === attributeType
|
|
82
|
+
)
|
|
83
|
+
.map( ( [ key, args ] ) => (
|
|
84
|
+
<DropdownMenuV2.RadioItem
|
|
85
|
+
key={ key }
|
|
86
|
+
onChange={ () =>
|
|
87
|
+
updateBlockBindings( {
|
|
88
|
+
[ attribute ]: {
|
|
89
|
+
source: name,
|
|
90
|
+
args: { key },
|
|
91
|
+
},
|
|
92
|
+
} )
|
|
93
|
+
}
|
|
94
|
+
name={ attribute + '-binding' }
|
|
95
|
+
value={ key }
|
|
96
|
+
checked={ key === currentKey }
|
|
97
|
+
>
|
|
98
|
+
<DropdownMenuV2.ItemLabel>
|
|
99
|
+
{ args?.label }
|
|
100
|
+
</DropdownMenuV2.ItemLabel>
|
|
101
|
+
<DropdownMenuV2.ItemHelpText>
|
|
102
|
+
{ args?.value }
|
|
103
|
+
</DropdownMenuV2.ItemHelpText>
|
|
104
|
+
</DropdownMenuV2.RadioItem>
|
|
105
|
+
) ) }
|
|
89
106
|
</DropdownMenuV2.Group>
|
|
90
107
|
{ i !== Object.keys( fieldsList ).length - 1 && (
|
|
91
108
|
<DropdownMenuV2.Separator />
|
|
@@ -9,39 +9,55 @@ import { useEffect, useRef } from '@wordpress/element';
|
|
|
9
9
|
*/
|
|
10
10
|
import { store as blockEditorStore } from '../store';
|
|
11
11
|
import { unlock } from '../lock-unlock';
|
|
12
|
-
|
|
13
12
|
/**
|
|
14
|
-
* A hook used to set the zoomed out
|
|
13
|
+
* A hook used to set the editor mode to zoomed out mode, invoking the hook sets the mode.
|
|
15
14
|
*
|
|
16
|
-
* @param {boolean} zoomOut If we should
|
|
15
|
+
* @param {boolean} zoomOut If we should enter into zoomOut mode or not
|
|
17
16
|
*/
|
|
18
17
|
export function useZoomOut( zoomOut = true ) {
|
|
19
|
-
const { setZoomLevel } = unlock(
|
|
20
|
-
|
|
18
|
+
const { __unstableSetEditorMode, setZoomLevel } = unlock(
|
|
19
|
+
useDispatch( blockEditorStore )
|
|
20
|
+
);
|
|
21
|
+
const { __unstableGetEditorMode } = unlock( useSelect( blockEditorStore ) );
|
|
21
22
|
|
|
22
|
-
const
|
|
23
|
+
const originalEditingModeRef = useRef( null );
|
|
24
|
+
const mode = __unstableGetEditorMode();
|
|
23
25
|
|
|
24
26
|
useEffect( () => {
|
|
25
27
|
// Only set this on mount so we know what to return to when we unmount.
|
|
26
|
-
if ( !
|
|
27
|
-
|
|
28
|
+
if ( ! originalEditingModeRef.current ) {
|
|
29
|
+
originalEditingModeRef.current = mode;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
return () => {
|
|
33
|
+
// We need to use __unstableGetEditorMode() here and not `mode`, as mode may not update on unmount
|
|
34
|
+
if (
|
|
35
|
+
__unstableGetEditorMode() === 'zoom-out' &&
|
|
36
|
+
__unstableGetEditorMode() !== originalEditingModeRef.current
|
|
37
|
+
) {
|
|
38
|
+
__unstableSetEditorMode( originalEditingModeRef.current );
|
|
39
|
+
setZoomLevel( 100 );
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}, [] );
|
|
43
|
+
|
|
44
|
+
// The effect opens the zoom-out view if we want it open and it's not currently in zoom-out mode.
|
|
45
|
+
useEffect( () => {
|
|
46
|
+
if ( zoomOut && mode !== 'zoom-out' ) {
|
|
47
|
+
__unstableSetEditorMode( 'zoom-out' );
|
|
32
48
|
setZoomLevel( 50 );
|
|
33
49
|
} else if (
|
|
34
50
|
! zoomOut &&
|
|
35
|
-
|
|
36
|
-
|
|
51
|
+
__unstableGetEditorMode() === 'zoom-out' &&
|
|
52
|
+
originalEditingModeRef.current !== mode
|
|
37
53
|
) {
|
|
38
|
-
|
|
54
|
+
__unstableSetEditorMode( originalEditingModeRef.current );
|
|
55
|
+
setZoomLevel( 100 );
|
|
39
56
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}, [ isZoomOut, setZoomLevel, zoomOut ] );
|
|
57
|
+
}, [
|
|
58
|
+
__unstableGetEditorMode,
|
|
59
|
+
__unstableSetEditorMode,
|
|
60
|
+
zoomOut,
|
|
61
|
+
setZoomLevel,
|
|
62
|
+
] ); // Mode is deliberately excluded from the dependencies so that the effect does not run when mode changes.
|
|
47
63
|
}
|
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
getBlockName,
|
|
16
16
|
getTemplateLock,
|
|
17
17
|
getClientIdsWithDescendants,
|
|
18
|
+
isNavigationMode,
|
|
19
|
+
__unstableGetEditorMode,
|
|
18
20
|
} from './selectors';
|
|
19
21
|
import {
|
|
20
22
|
checkAllowListRecursive,
|
|
@@ -545,7 +547,7 @@ export const getBlockStyles = createSelector(
|
|
|
545
547
|
* @return {boolean} Is zoom out mode enabled.
|
|
546
548
|
*/
|
|
547
549
|
export function isZoomOutMode( state ) {
|
|
548
|
-
return state
|
|
550
|
+
return __unstableGetEditorMode( state ) === 'zoom-out';
|
|
549
551
|
}
|
|
550
552
|
|
|
551
553
|
/**
|
|
@@ -580,3 +582,40 @@ export function getZoomLevel( state ) {
|
|
|
580
582
|
export function isZoomOut( state ) {
|
|
581
583
|
return getZoomLevel( state ) < 100;
|
|
582
584
|
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Retrieves the client ID of the parent section block.
|
|
588
|
+
*
|
|
589
|
+
* @param {Object} state Global application state.
|
|
590
|
+
* @param {string} clientId Client Id of the block.
|
|
591
|
+
*
|
|
592
|
+
* @return {?string} Client ID of the ancestor block that is content locking the block.
|
|
593
|
+
*/
|
|
594
|
+
export const getParentSectionBlock = ( state, clientId ) => {
|
|
595
|
+
let current = clientId;
|
|
596
|
+
let result;
|
|
597
|
+
while ( ! result && ( current = state.blocks.parents.get( current ) ) ) {
|
|
598
|
+
if ( isSectionBlock( state, current ) ) {
|
|
599
|
+
result = current;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
return result;
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Retrieves the client ID is a content locking parent
|
|
607
|
+
*
|
|
608
|
+
* @param {Object} state Global application state.
|
|
609
|
+
* @param {string} clientId Client Id of the block.
|
|
610
|
+
*
|
|
611
|
+
* @return {boolean} Whether the block is a content locking parent.
|
|
612
|
+
*/
|
|
613
|
+
export function isSectionBlock( state, clientId ) {
|
|
614
|
+
const sectionRootClientId = getSectionRootClientId( state );
|
|
615
|
+
const sectionClientIds = getBlockOrder( state, sectionRootClientId );
|
|
616
|
+
return (
|
|
617
|
+
getBlockName( state, clientId ) === 'core/block' ||
|
|
618
|
+
getTemplateLock( state, clientId ) === 'contentOnly' ||
|
|
619
|
+
( isNavigationMode( state ) && sectionClientIds.includes( clientId ) )
|
|
620
|
+
);
|
|
621
|
+
}
|
package/src/store/selectors.js
CHANGED
|
@@ -2363,6 +2363,21 @@ const getAllowedPatternsDependants = ( select ) => ( state, rootClientId ) => [
|
|
|
2363
2363
|
...getInsertBlockTypeDependants( state, rootClientId ),
|
|
2364
2364
|
];
|
|
2365
2365
|
|
|
2366
|
+
const patternsWithParsedBlocks = new WeakMap();
|
|
2367
|
+
function enhancePatternWithParsedBlocks( pattern ) {
|
|
2368
|
+
let enhancedPattern = patternsWithParsedBlocks.get( pattern );
|
|
2369
|
+
if ( ! enhancedPattern ) {
|
|
2370
|
+
enhancedPattern = {
|
|
2371
|
+
...pattern,
|
|
2372
|
+
get blocks() {
|
|
2373
|
+
return getParsedPattern( pattern ).blocks;
|
|
2374
|
+
},
|
|
2375
|
+
};
|
|
2376
|
+
patternsWithParsedBlocks.set( pattern, enhancedPattern );
|
|
2377
|
+
}
|
|
2378
|
+
return enhancedPattern;
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2366
2381
|
/**
|
|
2367
2382
|
* Returns the list of allowed patterns for inner blocks children.
|
|
2368
2383
|
*
|
|
@@ -2379,14 +2394,7 @@ export const __experimentalGetAllowedPatterns = createRegistrySelector(
|
|
|
2379
2394
|
const { allowedBlockTypes } = getSettings( state );
|
|
2380
2395
|
const parsedPatterns = patterns
|
|
2381
2396
|
.filter( ( { inserter = true } ) => !! inserter )
|
|
2382
|
-
.map(
|
|
2383
|
-
return {
|
|
2384
|
-
...pattern,
|
|
2385
|
-
get blocks() {
|
|
2386
|
-
return getParsedPattern( pattern ).blocks;
|
|
2387
|
-
},
|
|
2388
|
-
};
|
|
2389
|
-
} );
|
|
2397
|
+
.map( enhancePatternWithParsedBlocks );
|
|
2390
2398
|
|
|
2391
2399
|
const availableParsedPatterns = parsedPatterns.filter(
|
|
2392
2400
|
( pattern ) =>
|
package/src/style.scss
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
@import "./components/global-styles/style.scss";
|
|
31
31
|
@import "./components/grid/style.scss";
|
|
32
32
|
@import "./components/height-control/style.scss";
|
|
33
|
+
@import "./components/iframe/style.scss";
|
|
33
34
|
@import "./components/image-size-control/style.scss";
|
|
34
35
|
@import "./components/inserter-list-item/style.scss";
|
|
35
36
|
@import "./components/inspector-controls-tabs/style.scss";
|
|
@@ -1,57 +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 = ZoomOutPopover;
|
|
8
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
-
var _blockPopover = _interopRequireDefault(require("../block-popover"));
|
|
10
|
-
var _useBlockToolbarPopoverProps = _interopRequireDefault(require("./use-block-toolbar-popover-props"));
|
|
11
|
-
var _useSelectedBlockToolProps = _interopRequireDefault(require("./use-selected-block-tool-props"));
|
|
12
|
-
var _zoomOutToolbar = _interopRequireDefault(require("./zoom-out-toolbar"));
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
/**
|
|
15
|
-
* External dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
function ZoomOutPopover({
|
|
23
|
-
clientId,
|
|
24
|
-
__unstableContentRef
|
|
25
|
-
}) {
|
|
26
|
-
const {
|
|
27
|
-
capturingClientId,
|
|
28
|
-
isInsertionPointVisible,
|
|
29
|
-
lastClientId
|
|
30
|
-
} = (0, _useSelectedBlockToolProps.default)(clientId);
|
|
31
|
-
const popoverProps = (0, _useBlockToolbarPopoverProps.default)({
|
|
32
|
-
contentElement: __unstableContentRef?.current,
|
|
33
|
-
clientId
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// Override some of the popover props for the zoom-out toolbar.
|
|
37
|
-
const props = {
|
|
38
|
-
...popoverProps,
|
|
39
|
-
placement: 'left-start',
|
|
40
|
-
flip: false,
|
|
41
|
-
shift: true
|
|
42
|
-
};
|
|
43
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockPopover.default, {
|
|
44
|
-
clientId: capturingClientId || clientId,
|
|
45
|
-
bottomClientId: lastClientId,
|
|
46
|
-
className: (0, _clsx.default)('zoom-out-toolbar-popover', {
|
|
47
|
-
'is-insertion-point-visible': isInsertionPointVisible
|
|
48
|
-
}),
|
|
49
|
-
resize: false,
|
|
50
|
-
...props,
|
|
51
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_zoomOutToolbar.default, {
|
|
52
|
-
__unstableContentRef: __unstableContentRef,
|
|
53
|
-
clientId: clientId
|
|
54
|
-
})
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=zoom-out-popover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockPopover","_useBlockToolbarPopoverProps","_useSelectedBlockToolProps","_zoomOutToolbar","_jsxRuntime","ZoomOutPopover","clientId","__unstableContentRef","capturingClientId","isInsertionPointVisible","lastClientId","useSelectedBlockToolProps","popoverProps","useBlockToolbarPopoverProps","contentElement","current","props","placement","flip","shift","jsx","default","bottomClientId","className","clsx","resize","children"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-popover.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../block-popover';\nimport useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';\nimport useSelectedBlockToolProps from './use-selected-block-tool-props';\nimport ZoomOutToolbar from './zoom-out-toolbar';\n\nexport default function ZoomOutPopover( { clientId, __unstableContentRef } ) {\n\tconst { capturingClientId, isInsertionPointVisible, lastClientId } =\n\t\tuseSelectedBlockToolProps( clientId );\n\n\tconst popoverProps = useBlockToolbarPopoverProps( {\n\t\tcontentElement: __unstableContentRef?.current,\n\t\tclientId,\n\t} );\n\n\t// Override some of the popover props for the zoom-out toolbar.\n\tconst props = {\n\t\t...popoverProps,\n\t\tplacement: 'left-start',\n\t\tflip: false,\n\t\tshift: true,\n\t};\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ capturingClientId || clientId }\n\t\t\tbottomClientId={ lastClientId }\n\t\t\tclassName={ clsx( 'zoom-out-toolbar-popover', {\n\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t} ) }\n\t\t\tresize={ false }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<ZoomOutToolbar\n\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t</BlockPopover>\n\t);\n}\n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use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = ZoomOutToolbar;
|
|
8
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
-
var _icons = require("@wordpress/icons");
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
var _data = require("@wordpress/data");
|
|
12
|
-
var _blocks = require("@wordpress/blocks");
|
|
13
|
-
var _i18n = require("@wordpress/i18n");
|
|
14
|
-
var _store = require("../../store");
|
|
15
|
-
var _blockDraggable = _interopRequireDefault(require("../block-draggable"));
|
|
16
|
-
var _blockMover = _interopRequireDefault(require("../block-mover"));
|
|
17
|
-
var _shuffle = _interopRequireDefault(require("../block-toolbar/shuffle"));
|
|
18
|
-
var _navigableToolbar = _interopRequireDefault(require("../navigable-toolbar"));
|
|
19
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
20
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
/**
|
|
22
|
-
* External dependencies
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* WordPress dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Internal dependencies
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
function ZoomOutToolbar({
|
|
34
|
-
clientId,
|
|
35
|
-
__unstableContentRef
|
|
36
|
-
}) {
|
|
37
|
-
const selected = (0, _data.useSelect)(select => {
|
|
38
|
-
const {
|
|
39
|
-
getBlock,
|
|
40
|
-
hasBlockMovingClientId,
|
|
41
|
-
getNextBlockClientId,
|
|
42
|
-
getPreviousBlockClientId,
|
|
43
|
-
canRemoveBlock,
|
|
44
|
-
canMoveBlock,
|
|
45
|
-
getSettings
|
|
46
|
-
} = select(_store.store);
|
|
47
|
-
const {
|
|
48
|
-
__experimentalSetIsInserterOpened: setIsInserterOpened
|
|
49
|
-
} = getSettings();
|
|
50
|
-
const {
|
|
51
|
-
getBlockType
|
|
52
|
-
} = select(_blocks.store);
|
|
53
|
-
const {
|
|
54
|
-
name
|
|
55
|
-
} = getBlock(clientId);
|
|
56
|
-
const blockType = getBlockType(name);
|
|
57
|
-
const isBlockTemplatePart = blockType?.name === 'core/template-part';
|
|
58
|
-
let isNextBlockTemplatePart = false;
|
|
59
|
-
const nextClientId = getNextBlockClientId();
|
|
60
|
-
if (nextClientId) {
|
|
61
|
-
const {
|
|
62
|
-
name: nextName
|
|
63
|
-
} = getBlock(nextClientId);
|
|
64
|
-
const nextBlockType = getBlockType(nextName);
|
|
65
|
-
isNextBlockTemplatePart = nextBlockType?.name === 'core/template-part';
|
|
66
|
-
}
|
|
67
|
-
let isPrevBlockTemplatePart = false;
|
|
68
|
-
const prevClientId = getPreviousBlockClientId();
|
|
69
|
-
if (prevClientId) {
|
|
70
|
-
const {
|
|
71
|
-
name: prevName
|
|
72
|
-
} = getBlock(prevClientId);
|
|
73
|
-
const prevBlockType = getBlockType(prevName);
|
|
74
|
-
isPrevBlockTemplatePart = prevBlockType?.name === 'core/template-part';
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
blockMovingMode: hasBlockMovingClientId(),
|
|
78
|
-
isBlockTemplatePart,
|
|
79
|
-
isNextBlockTemplatePart,
|
|
80
|
-
isPrevBlockTemplatePart,
|
|
81
|
-
canRemove: canRemoveBlock(clientId),
|
|
82
|
-
canMove: canMoveBlock(clientId),
|
|
83
|
-
setIsInserterOpened
|
|
84
|
-
};
|
|
85
|
-
}, [clientId]);
|
|
86
|
-
const {
|
|
87
|
-
blockMovingMode,
|
|
88
|
-
isBlockTemplatePart,
|
|
89
|
-
isNextBlockTemplatePart,
|
|
90
|
-
isPrevBlockTemplatePart,
|
|
91
|
-
canRemove,
|
|
92
|
-
canMove,
|
|
93
|
-
setIsInserterOpened
|
|
94
|
-
} = selected;
|
|
95
|
-
const {
|
|
96
|
-
removeBlock,
|
|
97
|
-
__unstableSetEditorMode,
|
|
98
|
-
resetZoomLevel
|
|
99
|
-
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
100
|
-
const classNames = (0, _clsx.default)('zoom-out-toolbar', {
|
|
101
|
-
'is-block-moving-mode': !!blockMovingMode
|
|
102
|
-
});
|
|
103
|
-
const showBlockDraggable = canMove && !isBlockTemplatePart;
|
|
104
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_navigableToolbar.default, {
|
|
105
|
-
className: classNames
|
|
106
|
-
/* translators: accessibility text for the block toolbar */,
|
|
107
|
-
"aria-label": (0, _i18n.__)('Block tools')
|
|
108
|
-
// The variant is applied as "toolbar" when undefined, which is the black border style of the dropdown from the toolbar popover.
|
|
109
|
-
,
|
|
110
|
-
variant: "unstyled",
|
|
111
|
-
orientation: "vertical",
|
|
112
|
-
children: [showBlockDraggable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockDraggable.default, {
|
|
113
|
-
clientIds: [clientId],
|
|
114
|
-
children: draggableProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
115
|
-
icon: _icons.dragHandle,
|
|
116
|
-
className: "block-selection-button_drag-handle zoom-out-toolbar-button",
|
|
117
|
-
label: (0, _i18n.__)('Drag'),
|
|
118
|
-
iconSize: 24,
|
|
119
|
-
size: "compact"
|
|
120
|
-
// Should not be able to tab to drag handle as this
|
|
121
|
-
// button can only be used with a pointer device.
|
|
122
|
-
,
|
|
123
|
-
tabIndex: "-1",
|
|
124
|
-
...draggableProps
|
|
125
|
-
})
|
|
126
|
-
}), !isBlockTemplatePart && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockMover.default, {
|
|
127
|
-
clientIds: [clientId],
|
|
128
|
-
hideDragHandle: true,
|
|
129
|
-
isBlockMoverUpButtonDisabled: isPrevBlockTemplatePart,
|
|
130
|
-
isBlockMoverDownButtonDisabled: isNextBlockTemplatePart,
|
|
131
|
-
iconSize: 24,
|
|
132
|
-
size: "compact"
|
|
133
|
-
}), canMove && canRemove && /*#__PURE__*/(0, _jsxRuntime.jsx)(_shuffle.default, {
|
|
134
|
-
clientId: clientId,
|
|
135
|
-
as: _components.ToolbarButton
|
|
136
|
-
}), !isBlockTemplatePart && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
137
|
-
className: "zoom-out-toolbar-button",
|
|
138
|
-
icon: _icons.edit,
|
|
139
|
-
label: (0, _i18n.__)('Edit'),
|
|
140
|
-
onClick: () => {
|
|
141
|
-
// Setting may be undefined.
|
|
142
|
-
if (typeof setIsInserterOpened === 'function') {
|
|
143
|
-
setIsInserterOpened(false);
|
|
144
|
-
}
|
|
145
|
-
__unstableSetEditorMode('edit');
|
|
146
|
-
resetZoomLevel();
|
|
147
|
-
__unstableContentRef.current?.focus();
|
|
148
|
-
}
|
|
149
|
-
}), canRemove && !isBlockTemplatePart && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
150
|
-
className: "zoom-out-toolbar-button",
|
|
151
|
-
icon: _icons.trash,
|
|
152
|
-
label: (0, _i18n.__)('Delete'),
|
|
153
|
-
onClick: () => {
|
|
154
|
-
removeBlock(clientId);
|
|
155
|
-
}
|
|
156
|
-
})]
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
//# sourceMappingURL=zoom-out-toolbar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_icons","_components","_data","_blocks","_i18n","_store","_blockDraggable","_blockMover","_shuffle","_navigableToolbar","_lockUnlock","_jsxRuntime","ZoomOutToolbar","clientId","__unstableContentRef","selected","useSelect","select","getBlock","hasBlockMovingClientId","getNextBlockClientId","getPreviousBlockClientId","canRemoveBlock","canMoveBlock","getSettings","blockEditorStore","__experimentalSetIsInserterOpened","setIsInserterOpened","getBlockType","blocksStore","name","blockType","isBlockTemplatePart","isNextBlockTemplatePart","nextClientId","nextName","nextBlockType","isPrevBlockTemplatePart","prevClientId","prevName","prevBlockType","blockMovingMode","canRemove","canMove","removeBlock","__unstableSetEditorMode","resetZoomLevel","unlock","useDispatch","classNames","clsx","showBlockDraggable","jsxs","default","className","__","variant","orientation","children","jsx","clientIds","draggableProps","Button","icon","dragHandle","label","iconSize","size","tabIndex","hideDragHandle","isBlockMoverUpButtonDisabled","isBlockMoverDownButtonDisabled","as","ToolbarButton","edit","onClick","current","focus","trash"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-toolbar.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { dragHandle, trash, edit } from '@wordpress/icons';\nimport { Button, ToolbarButton } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockDraggable from '../block-draggable';\nimport BlockMover from '../block-mover';\nimport Shuffle from '../block-toolbar/shuffle';\nimport NavigableToolbar from '../navigable-toolbar';\nimport { unlock } from '../../lock-unlock';\n\nexport default function ZoomOutToolbar( { clientId, __unstableContentRef } ) {\n\tconst selected = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlock,\n\t\t\t\thasBlockMovingClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tcanRemoveBlock,\n\t\t\t\tcanMoveBlock,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst { __experimentalSetIsInserterOpened: setIsInserterOpened } =\n\t\t\t\tgetSettings();\n\n\t\t\tconst { getBlockType } = select( blocksStore );\n\t\t\tconst { name } = getBlock( clientId );\n\t\t\tconst blockType = getBlockType( name );\n\t\t\tconst isBlockTemplatePart =\n\t\t\t\tblockType?.name === 'core/template-part';\n\n\t\t\tlet isNextBlockTemplatePart = false;\n\t\t\tconst nextClientId = getNextBlockClientId();\n\t\t\tif ( nextClientId ) {\n\t\t\t\tconst { name: nextName } = getBlock( nextClientId );\n\t\t\t\tconst nextBlockType = getBlockType( nextName );\n\t\t\t\tisNextBlockTemplatePart =\n\t\t\t\t\tnextBlockType?.name === 'core/template-part';\n\t\t\t}\n\n\t\t\tlet isPrevBlockTemplatePart = false;\n\t\t\tconst prevClientId = getPreviousBlockClientId();\n\t\t\tif ( prevClientId ) {\n\t\t\t\tconst { name: prevName } = getBlock( prevClientId );\n\t\t\t\tconst prevBlockType = getBlockType( prevName );\n\t\t\t\tisPrevBlockTemplatePart =\n\t\t\t\t\tprevBlockType?.name === 'core/template-part';\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tblockMovingMode: hasBlockMovingClientId(),\n\t\t\t\tisBlockTemplatePart,\n\t\t\t\tisNextBlockTemplatePart,\n\t\t\t\tisPrevBlockTemplatePart,\n\t\t\t\tcanRemove: canRemoveBlock( clientId ),\n\t\t\t\tcanMove: canMoveBlock( clientId ),\n\t\t\t\tsetIsInserterOpened,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst {\n\t\tblockMovingMode,\n\t\tisBlockTemplatePart,\n\t\tisNextBlockTemplatePart,\n\t\tisPrevBlockTemplatePart,\n\t\tcanRemove,\n\t\tcanMove,\n\t\tsetIsInserterOpened,\n\t} = selected;\n\n\tconst { removeBlock, __unstableSetEditorMode, resetZoomLevel } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tconst classNames = clsx( 'zoom-out-toolbar', {\n\t\t'is-block-moving-mode': !! blockMovingMode,\n\t} );\n\n\tconst showBlockDraggable = canMove && ! isBlockTemplatePart;\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName={ classNames }\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=\"unstyled\"\n\t\t\torientation=\"vertical\"\n\t\t>\n\t\t\t{ showBlockDraggable && (\n\t\t\t\t<BlockDraggable clientIds={ [ clientId ] }>\n\t\t\t\t\t{ ( draggableProps ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ dragHandle }\n\t\t\t\t\t\t\tclassName=\"block-selection-button_drag-handle zoom-out-toolbar-button\"\n\t\t\t\t\t\t\tlabel={ __( 'Drag' ) }\n\t\t\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t// Should not be able to tab to drag handle as this\n\t\t\t\t\t\t\t// button can only be used with a pointer device.\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t{ ...draggableProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockDraggable>\n\t\t\t) }\n\t\t\t{ ! isBlockTemplatePart && (\n\t\t\t\t<BlockMover\n\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\thideDragHandle\n\t\t\t\t\tisBlockMoverUpButtonDisabled={ isPrevBlockTemplatePart }\n\t\t\t\t\tisBlockMoverDownButtonDisabled={ isNextBlockTemplatePart }\n\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ canMove && canRemove && (\n\t\t\t\t<Shuffle clientId={ clientId } as={ ToolbarButton } />\n\t\t\t) }\n\n\t\t\t{ ! isBlockTemplatePart && (\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"zoom-out-toolbar-button\"\n\t\t\t\t\ticon={ edit }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t// Setting may be undefined.\n\t\t\t\t\t\tif ( typeof setIsInserterOpened === 'function' ) {\n\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableSetEditorMode( 'edit' );\n\t\t\t\t\t\tresetZoomLevel();\n\t\t\t\t\t\t__unstableContentRef.current?.focus();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ canRemove && ! isBlockTemplatePart && (\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"zoom-out-toolbar-button\"\n\t\t\t\t\ticon={ trash }\n\t\t\t\t\tlabel={ __( 'Delete' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</NavigableToolbar>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,QAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,iBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AAA2C,IAAAY,WAAA,GAAAZ,OAAA;AAtB3C;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAQe,SAASa,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,EAAG;EAC5E,MAAMC,QAAQ,GAAG,IAAAC,eAAS,EACvBC,MAAM,IAAM;IACb,MAAM;MACLC,QAAQ;MACRC,sBAAsB;MACtBC,oBAAoB;MACpBC,wBAAwB;MACxBC,cAA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|
8
|
-
import BlockPopover from '../block-popover';
|
|
9
|
-
import useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';
|
|
10
|
-
import useSelectedBlockToolProps from './use-selected-block-tool-props';
|
|
11
|
-
import ZoomOutToolbar from './zoom-out-toolbar';
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export default function ZoomOutPopover({
|
|
14
|
-
clientId,
|
|
15
|
-
__unstableContentRef
|
|
16
|
-
}) {
|
|
17
|
-
const {
|
|
18
|
-
capturingClientId,
|
|
19
|
-
isInsertionPointVisible,
|
|
20
|
-
lastClientId
|
|
21
|
-
} = useSelectedBlockToolProps(clientId);
|
|
22
|
-
const popoverProps = useBlockToolbarPopoverProps({
|
|
23
|
-
contentElement: __unstableContentRef?.current,
|
|
24
|
-
clientId
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// Override some of the popover props for the zoom-out toolbar.
|
|
28
|
-
const props = {
|
|
29
|
-
...popoverProps,
|
|
30
|
-
placement: 'left-start',
|
|
31
|
-
flip: false,
|
|
32
|
-
shift: true
|
|
33
|
-
};
|
|
34
|
-
return /*#__PURE__*/_jsx(BlockPopover, {
|
|
35
|
-
clientId: capturingClientId || clientId,
|
|
36
|
-
bottomClientId: lastClientId,
|
|
37
|
-
className: clsx('zoom-out-toolbar-popover', {
|
|
38
|
-
'is-insertion-point-visible': isInsertionPointVisible
|
|
39
|
-
}),
|
|
40
|
-
resize: false,
|
|
41
|
-
...props,
|
|
42
|
-
children: /*#__PURE__*/_jsx(ZoomOutToolbar, {
|
|
43
|
-
__unstableContentRef: __unstableContentRef,
|
|
44
|
-
clientId: clientId
|
|
45
|
-
})
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=zoom-out-popover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","BlockPopover","useBlockToolbarPopoverProps","useSelectedBlockToolProps","ZoomOutToolbar","jsx","_jsx","ZoomOutPopover","clientId","__unstableContentRef","capturingClientId","isInsertionPointVisible","lastClientId","popoverProps","contentElement","current","props","placement","flip","shift","bottomClientId","className","resize","children"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-popover.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../block-popover';\nimport useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';\nimport useSelectedBlockToolProps from './use-selected-block-tool-props';\nimport ZoomOutToolbar from './zoom-out-toolbar';\n\nexport default function ZoomOutPopover( { clientId, __unstableContentRef } ) {\n\tconst { capturingClientId, isInsertionPointVisible, lastClientId } =\n\t\tuseSelectedBlockToolProps( clientId );\n\n\tconst popoverProps = useBlockToolbarPopoverProps( {\n\t\tcontentElement: __unstableContentRef?.current,\n\t\tclientId,\n\t} );\n\n\t// Override some of the popover props for the zoom-out toolbar.\n\tconst props = {\n\t\t...popoverProps,\n\t\tplacement: 'left-start',\n\t\tflip: false,\n\t\tshift: true,\n\t};\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ capturingClientId || clientId }\n\t\t\tbottomClientId={ lastClientId }\n\t\t\tclassName={ clsx( 'zoom-out-toolbar-popover', {\n\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t} ) }\n\t\t\tresize={ false }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<ZoomOutToolbar\n\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t</BlockPopover>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB;AACA;AACA;AACA,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,2BAA2B,MAAM,mCAAmC;AAC3E,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,cAAc,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhD,eAAe,SAASC,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,EAAG;EAC5E,MAAM;IAAEC,iBAAiB;IAAEC,uBAAuB;IAAEC;EAAa,CAAC,GACjET,yBAAyB,CAAEK,QAAS,CAAC;EAEtC,MAAMK,YAAY,GAAGX,2BAA2B,CAAE;IACjDY,cAAc,EAAEL,oBAAoB,EAAEM,OAAO;IAC7CP;EACD,CAAE,CAAC;;EAEH;EACA,MAAMQ,KAAK,GAAG;IACb,GAAGH,YAAY;IACfI,SAAS,EAAE,YAAY;IACvBC,IAAI,EAAE,KAAK;IACXC,KAAK,EAAE;EACR,CAAC;EAED,oBACCb,IAAA,CAACL,YAAY;IACZO,QAAQ,EAAGE,iBAAiB,IAAIF,QAAU;IAC1CY,cAAc,EAAGR,YAAc;IAC/BS,SAAS,EAAGrB,IAAI,CAAE,0BAA0B,EAAE;MAC7C,4BAA4B,EAAEW;IAC/B,CAAE,CAAG;IACLW,MAAM,EAAG,KAAO;IAAA,GACXN,KAAK;IAAAO,QAAA,eAEVjB,IAAA,CAACF,cAAc;MACdK,oBAAoB,EAAGA,oBAAsB;MAC7CD,QAAQ,EAAGA;IAAU,CACrB;EAAC,CACW,CAAC;AAEjB","ignoreList":[]}
|