@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,64 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { useState } from '@wordpress/element';
|
|
11
|
-
import { commentAuthorAvatar as authorIcon } from '@wordpress/icons';
|
|
12
|
-
import { __experimentalHStack as HStack, Icon } from '@wordpress/components';
|
|
13
|
-
import { useSelect } from '@wordpress/data';
|
|
14
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
function AuthorView({
|
|
21
|
-
item
|
|
22
|
-
}) {
|
|
23
|
-
const {
|
|
24
|
-
text,
|
|
25
|
-
imageUrl
|
|
26
|
-
} = useSelect(select => {
|
|
27
|
-
const {
|
|
28
|
-
getEntityRecord
|
|
29
|
-
} = select(coreStore);
|
|
30
|
-
let user;
|
|
31
|
-
if (!!item.author) {
|
|
32
|
-
user = getEntityRecord('root', 'user', item.author);
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
imageUrl: user?.avatar_urls?.[48],
|
|
36
|
-
text: user?.name
|
|
37
|
-
};
|
|
38
|
-
}, [item]);
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { __ } from "@wordpress/i18n";
|
|
4
|
+
import { useState } from "@wordpress/element";
|
|
5
|
+
import { commentAuthorAvatar as authorIcon } from "@wordpress/icons";
|
|
6
|
+
import { __experimentalHStack as HStack, Icon } from "@wordpress/components";
|
|
7
|
+
function AuthorView({ item }) {
|
|
8
|
+
const text = item?._embedded?.author?.[0]?.name;
|
|
9
|
+
const imageUrl = item?._embedded?.author?.[0]?.avatar_urls?.[48];
|
|
39
10
|
const [isImageLoaded, setIsImageLoaded] = useState(false);
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})]
|
|
61
|
-
});
|
|
11
|
+
return /* @__PURE__ */ jsxs(HStack, { alignment: "left", spacing: 0, children: [
|
|
12
|
+
!!imageUrl && /* @__PURE__ */ jsx(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: clsx("page-templates-author-field__avatar", {
|
|
16
|
+
"is-loaded": isImageLoaded
|
|
17
|
+
}),
|
|
18
|
+
children: /* @__PURE__ */ jsx(
|
|
19
|
+
"img",
|
|
20
|
+
{
|
|
21
|
+
onLoad: () => setIsImageLoaded(true),
|
|
22
|
+
alt: __("Author avatar"),
|
|
23
|
+
src: imageUrl
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
!imageUrl && /* @__PURE__ */ jsx("div", { className: "page-templates-author-field__icon", children: /* @__PURE__ */ jsx(Icon, { icon: authorIcon }) }),
|
|
29
|
+
/* @__PURE__ */ jsx("span", { className: "page-templates-author-field__name", children: text })
|
|
30
|
+
] });
|
|
62
31
|
}
|
|
63
|
-
|
|
64
|
-
|
|
32
|
+
var author_view_default = AuthorView;
|
|
33
|
+
export {
|
|
34
|
+
author_view_default as default
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=author-view.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/author/author-view.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { commentAuthorAvatar as authorIcon } from '@wordpress/icons';\nimport { __experimentalHStack as HStack, Icon } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport type { BasePostWithEmbeddedAuthor } from '../../types';\n\nfunction AuthorView( { item }: { item: BasePostWithEmbeddedAuthor } ) {\n\tconst text = item?._embedded?.author?.[ 0 ]?.name;\n\tconst imageUrl = item?._embedded?.author?.[ 0 ]?.avatar_urls?.[ 48 ];\n\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 0 }>\n\t\t\t{ !! imageUrl && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx( 'page-templates-author-field__avatar', {\n\t\t\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\t\t\talt={ __( 'Author avatar' ) }\n\t\t\t\t\t\tsrc={ imageUrl }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ ! imageUrl && (\n\t\t\t\t<div className=\"page-templates-author-field__icon\">\n\t\t\t\t\t<Icon icon={ authorIcon } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<span className=\"page-templates-author-field__name\">{ text }</span>\n\t\t</HStack>\n\t);\n}\n\nexport default AuthorView;\n"],
|
|
5
|
+
"mappings": "AAwBE,SAOG,KAPH;AArBF,OAAO,UAAU;AAKjB,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB,kBAAkB;AAClD,SAAS,wBAAwB,QAAQ,YAAY;AAOrD,SAAS,WAAY,EAAE,KAAK,GAA0C;AACrE,QAAM,OAAO,MAAM,WAAW,SAAU,CAAE,GAAG;AAC7C,QAAM,WAAW,MAAM,WAAW,SAAU,CAAE,GAAG,cAAe,EAAG;AAEnE,QAAM,CAAE,eAAe,gBAAiB,IAAI,SAAU,KAAM;AAC5D,SACC,qBAAC,UAAO,WAAU,QAAO,SAAU,GAChC;AAAA,KAAC,CAAE,YACJ;AAAA,MAAC;AAAA;AAAA,QACA,WAAY,KAAM,uCAAuC;AAAA,UACxD,aAAa;AAAA,QACd,CAAE;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACA,QAAS,MAAM,iBAAkB,IAAK;AAAA,YACtC,KAAM,GAAI,eAAgB;AAAA,YAC1B,KAAM;AAAA;AAAA,QACP;AAAA;AAAA,IACD;AAAA,IAEC,CAAE,YACH,oBAAC,SAAI,WAAU,qCACd,8BAAC,QAAK,MAAO,YAAa,GAC3B;AAAA,IAED,oBAAC,UAAK,WAAU,qCAAsC,gBAAM;AAAA,KAC7D;AAEF;AAEA,IAAO,sBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,32 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import AuthorView from './author-view';
|
|
1
|
+
import { __ } from "@wordpress/i18n";
|
|
2
|
+
import AuthorView from "./author-view";
|
|
12
3
|
const authorField = {
|
|
13
|
-
label: __(
|
|
14
|
-
id:
|
|
15
|
-
type:
|
|
4
|
+
label: __("Author"),
|
|
5
|
+
id: "author",
|
|
6
|
+
type: "integer",
|
|
16
7
|
elements: [],
|
|
17
8
|
render: AuthorView,
|
|
18
9
|
sort: (a, b, direction) => {
|
|
19
|
-
const nameA = a._embedded?.author?.[0]?.name ||
|
|
20
|
-
const nameB = b._embedded?.author?.[0]?.name ||
|
|
21
|
-
return direction ===
|
|
10
|
+
const nameA = a._embedded?.author?.[0]?.name || "";
|
|
11
|
+
const nameB = b._embedded?.author?.[0]?.name || "";
|
|
12
|
+
return direction === "asc" ? nameA.localeCompare(nameB) : nameB.localeCompare(nameA);
|
|
22
13
|
},
|
|
23
14
|
filterBy: {
|
|
24
|
-
operators: [
|
|
15
|
+
operators: ["isAny", "isNone"]
|
|
25
16
|
}
|
|
26
17
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
18
|
+
var author_default = authorField;
|
|
19
|
+
export {
|
|
20
|
+
author_default as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/author/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 { BasePostWithEmbeddedAuthor } from '../../types';\nimport AuthorView from './author-view';\n\nconst authorField: Field< BasePostWithEmbeddedAuthor > = {\n\tlabel: __( 'Author' ),\n\tid: 'author',\n\ttype: 'integer',\n\telements: [],\n\trender: AuthorView,\n\tsort: ( a, b, direction ) => {\n\t\tconst nameA = a._embedded?.author?.[ 0 ]?.name || '';\n\t\tconst nameB = b._embedded?.author?.[ 0 ]?.name || '';\n\n\t\treturn direction === 'asc'\n\t\t\t? nameA.localeCompare( nameB )\n\t\t\t: nameB.localeCompare( nameA );\n\t},\n\n\tfilterBy: {\n\t\toperators: [ 'isAny', 'isNone' ],\n\t},\n};\n\n/**\n * Author field for BasePost.\n */\nexport default authorField;\n"],
|
|
5
|
+
"mappings": "AAIA,SAAS,UAAU;AAMnB,OAAO,gBAAgB;AAEvB,MAAM,cAAmD;AAAA,EACxD,OAAO,GAAI,QAAS;AAAA,EACpB,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,UAAU,CAAC;AAAA,EACX,QAAQ;AAAA,EACR,MAAM,CAAE,GAAG,GAAG,cAAe;AAC5B,UAAM,QAAQ,EAAE,WAAW,SAAU,CAAE,GAAG,QAAQ;AAClD,UAAM,QAAQ,EAAE,WAAW,SAAU,CAAE,GAAG,QAAQ;AAElD,WAAO,cAAc,QAClB,MAAM,cAAe,KAAM,IAC3B,MAAM,cAAe,KAAM;AAAA,EAC/B;AAAA,EAEA,UAAU;AAAA,IACT,WAAW,CAAE,SAAS,QAAS;AAAA,EAChC;AACD;AAKA,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,34 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
1
|
+
import { __ } from "@wordpress/i18n";
|
|
11
2
|
const commentStatusField = {
|
|
12
|
-
id:
|
|
13
|
-
label: __(
|
|
14
|
-
type:
|
|
15
|
-
Edit:
|
|
3
|
+
id: "comment_status",
|
|
4
|
+
label: __("Comments"),
|
|
5
|
+
type: "text",
|
|
6
|
+
Edit: "radio",
|
|
16
7
|
enableSorting: false,
|
|
17
8
|
enableHiding: false,
|
|
18
9
|
filterBy: false,
|
|
19
|
-
elements: [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
elements: [
|
|
11
|
+
{
|
|
12
|
+
value: "open",
|
|
13
|
+
label: __("Open"),
|
|
14
|
+
description: __("Visitors can add new comments and replies.")
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: "closed",
|
|
18
|
+
label: __("Closed"),
|
|
19
|
+
description: __(
|
|
20
|
+
"Visitors cannot add new comments or replies. Existing comments remain visible."
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
]
|
|
28
24
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
25
|
+
var comment_status_default = commentStatusField;
|
|
26
|
+
export {
|
|
27
|
+
comment_status_default as default
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/comment-status/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';\n\nconst commentStatusField: Field< BasePost > = {\n\tid: 'comment_status',\n\tlabel: __( 'Comments' ),\n\ttype: 'text',\n\tEdit: 'radio',\n\tenableSorting: false,\n\tenableHiding: false,\n\tfilterBy: false,\n\telements: [\n\t\t{\n\t\t\tvalue: 'open',\n\t\t\tlabel: __( 'Open' ),\n\t\t\tdescription: __( 'Visitors can add new comments and replies.' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'closed',\n\t\t\tlabel: __( 'Closed' ),\n\t\t\tdescription: __(\n\t\t\t\t'Visitors cannot add new comments or replies. Existing comments remain visible.'\n\t\t\t),\n\t\t},\n\t],\n};\n\n/**\n * Comment status field for BasePost.\n */\nexport default commentStatusField;\n"],
|
|
5
|
+
"mappings": "AAIA,SAAS,UAAU;AAOnB,MAAM,qBAAwC;AAAA,EAC7C,IAAI;AAAA,EACJ,OAAO,GAAI,UAAW;AAAA,EACtB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,eAAe;AAAA,EACf,cAAc;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AAAA,IACT;AAAA,MACC,OAAO;AAAA,MACP,OAAO,GAAI,MAAO;AAAA,MAClB,aAAa,GAAI,4CAA6C;AAAA,IAC/D;AAAA,IACA;AAAA,MACC,OAAO;AAAA,MACP,OAAO,GAAI,QAAS;AAAA,MACpB,aAAa;AAAA,QACZ;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAKA,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,62 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const DateView = ({
|
|
14
|
-
item
|
|
15
|
-
}) => {
|
|
16
|
-
var _item$status, _item$modified, _item$date4, _item$date5;
|
|
17
|
-
const isDraftOrPrivate = ['draft', 'private'].includes((_item$status = item.status) !== null && _item$status !== void 0 ? _item$status : '');
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { __, sprintf } from "@wordpress/i18n";
|
|
3
|
+
import { createInterpolateElement } from "@wordpress/element";
|
|
4
|
+
import { dateI18n, getDate, getSettings } from "@wordpress/date";
|
|
5
|
+
const getFormattedDate = (dateToDisplay) => dateI18n(
|
|
6
|
+
getSettings().formats.datetimeAbbreviated,
|
|
7
|
+
getDate(dateToDisplay)
|
|
8
|
+
);
|
|
9
|
+
const DateView = ({ item }) => {
|
|
10
|
+
const isDraftOrPrivate = ["draft", "private"].includes(
|
|
11
|
+
item.status ?? ""
|
|
12
|
+
);
|
|
18
13
|
if (isDraftOrPrivate) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
return createInterpolateElement(
|
|
15
|
+
sprintf(
|
|
16
|
+
/* translators: %s: page creation or modification date. */
|
|
17
|
+
__("<span>Modified: <time>%s</time></span>"),
|
|
18
|
+
getFormattedDate(item.date ?? null)
|
|
19
|
+
),
|
|
20
|
+
{
|
|
21
|
+
span: /* @__PURE__ */ jsx("span", {}),
|
|
22
|
+
time: /* @__PURE__ */ jsx("time", {})
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
25
|
}
|
|
26
|
-
const isScheduled = item.status ===
|
|
26
|
+
const isScheduled = item.status === "future";
|
|
27
27
|
if (isScheduled) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
return createInterpolateElement(
|
|
29
|
+
sprintf(
|
|
30
|
+
/* translators: %s: page creation date */
|
|
31
|
+
__("<span>Scheduled: <time>%s</time></span>"),
|
|
32
|
+
getFormattedDate(item.date ?? null)
|
|
33
|
+
),
|
|
34
|
+
{
|
|
35
|
+
span: /* @__PURE__ */ jsx("span", {}),
|
|
36
|
+
time: /* @__PURE__ */ jsx("time", {})
|
|
37
|
+
}
|
|
38
|
+
);
|
|
34
39
|
}
|
|
35
|
-
const isPublished = item.status ===
|
|
40
|
+
const isPublished = item.status === "publish";
|
|
36
41
|
if (isPublished) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
return createInterpolateElement(
|
|
43
|
+
sprintf(
|
|
44
|
+
/* translators: %s: page creation time */
|
|
45
|
+
__("<span>Published: <time>%s</time></span>"),
|
|
46
|
+
getFormattedDate(item.date ?? null)
|
|
47
|
+
),
|
|
48
|
+
{
|
|
49
|
+
span: /* @__PURE__ */ jsx("span", {}),
|
|
50
|
+
time: /* @__PURE__ */ jsx("time", {})
|
|
51
|
+
}
|
|
52
|
+
);
|
|
43
53
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const dateToDisplay = getDate((_item$modified = item.modified) !== null && _item$modified !== void 0 ? _item$modified : null) > getDate((_item$date4 = item.date) !== null && _item$date4 !== void 0 ? _item$date4 : null) ? item.modified : item.date;
|
|
47
|
-
const isPending = item.status === 'pending';
|
|
54
|
+
const dateToDisplay = getDate(item.modified ?? null) > getDate(item.date ?? null) ? item.modified : item.date;
|
|
55
|
+
const isPending = item.status === "pending";
|
|
48
56
|
if (isPending) {
|
|
49
|
-
return createInterpolateElement(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
return createInterpolateElement(
|
|
58
|
+
sprintf(
|
|
59
|
+
/* translators: %s: page creation or modification date. */
|
|
60
|
+
__("<span>Modified: <time>%s</time></span>"),
|
|
61
|
+
getFormattedDate(dateToDisplay ?? null)
|
|
62
|
+
),
|
|
63
|
+
{
|
|
64
|
+
span: /* @__PURE__ */ jsx("span", {}),
|
|
65
|
+
time: /* @__PURE__ */ jsx("time", {})
|
|
66
|
+
}
|
|
67
|
+
);
|
|
54
68
|
}
|
|
55
|
-
|
|
56
|
-
// Unknow status.
|
|
57
|
-
return /*#__PURE__*/_jsx("time", {
|
|
58
|
-
children: getFormattedDate((_item$date5 = item.date) !== null && _item$date5 !== void 0 ? _item$date5 : null)
|
|
59
|
-
});
|
|
69
|
+
return /* @__PURE__ */ jsx("time", { children: getFormattedDate(item.date ?? null) });
|
|
60
70
|
};
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
var date_view_default = DateView;
|
|
72
|
+
export {
|
|
73
|
+
date_view_default as default
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=date-view.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/date/date-view.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { dateI18n, getDate, getSettings } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nconst getFormattedDate = ( dateToDisplay: string | null ) =>\n\tdateI18n(\n\t\tgetSettings().formats.datetimeAbbreviated,\n\t\tgetDate( dateToDisplay )\n\t);\n\nconst DateView = ( { item }: { item: BasePost } ) => {\n\tconst isDraftOrPrivate = [ 'draft', 'private' ].includes(\n\t\titem.status ?? ''\n\t);\n\tif ( isDraftOrPrivate ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation or modification date. */\n\t\t\t\t__( '<span>Modified: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( item.date ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\tconst isScheduled = item.status === 'future';\n\tif ( isScheduled ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation date */\n\t\t\t\t__( '<span>Scheduled: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( item.date ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\tconst isPublished = item.status === 'publish';\n\tif ( isPublished ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation time */\n\t\t\t\t__( '<span>Published: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( item.date ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\t// Pending posts show the modified date if it's newer.\n\tconst dateToDisplay =\n\t\tgetDate( item.modified ?? null ) > getDate( item.date ?? null )\n\t\t\t? item.modified\n\t\t\t: item.date;\n\n\tconst isPending = item.status === 'pending';\n\tif ( isPending ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: page creation or modification date. */\n\t\t\t\t__( '<span>Modified: <time>%s</time></span>' ),\n\t\t\t\tgetFormattedDate( dateToDisplay ?? null )\n\t\t\t),\n\t\t\t{\n\t\t\t\tspan: <span />,\n\t\t\t\ttime: <time />,\n\t\t\t}\n\t\t);\n\t}\n\n\t// Unknow status.\n\treturn <time>{ getFormattedDate( item.date ?? null ) }</time>;\n};\n\nexport default DateView;\n"],
|
|
5
|
+
"mappings": "AA8BU;AA3BV,SAAS,IAAI,eAAe;AAC5B,SAAS,gCAAgC;AACzC,SAAS,UAAU,SAAS,mBAAmB;AAO/C,MAAM,mBAAmB,CAAE,kBAC1B;AAAA,EACC,YAAY,EAAE,QAAQ;AAAA,EACtB,QAAS,aAAc;AACxB;AAED,MAAM,WAAW,CAAE,EAAE,KAAK,MAA2B;AACpD,QAAM,mBAAmB,CAAE,SAAS,SAAU,EAAE;AAAA,IAC/C,KAAK,UAAU;AAAA,EAChB;AACA,MAAK,kBAAmB;AACvB,WAAO;AAAA,MACN;AAAA;AAAA,QAEC,GAAI,wCAAyC;AAAA,QAC7C,iBAAkB,KAAK,QAAQ,IAAK;AAAA,MACrC;AAAA,MACA;AAAA,QACC,MAAM,oBAAC,UAAK;AAAA,QACZ,MAAM,oBAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAEA,QAAM,cAAc,KAAK,WAAW;AACpC,MAAK,aAAc;AAClB,WAAO;AAAA,MACN;AAAA;AAAA,QAEC,GAAI,yCAA0C;AAAA,QAC9C,iBAAkB,KAAK,QAAQ,IAAK;AAAA,MACrC;AAAA,MACA;AAAA,QACC,MAAM,oBAAC,UAAK;AAAA,QACZ,MAAM,oBAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAEA,QAAM,cAAc,KAAK,WAAW;AACpC,MAAK,aAAc;AAClB,WAAO;AAAA,MACN;AAAA;AAAA,QAEC,GAAI,yCAA0C;AAAA,QAC9C,iBAAkB,KAAK,QAAQ,IAAK;AAAA,MACrC;AAAA,MACA;AAAA,QACC,MAAM,oBAAC,UAAK;AAAA,QACZ,MAAM,oBAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAGA,QAAM,gBACL,QAAS,KAAK,YAAY,IAAK,IAAI,QAAS,KAAK,QAAQ,IAAK,IAC3D,KAAK,WACL,KAAK;AAET,QAAM,YAAY,KAAK,WAAW;AAClC,MAAK,WAAY;AAChB,WAAO;AAAA,MACN;AAAA;AAAA,QAEC,GAAI,wCAAyC;AAAA,QAC7C,iBAAkB,iBAAiB,IAAK;AAAA,MACzC;AAAA,MACA;AAAA,QACC,MAAM,oBAAC,UAAK;AAAA,QACZ,MAAM,oBAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAGA,SAAO,oBAAC,UAAO,2BAAkB,KAAK,QAAQ,IAAK,GAAG;AACvD;AAEA,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import DateView from './date-view';
|
|
1
|
+
import { __ } from "@wordpress/i18n";
|
|
2
|
+
import DateView from "./date-view";
|
|
12
3
|
const dateField = {
|
|
13
|
-
id:
|
|
14
|
-
type:
|
|
15
|
-
label: __(
|
|
4
|
+
id: "date",
|
|
5
|
+
type: "datetime",
|
|
6
|
+
label: __("Date"),
|
|
16
7
|
render: DateView,
|
|
17
8
|
filterBy: false
|
|
18
9
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
10
|
+
var date_default = dateField;
|
|
11
|
+
export {
|
|
12
|
+
date_default as default
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/date/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 DateView from './date-view';\n\nconst dateField: Field< BasePost > = {\n\tid: 'date',\n\ttype: 'datetime',\n\tlabel: __( 'Date' ),\n\trender: DateView,\n\tfilterBy: false,\n};\n\n/**\n * Date field for BasePost.\n */\nexport default dateField;\n"],
|
|
5
|
+
"mappings": "AAIA,SAAS,UAAU;AAMnB,OAAO,cAAc;AAErB,MAAM,YAA+B;AAAA,EACpC,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO,GAAI,MAAO;AAAA,EAClB,QAAQ;AAAA,EACR,UAAU;AACX;AAKA,IAAO,eAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,37 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
1
|
+
import { __ } from "@wordpress/i18n";
|
|
11
2
|
const discussionField = {
|
|
12
|
-
id:
|
|
13
|
-
label: __(
|
|
14
|
-
type:
|
|
15
|
-
render: ({
|
|
16
|
-
item
|
|
17
|
-
|
|
18
|
-
const commentsOpen = item.comment_status === 'open';
|
|
19
|
-
const pingsOpen = item.ping_status === 'open';
|
|
3
|
+
id: "discussion",
|
|
4
|
+
label: __("Discussion"),
|
|
5
|
+
type: "text",
|
|
6
|
+
render: ({ item }) => {
|
|
7
|
+
const commentsOpen = item.comment_status === "open";
|
|
8
|
+
const pingsOpen = item.ping_status === "open";
|
|
20
9
|
if (commentsOpen && pingsOpen) {
|
|
21
|
-
return __(
|
|
10
|
+
return __("Open");
|
|
22
11
|
}
|
|
23
12
|
if (commentsOpen && !pingsOpen) {
|
|
24
|
-
return __(
|
|
13
|
+
return __("Comments only");
|
|
25
14
|
}
|
|
26
15
|
if (!commentsOpen && pingsOpen) {
|
|
27
|
-
return __(
|
|
16
|
+
return __("Pings only");
|
|
28
17
|
}
|
|
29
|
-
return __(
|
|
30
|
-
}
|
|
18
|
+
return __("Closed");
|
|
19
|
+
},
|
|
20
|
+
filterBy: false
|
|
31
21
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
|
22
|
+
var discussion_default = discussionField;
|
|
23
|
+
export {
|
|
24
|
+
discussion_default as default
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/discussion/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';\n\nconst discussionField: Field< BasePost > = {\n\tid: 'discussion',\n\tlabel: __( 'Discussion' ),\n\ttype: 'text',\n\trender: ( { item } ) => {\n\t\tconst commentsOpen = item.comment_status === 'open';\n\t\tconst pingsOpen = item.ping_status === 'open';\n\n\t\tif ( commentsOpen && pingsOpen ) {\n\t\t\treturn __( 'Open' );\n\t\t}\n\t\tif ( commentsOpen && ! pingsOpen ) {\n\t\t\treturn __( 'Comments only' );\n\t\t}\n\t\tif ( ! commentsOpen && pingsOpen ) {\n\t\t\treturn __( 'Pings only' );\n\t\t}\n\t\treturn __( 'Closed' );\n\t},\n\tfilterBy: false,\n};\n\n/**\n * Discussion field for BasePost with custom render logic.\n */\nexport default discussionField;\n"],
|
|
5
|
+
"mappings": "AAIA,SAAS,UAAU;AAOnB,MAAM,kBAAqC;AAAA,EAC1C,IAAI;AAAA,EACJ,OAAO,GAAI,YAAa;AAAA,EACxB,MAAM;AAAA,EACN,QAAQ,CAAE,EAAE,KAAK,MAAO;AACvB,UAAM,eAAe,KAAK,mBAAmB;AAC7C,UAAM,YAAY,KAAK,gBAAgB;AAEvC,QAAK,gBAAgB,WAAY;AAChC,aAAO,GAAI,MAAO;AAAA,IACnB;AACA,QAAK,gBAAgB,CAAE,WAAY;AAClC,aAAO,GAAI,eAAgB;AAAA,IAC5B;AACA,QAAK,CAAE,gBAAgB,WAAY;AAClC,aAAO,GAAI,YAAa;AAAA,IACzB;AACA,WAAO,GAAI,QAAS;AAAA,EACrB;AAAA,EACA,UAAU;AACX;AAKA,IAAO,qBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|