@wordpress/fields 0.24.0 → 0.24.1-next.ff1cebbba.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/README.md +1 -1
- package/build/actions/delete-post.js +168 -117
- package/build/actions/delete-post.js.map +7 -1
- package/build/actions/duplicate-pattern.js +42 -43
- package/build/actions/duplicate-pattern.js.map +7 -1
- package/build/actions/duplicate-post.js +104 -93
- package/build/actions/duplicate-post.js.map +7 -1
- package/build/actions/duplicate-template-part.js +71 -63
- package/build/actions/duplicate-template-part.js.map +7 -1
- package/build/actions/export-pattern.js +60 -45
- package/build/actions/export-pattern.js.map +7 -1
- package/build/actions/index.js +71 -94
- package/build/actions/index.js.map +7 -1
- package/build/actions/permanently-delete-post.js +161 -132
- package/build/actions/permanently-delete-post.js.map +7 -1
- package/build/actions/rename-post.js +77 -83
- package/build/actions/rename-post.js.map +7 -1
- package/build/actions/reorder-page.js +76 -73
- package/build/actions/reorder-page.js.map +7 -1
- package/build/actions/reset-post.js +214 -165
- package/build/actions/reset-post.js.map +7 -1
- package/build/actions/restore-post.js +91 -75
- package/build/actions/restore-post.js.map +7 -1
- package/build/actions/trash-post.js +167 -127
- package/build/actions/trash-post.js.map +7 -1
- package/build/actions/utils.js +48 -41
- package/build/actions/utils.js.map +7 -1
- package/build/actions/view-post-revisions.js +39 -35
- package/build/actions/view-post-revisions.js.map +7 -1
- package/build/actions/view-post.js +31 -28
- package/build/actions/view-post.js.map +7 -1
- package/build/components/create-template-part-modal/index.js +213 -169
- package/build/components/create-template-part-modal/index.js.map +7 -1
- package/build/components/create-template-part-modal/utils.js +48 -48
- package/build/components/create-template-part-modal/utils.js.map +7 -1
- package/build/fields/author/author-view.js +63 -69
- package/build/fields/author/author-view.js.map +7 -1
- package/build/fields/author/index.js +43 -29
- package/build/fields/author/index.js.map +7 -1
- package/build/fields/comment-status/index.js +42 -32
- package/build/fields/comment-status/index.js.map +7 -1
- package/build/fields/date/date-view.js +84 -58
- package/build/fields/date/date-view.js.map +7 -1
- package/build/fields/date/index.js +39 -25
- package/build/fields/date/index.js.map +7 -1
- package/build/fields/discussion/index.js +36 -32
- package/build/fields/discussion/index.js.map +7 -1
- package/build/fields/featured-image/featured-image-edit.js +115 -97
- package/build/fields/featured-image/featured-image-edit.js.map +7 -1
- package/build/fields/featured-image/featured-image-view.js +41 -34
- package/build/fields/featured-image/featured-image-view.js.map +7 -1
- package/build/fields/featured-image/index.js +31 -26
- package/build/fields/featured-image/index.js.map +7 -1
- package/build/fields/index.js +83 -118
- package/build/fields/index.js.map +7 -1
- package/build/fields/order/index.js +28 -23
- package/build/fields/order/index.js.map +7 -1
- package/build/fields/page-title/index.js +42 -30
- package/build/fields/page-title/index.js.map +7 -1
- package/build/fields/page-title/view.js +38 -41
- package/build/fields/page-title/view.js.map +7 -1
- package/build/fields/parent/index.js +31 -26
- package/build/fields/parent/index.js.map +7 -1
- package/build/fields/parent/parent-edit.js +200 -168
- package/build/fields/parent/parent-edit.js.map +7 -1
- package/build/fields/parent/parent-view.js +40 -31
- package/build/fields/parent/parent-view.js.map +7 -1
- package/build/fields/parent/utils.js +29 -16
- package/build/fields/parent/utils.js.map +7 -1
- package/build/fields/password/edit.js +67 -53
- package/build/fields/password/edit.js.map +7 -1
- package/build/fields/password/index.js +40 -26
- package/build/fields/password/index.js.map +7 -1
- package/build/fields/pattern-title/index.js +42 -30
- package/build/fields/pattern-title/index.js.map +7 -1
- package/build/fields/pattern-title/view.js +43 -41
- package/build/fields/pattern-title/view.js.map +7 -1
- package/build/fields/ping-status/index.js +66 -47
- package/build/fields/ping-status/index.js.map +7 -1
- package/build/fields/slug/index.js +41 -27
- package/build/fields/slug/index.js.map +7 -1
- package/build/fields/slug/slug-edit.js +116 -107
- package/build/fields/slug/slug-edit.js.map +7 -1
- package/build/fields/slug/slug-view.js +30 -23
- package/build/fields/slug/slug-view.js.map +7 -1
- package/build/fields/slug/utils.js +32 -20
- package/build/fields/slug/utils.js.map +7 -1
- package/build/fields/status/index.js +43 -29
- package/build/fields/status/index.js.map +7 -1
- package/build/fields/status/status-elements.js +58 -44
- package/build/fields/status/status-elements.js.map +7 -1
- package/build/fields/status/status-view.js +42 -36
- package/build/fields/status/status-view.js.map +7 -1
- package/build/fields/template/index.js +29 -24
- package/build/fields/template/index.js.map +7 -1
- package/build/fields/template/template-edit.js +167 -142
- package/build/fields/template/template-edit.js.map +7 -1
- package/build/fields/template-title/index.js +42 -30
- package/build/fields/template-title/index.js.map +7 -1
- package/build/fields/title/index.js +42 -32
- package/build/fields/title/index.js.map +7 -1
- package/build/fields/title/view.js +57 -39
- package/build/fields/title/view.js.map +7 -1
- package/build/index.js +39 -36
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -14
- package/build/lock-unlock.js.map +7 -1
- package/build/mutation/index.js +91 -76
- package/build/mutation/index.js.map +7 -1
- package/build/types.js +16 -5
- package/build/types.js.map +7 -1
- package/build-module/actions/delete-post.js +155 -107
- package/build-module/actions/delete-post.js.map +7 -1
- package/build-module/actions/duplicate-pattern.js +24 -36
- package/build-module/actions/duplicate-pattern.js.map +7 -1
- package/build-module/actions/duplicate-post.js +87 -84
- package/build-module/actions/duplicate-post.js.map +7 -1
- package/build-module/actions/duplicate-template-part.js +51 -58
- package/build-module/actions/duplicate-template-part.js.map +7 -1
- package/build-module/actions/export-pattern.js +40 -39
- package/build-module/actions/export-pattern.js.map +7 -1
- package/build-module/actions/index.js +29 -14
- package/build-module/actions/index.js.map +7 -1
- package/build-module/actions/permanently-delete-post.js +146 -125
- package/build-module/actions/permanently-delete-post.js.map +7 -1
- package/build-module/actions/rename-post.js +63 -77
- package/build-module/actions/rename-post.js.map +7 -1
- package/build-module/actions/reorder-page.js +58 -65
- package/build-module/actions/reorder-page.js.map +7 -1
- package/build-module/actions/reset-post.js +185 -152
- package/build-module/actions/reset-post.js.map +7 -1
- package/build-module/actions/restore-post.js +72 -68
- package/build-module/actions/restore-post.js.map +7 -1
- package/build-module/actions/trash-post.js +152 -119
- package/build-module/actions/trash-post.js.map +7 -1
- package/build-module/actions/utils.js +23 -34
- package/build-module/actions/utils.js.map +7 -1
- package/build-module/actions/view-post-revisions.js +21 -31
- package/build-module/actions/view-post-revisions.js.map +7 -1
- package/build-module/actions/view-post.js +12 -23
- package/build-module/actions/view-post.js.map +7 -1
- package/build-module/components/create-template-part-modal/index.js +201 -154
- package/build-module/components/create-template-part-modal/index.js.map +7 -1
- package/build-module/components/create-template-part-modal/utils.js +26 -43
- package/build-module/components/create-template-part-modal/utils.js.map +7 -1
- package/build-module/fields/author/author-view.js +34 -62
- package/build-module/fields/author/author-view.js.map +7 -1
- package/build-module/fields/author/index.js +14 -24
- package/build-module/fields/author/index.js.map +7 -1
- package/build-module/fields/comment-status/index.js +24 -29
- package/build-module/fields/comment-status/index.js.map +7 -1
- package/build-module/fields/date/date-view.js +66 -53
- package/build-module/fields/date/date-view.js.map +7 -1
- package/build-module/fields/date/index.js +10 -20
- package/build-module/fields/date/index.js.map +7 -1
- package/build-module/fields/discussion/index.js +18 -29
- package/build-module/fields/discussion/index.js.map +7 -1
- package/build-module/fields/featured-image/featured-image-edit.js +93 -90
- package/build-module/fields/featured-image/featured-image-edit.js.map +7 -1
- package/build-module/fields/featured-image/featured-image-view.js +20 -29
- package/build-module/fields/featured-image/featured-image-view.js.map +7 -1
- package/build-module/fields/featured-image/index.js +11 -21
- package/build-module/fields/featured-image/index.js.map +7 -1
- package/build-module/fields/index.js +35 -17
- package/build-module/fields/index.js.map +7 -1
- package/build-module/fields/order/index.js +10 -20
- package/build-module/fields/order/index.js.map +7 -1
- package/build-module/fields/page-title/index.js +13 -25
- package/build-module/fields/page-title/index.js.map +7 -1
- package/build-module/fields/page-title/view.js +20 -37
- package/build-module/fields/page-title/view.js.map +7 -1
- package/build-module/fields/parent/index.js +11 -21
- package/build-module/fields/parent/index.js.map +7 -1
- package/build-module/fields/parent/parent-edit.js +172 -160
- package/build-module/fields/parent/parent-edit.js.map +7 -1
- package/build-module/fields/parent/parent-view.js +19 -27
- package/build-module/fields/parent/parent-view.js.map +7 -1
- package/build-module/fields/parent/utils.js +8 -13
- package/build-module/fields/parent/utils.js.map +7 -1
- package/build-module/fields/password/edit.js +53 -48
- package/build-module/fields/password/edit.js.map +7 -1
- package/build-module/fields/password/index.js +11 -21
- package/build-module/fields/password/index.js.map +7 -1
- package/build-module/fields/pattern-title/index.js +13 -25
- package/build-module/fields/pattern-title/index.js.map +7 -1
- package/build-module/fields/pattern-title/view.js +21 -34
- package/build-module/fields/pattern-title/view.js.map +7 -1
- package/build-module/fields/ping-status/index.js +48 -43
- package/build-module/fields/ping-status/index.js.map +7 -1
- package/build-module/fields/slug/index.js +11 -21
- package/build-module/fields/slug/index.js.map +7 -1
- package/build-module/fields/slug/slug-edit.js +101 -100
- package/build-module/fields/slug/slug-edit.js.map +7 -1
- package/build-module/fields/slug/slug-view.js +9 -16
- package/build-module/fields/slug/slug-view.js.map +7 -1
- package/build-module/fields/slug/utils.js +9 -13
- package/build-module/fields/slug/utils.js.map +7 -1
- package/build-module/fields/status/index.js +13 -23
- package/build-module/fields/status/index.js.map +7 -1
- package/build-module/fields/status/status-elements.js +47 -40
- package/build-module/fields/status/status-elements.js.map +7 -1
- package/build-module/fields/status/status-view.js +14 -31
- package/build-module/fields/status/status-view.js.map +7 -1
- package/build-module/fields/template/index.js +10 -18
- package/build-module/fields/template/index.js.map +7 -1
- package/build-module/fields/template/template-edit.js +147 -130
- package/build-module/fields/template/template-edit.js.map +7 -1
- package/build-module/fields/template-title/index.js +13 -25
- package/build-module/fields/template-title/index.js.map +7 -1
- package/build-module/fields/title/index.js +13 -27
- package/build-module/fields/title/index.js.map +7 -1
- package/build-module/fields/title/view.js +25 -32
- package/build-module/fields/title/view.js.map +7 -1
- package/build-module/index.js +7 -4
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/mutation/index.js +70 -72
- package/build-module/mutation/index.js.map +7 -1
- package/build-module/types.js +1 -2
- package/build-module/types.js.map +7 -1
- package/build-style/style-rtl.css +4 -139
- package/build-style/style.css +4 -139
- package/build-types/fields/author/author-view.d.ts.map +1 -1
- package/build-types/fields/discussion/index.d.ts.map +1 -1
- package/build-types/fields/featured-image/featured-image-edit.d.ts +2 -2
- package/build-types/fields/featured-image/featured-image-edit.d.ts.map +1 -1
- package/build-types/fields/featured-image/featured-image-view.d.ts +5 -2
- package/build-types/fields/featured-image/featured-image-view.d.ts.map +1 -1
- package/build-types/fields/featured-image/index.d.ts +3 -3
- package/build-types/fields/featured-image/index.d.ts.map +1 -1
- package/build-types/types.d.ts +18 -0
- package/build-types/types.d.ts.map +1 -1
- package/package.json +34 -27
- package/src/components/create-template-part-modal/style.scss +4 -0
- package/src/fields/author/author-view.tsx +3 -17
- package/src/fields/discussion/index.tsx +1 -0
- package/src/fields/featured-image/featured-image-edit.tsx +2 -2
- package/src/fields/featured-image/featured-image-view.tsx +3 -15
- package/src/fields/featured-image/index.ts +3 -3
- package/src/fields/featured-image/style.scss +3 -0
- package/src/fields/template/style.scss +4 -0
- package/src/fields/title/style.scss +1 -1
- package/src/style.scss +9 -8
- package/src/types.ts +18 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/index.native.js +0 -2
- package/build/index.native.js.map +0 -1
- package/build-module/index.native.js +0 -2
- package/build-module/index.native.js.map +0 -1
|
@@ -1,124 +1,118 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var rename_post_exports = {};
|
|
20
|
+
__export(rename_post_exports, {
|
|
21
|
+
default: () => rename_post_default
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
* WordPress dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
// @ts-ignore
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Internal dependencies
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
// Patterns.
|
|
28
|
-
const {
|
|
29
|
-
PATTERN_TYPES
|
|
30
|
-
} = (0, _lockUnlock.unlock)(_patterns.privateApis);
|
|
23
|
+
module.exports = __toCommonJS(rename_post_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_data = require("@wordpress/data");
|
|
26
|
+
var import_core_data = require("@wordpress/core-data");
|
|
27
|
+
var import_i18n = require("@wordpress/i18n");
|
|
28
|
+
var import_element = require("@wordpress/element");
|
|
29
|
+
var import_patterns = require("@wordpress/patterns");
|
|
30
|
+
var import_components = require("@wordpress/components");
|
|
31
|
+
var import_notices = require("@wordpress/notices");
|
|
32
|
+
var import_lock_unlock = require("../lock-unlock");
|
|
33
|
+
var import_utils = require("./utils");
|
|
34
|
+
const { PATTERN_TYPES } = (0, import_lock_unlock.unlock)(import_patterns.privateApis);
|
|
31
35
|
const renamePost = {
|
|
32
|
-
id:
|
|
33
|
-
label: (0,
|
|
34
|
-
modalFocusOnMount:
|
|
36
|
+
id: "rename-post",
|
|
37
|
+
label: (0, import_i18n.__)("Rename"),
|
|
38
|
+
modalFocusOnMount: "firstContentElement",
|
|
35
39
|
isEligible(post) {
|
|
36
|
-
if (post.status ===
|
|
40
|
+
if (post.status === "trash") {
|
|
37
41
|
return false;
|
|
38
42
|
}
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
if (![
|
|
44
|
+
"wp_template_part",
|
|
45
|
+
...Object.values(PATTERN_TYPES)
|
|
46
|
+
].includes(post.type)) {
|
|
41
47
|
return post.permissions?.update;
|
|
42
48
|
}
|
|
43
|
-
if ((0,
|
|
44
|
-
return post.source ===
|
|
49
|
+
if ((0, import_utils.isTemplatePart)(post)) {
|
|
50
|
+
return post.source === "custom" && !post?.has_theme_file && post.permissions?.update;
|
|
45
51
|
}
|
|
46
52
|
return post.type === PATTERN_TYPES.user && post.permissions?.update;
|
|
47
53
|
},
|
|
48
|
-
RenderModal: ({
|
|
49
|
-
items,
|
|
50
|
-
closeModal,
|
|
51
|
-
onActionPerformed
|
|
52
|
-
}) => {
|
|
54
|
+
RenderModal: ({ items, closeModal, onActionPerformed }) => {
|
|
53
55
|
const [item] = items;
|
|
54
|
-
const [title, setTitle] = (0,
|
|
55
|
-
const {
|
|
56
|
-
|
|
57
|
-
saveEditedEntityRecord
|
|
58
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
59
|
-
const {
|
|
60
|
-
createSuccessNotice,
|
|
61
|
-
createErrorNotice
|
|
62
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
56
|
+
const [title, setTitle] = (0, import_element.useState)(() => (0, import_utils.getItemTitle)(item, ""));
|
|
57
|
+
const { editEntityRecord, saveEditedEntityRecord } = (0, import_data.useDispatch)(import_core_data.store);
|
|
58
|
+
const { createSuccessNotice, createErrorNotice } = (0, import_data.useDispatch)(import_notices.store);
|
|
63
59
|
async function onRename(event) {
|
|
64
60
|
event.preventDefault();
|
|
65
61
|
try {
|
|
66
|
-
await editEntityRecord(
|
|
62
|
+
await editEntityRecord("postType", item.type, item.id, {
|
|
67
63
|
title
|
|
68
64
|
});
|
|
69
|
-
|
|
70
|
-
setTitle('');
|
|
65
|
+
setTitle("");
|
|
71
66
|
closeModal?.();
|
|
72
|
-
|
|
73
|
-
await saveEditedEntityRecord('postType', item.type, item.id, {
|
|
67
|
+
await saveEditedEntityRecord("postType", item.type, item.id, {
|
|
74
68
|
throwOnError: true
|
|
75
69
|
});
|
|
76
|
-
createSuccessNotice((0,
|
|
77
|
-
type:
|
|
70
|
+
createSuccessNotice((0, import_i18n.__)("Name updated"), {
|
|
71
|
+
type: "snackbar"
|
|
78
72
|
});
|
|
79
73
|
onActionPerformed?.(items);
|
|
80
74
|
} catch (error) {
|
|
81
75
|
const typedError = error;
|
|
82
|
-
const errorMessage = typedError.message && typedError.code !==
|
|
83
|
-
createErrorNotice(errorMessage, {
|
|
84
|
-
type: 'snackbar'
|
|
85
|
-
});
|
|
76
|
+
const errorMessage = typedError.message && typedError.code !== "unknown_error" ? typedError.message : (0, import_i18n.__)("An error occurred while updating the name");
|
|
77
|
+
createErrorNotice(errorMessage, { type: "snackbar" });
|
|
86
78
|
}
|
|
87
79
|
}
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
80
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("form", { onSubmit: onRename, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: "5", children: [
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
|
+
import_components.TextControl,
|
|
83
|
+
{
|
|
93
84
|
__nextHasNoMarginBottom: true,
|
|
94
85
|
__next40pxDefaultSize: true,
|
|
95
|
-
label: (0,
|
|
86
|
+
label: (0, import_i18n.__)("Name"),
|
|
96
87
|
value: title,
|
|
97
88
|
onChange: setTitle,
|
|
98
89
|
required: true
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "right", children: [
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
+
import_components.Button,
|
|
95
|
+
{
|
|
102
96
|
__next40pxDefaultSize: true,
|
|
103
97
|
variant: "tertiary",
|
|
104
98
|
onClick: () => {
|
|
105
99
|
closeModal?.();
|
|
106
100
|
},
|
|
107
|
-
children: (0,
|
|
108
|
-
}
|
|
101
|
+
children: (0, import_i18n.__)("Cancel")
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
|
+
import_components.Button,
|
|
106
|
+
{
|
|
109
107
|
__next40pxDefaultSize: true,
|
|
110
108
|
variant: "primary",
|
|
111
109
|
type: "submit",
|
|
112
|
-
children: (0,
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
})
|
|
116
|
-
});
|
|
110
|
+
children: (0, import_i18n.__)("Save")
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
] })
|
|
114
|
+
] }) });
|
|
117
115
|
}
|
|
118
116
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
* Rename action for PostWithPermissions.
|
|
122
|
-
*/
|
|
123
|
-
var _default = exports.default = renamePost;
|
|
124
|
-
//# sourceMappingURL=rename-post.js.map
|
|
117
|
+
var rename_post_default = renamePost;
|
|
118
|
+
//# sourceMappingURL=rename-post.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/actions/rename-post.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n// @ts-ignore\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport {\n\tButton,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport type { Action } from '@wordpress/dataviews';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../lock-unlock';\nimport { getItemTitle, isTemplatePart } from './utils';\nimport type { CoreDataError, PostWithPermissions } from '../types';\n\n// Patterns.\nconst { PATTERN_TYPES } = unlock( patternsPrivateApis );\n\nconst renamePost: Action< PostWithPermissions > = {\n\tid: 'rename-post',\n\tlabel: __( 'Rename' ),\n\tmodalFocusOnMount: 'firstContentElement',\n\tisEligible( post ) {\n\t\tif ( post.status === 'trash' ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Templates, template parts and patterns have special checks for renaming.\n\t\tif (\n\t\t\t! [\n\t\t\t\t'wp_template_part',\n\t\t\t\t...Object.values( PATTERN_TYPES ),\n\t\t\t].includes( post.type )\n\t\t) {\n\t\t\treturn post.permissions?.update;\n\t\t}\n\n\t\tif ( isTemplatePart( post ) ) {\n\t\t\treturn (\n\t\t\t\tpost.source === 'custom' &&\n\t\t\t\t! post?.has_theme_file &&\n\t\t\t\tpost.permissions?.update\n\t\t\t);\n\t\t}\n\n\t\treturn post.type === PATTERN_TYPES.user && post.permissions?.update;\n\t},\n\tRenderModal: ( { items, closeModal, onActionPerformed } ) => {\n\t\tconst [ item ] = items;\n\t\tconst [ title, setTitle ] = useState( () => getItemTitle( item, '' ) );\n\t\tconst { editEntityRecord, saveEditedEntityRecord } =\n\t\t\tuseDispatch( coreStore );\n\t\tconst { createSuccessNotice, createErrorNotice } =\n\t\t\tuseDispatch( noticesStore );\n\n\t\tasync function onRename( event: React.FormEvent ) {\n\t\t\tevent.preventDefault();\n\t\t\ttry {\n\t\t\t\tawait editEntityRecord( 'postType', item.type, item.id, {\n\t\t\t\t\ttitle,\n\t\t\t\t} );\n\t\t\t\t// Update state before saving rerenders the list.\n\t\t\t\tsetTitle( '' );\n\t\t\t\tcloseModal?.();\n\t\t\t\t// Persist edited entity.\n\t\t\t\tawait saveEditedEntityRecord( 'postType', item.type, item.id, {\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t} );\n\t\t\t\tcreateSuccessNotice( __( 'Name updated' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\tonActionPerformed?.( items );\n\t\t\t} catch ( error ) {\n\t\t\t\tconst typedError = error as CoreDataError;\n\t\t\t\tconst errorMessage =\n\t\t\t\t\ttypedError.message && typedError.code !== 'unknown_error'\n\t\t\t\t\t\t? typedError.message\n\t\t\t\t\t\t: __( 'An error occurred while updating the name' );\n\t\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<form onSubmit={ onRename }>\n\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tcloseModal?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t);\n\t},\n};\n\n/**\n * Rename action for PostWithPermissions.\n */\nexport default renamePost;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+FK;AA5FL,kBAA4B;AAC5B,uBAAmC;AACnC,kBAAmB;AACnB,qBAAyB;AAEzB,sBAAmD;AACnD,wBAKO;AAEP,qBAAsC;AAMtC,yBAAuB;AACvB,mBAA6C;AAI7C,MAAM,EAAE,cAAc,QAAI,2BAAQ,gBAAAA,WAAoB;AAEtD,MAAM,aAA4C;AAAA,EACjD,IAAI;AAAA,EACJ,WAAO,gBAAI,QAAS;AAAA,EACpB,mBAAmB;AAAA,EACnB,WAAY,MAAO;AAClB,QAAK,KAAK,WAAW,SAAU;AAC9B,aAAO;AAAA,IACR;AAEA,QACC,CAAE;AAAA,MACD;AAAA,MACA,GAAG,OAAO,OAAQ,aAAc;AAAA,IACjC,EAAE,SAAU,KAAK,IAAK,GACrB;AACD,aAAO,KAAK,aAAa;AAAA,IAC1B;AAEA,YAAK,6BAAgB,IAAK,GAAI;AAC7B,aACC,KAAK,WAAW,YAChB,CAAE,MAAM,kBACR,KAAK,aAAa;AAAA,IAEpB;AAEA,WAAO,KAAK,SAAS,cAAc,QAAQ,KAAK,aAAa;AAAA,EAC9D;AAAA,EACA,aAAa,CAAE,EAAE,OAAO,YAAY,kBAAkB,MAAO;AAC5D,UAAM,CAAE,IAAK,IAAI;AACjB,UAAM,CAAE,OAAO,QAAS,QAAI,yBAAU,UAAM,2BAAc,MAAM,EAAG,CAAE;AACrE,UAAM,EAAE,kBAAkB,uBAAuB,QAChD,yBAAa,iBAAAC,KAAU;AACxB,UAAM,EAAE,qBAAqB,kBAAkB,QAC9C,yBAAa,eAAAC,KAAa;AAE3B,mBAAe,SAAU,OAAyB;AACjD,YAAM,eAAe;AACrB,UAAI;AACH,cAAM,iBAAkB,YAAY,KAAK,MAAM,KAAK,IAAI;AAAA,UACvD;AAAA,QACD,CAAE;AAEF,iBAAU,EAAG;AACb,qBAAa;AAEb,cAAM,uBAAwB,YAAY,KAAK,MAAM,KAAK,IAAI;AAAA,UAC7D,cAAc;AAAA,QACf,CAAE;AACF,gCAAqB,gBAAI,cAAe,GAAG;AAAA,UAC1C,MAAM;AAAA,QACP,CAAE;AACF,4BAAqB,KAAM;AAAA,MAC5B,SAAU,OAAQ;AACjB,cAAM,aAAa;AACnB,cAAM,eACL,WAAW,WAAW,WAAW,SAAS,kBACvC,WAAW,cACX,gBAAI,2CAA4C;AACpD,0BAAmB,cAAc,EAAE,MAAM,WAAW,CAAE;AAAA,MACvD;AAAA,IACD;AAEA,WACC,4CAAC,UAAK,UAAW,UAChB,uDAAC,kBAAAC,sBAAA,EAAO,SAAQ,KACf;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,yBAAuB;AAAA,UACvB,uBAAqB;AAAA,UACrB,WAAQ,gBAAI,MAAO;AAAA,UACnB,OAAQ;AAAA,UACR,UAAW;AAAA,UACX,UAAQ;AAAA;AAAA,MACT;AAAA,MACA,6CAAC,kBAAAC,sBAAA,EAAO,SAAQ,SACf;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,uBAAqB;AAAA,YACrB,SAAQ;AAAA,YACR,SAAU,MAAM;AACf,2BAAa;AAAA,YACd;AAAA,YAEE,8BAAI,QAAS;AAAA;AAAA,QAChB;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,uBAAqB;AAAA,YACrB,SAAQ;AAAA,YACR,MAAK;AAAA,YAEH,8BAAI,MAAO;AAAA;AAAA,QACd;AAAA,SACD;AAAA,OACD,GACD;AAAA,EAEF;AACD;AAKA,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["patternsPrivateApis", "coreStore", "noticesStore", "VStack", "HStack"]
|
|
7
|
+
}
|
|
@@ -1,121 +1,124 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var reorder_page_exports = {};
|
|
20
|
+
__export(reorder_page_exports, {
|
|
21
|
+
default: () => reorder_page_default
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const fields = [_fields.orderField];
|
|
23
|
+
module.exports = __toCommonJS(reorder_page_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_data = require("@wordpress/data");
|
|
26
|
+
var import_core_data = require("@wordpress/core-data");
|
|
27
|
+
var import_i18n = require("@wordpress/i18n");
|
|
28
|
+
var import_notices = require("@wordpress/notices");
|
|
29
|
+
var import_element = require("@wordpress/element");
|
|
30
|
+
var import_dataviews = require("@wordpress/dataviews");
|
|
31
|
+
var import_components = require("@wordpress/components");
|
|
32
|
+
var import_fields = require("../fields");
|
|
33
|
+
const fields = [import_fields.orderField];
|
|
25
34
|
const formOrderAction = {
|
|
26
|
-
fields: [
|
|
35
|
+
fields: ["menu_order"]
|
|
27
36
|
};
|
|
28
37
|
function ReorderModal({
|
|
29
38
|
items,
|
|
30
39
|
closeModal,
|
|
31
40
|
onActionPerformed
|
|
32
41
|
}) {
|
|
33
|
-
const [item, setItem] = (0,
|
|
42
|
+
const [item, setItem] = (0, import_element.useState)(items[0]);
|
|
34
43
|
const orderInput = item.menu_order;
|
|
35
|
-
const {
|
|
36
|
-
|
|
37
|
-
saveEditedEntityRecord
|
|
38
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
39
|
-
const {
|
|
40
|
-
createSuccessNotice,
|
|
41
|
-
createErrorNotice
|
|
42
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
44
|
+
const { editEntityRecord, saveEditedEntityRecord } = (0, import_data.useDispatch)(import_core_data.store);
|
|
45
|
+
const { createSuccessNotice, createErrorNotice } = (0, import_data.useDispatch)(import_notices.store);
|
|
43
46
|
async function onOrder(event) {
|
|
44
47
|
event.preventDefault();
|
|
45
|
-
if (!(0,
|
|
48
|
+
if (!(0, import_dataviews.isItemValid)(item, fields, formOrderAction)) {
|
|
46
49
|
return;
|
|
47
50
|
}
|
|
48
51
|
try {
|
|
49
|
-
await editEntityRecord(
|
|
52
|
+
await editEntityRecord("postType", item.type, item.id, {
|
|
50
53
|
menu_order: orderInput
|
|
51
54
|
});
|
|
52
55
|
closeModal?.();
|
|
53
|
-
|
|
54
|
-
await saveEditedEntityRecord('postType', item.type, item.id, {
|
|
56
|
+
await saveEditedEntityRecord("postType", item.type, item.id, {
|
|
55
57
|
throwOnError: true
|
|
56
58
|
});
|
|
57
|
-
createSuccessNotice((0,
|
|
58
|
-
type:
|
|
59
|
+
createSuccessNotice((0, import_i18n.__)("Order updated."), {
|
|
60
|
+
type: "snackbar"
|
|
59
61
|
});
|
|
60
62
|
onActionPerformed?.(items);
|
|
61
63
|
} catch (error) {
|
|
62
64
|
const typedError = error;
|
|
63
|
-
const errorMessage = typedError.message && typedError.code !==
|
|
65
|
+
const errorMessage = typedError.message && typedError.code !== "unknown_error" ? typedError.message : (0, import_i18n.__)("An error occurred while updating the order");
|
|
64
66
|
createErrorNotice(errorMessage, {
|
|
65
|
-
type:
|
|
67
|
+
type: "snackbar"
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
|
-
const isSaveDisabled = !(0,
|
|
70
|
-
return
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
const isSaveDisabled = !(0, import_dataviews.isItemValid)(item, fields, formOrderAction);
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("form", { onSubmit: onOrder, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: "5", children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: (0, import_i18n.__)(
|
|
74
|
+
"Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported."
|
|
75
|
+
) }),
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
77
|
+
import_dataviews.DataForm,
|
|
78
|
+
{
|
|
77
79
|
data: item,
|
|
78
|
-
fields
|
|
80
|
+
fields,
|
|
79
81
|
form: formOrderAction,
|
|
80
|
-
onChange: changes => setItem({
|
|
82
|
+
onChange: (changes) => setItem({
|
|
81
83
|
...item,
|
|
82
84
|
...changes
|
|
83
85
|
})
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "right", children: [
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
+
import_components.Button,
|
|
91
|
+
{
|
|
87
92
|
__next40pxDefaultSize: true,
|
|
88
93
|
variant: "tertiary",
|
|
89
94
|
onClick: () => {
|
|
90
95
|
closeModal?.();
|
|
91
96
|
},
|
|
92
|
-
children: (0,
|
|
93
|
-
}
|
|
97
|
+
children: (0, import_i18n.__)("Cancel")
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
|
+
import_components.Button,
|
|
102
|
+
{
|
|
94
103
|
__next40pxDefaultSize: true,
|
|
95
104
|
variant: "primary",
|
|
96
105
|
type: "submit",
|
|
97
106
|
accessibleWhenDisabled: true,
|
|
98
107
|
disabled: isSaveDisabled,
|
|
99
|
-
children: (0,
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
})
|
|
103
|
-
});
|
|
108
|
+
children: (0, import_i18n.__)("Save")
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] })
|
|
112
|
+
] }) });
|
|
104
113
|
}
|
|
105
114
|
const reorderPage = {
|
|
106
|
-
id:
|
|
107
|
-
label: (0,
|
|
108
|
-
isEligible({
|
|
109
|
-
status
|
|
110
|
-
}) {
|
|
111
|
-
return status !== 'trash';
|
|
115
|
+
id: "order-pages",
|
|
116
|
+
label: (0, import_i18n.__)("Order"),
|
|
117
|
+
isEligible({ status }) {
|
|
118
|
+
return status !== "trash";
|
|
112
119
|
},
|
|
113
|
-
modalFocusOnMount:
|
|
120
|
+
modalFocusOnMount: "firstContentElement",
|
|
114
121
|
RenderModal: ReorderModal
|
|
115
122
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
* Reorder action for BasePost.
|
|
119
|
-
*/
|
|
120
|
-
var _default = exports.default = reorderPage;
|
|
121
|
-
//# sourceMappingURL=reorder-page.js.map
|
|
123
|
+
var reorder_page_default = reorderPage;
|
|
124
|
+
//# sourceMappingURL=reorder-page.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/actions/reorder-page.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { useState } from '@wordpress/element';\nimport { DataForm, isItemValid } from '@wordpress/dataviews';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport type { Action, RenderModalProps } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport type { CoreDataError, BasePost } from '../types';\nimport { orderField } from '../fields';\n\nconst fields = [ orderField ];\nconst formOrderAction = {\n\tfields: [ 'menu_order' ],\n};\n\nfunction ReorderModal( {\n\titems,\n\tcloseModal,\n\tonActionPerformed,\n}: RenderModalProps< BasePost > ) {\n\tconst [ item, setItem ] = useState( items[ 0 ] );\n\tconst orderInput = item.menu_order;\n\tconst { editEntityRecord, saveEditedEntityRecord } =\n\t\tuseDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tasync function onOrder( event: React.FormEvent ) {\n\t\tevent.preventDefault();\n\n\t\tif ( ! isItemValid( item, fields, formOrderAction ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', item.type, item.id, {\n\t\t\t\tmenu_order: orderInput,\n\t\t\t} );\n\t\t\tcloseModal?.();\n\t\t\t// Persist edited entity.\n\t\t\tawait saveEditedEntityRecord( 'postType', item.type, item.id, {\n\t\t\t\tthrowOnError: true,\n\t\t\t} );\n\t\t\tcreateSuccessNotice( __( 'Order updated.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\tonActionPerformed?.( items );\n\t\t} catch ( error ) {\n\t\t\tconst typedError = error as CoreDataError;\n\t\t\tconst errorMessage =\n\t\t\t\ttypedError.message && typedError.code !== 'unknown_error'\n\t\t\t\t\t? typedError.message\n\t\t\t\t\t: __( 'An error occurred while updating the order' );\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t}\n\t}\n\tconst isSaveDisabled = ! isItemValid( item, fields, formOrderAction );\n\treturn (\n\t\t<form onSubmit={ onOrder }>\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<div>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.'\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<DataForm\n\t\t\t\t\tdata={ item }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tform={ formOrderAction }\n\t\t\t\t\tonChange={ ( changes ) =>\n\t\t\t\t\t\tsetItem( {\n\t\t\t\t\t\t\t...item,\n\t\t\t\t\t\t\t...changes,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tcloseModal?.();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\tdisabled={ isSaveDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nconst reorderPage: Action< BasePost > = {\n\tid: 'order-pages',\n\tlabel: __( 'Order' ),\n\tisEligible( { status } ) {\n\t\treturn status !== 'trash';\n\t},\n\tmodalFocusOnMount: 'firstContentElement',\n\tRenderModal: ReorderModal,\n};\n\n/**\n * Reorder action for BasePost.\n */\nexport default reorderPage;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0EI;AAvEJ,kBAA4B;AAC5B,uBAAmC;AACnC,kBAAmB;AACnB,qBAAsC;AACtC,qBAAyB;AACzB,uBAAsC;AACtC,wBAIO;AAOP,oBAA2B;AAE3B,MAAM,SAAS,CAAE,wBAAW;AAC5B,MAAM,kBAAkB;AAAA,EACvB,QAAQ,CAAE,YAAa;AACxB;AAEA,SAAS,aAAc;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AACD,GAAkC;AACjC,QAAM,CAAE,MAAM,OAAQ,QAAI,yBAAU,MAAO,CAAE,CAAE;AAC/C,QAAM,aAAa,KAAK;AACxB,QAAM,EAAE,kBAAkB,uBAAuB,QAChD,yBAAa,iBAAAA,KAAU;AACxB,QAAM,EAAE,qBAAqB,kBAAkB,QAC9C,yBAAa,eAAAC,KAAa;AAE3B,iBAAe,QAAS,OAAyB;AAChD,UAAM,eAAe;AAErB,QAAK,KAAE,8BAAa,MAAM,QAAQ,eAAgB,GAAI;AACrD;AAAA,IACD;AAEA,QAAI;AACH,YAAM,iBAAkB,YAAY,KAAK,MAAM,KAAK,IAAI;AAAA,QACvD,YAAY;AAAA,MACb,CAAE;AACF,mBAAa;AAEb,YAAM,uBAAwB,YAAY,KAAK,MAAM,KAAK,IAAI;AAAA,QAC7D,cAAc;AAAA,MACf,CAAE;AACF,8BAAqB,gBAAI,gBAAiB,GAAG;AAAA,QAC5C,MAAM;AAAA,MACP,CAAE;AACF,0BAAqB,KAAM;AAAA,IAC5B,SAAU,OAAQ;AACjB,YAAM,aAAa;AACnB,YAAM,eACL,WAAW,WAAW,WAAW,SAAS,kBACvC,WAAW,cACX,gBAAI,4CAA6C;AACrD,wBAAmB,cAAc;AAAA,QAChC,MAAM;AAAA,MACP,CAAE;AAAA,IACH;AAAA,EACD;AACA,QAAM,iBAAiB,KAAE,8BAAa,MAAM,QAAQ,eAAgB;AACpE,SACC,4CAAC,UAAK,UAAW,SAChB,uDAAC,kBAAAC,sBAAA,EAAO,SAAQ,KACf;AAAA,gDAAC,SACE;AAAA,MACD;AAAA,IACD,GACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,MAAO;AAAA,QACP;AAAA,QACA,MAAO;AAAA,QACP,UAAW,CAAE,YACZ,QAAS;AAAA,UACR,GAAG;AAAA,UACH,GAAG;AAAA,QACJ,CAAE;AAAA;AAAA,IAEJ;AAAA,IACA,6CAAC,kBAAAC,sBAAA,EAAO,SAAQ,SACf;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,uBAAqB;AAAA,UACrB,SAAQ;AAAA,UACR,SAAU,MAAM;AACf,yBAAa;AAAA,UACd;AAAA,UAEE,8BAAI,QAAS;AAAA;AAAA,MAChB;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,uBAAqB;AAAA,UACrB,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,wBAAsB;AAAA,UACtB,UAAW;AAAA,UAET,8BAAI,MAAO;AAAA;AAAA,MACd;AAAA,OACD;AAAA,KACD,GACD;AAEF;AAEA,MAAM,cAAkC;AAAA,EACvC,IAAI;AAAA,EACJ,WAAO,gBAAI,OAAQ;AAAA,EACnB,WAAY,EAAE,OAAO,GAAI;AACxB,WAAO,WAAW;AAAA,EACnB;AAAA,EACA,mBAAmB;AAAA,EACnB,aAAa;AACd;AAKA,IAAO,uBAAQ;",
|
|
6
|
+
"names": ["coreStore", "noticesStore", "VStack", "HStack"]
|
|
7
|
+
}
|