@wordpress/edit-post 6.0.0 → 6.0.2
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/build/components/header/fullscreen-mode-close/index.js +11 -4
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/index.js +3 -1
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/template-title/delete-template.js +29 -20
- package/build/components/header/template-title/delete-template.js.map +1 -1
- package/build/components/preferences-modal/index.js +4 -41
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +0 -11
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/store/actions.js +135 -87
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +0 -3
- package/build/store/index.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +8 -4
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/index.js +3 -1
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/template-title/delete-template.js +32 -22
- package/build-module/components/header/template-title/delete-template.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +5 -42
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -12
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/store/actions.js +107 -75
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +0 -2
- package/build-module/store/index.js.map +1 -1
- package/build-style/style-rtl.css +14 -9
- package/build-style/style.css +14 -9
- package/package.json +17 -17
- package/src/components/header/fullscreen-mode-close/index.js +9 -4
- package/src/components/header/fullscreen-mode-close/style.scss +5 -1
- package/src/components/header/index.js +1 -1
- package/src/components/header/template-title/delete-template.js +57 -46
- package/src/components/preferences-modal/index.js +5 -33
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +9 -9
- package/src/components/secondary-sidebar/list-view-sidebar.js +1 -11
- package/src/store/actions.js +85 -121
- package/src/store/index.js +0 -2
- package/src/store/test/actions.js +107 -97
|
@@ -7,10 +7,9 @@ import { castArray, reduce } from 'lodash';
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import
|
|
11
|
-
import { store as interfaceStore } from '@wordpress/interface';
|
|
12
|
-
import { controls, select, subscribe, dispatch } from '@wordpress/data';
|
|
10
|
+
import apiFetch from '@wordpress/api-fetch';
|
|
13
11
|
import { speak } from '@wordpress/a11y';
|
|
12
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
14
13
|
import { store as noticesStore } from '@wordpress/notices';
|
|
15
14
|
import { store as coreStore } from '@wordpress/core-data';
|
|
16
15
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
@@ -25,22 +24,24 @@ import { store as editPostStore } from '.';
|
|
|
25
24
|
* Returns an action object used in signalling that the user opened an editor sidebar.
|
|
26
25
|
*
|
|
27
26
|
* @param {?string} name Sidebar name to be opened.
|
|
28
|
-
*
|
|
29
|
-
* @yield {Object} Action object.
|
|
30
27
|
*/
|
|
31
28
|
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
export const openGeneralSidebar = name => _ref => {
|
|
30
|
+
let {
|
|
31
|
+
registry
|
|
32
|
+
} = _ref;
|
|
33
|
+
return registry.dispatch(interfaceStore).enableComplementaryArea(editPostStore.name, name);
|
|
34
|
+
};
|
|
35
35
|
/**
|
|
36
36
|
* Returns an action object signalling that the user closed the sidebar.
|
|
37
|
-
*
|
|
38
|
-
* @yield {Object} Action object.
|
|
39
37
|
*/
|
|
40
38
|
|
|
41
|
-
export
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
export const closeGeneralSidebar = () => _ref2 => {
|
|
40
|
+
let {
|
|
41
|
+
registry
|
|
42
|
+
} = _ref2;
|
|
43
|
+
return registry.dispatch(interfaceStore).disableComplementaryArea(editPostStore.name);
|
|
44
|
+
};
|
|
44
45
|
/**
|
|
45
46
|
* Returns an action object used in signalling that the user opened a modal.
|
|
46
47
|
*
|
|
@@ -149,32 +150,42 @@ export function removeEditorPanel(panelName) {
|
|
|
149
150
|
* @param {string} feature Feature name.
|
|
150
151
|
*/
|
|
151
152
|
|
|
152
|
-
export
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
export const toggleFeature = feature => _ref3 => {
|
|
154
|
+
let {
|
|
155
|
+
registry
|
|
156
|
+
} = _ref3;
|
|
157
|
+
return registry.dispatch(interfaceStore).toggleFeature('core/edit-post', feature);
|
|
158
|
+
};
|
|
159
|
+
export const switchEditorMode = mode => _ref4 => {
|
|
160
|
+
let {
|
|
161
|
+
dispatch,
|
|
162
|
+
registry
|
|
163
|
+
} = _ref4;
|
|
164
|
+
dispatch({
|
|
157
165
|
type: 'SWITCH_MODE',
|
|
158
166
|
mode
|
|
159
|
-
}; // Unselect blocks when we switch to the code editor.
|
|
167
|
+
}); // Unselect blocks when we switch to the code editor.
|
|
160
168
|
|
|
161
169
|
if (mode !== 'visual') {
|
|
162
|
-
|
|
170
|
+
registry.dispatch(blockEditorStore).clearSelectedBlock();
|
|
163
171
|
}
|
|
164
172
|
|
|
165
173
|
const message = mode === 'visual' ? __('Visual editor selected') : __('Code editor selected');
|
|
166
174
|
speak(message, 'assertive');
|
|
167
|
-
}
|
|
175
|
+
};
|
|
168
176
|
/**
|
|
169
177
|
* Triggers an action object used to toggle a plugin name flag.
|
|
170
178
|
*
|
|
171
179
|
* @param {string} pluginName Plugin name.
|
|
172
180
|
*/
|
|
173
181
|
|
|
174
|
-
export
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
182
|
+
export const togglePinnedPluginItem = pluginName => _ref5 => {
|
|
183
|
+
let {
|
|
184
|
+
registry
|
|
185
|
+
} = _ref5;
|
|
186
|
+
const isPinned = registry.select(interfaceStore).isItemPinned('core/edit-post', pluginName);
|
|
187
|
+
registry.dispatch(interfaceStore)[isPinned ? 'unpinItem' : 'pinItem']('core/edit-post', pluginName);
|
|
188
|
+
};
|
|
178
189
|
/**
|
|
179
190
|
* Returns an action object used in signalling that block types by the given
|
|
180
191
|
* name(s) should be hidden.
|
|
@@ -240,26 +251,30 @@ export function showBlockTypes(blockNames) {
|
|
|
240
251
|
* what Meta boxes are available in which location.
|
|
241
252
|
*
|
|
242
253
|
* @param {Object} metaBoxesPerLocation Meta boxes per location.
|
|
243
|
-
*
|
|
244
|
-
* @yield {Object} Action object.
|
|
245
254
|
*/
|
|
246
255
|
|
|
247
|
-
export
|
|
248
|
-
|
|
256
|
+
export const setAvailableMetaBoxesPerLocation = metaBoxesPerLocation => _ref6 => {
|
|
257
|
+
let {
|
|
258
|
+
dispatch
|
|
259
|
+
} = _ref6;
|
|
260
|
+
return dispatch({
|
|
249
261
|
type: 'SET_META_BOXES_PER_LOCATIONS',
|
|
250
262
|
metaBoxesPerLocation
|
|
251
|
-
};
|
|
252
|
-
}
|
|
263
|
+
});
|
|
264
|
+
};
|
|
253
265
|
/**
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
* @yield {Object} Action object.
|
|
266
|
+
* Update a metabox.
|
|
257
267
|
*/
|
|
258
268
|
|
|
259
|
-
export
|
|
260
|
-
|
|
269
|
+
export const requestMetaBoxUpdates = () => async _ref7 => {
|
|
270
|
+
let {
|
|
271
|
+
registry,
|
|
272
|
+
select,
|
|
273
|
+
dispatch
|
|
274
|
+
} = _ref7;
|
|
275
|
+
dispatch({
|
|
261
276
|
type: 'REQUEST_META_BOX_UPDATES'
|
|
262
|
-
}; // Saves the wp_editor fields
|
|
277
|
+
}); // Saves the wp_editor fields
|
|
263
278
|
|
|
264
279
|
if (window.tinyMCE) {
|
|
265
280
|
window.tinyMCE.triggerSave();
|
|
@@ -267,11 +282,11 @@ export function* requestMetaBoxUpdates() {
|
|
|
267
282
|
// If we do not provide this data, the post will be overridden with the default values.
|
|
268
283
|
|
|
269
284
|
|
|
270
|
-
const post =
|
|
285
|
+
const post = registry.select(editorStore).getCurrentPost();
|
|
271
286
|
const additionalData = [post.comment_status ? ['comment_status', post.comment_status] : false, post.ping_status ? ['ping_status', post.ping_status] : false, post.sticky ? ['sticky', post.sticky] : false, post.author ? ['post_author', post.author] : false].filter(Boolean); // We gather all the metaboxes locations data and the base form data
|
|
272
287
|
|
|
273
288
|
const baseFormData = new window.FormData(document.querySelector('.metabox-base-form'));
|
|
274
|
-
const activeMetaBoxLocations =
|
|
289
|
+
const activeMetaBoxLocations = select.getActiveMetaBoxLocations();
|
|
275
290
|
const formDataToMerge = [baseFormData, ...activeMetaBoxLocations.map(location => new window.FormData(getMetaBoxContainer(location)))]; // Merge all form data objects into a single one.
|
|
276
291
|
|
|
277
292
|
const formData = reduce(formDataToMerge, (memo, currentFormData) => {
|
|
@@ -281,24 +296,24 @@ export function* requestMetaBoxUpdates() {
|
|
|
281
296
|
|
|
282
297
|
return memo;
|
|
283
298
|
}, new window.FormData());
|
|
284
|
-
additionalData.forEach(
|
|
285
|
-
let [key, value] =
|
|
299
|
+
additionalData.forEach(_ref8 => {
|
|
300
|
+
let [key, value] = _ref8;
|
|
286
301
|
return formData.append(key, value);
|
|
287
302
|
});
|
|
288
303
|
|
|
289
304
|
try {
|
|
290
305
|
// Save the metaboxes
|
|
291
|
-
|
|
306
|
+
await apiFetch({
|
|
292
307
|
url: window._wpMetaBoxUrl,
|
|
293
308
|
method: 'POST',
|
|
294
309
|
body: formData,
|
|
295
310
|
parse: false
|
|
296
311
|
});
|
|
297
|
-
|
|
312
|
+
dispatch.metaBoxUpdatesSuccess();
|
|
298
313
|
} catch {
|
|
299
|
-
|
|
314
|
+
dispatch.metaBoxUpdatesFailure();
|
|
300
315
|
}
|
|
301
|
-
}
|
|
316
|
+
};
|
|
302
317
|
/**
|
|
303
318
|
* Returns an action object used to signal a successful meta box update.
|
|
304
319
|
*
|
|
@@ -386,61 +401,78 @@ export function setIsEditingTemplate(value) {
|
|
|
386
401
|
* @param {boolean} newTemplate Is new template.
|
|
387
402
|
*/
|
|
388
403
|
|
|
389
|
-
export function
|
|
404
|
+
export const __unstableSwitchToTemplateMode = function () {
|
|
390
405
|
let newTemplate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
406
|
+
return _ref9 => {
|
|
407
|
+
let {
|
|
408
|
+
registry,
|
|
409
|
+
select,
|
|
410
|
+
dispatch
|
|
411
|
+
} = _ref9;
|
|
412
|
+
dispatch(setIsEditingTemplate(true));
|
|
413
|
+
const isWelcomeGuideActive = select.isFeatureActive('welcomeGuideTemplate');
|
|
414
|
+
|
|
415
|
+
if (!isWelcomeGuideActive) {
|
|
416
|
+
const message = newTemplate ? __("Custom template created. You're in template mode now.") : __('Editing template. Changes made here affect all posts and pages that use the template.');
|
|
417
|
+
registry.dispatch(noticesStore).createSuccessNotice(message, {
|
|
418
|
+
type: 'snackbar'
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
};
|
|
401
423
|
/**
|
|
402
424
|
* Create a block based template.
|
|
403
425
|
*
|
|
404
426
|
* @param {Object?} template Template to create and assign.
|
|
405
427
|
*/
|
|
406
428
|
|
|
407
|
-
export
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
429
|
+
export const __unstableCreateTemplate = template => async _ref10 => {
|
|
430
|
+
let {
|
|
431
|
+
registry
|
|
432
|
+
} = _ref10;
|
|
433
|
+
const savedTemplate = await registry.dispatch(coreStore).saveEntityRecord('postType', 'wp_template', template);
|
|
434
|
+
const post = registry.select(editorStore).getCurrentPost();
|
|
435
|
+
registry.dispatch(coreStore).editEntityRecord('postType', post.type, post.id, {
|
|
411
436
|
template: savedTemplate.slug
|
|
412
437
|
});
|
|
413
|
-
}
|
|
438
|
+
};
|
|
414
439
|
let metaBoxesInitialized = false;
|
|
415
440
|
/**
|
|
416
441
|
* Initializes WordPress `postboxes` script and the logic for saving meta boxes.
|
|
417
442
|
*/
|
|
418
443
|
|
|
419
|
-
export
|
|
420
|
-
|
|
444
|
+
export const initializeMetaBoxes = () => _ref11 => {
|
|
445
|
+
let {
|
|
446
|
+
registry,
|
|
447
|
+
select,
|
|
448
|
+
dispatch
|
|
449
|
+
} = _ref11;
|
|
450
|
+
|
|
451
|
+
const isEditorReady = registry.select(editorStore).__unstableIsEditorReady();
|
|
421
452
|
|
|
422
453
|
if (!isEditorReady) {
|
|
423
454
|
return;
|
|
424
|
-
}
|
|
455
|
+
} // Only initialize once.
|
|
425
456
|
|
|
426
|
-
const postType = yield controls.select(editorStore, 'getCurrentPostType'); // Only initialize once.
|
|
427
457
|
|
|
428
458
|
if (metaBoxesInitialized) {
|
|
429
459
|
return;
|
|
430
460
|
}
|
|
431
461
|
|
|
462
|
+
const postType = registry.select(editorStore).getCurrentPostType();
|
|
463
|
+
|
|
432
464
|
if (window.postboxes.page !== postType) {
|
|
433
465
|
window.postboxes.add_postbox_toggles(postType);
|
|
434
466
|
}
|
|
435
467
|
|
|
436
468
|
metaBoxesInitialized = true;
|
|
437
|
-
let wasSavingPost =
|
|
438
|
-
let wasAutosavingPost =
|
|
439
|
-
const hasMetaBoxes =
|
|
469
|
+
let wasSavingPost = registry.select(editorStore).isSavingPost();
|
|
470
|
+
let wasAutosavingPost = registry.select(editorStore).isAutosavingPost();
|
|
471
|
+
const hasMetaBoxes = select.hasMetaBoxes(); // Save metaboxes when performing a full save on the post.
|
|
440
472
|
|
|
441
|
-
subscribe(() => {
|
|
442
|
-
const isSavingPost = select(editorStore).isSavingPost();
|
|
443
|
-
const isAutosavingPost = select(editorStore).isAutosavingPost(); // Save metaboxes on save completion, except for autosaves that are not a post preview.
|
|
473
|
+
registry.subscribe(async () => {
|
|
474
|
+
const isSavingPost = registry.select(editorStore).isSavingPost();
|
|
475
|
+
const isAutosavingPost = registry.select(editorStore).isAutosavingPost(); // Save metaboxes on save completion, except for autosaves that are not a post preview.
|
|
444
476
|
//
|
|
445
477
|
// Meta boxes are initialized once at page load. It is not necessary to
|
|
446
478
|
// account for updates on each state change.
|
|
@@ -453,11 +485,11 @@ export function* initializeMetaBoxes() {
|
|
|
453
485
|
wasAutosavingPost = isAutosavingPost;
|
|
454
486
|
|
|
455
487
|
if (shouldTriggerMetaboxesSave) {
|
|
456
|
-
dispatch
|
|
488
|
+
await dispatch.requestMetaBoxUpdates();
|
|
457
489
|
}
|
|
458
490
|
});
|
|
459
|
-
|
|
491
|
+
dispatch({
|
|
460
492
|
type: 'META_BOXES_INITIALIZED'
|
|
461
|
-
};
|
|
462
|
-
}
|
|
493
|
+
});
|
|
494
|
+
};
|
|
463
495
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/store/actions.js"],"names":["castArray","reduce","__","apiFetch","store","interfaceStore","controls","select","subscribe","dispatch","speak","noticesStore","coreStore","blockEditorStore","editorStore","getMetaBoxContainer","editPostStore","openGeneralSidebar","name","closeGeneralSidebar","openModal","type","closeModal","openPublishSidebar","closePublishSidebar","togglePublishSidebar","toggleEditorPanelEnabled","panelName","toggleEditorPanelOpened","removeEditorPanel","toggleFeature","feature","switchEditorMode","mode","message","togglePinnedPluginItem","pluginName","isPinned","hideBlockTypes","blockNames","updatePreferredStyleVariations","blockName","blockStyle","__experimentalUpdateLocalAutosaveInterval","interval","showBlockTypes","setAvailableMetaBoxesPerLocation","metaBoxesPerLocation","requestMetaBoxUpdates","window","tinyMCE","triggerSave","post","additionalData","comment_status","ping_status","sticky","author","filter","Boolean","baseFormData","FormData","document","querySelector","activeMetaBoxLocations","formDataToMerge","map","location","formData","memo","currentFormData","key","value","append","forEach","url","_wpMetaBoxUrl","method","body","parse","metaBoxUpdatesSuccess","metaBoxUpdatesFailure","__experimentalSetPreviewDeviceType","deviceType","setIsInserterOpened","setIsListViewOpened","isOpen","setIsEditingTemplate","__unstableSwitchToTemplateMode","newTemplate","isWelcomeGuideActive","__unstableCreateTemplate","template","savedTemplate","id","slug","metaBoxesInitialized","initializeMetaBoxes","isEditorReady","postType","postboxes","page","add_postbox_toggles","wasSavingPost","wasAutosavingPost","hasMetaBoxes","isSavingPost","isAutosavingPost","shouldTriggerMetaboxesSave"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,MAApB,QAAkC,QAAlC;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,0BAAzB;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASC,QAAT,EAAmBC,MAAnB,EAA2BC,SAA3B,EAAsCC,QAAtC,QAAsD,iBAAtD;AACA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASN,KAAK,IAAIO,YAAlB,QAAsC,oBAAtC;AACA,SAASP,KAAK,IAAIQ,SAAlB,QAAmC,sBAAnC;AACA,SAASR,KAAK,IAAIS,gBAAlB,QAA0C,yBAA1C;AACA,SAAST,KAAK,IAAIU,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,qBAApC;AACA,SAASX,KAAK,IAAIY,aAAlB,QAAuC,GAAvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,UAAUC,kBAAV,CAA8BC,IAA9B,EAAqC;AAC3C,QAAMZ,QAAQ,CAACG,QAAT,CACLJ,cADK,EAEL,yBAFK,EAGLW,aAAa,CAACE,IAHT,EAILA,IAJK,CAAN;AAMA;AAED;AACA;AACA;AACA;AACA;;AACA,OAAO,UAAUC,mBAAV,GAAgC;AACtC,QAAMb,QAAQ,CAACG,QAAT,CACLJ,cADK,EAEL,0BAFK,EAGLW,aAAa,CAACE,IAHT,CAAN;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,SAAT,C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cAA9B,CAA1B;AACA,MAAI0F,iBAAiB,GAAG,MAAMlG,QAAQ,CAACC,MAAT,CAC7BO,WAD6B,EAE7B,kBAF6B,CAA9B;AAIA,QAAM2F,YAAY,GAAG,MAAMnG,QAAQ,CAACC,MAAT,CAAiBS,aAAjB,EAAgC,cAAhC,CAA3B,CA5BsC,CA8BtC;;AACAR,EAAAA,SAAS,CAAE,MAAM;AAChB,UAAMkG,YAAY,GAAGnG,MAAM,CAAEO,WAAF,CAAN,CAAsB4F,YAAtB,EAArB;AACA,UAAMC,gBAAgB,GAAGpG,MAAM,CAAEO,WAAF,CAAN,CAAsB6F,gBAAtB,EAAzB,CAFgB,CAIhB;AACA;AACA;AACA;AACA;AACA;;AACA,UAAMC,0BAA0B,GAC/BH,YAAY,IACZF,aADA,IAEA,CAAEG,YAFF,IAGA,CAAEF,iBAJH,CAVgB,CAgBhB;;AACAD,IAAAA,aAAa,GAAGG,YAAhB;AACAF,IAAAA,iBAAiB,GAAGG,gBAApB;;AAEA,QAAKC,0BAAL,EAAkC;AACjCnG,MAAAA,QAAQ,CAAEO,aAAF,CAAR,CAA0BgC,qBAA1B;AACA;AACD,GAvBQ,CAAT;AAyBA,SAAO;AACN3B,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA","sourcesContent":["/**\n * External dependencies\n */\nimport { castArray, reduce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { apiFetch } from '@wordpress/data-controls';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { controls, select, subscribe, dispatch } from '@wordpress/data';\nimport { speak } from '@wordpress/a11y';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { store as editPostStore } from '.';\n/**\n * Returns an action object used in signalling that the user opened an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n *\n * @yield {Object} Action object.\n */\nexport function* openGeneralSidebar( name ) {\n\tyield controls.dispatch(\n\t\tinterfaceStore,\n\t\t'enableComplementaryArea',\n\t\teditPostStore.name,\n\t\tname\n\t);\n}\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n *\n * @yield {Object} Action object.\n */\nexport function* closeGeneralSidebar() {\n\tyield controls.dispatch(\n\t\tinterfaceStore,\n\t\t'disableComplementaryArea',\n\t\teditPostStore.name\n\t);\n}\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport function openModal( name ) {\n\treturn {\n\t\ttype: 'OPEN_MODAL',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @return {Object} Action object.\n */\nexport function closeModal() {\n\treturn {\n\t\ttype: 'CLOSE_MODAL',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n *\n * @return {Object} Action object\n */\nexport function openPublishSidebar() {\n\treturn {\n\t\ttype: 'OPEN_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n *\n * @return {Object} Action object.\n */\nexport function closePublishSidebar() {\n\treturn {\n\t\ttype: 'CLOSE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function togglePublishSidebar() {\n\treturn {\n\t\ttype: 'TOGGLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport function toggleEditorPanelEnabled( panelName ) {\n\treturn {\n\t\ttype: 'TOGGLE_PANEL_ENABLED',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Returns an action object used to open or close a panel in the editor.\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n *\n * @return {Object} Action object.\n */\nexport function toggleEditorPanelOpened( panelName ) {\n\treturn {\n\t\ttype: 'TOGGLE_PANEL_OPENED',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport function removeEditorPanel( panelName ) {\n\treturn {\n\t\ttype: 'REMOVE_PANEL',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport function* toggleFeature( feature ) {\n\tyield controls.dispatch(\n\t\tinterfaceStore.name,\n\t\t'toggleFeature',\n\t\t'core/edit-post',\n\t\tfeature\n\t);\n}\n\nexport function* switchEditorMode( mode ) {\n\tyield {\n\t\ttype: 'SWITCH_MODE',\n\t\tmode,\n\t};\n\n\t// Unselect blocks when we switch to the code editor.\n\tif ( mode !== 'visual' ) {\n\t\tyield controls.dispatch( blockEditorStore, 'clearSelectedBlock' );\n\t}\n\n\tconst message =\n\t\tmode === 'visual'\n\t\t\t? __( 'Visual editor selected' )\n\t\t\t: __( 'Code editor selected' );\n\tspeak( message, 'assertive' );\n}\n\n/**\n * Triggers an action object used to toggle a plugin name flag.\n *\n * @param {string} pluginName Plugin name.\n */\nexport function* togglePinnedPluginItem( pluginName ) {\n\tconst isPinned = yield controls.select(\n\t\tinterfaceStore,\n\t\t'isItemPinned',\n\t\t'core/edit-post',\n\t\tpluginName\n\t);\n\n\tyield controls.dispatch(\n\t\tinterfaceStore,\n\t\tisPinned ? 'unpinItem' : 'pinItem',\n\t\t'core/edit-post',\n\t\tpluginName\n\t);\n}\n\n/**\n * Returns an action object used in signalling that block types by the given\n * name(s) should be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n *\n * @return {Object} Action object.\n */\nexport function hideBlockTypes( blockNames ) {\n\treturn {\n\t\ttype: 'HIDE_BLOCK_TYPES',\n\t\tblockNames: castArray( blockNames ),\n\t};\n}\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @param {string} blockName Name of the block.\n * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the \"auto apply\" setting of the block is removed.\n *\n * @return {Object} Action object.\n */\nexport function updatePreferredStyleVariations( blockName, blockStyle ) {\n\treturn {\n\t\ttype: 'UPDATE_PREFERRED_STYLE_VARIATIONS',\n\t\tblockName,\n\t\tblockStyle,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the editor should attempt\n * to locally autosave the current post every `interval` seconds.\n *\n * @param {number} interval The new interval, in seconds.\n * @return {Object} Action object.\n */\nexport function __experimentalUpdateLocalAutosaveInterval( interval ) {\n\treturn {\n\t\ttype: 'UPDATE_LOCAL_AUTOSAVE_INTERVAL',\n\t\tinterval,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that block types by the given\n * name(s) should be shown.\n *\n * @param {string[]} blockNames Names of block types to show.\n *\n * @return {Object} Action object.\n */\nexport function showBlockTypes( blockNames ) {\n\treturn {\n\t\ttype: 'SHOW_BLOCK_TYPES',\n\t\tblockNames: castArray( blockNames ),\n\t};\n}\n\n/**\n * Returns an action object used in signaling\n * what Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n *\n * @yield {Object} Action object.\n */\nexport function* setAvailableMetaBoxesPerLocation( metaBoxesPerLocation ) {\n\tyield {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t};\n}\n\n/**\n * Returns an action object used to request meta box update.\n *\n * @yield {Object} Action object.\n */\nexport function* requestMetaBoxUpdates() {\n\tyield {\n\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t};\n\n\t// Saves the wp_editor fields\n\tif ( window.tinyMCE ) {\n\t\twindow.tinyMCE.triggerSave();\n\t}\n\n\t// Additional data needed for backward compatibility.\n\t// If we do not provide this data, the post will be overridden with the default values.\n\tconst post = yield controls.select( editorStore, 'getCurrentPost' );\n\tconst additionalData = [\n\t\tpost.comment_status ? [ 'comment_status', post.comment_status ] : false,\n\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t].filter( Boolean );\n\n\t// We gather all the metaboxes locations data and the base form data\n\tconst baseFormData = new window.FormData(\n\t\tdocument.querySelector( '.metabox-base-form' )\n\t);\n\tconst activeMetaBoxLocations = yield controls.select(\n\t\teditPostStore,\n\t\t'getActiveMetaBoxLocations'\n\t);\n\tconst formDataToMerge = [\n\t\tbaseFormData,\n\t\t...activeMetaBoxLocations.map(\n\t\t\t( location ) =>\n\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t),\n\t];\n\n\t// Merge all form data objects into a single one.\n\tconst formData = reduce(\n\t\tformDataToMerge,\n\t\t( memo, currentFormData ) => {\n\t\t\tfor ( const [ key, value ] of currentFormData ) {\n\t\t\t\tmemo.append( key, value );\n\t\t\t}\n\t\t\treturn memo;\n\t\t},\n\t\tnew window.FormData()\n\t);\n\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\tformData.append( key, value )\n\t);\n\n\ttry {\n\t\t// Save the metaboxes\n\t\tyield apiFetch( {\n\t\t\turl: window._wpMetaBoxUrl,\n\t\t\tmethod: 'POST',\n\t\t\tbody: formData,\n\t\t\tparse: false,\n\t\t} );\n\t\tyield controls.dispatch( editPostStore, 'metaBoxUpdatesSuccess' );\n\t} catch {\n\t\tyield controls.dispatch( editPostStore, 'metaBoxUpdatesFailure' );\n\t}\n}\n\n/**\n * Returns an action object used to signal a successful meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesSuccess() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_SUCCESS',\n\t};\n}\n\n/**\n * Returns an action object used to signal a failed meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesFailure() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_FAILURE',\n\t};\n}\n\n/**\n * Returns an action object used to toggle the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @param {boolean} value Is editing template.\n * @return {Object} Action object.\n */\nexport function setIsEditingTemplate( value ) {\n\treturn {\n\t\ttype: 'SET_IS_EDITING_TEMPLATE',\n\t\tvalue,\n\t};\n}\n\n/**\n * Switches to the template mode.\n *\n * @param {boolean} newTemplate Is new template.\n */\nexport function* __unstableSwitchToTemplateMode( newTemplate = false ) {\n\tyield setIsEditingTemplate( true );\n\n\tconst isWelcomeGuideActive = yield controls.select(\n\t\teditPostStore,\n\t\t'isFeatureActive',\n\t\t'welcomeGuideTemplate'\n\t);\n\n\tif ( ! isWelcomeGuideActive ) {\n\t\tconst message = newTemplate\n\t\t\t? __( \"Custom template created. You're in template mode now.\" )\n\t\t\t: __(\n\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t );\n\t\tyield controls.dispatch( noticesStore, 'createSuccessNotice', message, {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport function* __unstableCreateTemplate( template ) {\n\tconst savedTemplate = yield controls.dispatch(\n\t\tcoreStore,\n\t\t'saveEntityRecord',\n\t\t'postType',\n\t\t'wp_template',\n\t\ttemplate\n\t);\n\tconst post = yield controls.select( editorStore, 'getCurrentPost' );\n\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'editEntityRecord',\n\t\t'postType',\n\t\tpost.type,\n\t\tpost.id,\n\t\t{\n\t\t\ttemplate: savedTemplate.slug,\n\t\t}\n\t);\n}\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport function* initializeMetaBoxes() {\n\tconst isEditorReady = yield controls.select(\n\t\teditorStore,\n\t\t'__unstableIsEditorReady'\n\t);\n\n\tif ( ! isEditorReady ) {\n\t\treturn;\n\t}\n\n\tconst postType = yield controls.select( editorStore, 'getCurrentPostType' );\n\n\t// Only initialize once.\n\tif ( metaBoxesInitialized ) {\n\t\treturn;\n\t}\n\n\tif ( window.postboxes.page !== postType ) {\n\t\twindow.postboxes.add_postbox_toggles( postType );\n\t}\n\n\tmetaBoxesInitialized = true;\n\n\tlet wasSavingPost = yield controls.select( editorStore, 'isSavingPost' );\n\tlet wasAutosavingPost = yield controls.select(\n\t\teditorStore,\n\t\t'isAutosavingPost'\n\t);\n\tconst hasMetaBoxes = yield controls.select( editPostStore, 'hasMetaBoxes' );\n\n\t// Save metaboxes when performing a full save on the post.\n\tsubscribe( () => {\n\t\tconst isSavingPost = select( editorStore ).isSavingPost();\n\t\tconst isAutosavingPost = select( editorStore ).isAutosavingPost();\n\n\t\t// Save metaboxes on save completion, except for autosaves that are not a post preview.\n\t\t//\n\t\t// Meta boxes are initialized once at page load. It is not necessary to\n\t\t// account for updates on each state change.\n\t\t//\n\t\t// See: https://github.com/WordPress/WordPress/blob/5.1.1/wp-admin/includes/post.php#L2307-L2309\n\t\tconst shouldTriggerMetaboxesSave =\n\t\t\thasMetaBoxes &&\n\t\t\twasSavingPost &&\n\t\t\t! isSavingPost &&\n\t\t\t! wasAutosavingPost;\n\n\t\t// Save current state for next inspection.\n\t\twasSavingPost = isSavingPost;\n\t\twasAutosavingPost = isAutosavingPost;\n\n\t\tif ( shouldTriggerMetaboxesSave ) {\n\t\t\tdispatch( editPostStore ).requestMetaBoxUpdates();\n\t\t}\n\t} );\n\n\treturn {\n\t\ttype: 'META_BOXES_INITIALIZED',\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/store/actions.js"],"names":["castArray","reduce","__","apiFetch","speak","store","interfaceStore","noticesStore","coreStore","blockEditorStore","editorStore","getMetaBoxContainer","editPostStore","openGeneralSidebar","name","registry","dispatch","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","openModal","type","closeModal","openPublishSidebar","closePublishSidebar","togglePublishSidebar","toggleEditorPanelEnabled","panelName","toggleEditorPanelOpened","removeEditorPanel","toggleFeature","feature","switchEditorMode","mode","clearSelectedBlock","message","togglePinnedPluginItem","pluginName","isPinned","select","isItemPinned","hideBlockTypes","blockNames","updatePreferredStyleVariations","blockName","blockStyle","__experimentalUpdateLocalAutosaveInterval","interval","showBlockTypes","setAvailableMetaBoxesPerLocation","metaBoxesPerLocation","requestMetaBoxUpdates","window","tinyMCE","triggerSave","post","getCurrentPost","additionalData","comment_status","ping_status","sticky","author","filter","Boolean","baseFormData","FormData","document","querySelector","activeMetaBoxLocations","getActiveMetaBoxLocations","formDataToMerge","map","location","formData","memo","currentFormData","key","value","append","forEach","url","_wpMetaBoxUrl","method","body","parse","metaBoxUpdatesSuccess","metaBoxUpdatesFailure","__experimentalSetPreviewDeviceType","deviceType","setIsInserterOpened","setIsListViewOpened","isOpen","setIsEditingTemplate","__unstableSwitchToTemplateMode","newTemplate","isWelcomeGuideActive","isFeatureActive","createSuccessNotice","__unstableCreateTemplate","template","savedTemplate","saveEntityRecord","editEntityRecord","id","slug","metaBoxesInitialized","initializeMetaBoxes","isEditorReady","__unstableIsEditorReady","postType","getCurrentPostType","postboxes","page","add_postbox_toggles","wasSavingPost","isSavingPost","wasAutosavingPost","isAutosavingPost","hasMetaBoxes","subscribe","shouldTriggerMetaboxesSave"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,MAApB,QAAkC,QAAlC;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,OAAOC,QAAP,MAAqB,sBAArB;AACA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,YAAlB,QAAsC,oBAAtC;AACA,SAASF,KAAK,IAAIG,SAAlB,QAAmC,sBAAnC;AACA,SAASH,KAAK,IAAII,gBAAlB,QAA0C,yBAA1C;AACA,SAASJ,KAAK,IAAIK,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,qBAApC;AACA,SAASN,KAAK,IAAIO,aAAlB,QAAuC,GAAvC;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,kBAAkB,GAAKC,IAAF,IAAY;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SAC7CA,QAAQ,CACNC,QADF,CACYV,cADZ,EAEEW,uBAFF,CAE2BL,aAAa,CAACE,IAFzC,EAE+CA,IAF/C,CAD6C;AAAA,CAAvC;AAKP;AACA;AACA;;AACA,OAAO,MAAMI,mBAAmB,GAAG,MAAM;AAAA,MAAE;AAAEH,IAAAA;AAAF,GAAF;AAAA,SACxCA,QAAQ,CACNC,QADF,CACYV,cADZ,EAEEa,wBAFF,CAE4BP,aAAa,CAACE,IAF1C,CADwC;AAAA,CAAlC;AAKP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASM,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A;AACD,GAzBD;AA2BAnC,EAAAA,QAAQ,CAAE;AACTK,IAAAA,IAAI,EAAE;AADG,GAAF,CAAR;AAGA,CAtDM","sourcesContent":["/**\n * External dependencies\n */\nimport { castArray, reduce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { speak } from '@wordpress/a11y';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { store as editPostStore } from '.';\n\n/**\n * Returns an action object used in signalling that the user opened an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar = ( name ) => ( { registry } ) =>\n\tregistry\n\t\t.dispatch( interfaceStore )\n\t\t.enableComplementaryArea( editPostStore.name, name );\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n */\nexport const closeGeneralSidebar = () => ( { registry } ) =>\n\tregistry\n\t\t.dispatch( interfaceStore )\n\t\t.disableComplementaryArea( editPostStore.name );\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport function openModal( name ) {\n\treturn {\n\t\ttype: 'OPEN_MODAL',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @return {Object} Action object.\n */\nexport function closeModal() {\n\treturn {\n\t\ttype: 'CLOSE_MODAL',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n *\n * @return {Object} Action object\n */\nexport function openPublishSidebar() {\n\treturn {\n\t\ttype: 'OPEN_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n *\n * @return {Object} Action object.\n */\nexport function closePublishSidebar() {\n\treturn {\n\t\ttype: 'CLOSE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function togglePublishSidebar() {\n\treturn {\n\t\ttype: 'TOGGLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport function toggleEditorPanelEnabled( panelName ) {\n\treturn {\n\t\ttype: 'TOGGLE_PANEL_ENABLED',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Returns an action object used to open or close a panel in the editor.\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n *\n * @return {Object} Action object.\n */\nexport function toggleEditorPanelOpened( panelName ) {\n\treturn {\n\t\ttype: 'TOGGLE_PANEL_OPENED',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport function removeEditorPanel( panelName ) {\n\treturn {\n\t\ttype: 'REMOVE_PANEL',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport const toggleFeature = ( feature ) => ( { registry } ) =>\n\tregistry\n\t\t.dispatch( interfaceStore )\n\t\t.toggleFeature( 'core/edit-post', feature );\n\nexport const switchEditorMode = ( mode ) => ( { dispatch, registry } ) => {\n\tdispatch( {\n\t\ttype: 'SWITCH_MODE',\n\t\tmode,\n\t} );\n\n\t// Unselect blocks when we switch to the code editor.\n\tif ( mode !== 'visual' ) {\n\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t}\n\n\tconst message =\n\t\tmode === 'visual'\n\t\t\t? __( 'Visual editor selected' )\n\t\t\t: __( 'Code editor selected' );\n\tspeak( message, 'assertive' );\n};\n\n/**\n * Triggers an action object used to toggle a plugin name flag.\n *\n * @param {string} pluginName Plugin name.\n */\nexport const togglePinnedPluginItem = ( pluginName ) => ( { registry } ) => {\n\tconst isPinned = registry\n\t\t.select( interfaceStore )\n\t\t.isItemPinned( 'core/edit-post', pluginName );\n\n\tregistry\n\t\t.dispatch( interfaceStore )\n\t\t[ isPinned ? 'unpinItem' : 'pinItem' ]( 'core/edit-post', pluginName );\n};\n\n/**\n * Returns an action object used in signalling that block types by the given\n * name(s) should be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n *\n * @return {Object} Action object.\n */\nexport function hideBlockTypes( blockNames ) {\n\treturn {\n\t\ttype: 'HIDE_BLOCK_TYPES',\n\t\tblockNames: castArray( blockNames ),\n\t};\n}\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @param {string} blockName Name of the block.\n * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the \"auto apply\" setting of the block is removed.\n *\n * @return {Object} Action object.\n */\nexport function updatePreferredStyleVariations( blockName, blockStyle ) {\n\treturn {\n\t\ttype: 'UPDATE_PREFERRED_STYLE_VARIATIONS',\n\t\tblockName,\n\t\tblockStyle,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the editor should attempt\n * to locally autosave the current post every `interval` seconds.\n *\n * @param {number} interval The new interval, in seconds.\n * @return {Object} Action object.\n */\nexport function __experimentalUpdateLocalAutosaveInterval( interval ) {\n\treturn {\n\t\ttype: 'UPDATE_LOCAL_AUTOSAVE_INTERVAL',\n\t\tinterval,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that block types by the given\n * name(s) should be shown.\n *\n * @param {string[]} blockNames Names of block types to show.\n *\n * @return {Object} Action object.\n */\nexport function showBlockTypes( blockNames ) {\n\treturn {\n\t\ttype: 'SHOW_BLOCK_TYPES',\n\t\tblockNames: castArray( blockNames ),\n\t};\n}\n\n/**\n * Returns an action object used in signaling\n * what Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n */\nexport const setAvailableMetaBoxesPerLocation = ( metaBoxesPerLocation ) => ( {\n\tdispatch,\n} ) =>\n\tdispatch( {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t} );\n\n/**\n * Update a metabox.\n */\nexport const requestMetaBoxUpdates = () => async ( {\n\tregistry,\n\tselect,\n\tdispatch,\n} ) => {\n\tdispatch( {\n\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t} );\n\n\t// Saves the wp_editor fields\n\tif ( window.tinyMCE ) {\n\t\twindow.tinyMCE.triggerSave();\n\t}\n\n\t// Additional data needed for backward compatibility.\n\t// If we do not provide this data, the post will be overridden with the default values.\n\tconst post = registry.select( editorStore ).getCurrentPost();\n\tconst additionalData = [\n\t\tpost.comment_status ? [ 'comment_status', post.comment_status ] : false,\n\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t].filter( Boolean );\n\n\t// We gather all the metaboxes locations data and the base form data\n\tconst baseFormData = new window.FormData(\n\t\tdocument.querySelector( '.metabox-base-form' )\n\t);\n\tconst activeMetaBoxLocations = select.getActiveMetaBoxLocations();\n\tconst formDataToMerge = [\n\t\tbaseFormData,\n\t\t...activeMetaBoxLocations.map(\n\t\t\t( location ) =>\n\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t),\n\t];\n\n\t// Merge all form data objects into a single one.\n\tconst formData = reduce(\n\t\tformDataToMerge,\n\t\t( memo, currentFormData ) => {\n\t\t\tfor ( const [ key, value ] of currentFormData ) {\n\t\t\t\tmemo.append( key, value );\n\t\t\t}\n\t\t\treturn memo;\n\t\t},\n\t\tnew window.FormData()\n\t);\n\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\tformData.append( key, value )\n\t);\n\n\ttry {\n\t\t// Save the metaboxes\n\t\tawait apiFetch( {\n\t\t\turl: window._wpMetaBoxUrl,\n\t\t\tmethod: 'POST',\n\t\t\tbody: formData,\n\t\t\tparse: false,\n\t\t} );\n\t\tdispatch.metaBoxUpdatesSuccess();\n\t} catch {\n\t\tdispatch.metaBoxUpdatesFailure();\n\t}\n};\n\n/**\n * Returns an action object used to signal a successful meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesSuccess() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_SUCCESS',\n\t};\n}\n\n/**\n * Returns an action object used to signal a failed meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesFailure() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_FAILURE',\n\t};\n}\n\n/**\n * Returns an action object used to toggle the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @param {boolean} value Is editing template.\n * @return {Object} Action object.\n */\nexport function setIsEditingTemplate( value ) {\n\treturn {\n\t\ttype: 'SET_IS_EDITING_TEMPLATE',\n\t\tvalue,\n\t};\n}\n\n/**\n * Switches to the template mode.\n *\n * @param {boolean} newTemplate Is new template.\n */\nexport const __unstableSwitchToTemplateMode = ( newTemplate = false ) => ( {\n\tregistry,\n\tselect,\n\tdispatch,\n} ) => {\n\tdispatch( setIsEditingTemplate( true ) );\n\tconst isWelcomeGuideActive = select.isFeatureActive(\n\t\t'welcomeGuideTemplate'\n\t);\n\tif ( ! isWelcomeGuideActive ) {\n\t\tconst message = newTemplate\n\t\t\t? __( \"Custom template created. You're in template mode now.\" )\n\t\t\t: __(\n\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t );\n\t\tregistry.dispatch( noticesStore ).createSuccessNotice( message, {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n};\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const __unstableCreateTemplate = ( template ) => async ( {\n\tregistry,\n} ) => {\n\tconst savedTemplate = await registry\n\t\t.dispatch( coreStore )\n\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\tconst post = registry.select( editorStore ).getCurrentPost();\n\tregistry\n\t\t.dispatch( coreStore )\n\t\t.editEntityRecord( 'postType', post.type, post.id, {\n\t\t\ttemplate: savedTemplate.slug,\n\t\t} );\n};\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport const initializeMetaBoxes = () => ( { registry, select, dispatch } ) => {\n\tconst isEditorReady = registry\n\t\t.select( editorStore )\n\t\t.__unstableIsEditorReady();\n\n\tif ( ! isEditorReady ) {\n\t\treturn;\n\t}\n\t// Only initialize once.\n\tif ( metaBoxesInitialized ) {\n\t\treturn;\n\t}\n\tconst postType = registry.select( editorStore ).getCurrentPostType();\n\tif ( window.postboxes.page !== postType ) {\n\t\twindow.postboxes.add_postbox_toggles( postType );\n\t}\n\n\tmetaBoxesInitialized = true;\n\n\tlet wasSavingPost = registry.select( editorStore ).isSavingPost();\n\tlet wasAutosavingPost = registry.select( editorStore ).isAutosavingPost();\n\tconst hasMetaBoxes = select.hasMetaBoxes();\n\n\t// Save metaboxes when performing a full save on the post.\n\tregistry.subscribe( async () => {\n\t\tconst isSavingPost = registry.select( editorStore ).isSavingPost();\n\t\tconst isAutosavingPost = registry\n\t\t\t.select( editorStore )\n\t\t\t.isAutosavingPost();\n\n\t\t// Save metaboxes on save completion, except for autosaves that are not a post preview.\n\t\t//\n\t\t// Meta boxes are initialized once at page load. It is not necessary to\n\t\t// account for updates on each state change.\n\t\t//\n\t\t// See: https://github.com/WordPress/WordPress/blob/5.1.1/wp-admin/includes/post.php#L2307-L2309\n\t\tconst shouldTriggerMetaboxesSave =\n\t\t\thasMetaBoxes &&\n\t\t\twasSavingPost &&\n\t\t\t! isSavingPost &&\n\t\t\t! wasAutosavingPost;\n\n\t\t// Save current state for next inspection.\n\t\twasSavingPost = isSavingPost;\n\t\twasAutosavingPost = isAutosavingPost;\n\n\t\tif ( shouldTriggerMetaboxesSave ) {\n\t\t\tawait dispatch.requestMetaBoxUpdates();\n\t\t}\n\t} );\n\n\tdispatch( {\n\t\ttype: 'META_BOXES_INITIALIZED',\n\t} );\n};\n"]}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { createReduxStore, registerStore } from '@wordpress/data';
|
|
5
|
-
import { controls } from '@wordpress/data-controls';
|
|
6
5
|
/**
|
|
7
6
|
* Internal dependencies
|
|
8
7
|
*/
|
|
@@ -15,7 +14,6 @@ const storeConfig = {
|
|
|
15
14
|
reducer,
|
|
16
15
|
actions,
|
|
17
16
|
selectors,
|
|
18
|
-
controls,
|
|
19
17
|
persist: ['preferences']
|
|
20
18
|
};
|
|
21
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/store/index.js"],"names":["createReduxStore","registerStore","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/store/index.js"],"names":["createReduxStore","registerStore","reducer","actions","selectors","STORE_NAME","storeConfig","persist","store"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAT,EAA2BC,aAA3B,QAAgD,iBAAhD;AAEA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,WAApB;AACA,OAAO,KAAKC,OAAZ,MAAyB,WAAzB;AACA,OAAO,KAAKC,SAAZ,MAA2B,aAA3B;AACA,SAASC,UAAT,QAA2B,aAA3B;AAEA,MAAMC,WAAW,GAAG;AACnBJ,EAAAA,OADmB;AAEnBC,EAAAA,OAFmB;AAGnBC,EAAAA,SAHmB;AAInBG,EAAAA,OAAO,EAAE,CAAE,aAAF;AAJU,CAApB;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,KAAK,GAAGR,gBAAgB,CAAEK,UAAF,EAAcC,WAAd,CAA9B,C,CAEP;;AACAL,aAAa,CAAEI,UAAF,EAAcC,WAAd,CAAb","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, registerStore } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport { STORE_NAME } from './constants';\n\nconst storeConfig = {\n\treducer,\n\tactions,\n\tselectors,\n\tpersist: [ 'preferences' ],\n};\n\n/**\n * Store definition for the edit post namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\n\n// Ideally we use register instead of register store.\nregisterStore( STORE_NAME, storeConfig );\n"]}
|
|
@@ -680,11 +680,11 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
680
680
|
margin-left: 8px;
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
-
.edit-post-fullscreen-mode-close.
|
|
683
|
+
.edit-post-fullscreen-mode-close.components-button {
|
|
684
684
|
display: none;
|
|
685
685
|
}
|
|
686
686
|
@media (min-width: 782px) {
|
|
687
|
-
.edit-post-fullscreen-mode-close.
|
|
687
|
+
.edit-post-fullscreen-mode-close.components-button {
|
|
688
688
|
display: flex;
|
|
689
689
|
align-items: center;
|
|
690
690
|
align-self: stretch;
|
|
@@ -697,13 +697,13 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
697
697
|
position: relative;
|
|
698
698
|
margin-bottom: -1px;
|
|
699
699
|
}
|
|
700
|
-
.edit-post-fullscreen-mode-close.
|
|
700
|
+
.edit-post-fullscreen-mode-close.components-button:active {
|
|
701
701
|
color: #fff;
|
|
702
702
|
}
|
|
703
|
-
.edit-post-fullscreen-mode-close.
|
|
703
|
+
.edit-post-fullscreen-mode-close.components-button:focus {
|
|
704
704
|
box-shadow: none;
|
|
705
705
|
}
|
|
706
|
-
.edit-post-fullscreen-mode-close.
|
|
706
|
+
.edit-post-fullscreen-mode-close.components-button::before {
|
|
707
707
|
transition: box-shadow 0.1s ease;
|
|
708
708
|
content: "";
|
|
709
709
|
display: block;
|
|
@@ -717,22 +717,27 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
719
|
@media (min-width: 782px) and (prefers-reduced-motion: reduce) {
|
|
720
|
-
.edit-post-fullscreen-mode-close.
|
|
720
|
+
.edit-post-fullscreen-mode-close.components-button::before {
|
|
721
721
|
transition-duration: 0s;
|
|
722
722
|
transition-delay: 0s;
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
@media (min-width: 782px) {
|
|
726
|
-
.edit-post-fullscreen-mode-close.
|
|
726
|
+
.edit-post-fullscreen-mode-close.components-button:hover::before {
|
|
727
727
|
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #757575;
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
730
|
@media (min-width: 782px) {
|
|
731
|
-
.edit-post-fullscreen-mode-close.has-icon:
|
|
731
|
+
.edit-post-fullscreen-mode-close.components-button.has-icon:hover::before {
|
|
732
|
+
box-shadow: none;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
@media (min-width: 782px) {
|
|
736
|
+
.edit-post-fullscreen-mode-close.components-button:focus::before {
|
|
732
737
|
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba(255, 255, 255, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
733
738
|
}
|
|
734
739
|
}
|
|
735
|
-
.edit-post-fullscreen-mode-close.
|
|
740
|
+
.edit-post-fullscreen-mode-close.components-button .edit-post-fullscreen-mode-close_site-icon {
|
|
736
741
|
width: 36px;
|
|
737
742
|
height: 36px;
|
|
738
743
|
border-radius: 2px;
|
package/build-style/style.css
CHANGED
|
@@ -680,11 +680,11 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
680
680
|
margin-right: 8px;
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
-
.edit-post-fullscreen-mode-close.
|
|
683
|
+
.edit-post-fullscreen-mode-close.components-button {
|
|
684
684
|
display: none;
|
|
685
685
|
}
|
|
686
686
|
@media (min-width: 782px) {
|
|
687
|
-
.edit-post-fullscreen-mode-close.
|
|
687
|
+
.edit-post-fullscreen-mode-close.components-button {
|
|
688
688
|
display: flex;
|
|
689
689
|
align-items: center;
|
|
690
690
|
align-self: stretch;
|
|
@@ -697,13 +697,13 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
697
697
|
position: relative;
|
|
698
698
|
margin-bottom: -1px;
|
|
699
699
|
}
|
|
700
|
-
.edit-post-fullscreen-mode-close.
|
|
700
|
+
.edit-post-fullscreen-mode-close.components-button:active {
|
|
701
701
|
color: #fff;
|
|
702
702
|
}
|
|
703
|
-
.edit-post-fullscreen-mode-close.
|
|
703
|
+
.edit-post-fullscreen-mode-close.components-button:focus {
|
|
704
704
|
box-shadow: none;
|
|
705
705
|
}
|
|
706
|
-
.edit-post-fullscreen-mode-close.
|
|
706
|
+
.edit-post-fullscreen-mode-close.components-button::before {
|
|
707
707
|
transition: box-shadow 0.1s ease;
|
|
708
708
|
content: "";
|
|
709
709
|
display: block;
|
|
@@ -717,22 +717,27 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
719
|
@media (min-width: 782px) and (prefers-reduced-motion: reduce) {
|
|
720
|
-
.edit-post-fullscreen-mode-close.
|
|
720
|
+
.edit-post-fullscreen-mode-close.components-button::before {
|
|
721
721
|
transition-duration: 0s;
|
|
722
722
|
transition-delay: 0s;
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
@media (min-width: 782px) {
|
|
726
|
-
.edit-post-fullscreen-mode-close.
|
|
726
|
+
.edit-post-fullscreen-mode-close.components-button:hover::before {
|
|
727
727
|
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #757575;
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
730
|
@media (min-width: 782px) {
|
|
731
|
-
.edit-post-fullscreen-mode-close.has-icon:
|
|
731
|
+
.edit-post-fullscreen-mode-close.components-button.has-icon:hover::before {
|
|
732
|
+
box-shadow: none;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
@media (min-width: 782px) {
|
|
736
|
+
.edit-post-fullscreen-mode-close.components-button:focus::before {
|
|
732
737
|
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba(255, 255, 255, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
733
738
|
}
|
|
734
739
|
}
|
|
735
|
-
.edit-post-fullscreen-mode-close.
|
|
740
|
+
.edit-post-fullscreen-mode-close.components-button .edit-post-fullscreen-mode-close_site-icon {
|
|
736
741
|
width: 36px;
|
|
737
742
|
height: 36px;
|
|
738
743
|
border-radius: 2px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -28,27 +28,27 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
30
|
"@wordpress/a11y": "^3.3.1",
|
|
31
|
-
"@wordpress/
|
|
32
|
-
"@wordpress/block-
|
|
33
|
-
"@wordpress/
|
|
34
|
-
"@wordpress/
|
|
35
|
-
"@wordpress/
|
|
36
|
-
"@wordpress/
|
|
37
|
-
"@wordpress/data": "^
|
|
38
|
-
"@wordpress/data
|
|
39
|
-
"@wordpress/editor": "^12.2.
|
|
31
|
+
"@wordpress/api-fetch": "^6.0.1",
|
|
32
|
+
"@wordpress/block-editor": "^8.2.0",
|
|
33
|
+
"@wordpress/block-library": "^7.0.2",
|
|
34
|
+
"@wordpress/blocks": "^11.2.2",
|
|
35
|
+
"@wordpress/components": "^19.5.0",
|
|
36
|
+
"@wordpress/compose": "^5.1.2",
|
|
37
|
+
"@wordpress/core-data": "^4.1.2",
|
|
38
|
+
"@wordpress/data": "^6.3.0",
|
|
39
|
+
"@wordpress/editor": "^12.2.2",
|
|
40
40
|
"@wordpress/element": "^4.1.1",
|
|
41
41
|
"@wordpress/hooks": "^3.3.1",
|
|
42
42
|
"@wordpress/i18n": "^4.3.1",
|
|
43
|
-
"@wordpress/icons": "^
|
|
44
|
-
"@wordpress/interface": "^4.2.
|
|
45
|
-
"@wordpress/keyboard-shortcuts": "^3.1.
|
|
43
|
+
"@wordpress/icons": "^7.0.1",
|
|
44
|
+
"@wordpress/interface": "^4.2.3",
|
|
45
|
+
"@wordpress/keyboard-shortcuts": "^3.1.2",
|
|
46
46
|
"@wordpress/keycodes": "^3.3.1",
|
|
47
47
|
"@wordpress/media-utils": "^3.1.1",
|
|
48
|
-
"@wordpress/notices": "^3.3.
|
|
49
|
-
"@wordpress/plugins": "^4.1.
|
|
48
|
+
"@wordpress/notices": "^3.3.2",
|
|
49
|
+
"@wordpress/plugins": "^4.1.3",
|
|
50
50
|
"@wordpress/url": "^3.4.1",
|
|
51
|
-
"@wordpress/viewport": "^4.1.
|
|
51
|
+
"@wordpress/viewport": "^4.1.2",
|
|
52
52
|
"@wordpress/warning": "^2.3.1",
|
|
53
53
|
"classnames": "^2.3.1",
|
|
54
54
|
"lodash": "^4.17.21",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "4566ac290359553d04de4eb574545309343f790b"
|
|
62
62
|
}
|