@wordpress/editor 13.31.0 → 13.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +857 -0
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +107 -0
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
- package/build/components/commands/index.js +1 -1
- package/build/components/commands/index.js.map +1 -1
- package/build/components/deprecated.js +158 -0
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-bar/index.js +5 -8
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +2 -39
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +3 -0
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/entities-saved-states/index.js +11 -85
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/index.js +24 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +5 -1
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +2 -1
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/pattern-overrides-panel/index.js +30 -0
- package/build/components/pattern-overrides-panel/index.js.map +1 -0
- package/build/components/plugin-post-publish-panel/index.js +68 -0
- package/build/components/plugin-post-publish-panel/index.js.map +1 -0
- package/build/components/plugin-pre-publish-panel/index.js +71 -0
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -0
- package/build/components/post-actions/actions.js +455 -0
- package/build/components/post-actions/actions.js.map +1 -0
- package/build/components/post-card-panel/index.js +93 -0
- package/build/components/post-card-panel/index.js.map +1 -0
- package/build/components/post-title/index.native.js +1 -1
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +36 -20
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +8 -9
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/template-areas/index.js +70 -0
- package/build/components/template-areas/index.js.map +1 -0
- package/build/hooks/use-select-nearest-editable-block.js +87 -0
- package/build/hooks/use-select-nearest-editable-block.js.map +1 -0
- package/build/private-apis.js +6 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +46 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +3 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/private-actions.js +80 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +56 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +14 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +21 -11
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils/get-filtered-template-parts.js +71 -0
- package/build/store/utils/get-filtered-template-parts.js.map +1 -0
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +100 -0
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
- package/build-module/components/commands/index.js +1 -1
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/deprecated.js +159 -0
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-bar/index.js +6 -9
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +4 -41
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +3 -0
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +11 -85
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/index.js +3 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +5 -1
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +2 -1
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/pattern-overrides-panel/index.js +23 -0
- package/build-module/components/pattern-overrides-panel/index.js.map +1 -0
- package/build-module/components/plugin-post-publish-panel/index.js +61 -0
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -0
- package/build-module/components/plugin-pre-publish-panel/index.js +64 -0
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -0
- package/build-module/components/post-actions/actions.js +444 -0
- package/build-module/components/post-actions/actions.js.map +1 -0
- package/build-module/components/post-card-panel/index.js +85 -0
- package/build-module/components/post-card-panel/index.js.map +1 -0
- package/build-module/components/post-title/index.native.js +1 -1
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +36 -20
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +9 -10
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/template-areas/index.js +63 -0
- package/build-module/components/template-areas/index.js.map +1 -0
- package/build-module/hooks/use-select-nearest-editable-block.js +80 -0
- package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -0
- package/build-module/private-apis.js +6 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +37 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +2 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/private-actions.js +78 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +54 -3
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +13 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +19 -10
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils/get-filtered-template-parts.js +64 -0
- package/build-module/store/utils/get-filtered-template-parts.js.map +1 -0
- package/build-style/style-rtl.css +70 -27
- package/build-style/style.css +70 -27
- package/package.json +35 -35
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +108 -0
- package/src/components/commands/index.js +1 -1
- package/src/components/deprecated.js +157 -0
- package/src/components/document-bar/index.js +9 -15
- package/src/components/document-bar/style.scss +9 -12
- package/src/components/document-tools/style.scss +4 -11
- package/src/components/editor-canvas/edit-template-blocks-notification.js +6 -56
- package/src/components/editor-canvas/index.js +4 -0
- package/src/components/entities-saved-states/index.js +12 -113
- package/src/components/index.js +3 -0
- package/src/components/inserter-sidebar/index.js +7 -1
- package/src/components/list-view-sidebar/index.js +1 -0
- package/src/components/list-view-sidebar/style.scss +1 -1
- package/src/components/pattern-overrides-panel/index.js +26 -0
- package/src/components/plugin-post-publish-panel/index.js +64 -0
- package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +39 -0
- package/src/components/plugin-post-publish-panel/test/index.js +33 -0
- package/src/components/plugin-pre-publish-panel/index.js +67 -0
- package/src/components/plugin-pre-publish-panel/test/index.js +33 -0
- package/src/components/post-actions/actions.js +582 -0
- package/src/components/post-card-panel/index.js +108 -0
- package/src/components/post-card-panel/style.scss +32 -0
- package/src/components/post-featured-image/style.scss +3 -2
- package/src/components/post-title/index.native.js +1 -1
- package/src/components/provider/disable-non-page-content-blocks.js +40 -20
- package/src/components/provider/test/disable-non-page-content-blocks.js +35 -14
- package/src/components/provider/use-block-editor-settings.js +11 -11
- package/src/components/template-areas/index.js +85 -0
- package/src/components/template-areas/style.scss +23 -0
- package/src/hooks/use-select-nearest-editable-block.js +95 -0
- package/src/private-apis.js +6 -0
- package/src/store/actions.js +37 -3
- package/src/store/constants.js +2 -0
- package/src/store/private-actions.js +111 -0
- package/src/store/private-selectors.js +105 -17
- package/src/store/reducer.js +13 -0
- package/src/store/selectors.js +50 -40
- package/src/store/utils/get-filtered-template-parts.js +69 -0
- package/src/store/utils/test/get-filtered-template-parts.js +189 -0
- package/src/style.scss +2 -0
|
@@ -94,6 +94,9 @@ function deprecateFunction( name, func ) {
|
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated since 5.3, use `wp.blockEditor.RichText` instead.
|
|
99
|
+
*/
|
|
97
100
|
const RichText = deprecateComponent( 'RichText', RootRichText, [ 'Content' ] );
|
|
98
101
|
RichText.isEmpty = deprecateFunction(
|
|
99
102
|
'RichText.isEmpty',
|
|
@@ -101,167 +104,321 @@ RichText.isEmpty = deprecateFunction(
|
|
|
101
104
|
);
|
|
102
105
|
|
|
103
106
|
export { RichText };
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated since 5.3, use `wp.blockEditor.Autocomplete` instead.
|
|
110
|
+
*/
|
|
104
111
|
export const Autocomplete = deprecateComponent(
|
|
105
112
|
'Autocomplete',
|
|
106
113
|
RootAutocomplete
|
|
107
114
|
);
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated since 5.3, use `wp.blockEditor.AlignmentToolbar` instead.
|
|
117
|
+
*/
|
|
108
118
|
export const AlignmentToolbar = deprecateComponent(
|
|
109
119
|
'AlignmentToolbar',
|
|
110
120
|
RootAlignmentToolbar
|
|
111
121
|
);
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockAlignmentToolbar` instead.
|
|
124
|
+
*/
|
|
112
125
|
export const BlockAlignmentToolbar = deprecateComponent(
|
|
113
126
|
'BlockAlignmentToolbar',
|
|
114
127
|
RootBlockAlignmentToolbar
|
|
115
128
|
);
|
|
129
|
+
/**
|
|
130
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockControls` instead.
|
|
131
|
+
*/
|
|
116
132
|
export const BlockControls = deprecateComponent(
|
|
117
133
|
'BlockControls',
|
|
118
134
|
RootBlockControls,
|
|
119
135
|
[ 'Slot' ]
|
|
120
136
|
);
|
|
137
|
+
/**
|
|
138
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockEdit` instead.
|
|
139
|
+
*/
|
|
121
140
|
export const BlockEdit = deprecateComponent( 'BlockEdit', RootBlockEdit );
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockEditorKeyboardShortcuts` instead.
|
|
143
|
+
*/
|
|
122
144
|
export const BlockEditorKeyboardShortcuts = deprecateComponent(
|
|
123
145
|
'BlockEditorKeyboardShortcuts',
|
|
124
146
|
RootBlockEditorKeyboardShortcuts
|
|
125
147
|
);
|
|
148
|
+
/**
|
|
149
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockFormatControls` instead.
|
|
150
|
+
*/
|
|
126
151
|
export const BlockFormatControls = deprecateComponent(
|
|
127
152
|
'BlockFormatControls',
|
|
128
153
|
RootBlockFormatControls,
|
|
129
154
|
[ 'Slot' ]
|
|
130
155
|
);
|
|
156
|
+
/**
|
|
157
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockIcon` instead.
|
|
158
|
+
*/
|
|
131
159
|
export const BlockIcon = deprecateComponent( 'BlockIcon', RootBlockIcon );
|
|
160
|
+
/**
|
|
161
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockInspector` instead.
|
|
162
|
+
*/
|
|
132
163
|
export const BlockInspector = deprecateComponent(
|
|
133
164
|
'BlockInspector',
|
|
134
165
|
RootBlockInspector
|
|
135
166
|
);
|
|
167
|
+
/**
|
|
168
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockList` instead.
|
|
169
|
+
*/
|
|
136
170
|
export const BlockList = deprecateComponent( 'BlockList', RootBlockList );
|
|
171
|
+
/**
|
|
172
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockMover` instead.
|
|
173
|
+
*/
|
|
137
174
|
export const BlockMover = deprecateComponent( 'BlockMover', RootBlockMover );
|
|
175
|
+
/**
|
|
176
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockNavigationDropdown` instead.
|
|
177
|
+
*/
|
|
138
178
|
export const BlockNavigationDropdown = deprecateComponent(
|
|
139
179
|
'BlockNavigationDropdown',
|
|
140
180
|
RootBlockNavigationDropdown
|
|
141
181
|
);
|
|
182
|
+
/**
|
|
183
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockSelectionClearer` instead.
|
|
184
|
+
*/
|
|
142
185
|
export const BlockSelectionClearer = deprecateComponent(
|
|
143
186
|
'BlockSelectionClearer',
|
|
144
187
|
RootBlockSelectionClearer
|
|
145
188
|
);
|
|
189
|
+
/**
|
|
190
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockSettingsMenu` instead.
|
|
191
|
+
*/
|
|
146
192
|
export const BlockSettingsMenu = deprecateComponent(
|
|
147
193
|
'BlockSettingsMenu',
|
|
148
194
|
RootBlockSettingsMenu
|
|
149
195
|
);
|
|
196
|
+
/**
|
|
197
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockTitle` instead.
|
|
198
|
+
*/
|
|
150
199
|
export const BlockTitle = deprecateComponent( 'BlockTitle', RootBlockTitle );
|
|
200
|
+
/**
|
|
201
|
+
* @deprecated since 5.3, use `wp.blockEditor.BlockToolbar` instead.
|
|
202
|
+
*/
|
|
151
203
|
export const BlockToolbar = deprecateComponent(
|
|
152
204
|
'BlockToolbar',
|
|
153
205
|
RootBlockToolbar
|
|
154
206
|
);
|
|
207
|
+
/**
|
|
208
|
+
* @deprecated since 5.3, use `wp.blockEditor.ColorPalette` instead.
|
|
209
|
+
*/
|
|
155
210
|
export const ColorPalette = deprecateComponent(
|
|
156
211
|
'ColorPalette',
|
|
157
212
|
RootColorPalette
|
|
158
213
|
);
|
|
214
|
+
/**
|
|
215
|
+
* @deprecated since 5.3, use `wp.blockEditor.ContrastChecker` instead.
|
|
216
|
+
*/
|
|
159
217
|
export const ContrastChecker = deprecateComponent(
|
|
160
218
|
'ContrastChecker',
|
|
161
219
|
RootContrastChecker
|
|
162
220
|
);
|
|
221
|
+
/**
|
|
222
|
+
* @deprecated since 5.3, use `wp.blockEditor.CopyHandler` instead.
|
|
223
|
+
*/
|
|
163
224
|
export const CopyHandler = deprecateComponent( 'CopyHandler', RootCopyHandler );
|
|
225
|
+
/**
|
|
226
|
+
* @deprecated since 5.3, use `wp.blockEditor.DefaultBlockAppender` instead.
|
|
227
|
+
*/
|
|
164
228
|
export const DefaultBlockAppender = deprecateComponent(
|
|
165
229
|
'DefaultBlockAppender',
|
|
166
230
|
RootDefaultBlockAppender
|
|
167
231
|
);
|
|
232
|
+
/**
|
|
233
|
+
* @deprecated since 5.3, use `wp.blockEditor.FontSizePicker` instead.
|
|
234
|
+
*/
|
|
168
235
|
export const FontSizePicker = deprecateComponent(
|
|
169
236
|
'FontSizePicker',
|
|
170
237
|
RootFontSizePicker
|
|
171
238
|
);
|
|
239
|
+
/**
|
|
240
|
+
* @deprecated since 5.3, use `wp.blockEditor.Inserter` instead.
|
|
241
|
+
*/
|
|
172
242
|
export const Inserter = deprecateComponent( 'Inserter', RootInserter );
|
|
243
|
+
/**
|
|
244
|
+
* @deprecated since 5.3, use `wp.blockEditor.InnerBlocks` instead.
|
|
245
|
+
*/
|
|
173
246
|
export const InnerBlocks = deprecateComponent( 'InnerBlocks', RootInnerBlocks, [
|
|
174
247
|
'ButtonBlockAppender',
|
|
175
248
|
'DefaultBlockAppender',
|
|
176
249
|
'Content',
|
|
177
250
|
] );
|
|
251
|
+
/**
|
|
252
|
+
* @deprecated since 5.3, use `wp.blockEditor.InspectorAdvancedControls` instead.
|
|
253
|
+
*/
|
|
178
254
|
export const InspectorAdvancedControls = deprecateComponent(
|
|
179
255
|
'InspectorAdvancedControls',
|
|
180
256
|
RootInspectorAdvancedControls,
|
|
181
257
|
[ 'Slot' ]
|
|
182
258
|
);
|
|
259
|
+
/**
|
|
260
|
+
* @deprecated since 5.3, use `wp.blockEditor.InspectorControls` instead.
|
|
261
|
+
*/
|
|
183
262
|
export const InspectorControls = deprecateComponent(
|
|
184
263
|
'InspectorControls',
|
|
185
264
|
RootInspectorControls,
|
|
186
265
|
[ 'Slot' ]
|
|
187
266
|
);
|
|
267
|
+
/**
|
|
268
|
+
* @deprecated since 5.3, use `wp.blockEditor.PanelColorSettings` instead.
|
|
269
|
+
*/
|
|
188
270
|
export const PanelColorSettings = deprecateComponent(
|
|
189
271
|
'PanelColorSettings',
|
|
190
272
|
RootPanelColorSettings
|
|
191
273
|
);
|
|
274
|
+
/**
|
|
275
|
+
* @deprecated since 5.3, use `wp.blockEditor.PlainText` instead.
|
|
276
|
+
*/
|
|
192
277
|
export const PlainText = deprecateComponent( 'PlainText', RootPlainText );
|
|
278
|
+
/**
|
|
279
|
+
* @deprecated since 5.3, use `wp.blockEditor.RichTextShortcut` instead.
|
|
280
|
+
*/
|
|
193
281
|
export const RichTextShortcut = deprecateComponent(
|
|
194
282
|
'RichTextShortcut',
|
|
195
283
|
RootRichTextShortcut
|
|
196
284
|
);
|
|
285
|
+
/**
|
|
286
|
+
* @deprecated since 5.3, use `wp.blockEditor.RichTextToolbarButton` instead.
|
|
287
|
+
*/
|
|
197
288
|
export const RichTextToolbarButton = deprecateComponent(
|
|
198
289
|
'RichTextToolbarButton',
|
|
199
290
|
RootRichTextToolbarButton
|
|
200
291
|
);
|
|
292
|
+
/**
|
|
293
|
+
* @deprecated since 5.3, use `wp.blockEditor.__unstableRichTextInputEvent` instead.
|
|
294
|
+
*/
|
|
201
295
|
export const __unstableRichTextInputEvent = deprecateComponent(
|
|
202
296
|
'__unstableRichTextInputEvent',
|
|
203
297
|
__unstableRootRichTextInputEvent
|
|
204
298
|
);
|
|
299
|
+
/**
|
|
300
|
+
* @deprecated since 5.3, use `wp.blockEditor.MediaPlaceholder` instead.
|
|
301
|
+
*/
|
|
205
302
|
export const MediaPlaceholder = deprecateComponent(
|
|
206
303
|
'MediaPlaceholder',
|
|
207
304
|
RootMediaPlaceholder
|
|
208
305
|
);
|
|
306
|
+
/**
|
|
307
|
+
* @deprecated since 5.3, use `wp.blockEditor.MediaUpload` instead.
|
|
308
|
+
*/
|
|
209
309
|
export const MediaUpload = deprecateComponent( 'MediaUpload', RootMediaUpload );
|
|
310
|
+
/**
|
|
311
|
+
* @deprecated since 5.3, use `wp.blockEditor.MediaUploadCheck` instead.
|
|
312
|
+
*/
|
|
210
313
|
export const MediaUploadCheck = deprecateComponent(
|
|
211
314
|
'MediaUploadCheck',
|
|
212
315
|
RootMediaUploadCheck
|
|
213
316
|
);
|
|
317
|
+
/**
|
|
318
|
+
* @deprecated since 5.3, use `wp.blockEditor.MultiSelectScrollIntoView` instead.
|
|
319
|
+
*/
|
|
214
320
|
export const MultiSelectScrollIntoView = deprecateComponent(
|
|
215
321
|
'MultiSelectScrollIntoView',
|
|
216
322
|
RootMultiSelectScrollIntoView
|
|
217
323
|
);
|
|
324
|
+
/**
|
|
325
|
+
* @deprecated since 5.3, use `wp.blockEditor.NavigableToolbar` instead.
|
|
326
|
+
*/
|
|
218
327
|
export const NavigableToolbar = deprecateComponent(
|
|
219
328
|
'NavigableToolbar',
|
|
220
329
|
RootNavigableToolbar
|
|
221
330
|
);
|
|
331
|
+
/**
|
|
332
|
+
* @deprecated since 5.3, use `wp.blockEditor.ObserveTyping` instead.
|
|
333
|
+
*/
|
|
222
334
|
export const ObserveTyping = deprecateComponent(
|
|
223
335
|
'ObserveTyping',
|
|
224
336
|
RootObserveTyping
|
|
225
337
|
);
|
|
338
|
+
/**
|
|
339
|
+
* @deprecated since 5.3, use `wp.blockEditor.SkipToSelectedBlock` instead.
|
|
340
|
+
*/
|
|
226
341
|
export const SkipToSelectedBlock = deprecateComponent(
|
|
227
342
|
'SkipToSelectedBlock',
|
|
228
343
|
RootSkipToSelectedBlock
|
|
229
344
|
);
|
|
345
|
+
/**
|
|
346
|
+
* @deprecated since 5.3, use `wp.blockEditor.URLInput` instead.
|
|
347
|
+
*/
|
|
230
348
|
export const URLInput = deprecateComponent( 'URLInput', RootURLInput );
|
|
349
|
+
/**
|
|
350
|
+
* @deprecated since 5.3, use `wp.blockEditor.URLInputButton` instead.
|
|
351
|
+
*/
|
|
231
352
|
export const URLInputButton = deprecateComponent(
|
|
232
353
|
'URLInputButton',
|
|
233
354
|
RootURLInputButton
|
|
234
355
|
);
|
|
356
|
+
/**
|
|
357
|
+
* @deprecated since 5.3, use `wp.blockEditor.URLPopover` instead.
|
|
358
|
+
*/
|
|
235
359
|
export const URLPopover = deprecateComponent( 'URLPopover', RootURLPopover );
|
|
360
|
+
/**
|
|
361
|
+
* @deprecated since 5.3, use `wp.blockEditor.Warning` instead.
|
|
362
|
+
*/
|
|
236
363
|
export const Warning = deprecateComponent( 'Warning', RootWarning );
|
|
364
|
+
/**
|
|
365
|
+
* @deprecated since 5.3, use `wp.blockEditor.WritingFlow` instead.
|
|
366
|
+
*/
|
|
237
367
|
export const WritingFlow = deprecateComponent( 'WritingFlow', RootWritingFlow );
|
|
238
368
|
|
|
369
|
+
/**
|
|
370
|
+
* @deprecated since 5.3, use `wp.blockEditor.createCustomColorsHOC` instead.
|
|
371
|
+
*/
|
|
239
372
|
export const createCustomColorsHOC = deprecateFunction(
|
|
240
373
|
'createCustomColorsHOC',
|
|
241
374
|
rootCreateCustomColorsHOC
|
|
242
375
|
);
|
|
376
|
+
/**
|
|
377
|
+
* @deprecated since 5.3, use `wp.blockEditor.getColorClassName` instead.
|
|
378
|
+
*/
|
|
243
379
|
export const getColorClassName = deprecateFunction(
|
|
244
380
|
'getColorClassName',
|
|
245
381
|
rootGetColorClassName
|
|
246
382
|
);
|
|
383
|
+
/**
|
|
384
|
+
* @deprecated since 5.3, use `wp.blockEditor.getColorObjectByAttributeValues` instead.
|
|
385
|
+
*/
|
|
247
386
|
export const getColorObjectByAttributeValues = deprecateFunction(
|
|
248
387
|
'getColorObjectByAttributeValues',
|
|
249
388
|
rootGetColorObjectByAttributeValues
|
|
250
389
|
);
|
|
390
|
+
/**
|
|
391
|
+
* @deprecated since 5.3, use `wp.blockEditor.getColorObjectByColorValue` instead.
|
|
392
|
+
*/
|
|
251
393
|
export const getColorObjectByColorValue = deprecateFunction(
|
|
252
394
|
'getColorObjectByColorValue',
|
|
253
395
|
rootGetColorObjectByColorValue
|
|
254
396
|
);
|
|
397
|
+
/**
|
|
398
|
+
* @deprecated since 5.3, use `wp.blockEditor.getFontSize` instead.
|
|
399
|
+
*/
|
|
255
400
|
export const getFontSize = deprecateFunction( 'getFontSize', rootGetFontSize );
|
|
401
|
+
/**
|
|
402
|
+
* @deprecated since 5.3, use `wp.blockEditor.getFontSizeClass` instead.
|
|
403
|
+
*/
|
|
256
404
|
export const getFontSizeClass = deprecateFunction(
|
|
257
405
|
'getFontSizeClass',
|
|
258
406
|
rootGetFontSizeClass
|
|
259
407
|
);
|
|
408
|
+
/**
|
|
409
|
+
* @deprecated since 5.3, use `wp.blockEditor.createCustomColorsHOC` instead.
|
|
410
|
+
*/
|
|
260
411
|
export const withColorContext = deprecateFunction(
|
|
261
412
|
'withColorContext',
|
|
262
413
|
rootWithColorContext
|
|
263
414
|
);
|
|
415
|
+
/**
|
|
416
|
+
* @deprecated since 5.3, use `wp.blockEditor.withColors` instead.
|
|
417
|
+
*/
|
|
264
418
|
export const withColors = deprecateFunction( 'withColors', rootWithColors );
|
|
419
|
+
/**
|
|
420
|
+
* @deprecated since 5.3, use `wp.blockEditor.withFontSizes` instead.
|
|
421
|
+
*/
|
|
265
422
|
export const withFontSizes = deprecateFunction(
|
|
266
423
|
'withFontSizes',
|
|
267
424
|
rootWithFontSizes
|
|
@@ -15,13 +15,7 @@ import {
|
|
|
15
15
|
__unstableAnimatePresence as AnimatePresence,
|
|
16
16
|
} from '@wordpress/components';
|
|
17
17
|
import { BlockIcon } from '@wordpress/block-editor';
|
|
18
|
-
import {
|
|
19
|
-
chevronLeftSmall,
|
|
20
|
-
chevronRightSmall,
|
|
21
|
-
page as pageIcon,
|
|
22
|
-
navigation as navigationIcon,
|
|
23
|
-
symbol,
|
|
24
|
-
} from '@wordpress/icons';
|
|
18
|
+
import { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';
|
|
25
19
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
26
20
|
import { store as coreStore } from '@wordpress/core-data';
|
|
27
21
|
import { store as commandsStore } from '@wordpress/commands';
|
|
@@ -32,6 +26,7 @@ import { useReducedMotion } from '@wordpress/compose';
|
|
|
32
26
|
* Internal dependencies
|
|
33
27
|
*/
|
|
34
28
|
import { store as editorStore } from '../../store';
|
|
29
|
+
import { unlock } from '../../lock-unlock';
|
|
35
30
|
|
|
36
31
|
const TYPE_LABELS = {
|
|
37
32
|
// translators: 1: Pattern title.
|
|
@@ -44,11 +39,6 @@ const TYPE_LABELS = {
|
|
|
44
39
|
wp_template_part: __( 'Editing template part: %s' ),
|
|
45
40
|
};
|
|
46
41
|
|
|
47
|
-
const ICONS = {
|
|
48
|
-
wp_block: symbol,
|
|
49
|
-
wp_navigation: navigationIcon,
|
|
50
|
-
};
|
|
51
|
-
|
|
52
42
|
const TEMPLATE_POST_TYPES = [ 'wp_template', 'wp_template_part' ];
|
|
53
43
|
|
|
54
44
|
const GLOBAL_POST_TYPES = [
|
|
@@ -93,7 +83,12 @@ export default function DocumentBar() {
|
|
|
93
83
|
_postType,
|
|
94
84
|
_postId
|
|
95
85
|
),
|
|
96
|
-
templateIcon:
|
|
86
|
+
templateIcon: unlock( select( editorStore ) ).getPostIcon(
|
|
87
|
+
_postType,
|
|
88
|
+
{
|
|
89
|
+
area: _document?.area,
|
|
90
|
+
}
|
|
91
|
+
),
|
|
97
92
|
templateTitle: _templateInfo.title,
|
|
98
93
|
onNavigateToPreviousEntityRecord:
|
|
99
94
|
getEditorSettings().onNavigateToPreviousEntityRecord,
|
|
@@ -104,7 +99,6 @@ export default function DocumentBar() {
|
|
|
104
99
|
const isReducedMotion = useReducedMotion();
|
|
105
100
|
|
|
106
101
|
const isNotFound = ! document && ! isResolving;
|
|
107
|
-
const icon = ICONS[ postType ] ?? pageIcon;
|
|
108
102
|
const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
|
|
109
103
|
const isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );
|
|
110
104
|
const hasBackButton = !! onNavigateToPreviousEntityRecord;
|
|
@@ -177,7 +171,7 @@ export default function DocumentBar() {
|
|
|
177
171
|
isReducedMotion ? { duration: 0 } : undefined
|
|
178
172
|
}
|
|
179
173
|
>
|
|
180
|
-
<BlockIcon icon={
|
|
174
|
+
<BlockIcon icon={ templateIcon } />
|
|
181
175
|
<Text
|
|
182
176
|
size="body"
|
|
183
177
|
as="h1"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
min-width: 0;
|
|
11
11
|
background: $gray-100;
|
|
12
12
|
border-radius: $grid-unit-05;
|
|
13
|
-
width: min(100%,
|
|
13
|
+
width: min(100%, 416px);
|
|
14
14
|
|
|
15
15
|
&:hover {
|
|
16
16
|
background-color: $gray-200;
|
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
.components-button {
|
|
20
20
|
border-radius: $grid-unit-05;
|
|
21
|
+
transition: all 0.1s ease-out;
|
|
22
|
+
@include reduce-motion("transition");
|
|
21
23
|
|
|
22
24
|
&:hover {
|
|
23
|
-
color: var(--wp-block-synced-color);
|
|
24
25
|
background: $gray-200;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -39,19 +40,15 @@
|
|
|
39
40
|
.editor-document-bar__title {
|
|
40
41
|
flex-grow: 1;
|
|
41
42
|
overflow: hidden;
|
|
42
|
-
color: $gray-
|
|
43
|
+
color: $gray-900;
|
|
43
44
|
gap: $grid-unit-05;
|
|
44
45
|
display: flex;
|
|
45
46
|
justify-content: center;
|
|
46
47
|
align-items: center;
|
|
47
48
|
|
|
48
49
|
// Offset the layout based on the width of the ⌘K label. This ensures the title is centrally aligned.
|
|
49
|
-
@include break-
|
|
50
|
-
padding-left: $grid-unit-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&:hover {
|
|
54
|
-
color: var(--wp-block-synced-color);
|
|
50
|
+
@include break-medium() {
|
|
51
|
+
padding-left: $grid-unit-30;
|
|
55
52
|
}
|
|
56
53
|
|
|
57
54
|
.editor-document-bar.is-global & {
|
|
@@ -67,14 +64,14 @@
|
|
|
67
64
|
white-space: nowrap;
|
|
68
65
|
overflow: hidden;
|
|
69
66
|
text-overflow: ellipsis;
|
|
70
|
-
max-width:
|
|
67
|
+
max-width: 70%;
|
|
71
68
|
color: currentColor;
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
.editor-document-bar__shortcut {
|
|
76
73
|
color: $gray-800;
|
|
77
|
-
min-width: $grid-unit-
|
|
74
|
+
min-width: $grid-unit-30;
|
|
78
75
|
display: none;
|
|
79
76
|
|
|
80
77
|
@include break-medium() {
|
|
@@ -91,7 +88,7 @@
|
|
|
91
88
|
position: absolute;
|
|
92
89
|
|
|
93
90
|
&:hover {
|
|
94
|
-
color:
|
|
91
|
+
color: $gray-900;
|
|
95
92
|
background-color: transparent;
|
|
96
93
|
}
|
|
97
94
|
}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
align-items: center;
|
|
4
4
|
|
|
5
5
|
// Hide all action buttons except the inserter on mobile.
|
|
6
|
-
.editor-document-tools__left > .
|
|
6
|
+
.editor-document-tools__left > .editor-history__redo,
|
|
7
|
+
.editor-document-tools__left > .editor-history__undo {
|
|
7
8
|
display: none;
|
|
8
9
|
|
|
9
|
-
@include break-
|
|
10
|
+
@include break-medium() {
|
|
10
11
|
display: inline-flex;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
// here to the original button styles
|
|
40
41
|
.editor-document-tools__left > .components-button.has-icon,
|
|
41
42
|
.editor-document-tools__left > .components-dropdown > .components-button.has-icon {
|
|
42
|
-
// @todo
|
|
43
|
+
// @todo override toolbar group inherited paddings from components/block-tools/style.scss.
|
|
43
44
|
// This is best fixed by making the mover control area a proper single toolbar group.
|
|
44
45
|
// It needs specificity due to style inherited from .components-accessible-toolbar .components-button.has-icon.has-icon.
|
|
45
46
|
height: $button-size-compact;
|
|
@@ -70,14 +71,6 @@
|
|
|
70
71
|
// Some plugins add buttons here despite best practices.
|
|
71
72
|
// Push them a bit rightwards to fit the top toolbar.
|
|
72
73
|
margin-right: $grid-unit-10;
|
|
73
|
-
|
|
74
|
-
@include break-medium() {
|
|
75
|
-
padding-left: $grid-unit-50 * 0.5;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@include break-wide() {
|
|
79
|
-
padding-right: $grid-unit-10;
|
|
80
|
-
}
|
|
81
74
|
}
|
|
82
75
|
|
|
83
76
|
.editor-document-tools .editor-document-tools__left > .editor-document-tools__inserter-toggle.has-icon {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect
|
|
5
|
-
import { useEffect, useState
|
|
6
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { useEffect, useState } from '@wordpress/element';
|
|
7
6
|
import { __ } from '@wordpress/i18n';
|
|
8
7
|
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
9
8
|
|
|
@@ -38,73 +37,22 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
|
|
|
38
37
|
};
|
|
39
38
|
}, [] );
|
|
40
39
|
|
|
41
|
-
const { getNotices } = useSelect( noticesStore );
|
|
42
|
-
|
|
43
|
-
const { createInfoNotice, removeNotice } = useDispatch( noticesStore );
|
|
44
|
-
|
|
45
40
|
const [ isDialogOpen, setIsDialogOpen ] = useState( false );
|
|
46
41
|
|
|
47
|
-
const lastNoticeId = useRef( 0 );
|
|
48
|
-
|
|
49
42
|
useEffect( () => {
|
|
50
|
-
const handleClick = async ( event ) => {
|
|
51
|
-
if ( ! event.target.classList.contains( 'is-root-container' ) ) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const isNoticeAlreadyShowing = getNotices().some(
|
|
56
|
-
( notice ) => notice.id === lastNoticeId.current
|
|
57
|
-
);
|
|
58
|
-
if ( isNoticeAlreadyShowing ) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const { notice } = await createInfoNotice(
|
|
63
|
-
__( 'Edit your template to edit this block.' ),
|
|
64
|
-
{
|
|
65
|
-
isDismissible: true,
|
|
66
|
-
type: 'snackbar',
|
|
67
|
-
actions: [
|
|
68
|
-
{
|
|
69
|
-
label: __( 'Edit template' ),
|
|
70
|
-
onClick: () =>
|
|
71
|
-
onNavigateToEntityRecord( {
|
|
72
|
-
postId: templateId,
|
|
73
|
-
postType: 'wp_template',
|
|
74
|
-
} ),
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
lastNoticeId.current = notice.id;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
43
|
const handleDblClick = ( event ) => {
|
|
83
44
|
if ( ! event.target.classList.contains( 'is-root-container' ) ) {
|
|
84
45
|
return;
|
|
85
46
|
}
|
|
86
|
-
if ( lastNoticeId.current ) {
|
|
87
|
-
removeNotice( lastNoticeId.current );
|
|
88
|
-
}
|
|
89
47
|
setIsDialogOpen( true );
|
|
90
48
|
};
|
|
91
49
|
|
|
92
50
|
const canvas = contentRef.current;
|
|
93
|
-
canvas?.addEventListener( 'click', handleClick );
|
|
94
51
|
canvas?.addEventListener( 'dblclick', handleDblClick );
|
|
95
52
|
return () => {
|
|
96
|
-
canvas?.removeEventListener( 'click', handleClick );
|
|
97
53
|
canvas?.removeEventListener( 'dblclick', handleDblClick );
|
|
98
54
|
};
|
|
99
|
-
}, [
|
|
100
|
-
lastNoticeId,
|
|
101
|
-
contentRef,
|
|
102
|
-
getNotices,
|
|
103
|
-
createInfoNotice,
|
|
104
|
-
onNavigateToEntityRecord,
|
|
105
|
-
templateId,
|
|
106
|
-
removeNotice,
|
|
107
|
-
] );
|
|
55
|
+
}, [ contentRef ] );
|
|
108
56
|
|
|
109
57
|
return (
|
|
110
58
|
<ConfirmDialog
|
|
@@ -119,7 +67,9 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
|
|
|
119
67
|
} }
|
|
120
68
|
onCancel={ () => setIsDialogOpen( false ) }
|
|
121
69
|
>
|
|
122
|
-
{ __(
|
|
70
|
+
{ __(
|
|
71
|
+
'You’ve tried to select a block that is part of a template, which may be used on other posts and pages.'
|
|
72
|
+
) }
|
|
123
73
|
</ConfirmDialog>
|
|
124
74
|
);
|
|
125
75
|
}
|
|
@@ -29,6 +29,7 @@ import PostTitle from '../post-title';
|
|
|
29
29
|
import { store as editorStore } from '../../store';
|
|
30
30
|
import { unlock } from '../../lock-unlock';
|
|
31
31
|
import EditTemplateBlocksNotification from './edit-template-blocks-notification';
|
|
32
|
+
import useSelectNearestEditableBlock from '../../hooks/use-select-nearest-editable-block';
|
|
32
33
|
|
|
33
34
|
const {
|
|
34
35
|
LayoutStyle,
|
|
@@ -313,6 +314,9 @@ function EditorCanvas( {
|
|
|
313
314
|
useFlashEditableBlocks( {
|
|
314
315
|
isEnabled: renderingMode === 'template-locked',
|
|
315
316
|
} ),
|
|
317
|
+
useSelectNearestEditableBlock( {
|
|
318
|
+
isEnabled: renderingMode === 'template-locked',
|
|
319
|
+
} ),
|
|
316
320
|
] );
|
|
317
321
|
|
|
318
322
|
return (
|