@wordpress/editor 14.8.3 → 14.8.5
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/bindings/post-meta.js +64 -42
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/editor-interface/index.js +7 -3
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/entities-saved-states/index.js +8 -6
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +2 -6
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +3 -3
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/preview-dropdown/index.js +14 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.js +10 -14
- package/build/components/provider/index.js.map +1 -1
- package/build/components/visual-editor/index.js +6 -6
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/zoom-out-toggle/index.js +22 -6
- package/build/components/zoom-out-toggle/index.js.map +1 -1
- package/build/store/actions.js +15 -4
- package/build/store/actions.js.map +1 -1
- package/build-module/bindings/post-meta.js +65 -42
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/editor-interface/index.js +7 -3
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +8 -6
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +2 -6
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +3 -3
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +14 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.js +10 -14
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +6 -6
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/zoom-out-toggle/index.js +22 -6
- package/build-module/components/zoom-out-toggle/index.js.map +1 -1
- package/build-module/store/actions.js +16 -5
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +2 -2
- package/build-style/style.css +2 -2
- package/build-types/bindings/post-meta.d.ts +3 -8
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/bindings/post-meta.js +73 -65
- package/src/components/editor-interface/index.js +6 -4
- package/src/components/entities-saved-states/index.js +10 -8
- package/src/components/entities-saved-states/style.scss +2 -2
- package/src/components/plugin-sidebar/index.js +1 -6
- package/src/components/post-publish-panel/maybe-upload-media.js +3 -3
- package/src/components/preview-dropdown/index.js +11 -1
- package/src/components/provider/index.js +13 -20
- package/src/components/visual-editor/index.js +8 -6
- package/src/components/zoom-out-toggle/index.js +23 -6
- package/src/store/actions.js +26 -11
- package/tsconfig.tsbuildinfo +1 -1
package/src/store/actions.js
CHANGED
|
@@ -12,7 +12,11 @@ import {
|
|
|
12
12
|
import { store as noticesStore } from '@wordpress/notices';
|
|
13
13
|
import { store as coreStore } from '@wordpress/core-data';
|
|
14
14
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
applyFilters,
|
|
17
|
+
applyFiltersAsync,
|
|
18
|
+
doActionAsync,
|
|
19
|
+
} from '@wordpress/hooks';
|
|
16
20
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
17
21
|
import { __ } from '@wordpress/i18n';
|
|
18
22
|
|
|
@@ -184,7 +188,7 @@ export const savePost =
|
|
|
184
188
|
}
|
|
185
189
|
|
|
186
190
|
const previousRecord = select.getCurrentPost();
|
|
187
|
-
|
|
191
|
+
let edits = {
|
|
188
192
|
id: previousRecord.id,
|
|
189
193
|
...registry
|
|
190
194
|
.select( coreStore )
|
|
@@ -199,9 +203,9 @@ export const savePost =
|
|
|
199
203
|
|
|
200
204
|
let error = false;
|
|
201
205
|
try {
|
|
202
|
-
|
|
203
|
-
'editor.
|
|
204
|
-
|
|
206
|
+
edits = await applyFiltersAsync(
|
|
207
|
+
'editor.preSavePost',
|
|
208
|
+
edits,
|
|
205
209
|
options
|
|
206
210
|
);
|
|
207
211
|
} catch ( err ) {
|
|
@@ -236,14 +240,25 @@ export const savePost =
|
|
|
236
240
|
);
|
|
237
241
|
}
|
|
238
242
|
|
|
243
|
+
// Run the hook with legacy unstable name for backward compatibility
|
|
239
244
|
if ( ! error ) {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
+
try {
|
|
246
|
+
await applyFilters(
|
|
247
|
+
'editor.__unstableSavePost',
|
|
248
|
+
Promise.resolve(),
|
|
249
|
+
options
|
|
250
|
+
);
|
|
251
|
+
} catch ( err ) {
|
|
245
252
|
error = err;
|
|
246
|
-
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if ( ! error ) {
|
|
257
|
+
try {
|
|
258
|
+
await doActionAsync( 'editor.savePost', options );
|
|
259
|
+
} catch ( err ) {
|
|
260
|
+
error = err;
|
|
261
|
+
}
|
|
247
262
|
}
|
|
248
263
|
dispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );
|
|
249
264
|
|