@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,20 +1,33 @@
|
|
|
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 utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
getTitleWithFallbackName: () => getTitleWithFallbackName
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
/**
|
|
10
|
-
* WordPress dependencies
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
23
|
+
module.exports = __toCommonJS(utils_exports);
|
|
24
|
+
var import_html_entities = require("@wordpress/html-entities");
|
|
25
|
+
var import_i18n = require("@wordpress/i18n");
|
|
17
26
|
function getTitleWithFallbackName(post) {
|
|
18
|
-
return typeof post.title ===
|
|
27
|
+
return typeof post.title === "object" && "rendered" in post.title && post.title.rendered ? (0, import_html_entities.decodeEntities)(post.title.rendered) : `#${post?.id} (${(0, import_i18n.__)("no title")})`;
|
|
19
28
|
}
|
|
20
|
-
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
getTitleWithFallbackName
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/parent/utils.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport function getTitleWithFallbackName( post: BasePost ) {\n\treturn typeof post.title === 'object' &&\n\t\t'rendered' in post.title &&\n\t\tpost.title.rendered\n\t\t? decodeEntities( post.title.rendered )\n\t\t: `#${ post?.id } (${ __( 'no title' ) })`;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,2BAA+B;AAC/B,kBAAmB;AAOZ,SAAS,yBAA0B,MAAiB;AAC1D,SAAO,OAAO,KAAK,UAAU,YAC5B,cAAc,KAAK,SACnB,KAAK,MAAM,eACT,qCAAgB,KAAK,MAAM,QAAS,IACpC,IAAK,MAAM,EAAG,SAAM,gBAAI,UAAW,CAAE;AACzC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,65 +1,79 @@
|
|
|
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 edit_exports = {};
|
|
20
|
+
__export(edit_exports, {
|
|
21
|
+
default: () => edit_default
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
23
|
+
module.exports = __toCommonJS(edit_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_components = require("@wordpress/components");
|
|
26
|
+
var import_element = require("@wordpress/element");
|
|
27
|
+
var import_i18n = require("@wordpress/i18n");
|
|
19
28
|
function PasswordEdit({
|
|
20
29
|
data,
|
|
21
30
|
onChange,
|
|
22
31
|
field
|
|
23
32
|
}) {
|
|
24
|
-
const [showPassword, setShowPassword] = (0,
|
|
25
|
-
item: data
|
|
26
|
-
|
|
27
|
-
const handleTogglePassword = value => {
|
|
33
|
+
const [showPassword, setShowPassword] = (0, import_element.useState)(
|
|
34
|
+
!!field.getValue({ item: data })
|
|
35
|
+
);
|
|
36
|
+
const handleTogglePassword = (value) => {
|
|
28
37
|
setShowPassword(value);
|
|
29
38
|
if (!value) {
|
|
30
|
-
onChange({
|
|
31
|
-
password: ''
|
|
32
|
-
});
|
|
39
|
+
onChange({ password: "" });
|
|
33
40
|
}
|
|
34
41
|
};
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
43
|
+
import_components.__experimentalVStack,
|
|
44
|
+
{
|
|
45
|
+
as: "fieldset",
|
|
46
|
+
spacing: 4,
|
|
47
|
+
className: "fields-controls__password",
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
import_components.CheckboxControl,
|
|
51
|
+
{
|
|
52
|
+
__nextHasNoMarginBottom: true,
|
|
53
|
+
label: (0, import_i18n.__)("Password protected"),
|
|
54
|
+
help: (0, import_i18n.__)("Only visible to those who know the password"),
|
|
55
|
+
checked: showPassword,
|
|
56
|
+
onChange: handleTogglePassword
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
showPassword && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "fields-controls__password-input", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_components.TextControl,
|
|
61
|
+
{
|
|
62
|
+
label: (0, import_i18n.__)("Password"),
|
|
63
|
+
onChange: (value) => onChange({
|
|
64
|
+
password: value
|
|
65
|
+
}),
|
|
66
|
+
value: field.getValue({ item: data }) || "",
|
|
67
|
+
placeholder: (0, import_i18n.__)("Use a secure password"),
|
|
68
|
+
type: "text",
|
|
69
|
+
__next40pxDefaultSize: true,
|
|
70
|
+
__nextHasNoMarginBottom: true,
|
|
71
|
+
maxLength: 255
|
|
72
|
+
}
|
|
73
|
+
) })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
63
77
|
}
|
|
64
|
-
var
|
|
65
|
-
//# sourceMappingURL=edit.js.map
|
|
78
|
+
var edit_default = PasswordEdit;
|
|
79
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/password/edit.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tCheckboxControl,\n\t__experimentalVStack as VStack,\n\tTextControl,\n} from '@wordpress/components';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nfunction PasswordEdit( {\n\tdata,\n\tonChange,\n\tfield,\n}: DataFormControlProps< BasePost > ) {\n\tconst [ showPassword, setShowPassword ] = useState(\n\t\t!! field.getValue( { item: data } )\n\t);\n\n\tconst handleTogglePassword = ( value: boolean ) => {\n\t\tsetShowPassword( value );\n\t\tif ( ! value ) {\n\t\t\tonChange( { password: '' } );\n\t\t}\n\t};\n\n\treturn (\n\t\t<VStack\n\t\t\tas=\"fieldset\"\n\t\t\tspacing={ 4 }\n\t\t\tclassName=\"fields-controls__password\"\n\t\t>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Password protected' ) }\n\t\t\t\thelp={ __( 'Only visible to those who know the password' ) }\n\t\t\t\tchecked={ showPassword }\n\t\t\t\tonChange={ handleTogglePassword }\n\t\t\t/>\n\t\t\t{ showPassword && (\n\t\t\t\t<div className=\"fields-controls__password-input\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tlabel={ __( 'Password' ) }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tpassword: value,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ field.getValue( { item: data } ) || '' }\n\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tmaxLength={ 255 }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\nexport default PasswordEdit;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCE;AA/BF,wBAIO;AAEP,qBAAyB;AACzB,kBAAmB;AAOnB,SAAS,aAAc;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AACD,GAAsC;AACrC,QAAM,CAAE,cAAc,eAAgB,QAAI;AAAA,IACzC,CAAC,CAAE,MAAM,SAAU,EAAE,MAAM,KAAK,CAAE;AAAA,EACnC;AAEA,QAAM,uBAAuB,CAAE,UAAoB;AAClD,oBAAiB,KAAM;AACvB,QAAK,CAAE,OAAQ;AACd,eAAU,EAAE,UAAU,GAAG,CAAE;AAAA,IAC5B;AAAA,EACD;AAEA,SACC;AAAA,IAAC,kBAAAA;AAAA,IAAA;AAAA,MACA,IAAG;AAAA,MACH,SAAU;AAAA,MACV,WAAU;AAAA,MAEV;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,yBAAuB;AAAA,YACvB,WAAQ,gBAAI,oBAAqB;AAAA,YACjC,UAAO,gBAAI,6CAA8C;AAAA,YACzD,SAAU;AAAA,YACV,UAAW;AAAA;AAAA,QACZ;AAAA,QACE,gBACD,4CAAC,SAAI,WAAU,mCACd;AAAA,UAAC;AAAA;AAAA,YACA,WAAQ,gBAAI,UAAW;AAAA,YACvB,UAAW,CAAE,UACZ,SAAU;AAAA,cACT,UAAU;AAAA,YACX,CAAE;AAAA,YAEH,OAAQ,MAAM,SAAU,EAAE,MAAM,KAAK,CAAE,KAAK;AAAA,YAC5C,iBAAc,gBAAI,uBAAwB;AAAA,YAC1C,MAAK;AAAA,YACL,uBAAqB;AAAA,YACrB,yBAAuB;AAAA,YACvB,WAAY;AAAA;AAAA,QACb,GACD;AAAA;AAAA;AAAA,EAEF;AAEF;AACA,IAAO,eAAQ;",
|
|
6
|
+
"names": ["VStack"]
|
|
7
|
+
}
|
|
@@ -1,33 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var password_exports = {};
|
|
30
|
+
__export(password_exports, {
|
|
31
|
+
default: () => password_default
|
|
6
32
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
/**
|
|
11
|
-
* WordPress dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
33
|
+
module.exports = __toCommonJS(password_exports);
|
|
34
|
+
var import_i18n = require("@wordpress/i18n");
|
|
35
|
+
var import_edit = __toESM(require("./edit"));
|
|
18
36
|
const passwordField = {
|
|
19
|
-
id:
|
|
20
|
-
type:
|
|
21
|
-
label: (0,
|
|
22
|
-
Edit:
|
|
37
|
+
id: "password",
|
|
38
|
+
type: "text",
|
|
39
|
+
label: (0, import_i18n.__)("Password"),
|
|
40
|
+
Edit: import_edit.default,
|
|
23
41
|
enableSorting: false,
|
|
24
42
|
enableHiding: false,
|
|
25
|
-
isVisible: item => item.status !==
|
|
43
|
+
isVisible: (item) => item.status !== "private",
|
|
26
44
|
filterBy: false
|
|
27
45
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* Password field for BasePost.
|
|
31
|
-
*/
|
|
32
|
-
var _default = exports.default = passwordField;
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
46
|
+
var password_default = passwordField;
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/password/index.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { Field } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\nimport PasswordEdit from './edit';\n\nconst passwordField: Field< BasePost > = {\n\tid: 'password',\n\ttype: 'text',\n\tlabel: __( 'Password' ),\n\tEdit: PasswordEdit,\n\tenableSorting: false,\n\tenableHiding: false,\n\tisVisible: ( item ) => item.status !== 'private',\n\tfilterBy: false,\n};\n\n/**\n * Password field for BasePost.\n */\nexport default passwordField;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAMnB,kBAAyB;AAEzB,MAAM,gBAAmC;AAAA,EACxC,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,UAAW;AAAA,EACtB,MAAM,YAAAA;AAAA,EACN,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW,CAAE,SAAU,KAAK,WAAW;AAAA,EACvC,UAAU;AACX;AAKA,IAAO,mBAAQ;",
|
|
6
|
+
"names": ["PasswordEdit"]
|
|
7
|
+
}
|
|
@@ -1,37 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var pattern_title_exports = {};
|
|
30
|
+
__export(pattern_title_exports, {
|
|
31
|
+
default: () => pattern_title_default
|
|
6
32
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
33
|
+
module.exports = __toCommonJS(pattern_title_exports);
|
|
34
|
+
var import_i18n = require("@wordpress/i18n");
|
|
35
|
+
var import_utils = require("../../actions/utils");
|
|
36
|
+
var import_view = __toESM(require("./view"));
|
|
19
37
|
const patternTitleField = {
|
|
20
|
-
type:
|
|
21
|
-
id:
|
|
22
|
-
label: (0,
|
|
23
|
-
placeholder: (0,
|
|
24
|
-
getValue: ({
|
|
25
|
-
|
|
26
|
-
}) => (0, _utils.getItemTitle)(item),
|
|
27
|
-
render: _view.default,
|
|
38
|
+
type: "text",
|
|
39
|
+
id: "title",
|
|
40
|
+
label: (0, import_i18n.__)("Title"),
|
|
41
|
+
placeholder: (0, import_i18n.__)("No title"),
|
|
42
|
+
getValue: ({ item }) => (0, import_utils.getItemTitle)(item),
|
|
43
|
+
render: import_view.default,
|
|
28
44
|
enableHiding: false,
|
|
29
45
|
enableGlobalSearch: true,
|
|
30
46
|
filterBy: false
|
|
31
47
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* Title for the pattern entity.
|
|
35
|
-
*/
|
|
36
|
-
var _default = exports.default = patternTitleField;
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
|
48
|
+
var pattern_title_default = patternTitleField;
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/pattern-title/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { Field } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { Pattern } from '../../types';\nimport { getItemTitle } from '../../actions/utils';\nimport PatternTitleView from './view';\n\nconst patternTitleField: Field< Pattern > = {\n\ttype: 'text',\n\tid: 'title',\n\tlabel: __( 'Title' ),\n\tplaceholder: __( 'No title' ),\n\tgetValue: ( { item } ) => getItemTitle( item ),\n\trender: PatternTitleView,\n\tenableHiding: false,\n\tenableGlobalSearch: true,\n\tfilterBy: false,\n};\n\n/**\n * Title for the pattern entity.\n */\nexport default patternTitleField;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAMnB,mBAA6B;AAC7B,kBAA6B;AAE7B,MAAM,oBAAsC;AAAA,EAC3C,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,WAAO,gBAAI,OAAQ;AAAA,EACnB,iBAAa,gBAAI,UAAW;AAAA,EAC5B,UAAU,CAAE,EAAE,KAAK,UAAO,2BAAc,IAAK;AAAA,EAC7C,QAAQ,YAAAA;AAAA,EACR,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,UAAU;AACX;AAKA,IAAO,wBAAQ;",
|
|
6
|
+
"names": ["PatternTitleView"]
|
|
7
|
+
}
|
|
@@ -1,45 +1,47 @@
|
|
|
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 view_exports = {};
|
|
20
|
+
__export(view_exports, {
|
|
21
|
+
PATTERN_TYPES: () => PATTERN_TYPES,
|
|
22
|
+
default: () => PatternTitleView
|
|
5
23
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Internal dependencies
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
PATTERN_TYPES
|
|
27
|
-
} = (0, _lockUnlock.unlock)(_patterns.privateApis);
|
|
28
|
-
exports.PATTERN_TYPES = PATTERN_TYPES;
|
|
29
|
-
function PatternTitleView({
|
|
30
|
-
item
|
|
31
|
-
}) {
|
|
32
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_view.BaseTitleView, {
|
|
33
|
-
item: item,
|
|
34
|
-
className: "fields-field__pattern-title",
|
|
35
|
-
children: item.type === PATTERN_TYPES.theme && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
24
|
+
module.exports = __toCommonJS(view_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_i18n = require("@wordpress/i18n");
|
|
27
|
+
var import_icons = require("@wordpress/icons");
|
|
28
|
+
var import_components = require("@wordpress/components");
|
|
29
|
+
var import_patterns = require("@wordpress/patterns");
|
|
30
|
+
var import_view = require("../title/view");
|
|
31
|
+
var import_lock_unlock = require("../../lock-unlock");
|
|
32
|
+
const { PATTERN_TYPES } = (0, import_lock_unlock.unlock)(import_patterns.privateApis);
|
|
33
|
+
function PatternTitleView({ item }) {
|
|
34
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_view.BaseTitleView, { item, className: "fields-field__pattern-title", children: item.type === PATTERN_TYPES.theme && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
35
|
+
import_components.Tooltip,
|
|
36
|
+
{
|
|
36
37
|
placement: "top",
|
|
37
|
-
text: (0,
|
|
38
|
-
children:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
});
|
|
38
|
+
text: (0, import_i18n.__)("This pattern cannot be edited."),
|
|
39
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, { icon: import_icons.lockSmall, size: 24 })
|
|
40
|
+
}
|
|
41
|
+
) });
|
|
44
42
|
}
|
|
45
|
-
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
PATTERN_TYPES
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/pattern-title/view.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, lockSmall } from '@wordpress/icons';\nimport { Tooltip } from '@wordpress/components';\n// @ts-ignore\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport type { CommonPost } from '../../types';\nimport { BaseTitleView } from '../title/view';\nimport { unlock } from '../../lock-unlock';\n\nexport const { PATTERN_TYPES } = unlock( patternPrivateApis );\n\nexport default function PatternTitleView( { item }: { item: CommonPost } ) {\n\treturn (\n\t\t<BaseTitleView item={ item } className=\"fields-field__pattern-title\">\n\t\t\t{ item.type === PATTERN_TYPES.theme && (\n\t\t\t\t<Tooltip\n\t\t\t\t\tplacement=\"top\"\n\t\t\t\t\ttext={ __( 'This pattern cannot be edited.' ) }\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={ lockSmall } size={ 24 } />\n\t\t\t\t</Tooltip>\n\t\t\t) }\n\t\t</BaseTitleView>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BK;AAvBL,kBAAmB;AACnB,mBAAgC;AAChC,wBAAwB;AAExB,sBAAkD;AAMlD,kBAA8B;AAC9B,yBAAuB;AAEhB,MAAM,EAAE,cAAc,QAAI,2BAAQ,gBAAAA,WAAmB;AAE7C,SAAR,iBAAmC,EAAE,KAAK,GAA0B;AAC1E,SACC,4CAAC,6BAAc,MAAc,WAAU,+BACpC,eAAK,SAAS,cAAc,SAC7B;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,UAAO,gBAAI,gCAAiC;AAAA,MAE5C,sDAAC,qBAAK,MAAO,wBAAY,MAAO,IAAK;AAAA;AAAA,EACtC,GAEF;AAEF;",
|
|
6
|
+
"names": ["patternPrivateApis"]
|
|
7
|
+
}
|
|
@@ -1,64 +1,83 @@
|
|
|
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 ping_status_exports = {};
|
|
20
|
+
__export(ping_status_exports, {
|
|
21
|
+
default: () => ping_status_default
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
/**
|
|
11
|
-
* WordPress dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
23
|
+
module.exports = __toCommonJS(ping_status_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_i18n = require("@wordpress/i18n");
|
|
26
|
+
var import_components = require("@wordpress/components");
|
|
18
27
|
function PingStatusEdit({
|
|
19
28
|
data,
|
|
20
29
|
onChange
|
|
21
30
|
}) {
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const onTogglePingback = checked => {
|
|
31
|
+
const pingStatus = data?.ping_status ?? "open";
|
|
32
|
+
const onTogglePingback = (checked) => {
|
|
25
33
|
onChange({
|
|
26
34
|
...data,
|
|
27
|
-
ping_status: checked ?
|
|
35
|
+
ping_status: checked ? "open" : "closed"
|
|
28
36
|
});
|
|
29
37
|
};
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
import_components.CheckboxControl,
|
|
40
|
+
{
|
|
41
|
+
__nextHasNoMarginBottom: true,
|
|
42
|
+
label: (0, import_i18n.__)("Enable pingbacks & trackbacks"),
|
|
43
|
+
checked: pingStatus === "open",
|
|
44
|
+
onChange: onTogglePingback,
|
|
45
|
+
help: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
import_components.ExternalLink,
|
|
47
|
+
{
|
|
48
|
+
href: (0, import_i18n.__)(
|
|
49
|
+
"https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"
|
|
50
|
+
),
|
|
51
|
+
children: (0, import_i18n.__)("Learn more about pingbacks & trackbacks")
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
);
|
|
40
56
|
}
|
|
41
57
|
const pingStatusField = {
|
|
42
|
-
id:
|
|
43
|
-
label: (0,
|
|
44
|
-
type:
|
|
58
|
+
id: "ping_status",
|
|
59
|
+
label: (0, import_i18n.__)("Trackbacks & Pingbacks"),
|
|
60
|
+
type: "text",
|
|
45
61
|
Edit: PingStatusEdit,
|
|
46
62
|
enableSorting: false,
|
|
47
63
|
enableHiding: false,
|
|
48
64
|
filterBy: false,
|
|
49
|
-
elements: [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
65
|
+
elements: [
|
|
66
|
+
{
|
|
67
|
+
value: "open",
|
|
68
|
+
label: (0, import_i18n.__)("Allow"),
|
|
69
|
+
description: (0, import_i18n.__)(
|
|
70
|
+
"Allow link notifications from other blogs (pingbacks and trackbacks) on new articles."
|
|
71
|
+
)
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
value: "closed",
|
|
75
|
+
label: (0, import_i18n.__)("Don't allow"),
|
|
76
|
+
description: (0, import_i18n.__)(
|
|
77
|
+
"Don't allow link notifications from other blogs (pingbacks and trackbacks) on new articles."
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
]
|
|
58
81
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
* Ping status field for BasePost.
|
|
62
|
-
*/
|
|
63
|
-
var _default = exports.default = pingStatusField;
|
|
64
|
-
//# sourceMappingURL=index.js.map
|
|
82
|
+
var ping_status_default = pingStatusField;
|
|
83
|
+
//# sourceMappingURL=index.js.map
|