@wordpress/block-editor 15.3.1-next.a730c9c8c.0 → 15.4.1-next.f56bd8138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-inspector/index.js +110 -95
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-switcher/index.js +4 -3
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/content-tab.js +34 -0
- package/build/components/inspector-controls-tabs/content-tab.js.map +1 -0
- package/build/components/inspector-controls-tabs/index.js +12 -2
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +24 -21
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +9 -5
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/inspector-controls-tabs/utils.js +7 -1
- package/build/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build/components/rich-text/index.js +4 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/private-apis.js +3 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +3 -2
- package/build/store/actions.js.map +1 -1
- package/build-module/components/block-inspector/index.js +110 -95
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +4 -3
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/content-tab.js +26 -0
- package/build-module/components/inspector-controls-tabs/content-tab.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/index.js +13 -3
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +24 -21
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -6
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/utils.js +7 -1
- package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build-module/components/rich-text/index.js +4 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +3 -2
- package/build-module/store/actions.js.map +1 -1
- package/package.json +34 -34
- package/src/components/block-inspector/index.js +134 -114
- package/src/components/block-switcher/index.js +8 -3
- package/src/components/inspector-controls-tabs/content-tab.js +24 -0
- package/src/components/inspector-controls-tabs/index.js +8 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +33 -21
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +19 -6
- package/src/components/inspector-controls-tabs/utils.js +8 -1
- package/src/components/rich-text/index.js +8 -1
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -23,8 +23,8 @@ var _useInspectorControlsTabs = _interopRequireDefault(require("../inspector-con
|
|
|
23
23
|
var _advancedControlsPanel = _interopRequireDefault(require("../inspector-controls-tabs/advanced-controls-panel"));
|
|
24
24
|
var _positionControlsPanel = _interopRequireDefault(require("../inspector-controls-tabs/position-controls-panel"));
|
|
25
25
|
var _useBlockInspectorAnimationSettings = _interopRequireDefault(require("./useBlockInspectorAnimationSettings"));
|
|
26
|
-
var _blockQuickNavigation = _interopRequireDefault(require("../block-quick-navigation"));
|
|
27
26
|
var _border = require("../../hooks/border");
|
|
27
|
+
var _contentTab = _interopRequireDefault(require("../inspector-controls-tabs/content-tab"));
|
|
28
28
|
var _lockUnlock = require("../../lock-unlock");
|
|
29
29
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
30
|
/**
|
|
@@ -45,35 +45,99 @@ function BlockStylesPanel({
|
|
|
45
45
|
})
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
+
function StyleInspectorSlots({
|
|
49
|
+
blockName,
|
|
50
|
+
showAdvancedControls = true,
|
|
51
|
+
showPositionControls = true,
|
|
52
|
+
showListControls = false,
|
|
53
|
+
showBindingsControls = true
|
|
54
|
+
}) {
|
|
55
|
+
const borderPanelLabel = (0, _border.useBorderPanelLabel)({
|
|
56
|
+
blockName
|
|
57
|
+
});
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
59
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {}), showListControls && /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
60
|
+
group: "list"
|
|
61
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
62
|
+
group: "color",
|
|
63
|
+
label: (0, _i18n.__)('Color'),
|
|
64
|
+
className: "color-block-support-panel__inner-wrapper"
|
|
65
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
66
|
+
group: "background",
|
|
67
|
+
label: (0, _i18n.__)('Background image')
|
|
68
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
69
|
+
group: "typography",
|
|
70
|
+
label: (0, _i18n.__)('Typography')
|
|
71
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
72
|
+
group: "dimensions",
|
|
73
|
+
label: (0, _i18n.__)('Dimensions')
|
|
74
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
75
|
+
group: "border",
|
|
76
|
+
label: borderPanelLabel
|
|
77
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
78
|
+
group: "styles"
|
|
79
|
+
}), showPositionControls && /*#__PURE__*/(0, _jsxRuntime.jsx)(_positionControlsPanel.default, {}), showBindingsControls && /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
80
|
+
group: "bindings"
|
|
81
|
+
}), showAdvancedControls && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
82
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_advancedControlsPanel.default, {})
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
48
86
|
function BlockInspector() {
|
|
49
87
|
const {
|
|
50
|
-
|
|
88
|
+
selectedBlockCount,
|
|
51
89
|
selectedBlockName,
|
|
52
90
|
selectedBlockClientId,
|
|
53
91
|
blockType,
|
|
54
|
-
isSectionBlock
|
|
92
|
+
isSectionBlock,
|
|
93
|
+
isSectionBlockInSelection,
|
|
94
|
+
hasBlockStyles
|
|
55
95
|
} = (0, _data.useSelect)(select => {
|
|
56
96
|
const {
|
|
57
97
|
getSelectedBlockClientId,
|
|
98
|
+
getSelectedBlockClientIds,
|
|
58
99
|
getSelectedBlockCount,
|
|
59
100
|
getBlockName,
|
|
60
101
|
getParentSectionBlock,
|
|
61
102
|
isSectionBlock: _isSectionBlock
|
|
62
103
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
104
|
+
const {
|
|
105
|
+
getBlockStyles
|
|
106
|
+
} = select(_blocks.store);
|
|
63
107
|
const _selectedBlockClientId = getSelectedBlockClientId();
|
|
64
|
-
const renderedBlockClientId = getParentSectionBlock(_selectedBlockClientId) ||
|
|
108
|
+
const renderedBlockClientId = getParentSectionBlock(_selectedBlockClientId) || _selectedBlockClientId;
|
|
65
109
|
const _selectedBlockName = renderedBlockClientId && getBlockName(renderedBlockClientId);
|
|
66
110
|
const _blockType = _selectedBlockName && (0, _blocks.getBlockType)(_selectedBlockName);
|
|
111
|
+
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
112
|
+
const _isSectionBlockInSelection = selectedBlockClientIds.some(id => _isSectionBlock(id));
|
|
113
|
+
const blockStyles = _selectedBlockName && getBlockStyles(_selectedBlockName);
|
|
114
|
+
const _hasBlockStyles = blockStyles && blockStyles.length > 0;
|
|
67
115
|
return {
|
|
68
|
-
|
|
116
|
+
selectedBlockCount: getSelectedBlockCount(),
|
|
69
117
|
selectedBlockClientId: renderedBlockClientId,
|
|
70
118
|
selectedBlockName: _selectedBlockName,
|
|
71
119
|
blockType: _blockType,
|
|
72
|
-
|
|
120
|
+
isSectionBlockInSelection: _isSectionBlockInSelection,
|
|
121
|
+
isSectionBlock: _isSectionBlock(renderedBlockClientId),
|
|
122
|
+
hasBlockStyles: _hasBlockStyles
|
|
73
123
|
};
|
|
74
124
|
}, []);
|
|
75
|
-
|
|
76
|
-
|
|
125
|
+
|
|
126
|
+
// Separate useSelect for contentClientIds with proper dependencies
|
|
127
|
+
const contentClientIds = (0, _data.useSelect)(select => {
|
|
128
|
+
if (!isSectionBlock || !selectedBlockClientId) {
|
|
129
|
+
return [];
|
|
130
|
+
}
|
|
131
|
+
const {
|
|
132
|
+
getClientIdsOfDescendants,
|
|
133
|
+
getBlockName,
|
|
134
|
+
getBlockEditingMode
|
|
135
|
+
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
136
|
+
const descendants = getClientIdsOfDescendants(selectedBlockClientId);
|
|
137
|
+
return descendants.filter(current => getBlockName(current) !== 'core/list-item' && getBlockEditingMode(current) === 'contentOnly');
|
|
138
|
+
}, [isSectionBlock, selectedBlockClientId]);
|
|
139
|
+
const availableTabs = (0, _useInspectorControlsTabs.default)(blockType?.name, contentClientIds, isSectionBlock, hasBlockStyles);
|
|
140
|
+
const hasMultipleTabs = availableTabs?.length > 1;
|
|
77
141
|
|
|
78
142
|
// The block inspector animation settings will be completely
|
|
79
143
|
// removed in the future to create an API which allows the block
|
|
@@ -82,44 +146,34 @@ function BlockInspector() {
|
|
|
82
146
|
// and its parent, and only enable it if the parent is controlling
|
|
83
147
|
// its children blocks.
|
|
84
148
|
const blockInspectorAnimationSettings = (0, _useBlockInspectorAnimationSettings.default)(blockType);
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
});
|
|
88
|
-
if (count > 1 && !isSectionBlock) {
|
|
149
|
+
const hasSelectedBlocks = selectedBlockCount > 1;
|
|
150
|
+
if (hasSelectedBlocks && !isSectionBlockInSelection) {
|
|
89
151
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
90
152
|
className: "block-editor-block-inspector",
|
|
91
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_multiSelectionInspector.default, {}),
|
|
153
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_multiSelectionInspector.default, {}), hasMultipleTabs ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControlsTabs.default, {
|
|
92
154
|
tabs: availableTabs
|
|
93
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
99
|
-
group: "background",
|
|
100
|
-
label: (0, _i18n.__)('Background image')
|
|
101
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
102
|
-
group: "typography",
|
|
103
|
-
label: (0, _i18n.__)('Typography')
|
|
104
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
105
|
-
group: "dimensions",
|
|
106
|
-
label: (0, _i18n.__)('Dimensions')
|
|
107
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
108
|
-
group: "border",
|
|
109
|
-
label: borderPanelLabel
|
|
110
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
111
|
-
group: "styles"
|
|
112
|
-
})]
|
|
155
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(StyleInspectorSlots, {
|
|
156
|
+
blockName: selectedBlockName,
|
|
157
|
+
showAdvancedControls: false,
|
|
158
|
+
showPositionControls: false,
|
|
159
|
+
showBindingsControls: false
|
|
113
160
|
})]
|
|
114
161
|
});
|
|
115
162
|
}
|
|
163
|
+
if (hasSelectedBlocks && isSectionBlockInSelection) {
|
|
164
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
165
|
+
className: "block-editor-block-inspector",
|
|
166
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_multiSelectionInspector.default, {})
|
|
167
|
+
});
|
|
168
|
+
}
|
|
116
169
|
const isSelectedBlockUnregistered = selectedBlockName === (0, _blocks.getUnregisteredTypeHandlerName)();
|
|
117
170
|
|
|
118
171
|
/*
|
|
119
172
|
* If the selected block is of an unregistered type, avoid showing it as an actual selection
|
|
120
173
|
* because we want the user to focus on the unregistered block warning, not block settings.
|
|
121
174
|
*/
|
|
122
|
-
|
|
175
|
+
const shouldShowWarning = !blockType || !selectedBlockClientId || isSelectedBlockUnregistered;
|
|
176
|
+
if (shouldShowWarning) {
|
|
123
177
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
124
178
|
className: "block-editor-block-inspector__no-blocks",
|
|
125
179
|
children: (0, _i18n.__)('No block selected.')
|
|
@@ -135,7 +189,10 @@ function BlockInspector() {
|
|
|
135
189
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockInspectorSingleBlock, {
|
|
136
190
|
clientId: selectedBlockClientId,
|
|
137
191
|
blockName: blockType.name,
|
|
138
|
-
isSectionBlock: isSectionBlock
|
|
192
|
+
isSectionBlock: isSectionBlock,
|
|
193
|
+
availableTabs: availableTabs,
|
|
194
|
+
contentClientIds: contentClientIds,
|
|
195
|
+
hasBlockStyles: hasBlockStyles
|
|
139
196
|
})
|
|
140
197
|
});
|
|
141
198
|
}
|
|
@@ -171,82 +228,40 @@ const AnimatedContainer = ({
|
|
|
171
228
|
const BlockInspectorSingleBlock = ({
|
|
172
229
|
clientId,
|
|
173
230
|
blockName,
|
|
174
|
-
isSectionBlock
|
|
231
|
+
isSectionBlock,
|
|
232
|
+
availableTabs,
|
|
233
|
+
contentClientIds,
|
|
234
|
+
hasBlockStyles
|
|
175
235
|
}) => {
|
|
176
|
-
const
|
|
177
|
-
const showTabs = !isSectionBlock && availableTabs?.length > 1;
|
|
178
|
-
const hasBlockStyles = (0, _data.useSelect)(select => {
|
|
179
|
-
const {
|
|
180
|
-
getBlockStyles
|
|
181
|
-
} = select(_blocks.store);
|
|
182
|
-
const blockStyles = getBlockStyles(blockName);
|
|
183
|
-
return blockStyles && blockStyles.length > 0;
|
|
184
|
-
}, [blockName]);
|
|
236
|
+
const hasMultipleTabs = availableTabs?.length > 1;
|
|
185
237
|
const blockInformation = (0, _useBlockDisplayInformation.default)(clientId);
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
});
|
|
189
|
-
const contentClientIds = (0, _data.useSelect)(select => {
|
|
190
|
-
// Avoid unnecessary subscription.
|
|
191
|
-
if (!isSectionBlock) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
const {
|
|
195
|
-
getClientIdsOfDescendants,
|
|
196
|
-
getBlockName,
|
|
197
|
-
getBlockEditingMode
|
|
198
|
-
} = select(_store.store);
|
|
199
|
-
return getClientIdsOfDescendants(clientId).filter(current => getBlockName(current) !== 'core/list-item' && getBlockEditingMode(current) === 'contentOnly');
|
|
200
|
-
}, [isSectionBlock, clientId]);
|
|
238
|
+
const isBlockSynced = blockInformation.isSynced;
|
|
239
|
+
const shouldShowTabs = !isBlockSynced && hasMultipleTabs;
|
|
201
240
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
202
241
|
className: "block-editor-block-inspector",
|
|
203
242
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockCard.default, {
|
|
204
243
|
...blockInformation,
|
|
205
|
-
className:
|
|
244
|
+
className: isBlockSynced && 'is-synced',
|
|
206
245
|
children: window?.__experimentalContentOnlyPatternInsertion && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editContentsButton.default, {
|
|
207
246
|
clientId: clientId
|
|
208
247
|
})
|
|
209
248
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockVariationTransforms.default, {
|
|
210
249
|
blockClientId: clientId
|
|
211
|
-
}),
|
|
250
|
+
}), shouldShowTabs && /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControlsTabs.default, {
|
|
212
251
|
hasBlockStyles: hasBlockStyles,
|
|
213
252
|
clientId: clientId,
|
|
214
253
|
blockName: blockName,
|
|
215
|
-
tabs: availableTabs
|
|
216
|
-
|
|
254
|
+
tabs: availableTabs,
|
|
255
|
+
isSectionBlock: isSectionBlock,
|
|
256
|
+
contentClientIds: contentClientIds
|
|
257
|
+
}), !shouldShowTabs && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
217
258
|
children: [hasBlockStyles && /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockStylesPanel, {
|
|
218
259
|
clientId: clientId
|
|
219
|
-
}),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}), !isSectionBlock && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
225
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
226
|
-
group: "list"
|
|
227
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
228
|
-
group: "color",
|
|
229
|
-
label: (0, _i18n.__)('Color'),
|
|
230
|
-
className: "color-block-support-panel__inner-wrapper"
|
|
231
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
232
|
-
group: "background",
|
|
233
|
-
label: (0, _i18n.__)('Background image')
|
|
234
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
235
|
-
group: "typography",
|
|
236
|
-
label: (0, _i18n.__)('Typography')
|
|
237
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
238
|
-
group: "dimensions",
|
|
239
|
-
label: (0, _i18n.__)('Dimensions')
|
|
240
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
241
|
-
group: "border",
|
|
242
|
-
label: borderPanelLabel
|
|
243
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
244
|
-
group: "styles"
|
|
245
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_positionControlsPanel.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default.Slot, {
|
|
246
|
-
group: "bindings"
|
|
247
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
248
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_advancedControlsPanel.default, {})
|
|
249
|
-
})]
|
|
260
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_contentTab.default, {
|
|
261
|
+
contentClientIds: contentClientIds
|
|
262
|
+
}), !isSectionBlock && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyleInspectorSlots, {
|
|
263
|
+
blockName: blockName,
|
|
264
|
+
showListControls: true
|
|
250
265
|
})]
|
|
251
266
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skipToSelectedBlock.default, {}, "back")]
|
|
252
267
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blocks","_components","_data","_editContentsButton","_interopRequireDefault","_skipToSelectedBlock","_blockCard","_multiSelectionInspector","_blockVariationTransforms","_useBlockDisplayInformation","_store","_blockStyles","_inspectorControls","_inspectorControlsTabs","_useInspectorControlsTabs","_advancedControlsPanel","_positionControlsPanel","_useBlockInspectorAnimationSettings","_blockQuickNavigation","_border","_lockUnlock","_jsxRuntime","BlockStylesPanel","clientId","jsx","PanelBody","title","__","children","default","BlockInspector","count","selectedBlockName","selectedBlockClientId","blockType","isSectionBlock","useSelect","select","getSelectedBlockClientId","getSelectedBlockCount","getBlockName","getParentSectionBlock","_isSectionBlock","unlock","blockEditorStore","_selectedBlockClientId","renderedBlockClientId","_selectedBlockName","_blockType","getBlockType","availableTabs","useInspectorControlsTabs","name","showTabs","length","blockInspectorAnimationSettings","useBlockInspectorAnimationSettings","borderPanelLabel","useBorderPanelLabel","blockName","jsxs","className","tabs","Fragment","Slot","group","label","isSelectedBlockUnregistered","getUnregisteredTypeHandlerName","BlockInspectorSingleBlockWrapper","animate","wrapper","AnimatedContainer","BlockInspectorSingleBlock","animationOrigin","enterDirection","__unstableMotion","div","x","opacity","transition","ease","duration","initial","hasBlockStyles","getBlockStyles","blocksStore","blockStyles","blockInformation","useBlockDisplayInformation","contentClientIds","getClientIdsOfDescendants","getBlockEditingMode","filter","current","isSynced","window","__experimentalContentOnlyPatternInsertion","blockClientId","clientIds","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-inspector/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetUnregisteredTypeHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { PanelBody, __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EditContentsButton from './edit-contents-button';\nimport SkipToSelectedBlock from '../skip-to-selected-block';\nimport BlockCard from '../block-card';\nimport MultiSelectionInspector from '../multi-selection-inspector';\nimport BlockVariationTransforms from '../block-variation-transforms';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { store as blockEditorStore } from '../../store';\nimport BlockStyles from '../block-styles';\nimport { default as InspectorControls } from '../inspector-controls';\nimport { default as InspectorControlsTabs } from '../inspector-controls-tabs';\nimport useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';\nimport AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';\nimport PositionControls from '../inspector-controls-tabs/position-controls-panel';\nimport useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';\nimport BlockQuickNavigation from '../block-quick-navigation';\nimport { useBorderPanelLabel } from '../../hooks/border';\n\nimport { unlock } from '../../lock-unlock';\n\nfunction BlockStylesPanel( { clientId } ) {\n\treturn (\n\t\t<PanelBody title={ __( 'Styles' ) }>\n\t\t\t<BlockStyles clientId={ clientId } />\n\t\t</PanelBody>\n\t);\n}\n\nfunction BlockInspector() {\n\tconst {\n\t\tcount,\n\t\tselectedBlockName,\n\t\tselectedBlockClientId,\n\t\tblockType,\n\t\tisSectionBlock,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetSelectedBlockCount,\n\t\t\tgetBlockName,\n\t\t\tgetParentSectionBlock,\n\t\t\tisSectionBlock: _isSectionBlock,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst _selectedBlockClientId = getSelectedBlockClientId();\n\t\tconst renderedBlockClientId =\n\t\t\tgetParentSectionBlock( _selectedBlockClientId ) ||\n\t\t\tgetSelectedBlockClientId();\n\t\tconst _selectedBlockName =\n\t\t\trenderedBlockClientId && getBlockName( renderedBlockClientId );\n\t\tconst _blockType =\n\t\t\t_selectedBlockName && getBlockType( _selectedBlockName );\n\n\t\treturn {\n\t\t\tcount: getSelectedBlockCount(),\n\t\t\tselectedBlockClientId: renderedBlockClientId,\n\t\t\tselectedBlockName: _selectedBlockName,\n\t\t\tblockType: _blockType,\n\t\t\tisSectionBlock: _isSectionBlock( renderedBlockClientId ),\n\t\t};\n\t}, [] );\n\n\tconst availableTabs = useInspectorControlsTabs( blockType?.name );\n\tconst showTabs = availableTabs?.length > 1;\n\n\t// The block inspector animation settings will be completely\n\t// removed in the future to create an API which allows the block\n\t// inspector to transition between what it\n\t// displays based on the relationship between the selected block\n\t// and its parent, and only enable it if the parent is controlling\n\t// its children blocks.\n\tconst blockInspectorAnimationSettings =\n\t\tuseBlockInspectorAnimationSettings( blockType );\n\n\tconst borderPanelLabel = useBorderPanelLabel( {\n\t\tblockName: selectedBlockName,\n\t} );\n\n\tif ( count > 1 && ! isSectionBlock ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t\t{ showTabs ? (\n\t\t\t\t\t<InspectorControlsTabs tabs={ availableTabs } />\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorControls.Slot />\n\t\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\t\tgroup=\"color\"\n\t\t\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\t\tgroup=\"background\"\n\t\t\t\t\t\t\tlabel={ __( 'Background image' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\t\tgroup=\"typography\"\n\t\t\t\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\t\tgroup=\"dimensions\"\n\t\t\t\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\t\tgroup=\"border\"\n\t\t\t\t\t\t\tlabel={ borderPanelLabel }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst isSelectedBlockUnregistered =\n\t\tselectedBlockName === getUnregisteredTypeHandlerName();\n\n\t/*\n\t * If the selected block is of an unregistered type, avoid showing it as an actual selection\n\t * because we want the user to focus on the unregistered block warning, not block settings.\n\t */\n\tif (\n\t\t! blockType ||\n\t\t! selectedBlockClientId ||\n\t\tisSelectedBlockUnregistered\n\t) {\n\t\treturn (\n\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t</span>\n\t\t);\n\t}\n\n\treturn (\n\t\t<BlockInspectorSingleBlockWrapper\n\t\t\tanimate={ blockInspectorAnimationSettings }\n\t\t\twrapper={ ( children ) => (\n\t\t\t\t<AnimatedContainer\n\t\t\t\t\tblockInspectorAnimationSettings={\n\t\t\t\t\t\tblockInspectorAnimationSettings\n\t\t\t\t\t}\n\t\t\t\t\tselectedBlockClientId={ selectedBlockClientId }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</AnimatedContainer>\n\t\t\t) }\n\t\t>\n\t\t\t<BlockInspectorSingleBlock\n\t\t\t\tclientId={ selectedBlockClientId }\n\t\t\t\tblockName={ blockType.name }\n\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t/>\n\t\t</BlockInspectorSingleBlockWrapper>\n\t);\n}\n\nconst BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {\n\treturn animate ? wrapper( children ) : children;\n};\n\nconst AnimatedContainer = ( {\n\tblockInspectorAnimationSettings,\n\tselectedBlockClientId,\n\tchildren,\n} ) => {\n\tconst animationOrigin =\n\t\tblockInspectorAnimationSettings &&\n\t\tblockInspectorAnimationSettings.enterDirection === 'leftToRight'\n\t\t\t? -50\n\t\t\t: 50;\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={ {\n\t\t\t\tx: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\tease: 'easeInOut',\n\t\t\t\t\tduration: 0.14,\n\t\t\t\t},\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tx: animationOrigin,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\tkey={ selectedBlockClientId }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n};\n\nconst BlockInspectorSingleBlock = ( {\n\tclientId,\n\tblockName,\n\tisSectionBlock,\n} ) => {\n\tconst availableTabs = useInspectorControlsTabs( blockName );\n\tconst showTabs = ! isSectionBlock && availableTabs?.length > 1;\n\n\tconst hasBlockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\tconst blockStyles = getBlockStyles( blockName );\n\t\t\treturn blockStyles && blockStyles.length > 0;\n\t\t},\n\t\t[ blockName ]\n\t);\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\tconst contentClientIds = useSelect(\n\t\t( select ) => {\n\t\t\t// Avoid unnecessary subscription.\n\t\t\tif ( ! isSectionBlock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\treturn getClientIdsOfDescendants( clientId ).filter(\n\t\t\t\t( current ) =>\n\t\t\t\t\tgetBlockName( current ) !== 'core/list-item' &&\n\t\t\t\t\tgetBlockEditingMode( current ) === 'contentOnly'\n\t\t\t);\n\t\t},\n\t\t[ isSectionBlock, clientId ]\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t<BlockCard\n\t\t\t\t{ ...blockInformation }\n\t\t\t\tclassName={ blockInformation.isSynced && 'is-synced' }\n\t\t\t>\n\t\t\t\t{ window?.__experimentalContentOnlyPatternInsertion && (\n\t\t\t\t\t<EditContentsButton clientId={ clientId } />\n\t\t\t\t) }\n\t\t\t</BlockCard>\n\t\t\t<BlockVariationTransforms blockClientId={ clientId } />\n\t\t\t{ showTabs && (\n\t\t\t\t<InspectorControlsTabs\n\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\ttabs={ availableTabs }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ ! showTabs && (\n\t\t\t\t<>\n\t\t\t\t\t{ hasBlockStyles && (\n\t\t\t\t\t\t<BlockStylesPanel clientId={ clientId } />\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ contentClientIds && contentClientIds?.length > 0 && (\n\t\t\t\t\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t\t\t\t\t<BlockQuickNavigation\n\t\t\t\t\t\t\t\tclientIds={ contentClientIds }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isSectionBlock && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<InspectorControls.Slot />\n\t\t\t\t\t\t\t<InspectorControls.Slot group=\"list\" />\n\t\t\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\t\t\tgroup=\"color\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\t\t\tgroup=\"background\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Background image' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\t\t\tgroup=\"typography\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\t\t\tgroup=\"dimensions\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\t\t\tgroup=\"border\"\n\t\t\t\t\t\t\t\tlabel={ borderPanelLabel }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t\t\t\t\t<PositionControls />\n\t\t\t\t\t\t\t<InspectorControls.Slot group=\"bindings\" />\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<AdvancedControls />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<SkipToSelectedBlock key=\"back\" />\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md\n */\nexport default BlockInspector;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,mBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,UAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,wBAAA,GAAAH,sBAAA,CAAAL,OAAA;AACA,IAAAS,yBAAA,GAAAJ,sBAAA,CAAAL,OAAA;AACA,IAAAU,2BAAA,GAAAL,sBAAA,CAAAL,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,YAAA,GAAAP,sBAAA,CAAAL,OAAA;AACA,IAAAa,kBAAA,GAAAR,sBAAA,CAAAL,OAAA;AACA,IAAAc,sBAAA,GAAAT,sBAAA,CAAAL,OAAA;AACA,IAAAe,yBAAA,GAAAV,sBAAA,CAAAL,OAAA;AACA,IAAAgB,sBAAA,GAAAX,sBAAA,CAAAL,OAAA;AACA,IAAAiB,sBAAA,GAAAZ,sBAAA,CAAAL,OAAA;AACA,IAAAkB,mCAAA,GAAAb,sBAAA,CAAAL,OAAA;AACA,IAAAmB,qBAAA,GAAAd,sBAAA,CAAAL,OAAA;A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GeC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blocks","_components","_data","_editContentsButton","_interopRequireDefault","_skipToSelectedBlock","_blockCard","_multiSelectionInspector","_blockVariationTransforms","_useBlockDisplayInformation","_store","_blockStyles","_inspectorControls","_inspectorControlsTabs","_useInspectorControlsTabs","_advancedControlsPanel","_positionControlsPanel","_useBlockInspectorAnimationSettings","_border","_contentTab","_lockUnlock","_jsxRuntime","BlockStylesPanel","clientId","jsx","PanelBody","title","__","children","default","StyleInspectorSlots","blockName","showAdvancedControls","showPositionControls","showListControls","showBindingsControls","borderPanelLabel","useBorderPanelLabel","jsxs","Fragment","Slot","group","label","className","BlockInspector","selectedBlockCount","selectedBlockName","selectedBlockClientId","blockType","isSectionBlock","isSectionBlockInSelection","hasBlockStyles","useSelect","select","getSelectedBlockClientId","getSelectedBlockClientIds","getSelectedBlockCount","getBlockName","getParentSectionBlock","_isSectionBlock","unlock","blockEditorStore","getBlockStyles","blocksStore","_selectedBlockClientId","renderedBlockClientId","_selectedBlockName","_blockType","getBlockType","selectedBlockClientIds","_isSectionBlockInSelection","some","id","blockStyles","_hasBlockStyles","length","contentClientIds","getClientIdsOfDescendants","getBlockEditingMode","descendants","filter","current","availableTabs","useInspectorControlsTabs","name","hasMultipleTabs","blockInspectorAnimationSettings","useBlockInspectorAnimationSettings","hasSelectedBlocks","tabs","isSelectedBlockUnregistered","getUnregisteredTypeHandlerName","shouldShowWarning","BlockInspectorSingleBlockWrapper","animate","wrapper","AnimatedContainer","BlockInspectorSingleBlock","animationOrigin","enterDirection","__unstableMotion","div","x","opacity","transition","ease","duration","initial","blockInformation","useBlockDisplayInformation","isBlockSynced","isSynced","shouldShowTabs","window","__experimentalContentOnlyPatternInsertion","blockClientId","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-inspector/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetUnregisteredTypeHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { PanelBody, __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EditContentsButton from './edit-contents-button';\nimport SkipToSelectedBlock from '../skip-to-selected-block';\nimport BlockCard from '../block-card';\nimport MultiSelectionInspector from '../multi-selection-inspector';\nimport BlockVariationTransforms from '../block-variation-transforms';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { store as blockEditorStore } from '../../store';\nimport BlockStyles from '../block-styles';\nimport { default as InspectorControls } from '../inspector-controls';\nimport { default as InspectorControlsTabs } from '../inspector-controls-tabs';\nimport useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';\nimport AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';\nimport PositionControls from '../inspector-controls-tabs/position-controls-panel';\nimport useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';\nimport { useBorderPanelLabel } from '../../hooks/border';\nimport ContentTab from '../inspector-controls-tabs/content-tab';\n\nimport { unlock } from '../../lock-unlock';\n\nfunction BlockStylesPanel( { clientId } ) {\n\treturn (\n\t\t<PanelBody title={ __( 'Styles' ) }>\n\t\t\t<BlockStyles clientId={ clientId } />\n\t\t</PanelBody>\n\t);\n}\n\nfunction StyleInspectorSlots( {\n\tblockName,\n\tshowAdvancedControls = true,\n\tshowPositionControls = true,\n\tshowListControls = false,\n\tshowBindingsControls = true,\n} ) {\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls.Slot />\n\t\t\t{ showListControls && <InspectorControls.Slot group=\"list\" /> }\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"color\"\n\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"background\"\n\t\t\t\tlabel={ __( 'Background image' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"typography\"\n\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"border\" label={ borderPanelLabel } />\n\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t{ showPositionControls && <PositionControls /> }\n\t\t\t{ showBindingsControls && (\n\t\t\t\t<InspectorControls.Slot group=\"bindings\" />\n\t\t\t) }\n\t\t\t{ showAdvancedControls && (\n\t\t\t\t<div>\n\t\t\t\t\t<AdvancedControls />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction BlockInspector() {\n\tconst {\n\t\tselectedBlockCount,\n\t\tselectedBlockName,\n\t\tselectedBlockClientId,\n\t\tblockType,\n\t\tisSectionBlock,\n\t\tisSectionBlockInSelection,\n\t\thasBlockStyles,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tgetSelectedBlockCount,\n\t\t\tgetBlockName,\n\t\t\tgetParentSectionBlock,\n\t\t\tisSectionBlock: _isSectionBlock,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { getBlockStyles } = select( blocksStore );\n\t\tconst _selectedBlockClientId = getSelectedBlockClientId();\n\t\tconst renderedBlockClientId =\n\t\t\tgetParentSectionBlock( _selectedBlockClientId ) ||\n\t\t\t_selectedBlockClientId;\n\t\tconst _selectedBlockName =\n\t\t\trenderedBlockClientId && getBlockName( renderedBlockClientId );\n\t\tconst _blockType =\n\t\t\t_selectedBlockName && getBlockType( _selectedBlockName );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst _isSectionBlockInSelection = selectedBlockClientIds.some(\n\t\t\t( id ) => _isSectionBlock( id )\n\t\t);\n\n\t\tconst blockStyles =\n\t\t\t_selectedBlockName && getBlockStyles( _selectedBlockName );\n\t\tconst _hasBlockStyles = blockStyles && blockStyles.length > 0;\n\n\t\treturn {\n\t\t\tselectedBlockCount: getSelectedBlockCount(),\n\t\t\tselectedBlockClientId: renderedBlockClientId,\n\t\t\tselectedBlockName: _selectedBlockName,\n\t\t\tblockType: _blockType,\n\t\t\tisSectionBlockInSelection: _isSectionBlockInSelection,\n\t\t\tisSectionBlock: _isSectionBlock( renderedBlockClientId ),\n\t\t\thasBlockStyles: _hasBlockStyles,\n\t\t};\n\t}, [] );\n\n\t// Separate useSelect for contentClientIds with proper dependencies\n\tconst contentClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSectionBlock || ! selectedBlockClientId ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst descendants = getClientIdsOfDescendants(\n\t\t\t\tselectedBlockClientId\n\t\t\t);\n\t\t\treturn descendants.filter(\n\t\t\t\t( current ) =>\n\t\t\t\t\tgetBlockName( current ) !== 'core/list-item' &&\n\t\t\t\t\tgetBlockEditingMode( current ) === 'contentOnly'\n\t\t\t);\n\t\t},\n\t\t[ isSectionBlock, selectedBlockClientId ]\n\t);\n\n\tconst availableTabs = useInspectorControlsTabs(\n\t\tblockType?.name,\n\t\tcontentClientIds,\n\t\tisSectionBlock,\n\t\thasBlockStyles\n\t);\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\n\t// The block inspector animation settings will be completely\n\t// removed in the future to create an API which allows the block\n\t// inspector to transition between what it\n\t// displays based on the relationship between the selected block\n\t// and its parent, and only enable it if the parent is controlling\n\t// its children blocks.\n\tconst blockInspectorAnimationSettings =\n\t\tuseBlockInspectorAnimationSettings( blockType );\n\n\tconst hasSelectedBlocks = selectedBlockCount > 1;\n\n\tif ( hasSelectedBlocks && ! isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t\t{ hasMultipleTabs ? (\n\t\t\t\t\t<InspectorControlsTabs tabs={ availableTabs } />\n\t\t\t\t) : (\n\t\t\t\t\t<StyleInspectorSlots\n\t\t\t\t\t\tblockName={ selectedBlockName }\n\t\t\t\t\t\tshowAdvancedControls={ false }\n\t\t\t\t\t\tshowPositionControls={ false }\n\t\t\t\t\t\tshowBindingsControls={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( hasSelectedBlocks && isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst isSelectedBlockUnregistered =\n\t\tselectedBlockName === getUnregisteredTypeHandlerName();\n\n\t/*\n\t * If the selected block is of an unregistered type, avoid showing it as an actual selection\n\t * because we want the user to focus on the unregistered block warning, not block settings.\n\t */\n\tconst shouldShowWarning =\n\t\t! blockType || ! selectedBlockClientId || isSelectedBlockUnregistered;\n\n\tif ( shouldShowWarning ) {\n\t\treturn (\n\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t</span>\n\t\t);\n\t}\n\n\treturn (\n\t\t<BlockInspectorSingleBlockWrapper\n\t\t\tanimate={ blockInspectorAnimationSettings }\n\t\t\twrapper={ ( children ) => (\n\t\t\t\t<AnimatedContainer\n\t\t\t\t\tblockInspectorAnimationSettings={\n\t\t\t\t\t\tblockInspectorAnimationSettings\n\t\t\t\t\t}\n\t\t\t\t\tselectedBlockClientId={ selectedBlockClientId }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</AnimatedContainer>\n\t\t\t) }\n\t\t>\n\t\t\t<BlockInspectorSingleBlock\n\t\t\t\tclientId={ selectedBlockClientId }\n\t\t\t\tblockName={ blockType.name }\n\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\tavailableTabs={ availableTabs }\n\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t/>\n\t\t</BlockInspectorSingleBlockWrapper>\n\t);\n}\n\nconst BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {\n\treturn animate ? wrapper( children ) : children;\n};\n\nconst AnimatedContainer = ( {\n\tblockInspectorAnimationSettings,\n\tselectedBlockClientId,\n\tchildren,\n} ) => {\n\tconst animationOrigin =\n\t\tblockInspectorAnimationSettings &&\n\t\tblockInspectorAnimationSettings.enterDirection === 'leftToRight'\n\t\t\t? -50\n\t\t\t: 50;\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={ {\n\t\t\t\tx: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\tease: 'easeInOut',\n\t\t\t\t\tduration: 0.14,\n\t\t\t\t},\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tx: animationOrigin,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\tkey={ selectedBlockClientId }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n};\n\nconst BlockInspectorSingleBlock = ( {\n\tclientId,\n\tblockName,\n\tisSectionBlock,\n\tavailableTabs,\n\tcontentClientIds,\n\thasBlockStyles,\n} ) => {\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst isBlockSynced = blockInformation.isSynced;\n\n\tconst shouldShowTabs = ! isBlockSynced && hasMultipleTabs;\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t<BlockCard\n\t\t\t\t{ ...blockInformation }\n\t\t\t\tclassName={ isBlockSynced && 'is-synced' }\n\t\t\t>\n\t\t\t\t{ window?.__experimentalContentOnlyPatternInsertion && (\n\t\t\t\t\t<EditContentsButton clientId={ clientId } />\n\t\t\t\t) }\n\t\t\t</BlockCard>\n\t\t\t<BlockVariationTransforms blockClientId={ clientId } />\n\t\t\t{ shouldShowTabs && (\n\t\t\t\t<InspectorControlsTabs\n\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\ttabs={ availableTabs }\n\t\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ ! shouldShowTabs && (\n\t\t\t\t<>\n\t\t\t\t\t{ hasBlockStyles && (\n\t\t\t\t\t\t<BlockStylesPanel clientId={ clientId } />\n\t\t\t\t\t) }\n\t\t\t\t\t<ContentTab contentClientIds={ contentClientIds } />\n\t\t\t\t\t{ ! isSectionBlock && (\n\t\t\t\t\t\t<StyleInspectorSlots\n\t\t\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\t\t\tshowListControls\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<SkipToSelectedBlock key=\"back\" />\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md\n */\nexport default BlockInspector;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,mBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,UAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,wBAAA,GAAAH,sBAAA,CAAAL,OAAA;AACA,IAAAS,yBAA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G,GAAA,EAACL,WAAA,CAAAU,OAAU;QAAC+C,gBAAgB,EAAGA;MAAkB,CAAE,CAAC,EAClD,CAAE3B,cAAc,iBACjB,IAAA5B,WAAA,CAAAG,GAAA,EAACM,mBAAmB;QACnBC,SAAS,EAAGA,SAAW;QACvBG,gBAAgB;MAAA,CAChB,CACD;IAAA,CACA,CACF,eACD,IAAAb,WAAA,CAAAG,GAAA,EAACnB,oBAAA,CAAAwB,OAAmB,MAAK,MAAQ,CAAC;EAAA,CAC9B,CAAC;AAER,CAAC;;AAED;AACA;AACA;AAFA,IAAAuF,QAAA,GAAAC,OAAA,CAAAxF,OAAA,GAGee,cAAc","ignoreList":[]}
|
|
@@ -152,7 +152,7 @@ const BlockSwitcher = ({
|
|
|
152
152
|
isReusable,
|
|
153
153
|
isTemplate,
|
|
154
154
|
isDisabled,
|
|
155
|
-
|
|
155
|
+
isSectionInSelection
|
|
156
156
|
} = (0, _data.useSelect)(select => {
|
|
157
157
|
const {
|
|
158
158
|
getTemplateLock,
|
|
@@ -195,6 +195,7 @@ const BlockSwitcher = ({
|
|
|
195
195
|
// appropriate icon to communicate the non-uniformity.
|
|
196
196
|
_icon = isSelectionOfSameType ? blockType.icon : _icons.copy;
|
|
197
197
|
}
|
|
198
|
+
const _isSectionInSelection = clientIds.some(id => isSectionBlock(id));
|
|
198
199
|
return {
|
|
199
200
|
canRemove: canRemoveBlocks(clientIds),
|
|
200
201
|
hasBlockStyles: _isSingleBlockSelected && !!getBlockStyles(firstBlockName)?.length,
|
|
@@ -203,7 +204,7 @@ const BlockSwitcher = ({
|
|
|
203
204
|
isTemplate: _isSingleBlockSelected && (0, _blocks2.isTemplatePart)(_blocks[0]),
|
|
204
205
|
hasContentOnlyLocking: _hasTemplateLock,
|
|
205
206
|
isDisabled: editingMode !== 'default',
|
|
206
|
-
|
|
207
|
+
isSectionInSelection: _isSectionInSelection
|
|
207
208
|
};
|
|
208
209
|
}, [clientIds]);
|
|
209
210
|
const blockTitle = (0, _useBlockDisplayTitle.default)({
|
|
@@ -217,7 +218,7 @@ const BlockSwitcher = ({
|
|
|
217
218
|
const isSingleBlock = clientIds.length === 1;
|
|
218
219
|
const blockSwitcherLabel = isSingleBlock ? blockTitle : (0, _i18n.__)('Multiple blocks selected');
|
|
219
220
|
const blockIndicatorText = (isReusable || isTemplate) && !showIconLabels && blockTitle ? blockTitle : undefined;
|
|
220
|
-
const hideTransformsForSections = window?.__experimentalContentOnlyPatternInsertion &&
|
|
221
|
+
const hideTransformsForSections = window?.__experimentalContentOnlyPatternInsertion && isSectionInSelection;
|
|
221
222
|
const hideDropdown = hideTransformsForSections || isDisabled || !hasBlockStyles && !canRemove || hasContentOnlyLocking;
|
|
222
223
|
if (hideDropdown) {
|
|
223
224
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_blocks2","_data","_icons","_preferences","_store","_blockIcon","_interopRequireDefault","_blockTransformationsMenu","_blockVariationTransformations","_blockStylesMenu","_patternTransformationsMenu","_useBlockDisplayTitle","_lockUnlock","_jsxRuntime","BlockSwitcherDropdownMenuContents","onClose","clientIds","hasBlockStyles","canRemove","replaceBlocks","multiSelect","updateBlockAttributes","useDispatch","blockEditorStore","possibleBlockTransformations","patterns","blocks","isUsingBindings","useSelect","select","getBlockAttributes","getBlocksByClientId","getBlockRootClientId","getBlockTransformItems","__experimentalGetPatternTransformItems","rootClientId","_blocks","every","clientId","metadata","bindings","blockVariationTransformations","useBlockVariationTransforms","selectForMultipleBlocks","insertedBlocks","length","onBlockTransform","name","newBlocks","switchToBlockType","onBlockVariationTransform","find","variationName","attributes","onPatternTransform","transformedBlocks","isSingleBlock","isSynced","isTemplatePart","isReusableBlock","hasPossibleBlockTransformations","hasPossibleBlockVariationTransformations","hasPatternTransformation","hasBlockOrBlockVariationTransforms","hasContents","jsx","className","children","__","connectedBlockDescription","_x","jsxs","default","onSelect","possibleBlockVariationTransformations","onSelectVariation","hoveredBlock","onSwitch","MenuGroup","__experimentalText","BlockSwitcher","hasContentOnlyLocking","icon","invalidBlocks","isReusable","isTemplate","isDisabled","isSection","getTemplateLock","canRemoveBlocks","getBlockEditingMode","isSectionBlock","unlock","getBlockStyles","getBlockType","getActiveBlockVariation","blocksStore","some","block","firstBlockName","_isSingleBlockSelected","blockType","editingMode","_icon","_hasTemplateLock","match","isSelectionOfSameType","Set","map","size","id","copy","blockTitle","useBlockDisplayTitle","maximumLength","showIconLabels","preferencesStore","get","blockSwitcherLabel","blockIndicatorText","undefined","hideTransformsForSections","window","__experimentalContentOnlyPatternInsertion","hideDropdown","ToolbarGroup","ToolbarButton","disabled","title","showColors","text","blockSwitcherDescription","sprintf","_n","ToolbarItem","toggleProps","DropdownMenu","label","popoverProps","placement","description","menuProps","orientation","exports","_default"],"sources":["@wordpress/block-editor/src/components/block-switcher/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, _x } from '@wordpress/i18n';\nimport {\n\tDropdownMenu,\n\tToolbarButton,\n\tToolbarGroup,\n\tToolbarItem,\n\t__experimentalText as Text,\n\tMenuGroup,\n} from '@wordpress/components';\nimport {\n\tswitchToBlockType,\n\tstore as blocksStore,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { copy } from '@wordpress/icons';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockIcon from '../block-icon';\nimport BlockTransformationsMenu from './block-transformations-menu';\nimport { useBlockVariationTransforms } from './block-variation-transformations';\nimport BlockStylesMenu from './block-styles-menu';\nimport PatternTransformationsMenu from './pattern-transformations-menu';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport { unlock } from '../../lock-unlock';\n\nfunction BlockSwitcherDropdownMenuContents( {\n\tonClose,\n\tclientIds,\n\thasBlockStyles,\n\tcanRemove,\n} ) {\n\tconst { replaceBlocks, multiSelect, updateBlockAttributes } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { possibleBlockTransformations, patterns, blocks, isUsingBindings } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockAttributes,\n\t\t\t\t\tgetBlocksByClientId,\n\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\tgetBlockTransformItems,\n\t\t\t\t\t__experimentalGetPatternTransformItems,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\t\tconst _blocks = getBlocksByClientId( clientIds );\n\t\t\t\treturn {\n\t\t\t\t\tblocks: _blocks,\n\t\t\t\t\tpossibleBlockTransformations: getBlockTransformItems(\n\t\t\t\t\t\t_blocks,\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t),\n\t\t\t\t\tpatterns: __experimentalGetPatternTransformItems(\n\t\t\t\t\t\t_blocks,\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t),\n\t\t\t\t\tisUsingBindings: clientIds.every(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\t!! getBlockAttributes( clientId )?.metadata\n\t\t\t\t\t\t\t\t?.bindings\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientIds ]\n\t\t);\n\tconst blockVariationTransformations = useBlockVariationTransforms( {\n\t\tclientIds,\n\t\tblocks,\n\t} );\n\tfunction selectForMultipleBlocks( insertedBlocks ) {\n\t\tif ( insertedBlocks.length > 1 ) {\n\t\t\tmultiSelect(\n\t\t\t\tinsertedBlocks[ 0 ].clientId,\n\t\t\t\tinsertedBlocks[ insertedBlocks.length - 1 ].clientId\n\t\t\t);\n\t\t}\n\t}\n\t// Simple block transformation based on the `Block Transforms` API.\n\tfunction onBlockTransform( name ) {\n\t\tconst newBlocks = switchToBlockType( blocks, name );\n\t\treplaceBlocks( clientIds, newBlocks );\n\t\tselectForMultipleBlocks( newBlocks );\n\t}\n\tfunction onBlockVariationTransform( name ) {\n\t\tupdateBlockAttributes( blocks[ 0 ].clientId, {\n\t\t\t...blockVariationTransformations.find(\n\t\t\t\t( { name: variationName } ) => variationName === name\n\t\t\t).attributes,\n\t\t} );\n\t}\n\t// Pattern transformation through the `Patterns` API.\n\tfunction onPatternTransform( transformedBlocks ) {\n\t\treplaceBlocks( clientIds, transformedBlocks );\n\t\tselectForMultipleBlocks( transformedBlocks );\n\t}\n\t/**\n\t * The `isSynced` check is a stopgap solution here.\n\t * Ideally, the Transforms API should handle this\n\t * by allowing to exclude blocks from wildcard transformations.\n\t */\n\tconst isSingleBlock = blocks.length === 1;\n\tconst isSynced =\n\t\tisSingleBlock &&\n\t\t( isTemplatePart( blocks[ 0 ] ) || isReusableBlock( blocks[ 0 ] ) );\n\tconst hasPossibleBlockTransformations =\n\t\t!! possibleBlockTransformations?.length && canRemove && ! isSynced;\n\tconst hasPossibleBlockVariationTransformations =\n\t\t!! blockVariationTransformations?.length;\n\tconst hasPatternTransformation = !! patterns?.length && canRemove;\n\tconst hasBlockOrBlockVariationTransforms =\n\t\thasPossibleBlockTransformations ||\n\t\thasPossibleBlockVariationTransformations;\n\tconst hasContents =\n\t\thasBlockStyles ||\n\t\thasBlockOrBlockVariationTransforms ||\n\t\thasPatternTransformation;\n\tif ( ! hasContents ) {\n\t\treturn (\n\t\t\t<p className=\"block-editor-block-switcher__no-transforms\">\n\t\t\t\t{ __( 'No transforms.' ) }\n\t\t\t</p>\n\t\t);\n\t}\n\n\tconst connectedBlockDescription = isSingleBlock\n\t\t? _x(\n\t\t\t\t'This block is connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t )\n\t\t: _x(\n\t\t\t\t'These blocks are connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t );\n\n\treturn (\n\t\t<div className=\"block-editor-block-switcher__container\">\n\t\t\t{ hasPatternTransformation && (\n\t\t\t\t<PatternTransformationsMenu\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonSelect={ ( transformedBlocks ) => {\n\t\t\t\t\t\tonPatternTransform( transformedBlocks );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBlockOrBlockVariationTransforms && (\n\t\t\t\t<BlockTransformationsMenu\n\t\t\t\t\tclassName=\"block-editor-block-switcher__transforms__menugroup\"\n\t\t\t\t\tpossibleBlockTransformations={\n\t\t\t\t\t\tpossibleBlockTransformations\n\t\t\t\t\t}\n\t\t\t\t\tpossibleBlockVariationTransformations={\n\t\t\t\t\t\tblockVariationTransformations\n\t\t\t\t\t}\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tonSelect={ ( name ) => {\n\t\t\t\t\t\tonBlockTransform( name );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\tonSelectVariation={ ( name ) => {\n\t\t\t\t\t\tonBlockVariationTransform( name );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBlockStyles && (\n\t\t\t\t<BlockStylesMenu\n\t\t\t\t\thoveredBlock={ blocks[ 0 ] }\n\t\t\t\t\tonSwitch={ onClose }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isUsingBindings && (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t<Text className=\"block-editor-block-switcher__binding-indicator\">\n\t\t\t\t\t\t{ connectedBlockDescription }\n\t\t\t\t\t</Text>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport const BlockSwitcher = ( { clientIds } ) => {\n\tconst {\n\t\thasContentOnlyLocking,\n\t\tcanRemove,\n\t\thasBlockStyles,\n\t\ticon,\n\t\tinvalidBlocks,\n\t\tisReusable,\n\t\tisTemplate,\n\t\tisDisabled,\n\t\tisSection,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tcanRemoveBlocks,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tisSectionBlock,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst { getBlockStyles, getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst _blocks = getBlocksByClientId( clientIds );\n\t\t\tif ( ! _blocks.length || _blocks.some( ( block ) => ! block ) ) {\n\t\t\t\treturn { invalidBlocks: true };\n\t\t\t}\n\t\t\tconst [ { name: firstBlockName } ] = _blocks;\n\t\t\tconst _isSingleBlockSelected = _blocks.length === 1;\n\t\t\tconst blockType = getBlockType( firstBlockName );\n\t\t\tconst editingMode = getBlockEditingMode( clientIds[ 0 ] );\n\n\t\t\tlet _icon;\n\t\t\tlet _hasTemplateLock;\n\t\t\tif ( _isSingleBlockSelected ) {\n\t\t\t\tconst match = getActiveBlockVariation(\n\t\t\t\t\tfirstBlockName,\n\t\t\t\t\tgetBlockAttributes( clientIds[ 0 ] )\n\t\t\t\t);\n\t\t\t\t// Take into account active block variations.\n\t\t\t\t_icon = match?.icon || blockType.icon;\n\t\t\t\t_hasTemplateLock =\n\t\t\t\t\tgetTemplateLock( clientIds[ 0 ] ) === 'contentOnly';\n\t\t\t} else {\n\t\t\t\tconst isSelectionOfSameType =\n\t\t\t\t\tnew Set( _blocks.map( ( { name } ) => name ) ).size === 1;\n\t\t\t\t_hasTemplateLock = clientIds.some(\n\t\t\t\t\t( id ) => getTemplateLock( id ) === 'contentOnly'\n\t\t\t\t);\n\t\t\t\t// When selection consists of blocks of multiple types, display an\n\t\t\t\t// appropriate icon to communicate the non-uniformity.\n\t\t\t\t_icon = isSelectionOfSameType ? blockType.icon : copy;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcanRemove: canRemoveBlocks( clientIds ),\n\t\t\t\thasBlockStyles:\n\t\t\t\t\t_isSingleBlockSelected &&\n\t\t\t\t\t!! getBlockStyles( firstBlockName )?.length,\n\t\t\t\ticon: _icon,\n\t\t\t\tisReusable:\n\t\t\t\t\t_isSingleBlockSelected && isReusableBlock( _blocks[ 0 ] ),\n\t\t\t\tisTemplate:\n\t\t\t\t\t_isSingleBlockSelected && isTemplatePart( _blocks[ 0 ] ),\n\t\t\t\thasContentOnlyLocking: _hasTemplateLock,\n\t\t\t\tisDisabled: editingMode !== 'default',\n\t\t\t\tisSection: isSectionBlock( clientIds[ 0 ] ),\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId: clientIds?.[ 0 ],\n\t\tmaximumLength: 35,\n\t} );\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\n\tif ( invalidBlocks ) {\n\t\treturn null;\n\t}\n\n\tconst isSingleBlock = clientIds.length === 1;\n\tconst blockSwitcherLabel = isSingleBlock\n\t\t? blockTitle\n\t\t: __( 'Multiple blocks selected' );\n\n\tconst blockIndicatorText =\n\t\t( isReusable || isTemplate ) && ! showIconLabels && blockTitle\n\t\t\t? blockTitle\n\t\t\t: undefined;\n\n\tconst hideTransformsForSections =\n\t\twindow?.__experimentalContentOnlyPatternInsertion && isSection;\n\tconst hideDropdown =\n\t\thideTransformsForSections ||\n\t\tisDisabled ||\n\t\t( ! hasBlockStyles && ! canRemove ) ||\n\t\thasContentOnlyLocking;\n\n\tif ( hideDropdown ) {\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tdisabled\n\t\t\t\t\tclassName=\"block-editor-block-switcher__no-switcher-icon\"\n\t\t\t\t\ttitle={ blockSwitcherLabel }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\tclassName=\"block-editor-block-switcher__toggle\"\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tshowColors\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\ttext={ blockIndicatorText }\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t}\n\n\tconst blockSwitcherDescription = isSingleBlock\n\t\t? __( 'Change block type or style' )\n\t\t: sprintf(\n\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'Change type of %d block',\n\t\t\t\t\t'Change type of %d blocks',\n\t\t\t\t\tclientIds.length\n\t\t\t\t),\n\t\t\t\tclientIds.length\n\t\t );\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarItem>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\tclassName=\"block-editor-block-switcher\"\n\t\t\t\t\t\tlabel={ blockSwitcherLabel }\n\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\t\tclassName: 'block-editor-block-switcher__popover',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-switcher__toggle\"\n\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\tshowColors\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttext={ blockIndicatorText }\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tdescription: blockSwitcherDescription,\n\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmenuProps={ { orientation: 'both' } }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<BlockSwitcherDropdownMenuContents\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\tclientIds={ clientI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A,CAAAoD,GAAA,EAAClE,WAAA,CAAAyI,YAAY;QACZtE,SAAS,EAAC,6BAA6B;QACvCuE,KAAK,EAAGnB,kBAAoB;QAC5BoB,YAAY,EAAG;UACdC,SAAS,EAAE,cAAc;UACzBzE,SAAS,EAAE;QACZ,CAAG;QACHgB,IAAI,eACH,IAAArE,WAAA,CAAAoD,GAAA,EAAC5D,UAAA,CAAAmE,OAAS;UACTN,SAAS,EAAC,qCAAqC;UAC/CgB,IAAI,EAAGA,IAAM;UACb+C,UAAU;QAAA,CACV,CACD;QACDC,IAAI,EAAGX,kBAAoB;QAC3BgB,WAAW,EAAG;UACbK,WAAW,EAAET,wBAAwB;UACrC,GAAGI;QACJ,CAAG;QACHM,SAAS,EAAG;UAAEC,WAAW,EAAE;QAAO,CAAG;QAAA3E,QAAA,EAEnCA,CAAE;UAAEpD;QAAQ,CAAC,kBACd,IAAAF,WAAA,CAAAoD,GAAA,EAACnD,iCAAiC;UACjCC,OAAO,EAAGA,OAAS;UACnBC,SAAS,EAAGA,SAAW;UACvBC,cAAc,EAAGA,cAAgB;UACjCC,SAAS,EAAGA;QAAW,CACvB;MACD,CACY;IACd,CACW;EAAC,CACD,CAAC;AAEjB,CAAC;AAAC6H,OAAA,CAAA/D,aAAA,GAAAA,aAAA;AAAA,IAAAgE,QAAA,GAAAD,OAAA,CAAAvE,OAAA,GAEaQ,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_blocks2","_data","_icons","_preferences","_store","_blockIcon","_interopRequireDefault","_blockTransformationsMenu","_blockVariationTransformations","_blockStylesMenu","_patternTransformationsMenu","_useBlockDisplayTitle","_lockUnlock","_jsxRuntime","BlockSwitcherDropdownMenuContents","onClose","clientIds","hasBlockStyles","canRemove","replaceBlocks","multiSelect","updateBlockAttributes","useDispatch","blockEditorStore","possibleBlockTransformations","patterns","blocks","isUsingBindings","useSelect","select","getBlockAttributes","getBlocksByClientId","getBlockRootClientId","getBlockTransformItems","__experimentalGetPatternTransformItems","rootClientId","_blocks","every","clientId","metadata","bindings","blockVariationTransformations","useBlockVariationTransforms","selectForMultipleBlocks","insertedBlocks","length","onBlockTransform","name","newBlocks","switchToBlockType","onBlockVariationTransform","find","variationName","attributes","onPatternTransform","transformedBlocks","isSingleBlock","isSynced","isTemplatePart","isReusableBlock","hasPossibleBlockTransformations","hasPossibleBlockVariationTransformations","hasPatternTransformation","hasBlockOrBlockVariationTransforms","hasContents","jsx","className","children","__","connectedBlockDescription","_x","jsxs","default","onSelect","possibleBlockVariationTransformations","onSelectVariation","hoveredBlock","onSwitch","MenuGroup","__experimentalText","BlockSwitcher","hasContentOnlyLocking","icon","invalidBlocks","isReusable","isTemplate","isDisabled","isSectionInSelection","getTemplateLock","canRemoveBlocks","getBlockEditingMode","isSectionBlock","unlock","getBlockStyles","getBlockType","getActiveBlockVariation","blocksStore","some","block","firstBlockName","_isSingleBlockSelected","blockType","editingMode","_icon","_hasTemplateLock","match","isSelectionOfSameType","Set","map","size","id","copy","_isSectionInSelection","blockTitle","useBlockDisplayTitle","maximumLength","showIconLabels","preferencesStore","get","blockSwitcherLabel","blockIndicatorText","undefined","hideTransformsForSections","window","__experimentalContentOnlyPatternInsertion","hideDropdown","ToolbarGroup","ToolbarButton","disabled","title","showColors","text","blockSwitcherDescription","sprintf","_n","ToolbarItem","toggleProps","DropdownMenu","label","popoverProps","placement","description","menuProps","orientation","exports","_default"],"sources":["@wordpress/block-editor/src/components/block-switcher/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, _x } from '@wordpress/i18n';\nimport {\n\tDropdownMenu,\n\tToolbarButton,\n\tToolbarGroup,\n\tToolbarItem,\n\t__experimentalText as Text,\n\tMenuGroup,\n} from '@wordpress/components';\nimport {\n\tswitchToBlockType,\n\tstore as blocksStore,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { copy } from '@wordpress/icons';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockIcon from '../block-icon';\nimport BlockTransformationsMenu from './block-transformations-menu';\nimport { useBlockVariationTransforms } from './block-variation-transformations';\nimport BlockStylesMenu from './block-styles-menu';\nimport PatternTransformationsMenu from './pattern-transformations-menu';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport { unlock } from '../../lock-unlock';\n\nfunction BlockSwitcherDropdownMenuContents( {\n\tonClose,\n\tclientIds,\n\thasBlockStyles,\n\tcanRemove,\n} ) {\n\tconst { replaceBlocks, multiSelect, updateBlockAttributes } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { possibleBlockTransformations, patterns, blocks, isUsingBindings } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockAttributes,\n\t\t\t\t\tgetBlocksByClientId,\n\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\tgetBlockTransformItems,\n\t\t\t\t\t__experimentalGetPatternTransformItems,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\t\tconst _blocks = getBlocksByClientId( clientIds );\n\t\t\t\treturn {\n\t\t\t\t\tblocks: _blocks,\n\t\t\t\t\tpossibleBlockTransformations: getBlockTransformItems(\n\t\t\t\t\t\t_blocks,\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t),\n\t\t\t\t\tpatterns: __experimentalGetPatternTransformItems(\n\t\t\t\t\t\t_blocks,\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t),\n\t\t\t\t\tisUsingBindings: clientIds.every(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\t!! getBlockAttributes( clientId )?.metadata\n\t\t\t\t\t\t\t\t?.bindings\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientIds ]\n\t\t);\n\tconst blockVariationTransformations = useBlockVariationTransforms( {\n\t\tclientIds,\n\t\tblocks,\n\t} );\n\tfunction selectForMultipleBlocks( insertedBlocks ) {\n\t\tif ( insertedBlocks.length > 1 ) {\n\t\t\tmultiSelect(\n\t\t\t\tinsertedBlocks[ 0 ].clientId,\n\t\t\t\tinsertedBlocks[ insertedBlocks.length - 1 ].clientId\n\t\t\t);\n\t\t}\n\t}\n\t// Simple block transformation based on the `Block Transforms` API.\n\tfunction onBlockTransform( name ) {\n\t\tconst newBlocks = switchToBlockType( blocks, name );\n\t\treplaceBlocks( clientIds, newBlocks );\n\t\tselectForMultipleBlocks( newBlocks );\n\t}\n\tfunction onBlockVariationTransform( name ) {\n\t\tupdateBlockAttributes( blocks[ 0 ].clientId, {\n\t\t\t...blockVariationTransformations.find(\n\t\t\t\t( { name: variationName } ) => variationName === name\n\t\t\t).attributes,\n\t\t} );\n\t}\n\t// Pattern transformation through the `Patterns` API.\n\tfunction onPatternTransform( transformedBlocks ) {\n\t\treplaceBlocks( clientIds, transformedBlocks );\n\t\tselectForMultipleBlocks( transformedBlocks );\n\t}\n\t/**\n\t * The `isSynced` check is a stopgap solution here.\n\t * Ideally, the Transforms API should handle this\n\t * by allowing to exclude blocks from wildcard transformations.\n\t */\n\tconst isSingleBlock = blocks.length === 1;\n\tconst isSynced =\n\t\tisSingleBlock &&\n\t\t( isTemplatePart( blocks[ 0 ] ) || isReusableBlock( blocks[ 0 ] ) );\n\tconst hasPossibleBlockTransformations =\n\t\t!! possibleBlockTransformations?.length && canRemove && ! isSynced;\n\tconst hasPossibleBlockVariationTransformations =\n\t\t!! blockVariationTransformations?.length;\n\tconst hasPatternTransformation = !! patterns?.length && canRemove;\n\tconst hasBlockOrBlockVariationTransforms =\n\t\thasPossibleBlockTransformations ||\n\t\thasPossibleBlockVariationTransformations;\n\tconst hasContents =\n\t\thasBlockStyles ||\n\t\thasBlockOrBlockVariationTransforms ||\n\t\thasPatternTransformation;\n\tif ( ! hasContents ) {\n\t\treturn (\n\t\t\t<p className=\"block-editor-block-switcher__no-transforms\">\n\t\t\t\t{ __( 'No transforms.' ) }\n\t\t\t</p>\n\t\t);\n\t}\n\n\tconst connectedBlockDescription = isSingleBlock\n\t\t? _x(\n\t\t\t\t'This block is connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t )\n\t\t: _x(\n\t\t\t\t'These blocks are connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t );\n\n\treturn (\n\t\t<div className=\"block-editor-block-switcher__container\">\n\t\t\t{ hasPatternTransformation && (\n\t\t\t\t<PatternTransformationsMenu\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonSelect={ ( transformedBlocks ) => {\n\t\t\t\t\t\tonPatternTransform( transformedBlocks );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBlockOrBlockVariationTransforms && (\n\t\t\t\t<BlockTransformationsMenu\n\t\t\t\t\tclassName=\"block-editor-block-switcher__transforms__menugroup\"\n\t\t\t\t\tpossibleBlockTransformations={\n\t\t\t\t\t\tpossibleBlockTransformations\n\t\t\t\t\t}\n\t\t\t\t\tpossibleBlockVariationTransformations={\n\t\t\t\t\t\tblockVariationTransformations\n\t\t\t\t\t}\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tonSelect={ ( name ) => {\n\t\t\t\t\t\tonBlockTransform( name );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\tonSelectVariation={ ( name ) => {\n\t\t\t\t\t\tonBlockVariationTransform( name );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBlockStyles && (\n\t\t\t\t<BlockStylesMenu\n\t\t\t\t\thoveredBlock={ blocks[ 0 ] }\n\t\t\t\t\tonSwitch={ onClose }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isUsingBindings && (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t<Text className=\"block-editor-block-switcher__binding-indicator\">\n\t\t\t\t\t\t{ connectedBlockDescription }\n\t\t\t\t\t</Text>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport const BlockSwitcher = ( { clientIds } ) => {\n\tconst {\n\t\thasContentOnlyLocking,\n\t\tcanRemove,\n\t\thasBlockStyles,\n\t\ticon,\n\t\tinvalidBlocks,\n\t\tisReusable,\n\t\tisTemplate,\n\t\tisDisabled,\n\t\tisSectionInSelection,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tcanRemoveBlocks,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tisSectionBlock,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst { getBlockStyles, getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst _blocks = getBlocksByClientId( clientIds );\n\t\t\tif ( ! _blocks.length || _blocks.some( ( block ) => ! block ) ) {\n\t\t\t\treturn { invalidBlocks: true };\n\t\t\t}\n\t\t\tconst [ { name: firstBlockName } ] = _blocks;\n\t\t\tconst _isSingleBlockSelected = _blocks.length === 1;\n\t\t\tconst blockType = getBlockType( firstBlockName );\n\t\t\tconst editingMode = getBlockEditingMode( clientIds[ 0 ] );\n\n\t\t\tlet _icon;\n\t\t\tlet _hasTemplateLock;\n\t\t\tif ( _isSingleBlockSelected ) {\n\t\t\t\tconst match = getActiveBlockVariation(\n\t\t\t\t\tfirstBlockName,\n\t\t\t\t\tgetBlockAttributes( clientIds[ 0 ] )\n\t\t\t\t);\n\t\t\t\t// Take into account active block variations.\n\t\t\t\t_icon = match?.icon || blockType.icon;\n\t\t\t\t_hasTemplateLock =\n\t\t\t\t\tgetTemplateLock( clientIds[ 0 ] ) === 'contentOnly';\n\t\t\t} else {\n\t\t\t\tconst isSelectionOfSameType =\n\t\t\t\t\tnew Set( _blocks.map( ( { name } ) => name ) ).size === 1;\n\t\t\t\t_hasTemplateLock = clientIds.some(\n\t\t\t\t\t( id ) => getTemplateLock( id ) === 'contentOnly'\n\t\t\t\t);\n\t\t\t\t// When selection consists of blocks of multiple types, display an\n\t\t\t\t// appropriate icon to communicate the non-uniformity.\n\t\t\t\t_icon = isSelectionOfSameType ? blockType.icon : copy;\n\t\t\t}\n\n\t\t\tconst _isSectionInSelection = clientIds.some( ( id ) =>\n\t\t\t\tisSectionBlock( id )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tcanRemove: canRemoveBlocks( clientIds ),\n\t\t\t\thasBlockStyles:\n\t\t\t\t\t_isSingleBlockSelected &&\n\t\t\t\t\t!! getBlockStyles( firstBlockName )?.length,\n\t\t\t\ticon: _icon,\n\t\t\t\tisReusable:\n\t\t\t\t\t_isSingleBlockSelected && isReusableBlock( _blocks[ 0 ] ),\n\t\t\t\tisTemplate:\n\t\t\t\t\t_isSingleBlockSelected && isTemplatePart( _blocks[ 0 ] ),\n\t\t\t\thasContentOnlyLocking: _hasTemplateLock,\n\t\t\t\tisDisabled: editingMode !== 'default',\n\t\t\t\tisSectionInSelection: _isSectionInSelection,\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId: clientIds?.[ 0 ],\n\t\tmaximumLength: 35,\n\t} );\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\n\tif ( invalidBlocks ) {\n\t\treturn null;\n\t}\n\n\tconst isSingleBlock = clientIds.length === 1;\n\tconst blockSwitcherLabel = isSingleBlock\n\t\t? blockTitle\n\t\t: __( 'Multiple blocks selected' );\n\n\tconst blockIndicatorText =\n\t\t( isReusable || isTemplate ) && ! showIconLabels && blockTitle\n\t\t\t? blockTitle\n\t\t\t: undefined;\n\n\tconst hideTransformsForSections =\n\t\twindow?.__experimentalContentOnlyPatternInsertion &&\n\t\tisSectionInSelection;\n\tconst hideDropdown =\n\t\thideTransformsForSections ||\n\t\tisDisabled ||\n\t\t( ! hasBlockStyles && ! canRemove ) ||\n\t\thasContentOnlyLocking;\n\n\tif ( hideDropdown ) {\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tdisabled\n\t\t\t\t\tclassName=\"block-editor-block-switcher__no-switcher-icon\"\n\t\t\t\t\ttitle={ blockSwitcherLabel }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\tclassName=\"block-editor-block-switcher__toggle\"\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tshowColors\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\ttext={ blockIndicatorText }\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t}\n\n\tconst blockSwitcherDescription = isSingleBlock\n\t\t? __( 'Change block type or style' )\n\t\t: sprintf(\n\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'Change type of %d block',\n\t\t\t\t\t'Change type of %d blocks',\n\t\t\t\t\tclientIds.length\n\t\t\t\t),\n\t\t\t\tclientIds.length\n\t\t );\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarItem>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\tclassName=\"block-editor-block-switcher\"\n\t\t\t\t\t\tlabel={ blockSwitcherLabel }\n\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\t\tclassName: 'block-editor-block-switcher__popover',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-switcher__toggle\"\n\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\tshowColors\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttext={ blockIndicatorText }\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tdescription: blockSwitcherDescription,\n\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmenuProps={ { orientation: 'both' } }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<BlockSwitcherDropdownMenuContents\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t\t\t\tcanRemove={ canRemove }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t</ToolbarGroup>\n\t);\n};\n\nexport default BlockSwitcher;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,yBAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,8BAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAH,sBAAA,CAAAR,OAAA;AACA,IAAAY,2BAAA,GAAAJ,sBAAA,CAAAR,OAAA;AACA,IAAAa,qBAAA,GAAAL,sBAAA,CAAAR,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAA2C,IAAAe,WAA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AAC,CACD,CAAC;AAEjB,CAAC;AAAC8H,OAAA,CAAAhE,aAAA,GAAAA,aAAA;AAAA,IAAAiE,QAAA,GAAAD,OAAA,CAAAxE,OAAA,GAEaQ,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _components = require("@wordpress/components");
|
|
9
|
+
var _i18n = require("@wordpress/i18n");
|
|
10
|
+
var _blockQuickNavigation = _interopRequireDefault(require("../block-quick-navigation"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const ContentTab = ({
|
|
21
|
+
contentClientIds
|
|
22
|
+
}) => {
|
|
23
|
+
if (!contentClientIds || contentClientIds.length === 0) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
|
|
27
|
+
title: (0, _i18n.__)('Content'),
|
|
28
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockQuickNavigation.default, {
|
|
29
|
+
clientIds: contentClientIds
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
var _default = exports.default = ContentTab;
|
|
34
|
+
//# sourceMappingURL=content-tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_blockQuickNavigation","_interopRequireDefault","_jsxRuntime","ContentTab","contentClientIds","length","jsx","PanelBody","title","__","children","default","clientIds","_default","exports"],"sources":["@wordpress/block-editor/src/components/inspector-controls-tabs/content-tab.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockQuickNavigation from '../block-quick-navigation';\n\nconst ContentTab = ( { contentClientIds } ) => {\n\tif ( ! contentClientIds || contentClientIds.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t<BlockQuickNavigation clientIds={ contentClientIds } />\n\t\t</PanelBody>\n\t);\n};\n\nexport default ContentTab;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA6D,IAAAI,WAAA,GAAAJ,OAAA;AAT7D;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAMK,UAAU,GAAGA,CAAE;EAAEC;AAAiB,CAAC,KAAM;EAC9C,IAAK,CAAEA,gBAAgB,IAAIA,gBAAgB,CAACC,MAAM,KAAK,CAAC,EAAG;IAC1D,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAH,WAAA,CAAAI,GAAA,EAACT,WAAA,CAAAU,SAAS;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;IAAAC,QAAA,eACnC,IAAAR,WAAA,CAAAI,GAAA,EAACN,qBAAA,CAAAW,OAAoB;MAACC,SAAS,EAAGR;IAAkB,CAAE;EAAC,CAC7C,CAAC;AAEd,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEaR,UAAU","ignoreList":[]}
|