@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,72 +1,66 @@
|
|
|
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 author_view_exports = {};
|
|
30
|
+
__export(author_view_exports, {
|
|
31
|
+
default: () => author_view_default
|
|
6
32
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let user;
|
|
39
|
-
if (!!item.author) {
|
|
40
|
-
user = getEntityRecord('root', 'user', item.author);
|
|
41
|
-
}
|
|
42
|
-
return {
|
|
43
|
-
imageUrl: user?.avatar_urls?.[48],
|
|
44
|
-
text: user?.name
|
|
45
|
-
};
|
|
46
|
-
}, [item]);
|
|
47
|
-
const [isImageLoaded, setIsImageLoaded] = (0, _element.useState)(false);
|
|
48
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
49
|
-
alignment: "left",
|
|
50
|
-
spacing: 0,
|
|
51
|
-
children: [!!imageUrl && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
52
|
-
className: (0, _clsx.default)('page-templates-author-field__avatar', {
|
|
53
|
-
'is-loaded': isImageLoaded
|
|
54
|
-
}),
|
|
55
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
56
|
-
onLoad: () => setIsImageLoaded(true),
|
|
57
|
-
alt: (0, _i18n.__)('Author avatar'),
|
|
58
|
-
src: imageUrl
|
|
59
|
-
})
|
|
60
|
-
}), !imageUrl && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
61
|
-
className: "page-templates-author-field__icon",
|
|
62
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
63
|
-
icon: _icons.commentAuthorAvatar
|
|
64
|
-
})
|
|
65
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
66
|
-
className: "page-templates-author-field__name",
|
|
67
|
-
children: text
|
|
68
|
-
})]
|
|
69
|
-
});
|
|
33
|
+
module.exports = __toCommonJS(author_view_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_clsx = __toESM(require("clsx"));
|
|
36
|
+
var import_i18n = require("@wordpress/i18n");
|
|
37
|
+
var import_element = require("@wordpress/element");
|
|
38
|
+
var import_icons = require("@wordpress/icons");
|
|
39
|
+
var import_components = require("@wordpress/components");
|
|
40
|
+
function AuthorView({ item }) {
|
|
41
|
+
const text = item?._embedded?.author?.[0]?.name;
|
|
42
|
+
const imageUrl = item?._embedded?.author?.[0]?.avatar_urls?.[48];
|
|
43
|
+
const [isImageLoaded, setIsImageLoaded] = (0, import_element.useState)(false);
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { alignment: "left", spacing: 0, children: [
|
|
45
|
+
!!imageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: (0, import_clsx.default)("page-templates-author-field__avatar", {
|
|
49
|
+
"is-loaded": isImageLoaded
|
|
50
|
+
}),
|
|
51
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
"img",
|
|
53
|
+
{
|
|
54
|
+
onLoad: () => setIsImageLoaded(true),
|
|
55
|
+
alt: (0, import_i18n.__)("Author avatar"),
|
|
56
|
+
src: imageUrl
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
!imageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "page-templates-author-field__icon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Icon, { icon: import_icons.commentAuthorAvatar }) }),
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-templates-author-field__name", children: text })
|
|
63
|
+
] });
|
|
70
64
|
}
|
|
71
|
-
var
|
|
72
|
-
//# sourceMappingURL=author-view.js.map
|
|
65
|
+
var author_view_default = AuthorView;
|
|
66
|
+
//# 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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBE;AArBF,kBAAiB;AAKjB,kBAAmB;AACnB,qBAAyB;AACzB,mBAAkD;AAClD,wBAAqD;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,QAAI,yBAAU,KAAM;AAC5D,SACC,6CAAC,kBAAAA,sBAAA,EAAO,WAAU,QAAO,SAAU,GAChC;AAAA,KAAC,CAAE,YACJ;AAAA,MAAC;AAAA;AAAA,QACA,eAAY,YAAAC,SAAM,uCAAuC;AAAA,UACxD,aAAa;AAAA,QACd,CAAE;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACA,QAAS,MAAM,iBAAkB,IAAK;AAAA,YACtC,SAAM,gBAAI,eAAgB;AAAA,YAC1B,KAAM;AAAA;AAAA,QACP;AAAA;AAAA,IACD;AAAA,IAEC,CAAE,YACH,4CAAC,SAAI,WAAU,qCACd,sDAAC,0BAAK,MAAO,aAAAC,qBAAa,GAC3B;AAAA,IAED,4CAAC,UAAK,WAAU,qCAAsC,gBAAM;AAAA,KAC7D;AAEF;AAEA,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["HStack", "clsx", "authorIcon"]
|
|
7
|
+
}
|
|
@@ -1,38 +1,52 @@
|
|
|
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 author_exports = {};
|
|
30
|
+
__export(author_exports, {
|
|
31
|
+
default: () => author_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(author_exports);
|
|
34
|
+
var import_i18n = require("@wordpress/i18n");
|
|
35
|
+
var import_author_view = __toESM(require("./author-view"));
|
|
18
36
|
const authorField = {
|
|
19
|
-
label: (0,
|
|
20
|
-
id:
|
|
21
|
-
type:
|
|
37
|
+
label: (0, import_i18n.__)("Author"),
|
|
38
|
+
id: "author",
|
|
39
|
+
type: "integer",
|
|
22
40
|
elements: [],
|
|
23
|
-
render:
|
|
41
|
+
render: import_author_view.default,
|
|
24
42
|
sort: (a, b, direction) => {
|
|
25
|
-
const nameA = a._embedded?.author?.[0]?.name ||
|
|
26
|
-
const nameB = b._embedded?.author?.[0]?.name ||
|
|
27
|
-
return direction ===
|
|
43
|
+
const nameA = a._embedded?.author?.[0]?.name || "";
|
|
44
|
+
const nameB = b._embedded?.author?.[0]?.name || "";
|
|
45
|
+
return direction === "asc" ? nameA.localeCompare(nameB) : nameB.localeCompare(nameA);
|
|
28
46
|
},
|
|
29
47
|
filterBy: {
|
|
30
|
-
operators: [
|
|
48
|
+
operators: ["isAny", "isNone"]
|
|
31
49
|
}
|
|
32
50
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* Author field for BasePost.
|
|
36
|
-
*/
|
|
37
|
-
var _default = exports.default = authorField;
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
|
51
|
+
var author_default = authorField;
|
|
52
|
+
//# 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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAMnB,yBAAuB;AAEvB,MAAM,cAAmD;AAAA,EACxD,WAAO,gBAAI,QAAS;AAAA,EACpB,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,UAAU,CAAC;AAAA,EACX,QAAQ,mBAAAA;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": ["AuthorView"]
|
|
7
|
+
}
|
|
@@ -1,39 +1,49 @@
|
|
|
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 comment_status_exports = {};
|
|
20
|
+
__export(comment_status_exports, {
|
|
21
|
+
default: () => comment_status_default
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
|
|
23
|
+
module.exports = __toCommonJS(comment_status_exports);
|
|
24
|
+
var import_i18n = require("@wordpress/i18n");
|
|
16
25
|
const commentStatusField = {
|
|
17
|
-
id:
|
|
18
|
-
label: (0,
|
|
19
|
-
type:
|
|
20
|
-
Edit:
|
|
26
|
+
id: "comment_status",
|
|
27
|
+
label: (0, import_i18n.__)("Comments"),
|
|
28
|
+
type: "text",
|
|
29
|
+
Edit: "radio",
|
|
21
30
|
enableSorting: false,
|
|
22
31
|
enableHiding: false,
|
|
23
32
|
filterBy: false,
|
|
24
|
-
elements: [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
elements: [
|
|
34
|
+
{
|
|
35
|
+
value: "open",
|
|
36
|
+
label: (0, import_i18n.__)("Open"),
|
|
37
|
+
description: (0, import_i18n.__)("Visitors can add new comments and replies.")
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: "closed",
|
|
41
|
+
label: (0, import_i18n.__)("Closed"),
|
|
42
|
+
description: (0, import_i18n.__)(
|
|
43
|
+
"Visitors cannot add new comments or replies. Existing comments remain visible."
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
]
|
|
33
47
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* Comment status field for BasePost.
|
|
37
|
-
*/
|
|
38
|
-
var _default = exports.default = commentStatusField;
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
48
|
+
var comment_status_default = commentStatusField;
|
|
49
|
+
//# 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": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAOnB,MAAM,qBAAwC;AAAA,EAC7C,IAAI;AAAA,EACJ,WAAO,gBAAI,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,WAAO,gBAAI,MAAO;AAAA,MAClB,iBAAa,gBAAI,4CAA6C;AAAA,IAC/D;AAAA,IACA;AAAA,MACC,OAAO;AAAA,MACP,WAAO,gBAAI,QAAS;AAAA,MACpB,iBAAa;AAAA,QACZ;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAKA,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,69 +1,95 @@
|
|
|
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 date_view_exports = {};
|
|
20
|
+
__export(date_view_exports, {
|
|
21
|
+
default: () => date_view_default
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const getFormattedDate = dateToDisplay => (0, _date.dateI18n)((0, _date.getSettings)().formats.datetimeAbbreviated, (0, _date.getDate)(dateToDisplay));
|
|
20
|
-
const DateView = ({
|
|
21
|
-
item
|
|
22
|
-
}) => {
|
|
23
|
-
var _item$status, _item$modified, _item$date4, _item$date5;
|
|
24
|
-
const isDraftOrPrivate = ['draft', 'private'].includes((_item$status = item.status) !== null && _item$status !== void 0 ? _item$status : '');
|
|
23
|
+
module.exports = __toCommonJS(date_view_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_i18n = require("@wordpress/i18n");
|
|
26
|
+
var import_element = require("@wordpress/element");
|
|
27
|
+
var import_date = require("@wordpress/date");
|
|
28
|
+
const getFormattedDate = (dateToDisplay) => (0, import_date.dateI18n)(
|
|
29
|
+
(0, import_date.getSettings)().formats.datetimeAbbreviated,
|
|
30
|
+
(0, import_date.getDate)(dateToDisplay)
|
|
31
|
+
);
|
|
32
|
+
const DateView = ({ item }) => {
|
|
33
|
+
const isDraftOrPrivate = ["draft", "private"].includes(
|
|
34
|
+
item.status ?? ""
|
|
35
|
+
);
|
|
25
36
|
if (isDraftOrPrivate) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
return (0, import_element.createInterpolateElement)(
|
|
38
|
+
(0, import_i18n.sprintf)(
|
|
39
|
+
/* translators: %s: page creation or modification date. */
|
|
40
|
+
(0, import_i18n.__)("<span>Modified: <time>%s</time></span>"),
|
|
41
|
+
getFormattedDate(item.date ?? null)
|
|
42
|
+
),
|
|
43
|
+
{
|
|
44
|
+
span: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
|
|
45
|
+
time: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {})
|
|
46
|
+
}
|
|
47
|
+
);
|
|
32
48
|
}
|
|
33
|
-
const isScheduled = item.status ===
|
|
49
|
+
const isScheduled = item.status === "future";
|
|
34
50
|
if (isScheduled) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
return (0, import_element.createInterpolateElement)(
|
|
52
|
+
(0, import_i18n.sprintf)(
|
|
53
|
+
/* translators: %s: page creation date */
|
|
54
|
+
(0, import_i18n.__)("<span>Scheduled: <time>%s</time></span>"),
|
|
55
|
+
getFormattedDate(item.date ?? null)
|
|
56
|
+
),
|
|
57
|
+
{
|
|
58
|
+
span: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
|
|
59
|
+
time: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {})
|
|
60
|
+
}
|
|
61
|
+
);
|
|
41
62
|
}
|
|
42
|
-
const isPublished = item.status ===
|
|
63
|
+
const isPublished = item.status === "publish";
|
|
43
64
|
if (isPublished) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
65
|
+
return (0, import_element.createInterpolateElement)(
|
|
66
|
+
(0, import_i18n.sprintf)(
|
|
67
|
+
/* translators: %s: page creation time */
|
|
68
|
+
(0, import_i18n.__)("<span>Published: <time>%s</time></span>"),
|
|
69
|
+
getFormattedDate(item.date ?? null)
|
|
70
|
+
),
|
|
71
|
+
{
|
|
72
|
+
span: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
|
|
73
|
+
time: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {})
|
|
74
|
+
}
|
|
75
|
+
);
|
|
50
76
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const dateToDisplay = (0, _date.getDate)((_item$modified = item.modified) !== null && _item$modified !== void 0 ? _item$modified : null) > (0, _date.getDate)((_item$date4 = item.date) !== null && _item$date4 !== void 0 ? _item$date4 : null) ? item.modified : item.date;
|
|
54
|
-
const isPending = item.status === 'pending';
|
|
77
|
+
const dateToDisplay = (0, import_date.getDate)(item.modified ?? null) > (0, import_date.getDate)(item.date ?? null) ? item.modified : item.date;
|
|
78
|
+
const isPending = item.status === "pending";
|
|
55
79
|
if (isPending) {
|
|
56
|
-
return (0,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
80
|
+
return (0, import_element.createInterpolateElement)(
|
|
81
|
+
(0, import_i18n.sprintf)(
|
|
82
|
+
/* translators: %s: page creation or modification date. */
|
|
83
|
+
(0, import_i18n.__)("<span>Modified: <time>%s</time></span>"),
|
|
84
|
+
getFormattedDate(dateToDisplay ?? null)
|
|
85
|
+
),
|
|
86
|
+
{
|
|
87
|
+
span: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
|
|
88
|
+
time: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {})
|
|
89
|
+
}
|
|
90
|
+
);
|
|
61
91
|
}
|
|
62
|
-
|
|
63
|
-
// Unknow status.
|
|
64
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
|
|
65
|
-
children: getFormattedDate((_item$date5 = item.date) !== null && _item$date5 !== void 0 ? _item$date5 : null)
|
|
66
|
-
});
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", { children: getFormattedDate(item.date ?? null) });
|
|
67
93
|
};
|
|
68
|
-
var
|
|
69
|
-
//# sourceMappingURL=date-view.js.map
|
|
94
|
+
var date_view_default = DateView;
|
|
95
|
+
//# 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": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BU;AA3BV,kBAA4B;AAC5B,qBAAyC;AACzC,kBAA+C;AAO/C,MAAM,mBAAmB,CAAE,sBAC1B;AAAA,MACC,yBAAY,EAAE,QAAQ;AAAA,MACtB,qBAAS,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,eAAO;AAAA,UACN;AAAA;AAAA,YAEC,gBAAI,wCAAyC;AAAA,QAC7C,iBAAkB,KAAK,QAAQ,IAAK;AAAA,MACrC;AAAA,MACA;AAAA,QACC,MAAM,4CAAC,UAAK;AAAA,QACZ,MAAM,4CAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAEA,QAAM,cAAc,KAAK,WAAW;AACpC,MAAK,aAAc;AAClB,eAAO;AAAA,UACN;AAAA;AAAA,YAEC,gBAAI,yCAA0C;AAAA,QAC9C,iBAAkB,KAAK,QAAQ,IAAK;AAAA,MACrC;AAAA,MACA;AAAA,QACC,MAAM,4CAAC,UAAK;AAAA,QACZ,MAAM,4CAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAEA,QAAM,cAAc,KAAK,WAAW;AACpC,MAAK,aAAc;AAClB,eAAO;AAAA,UACN;AAAA;AAAA,YAEC,gBAAI,yCAA0C;AAAA,QAC9C,iBAAkB,KAAK,QAAQ,IAAK;AAAA,MACrC;AAAA,MACA;AAAA,QACC,MAAM,4CAAC,UAAK;AAAA,QACZ,MAAM,4CAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAGA,QAAM,oBACL,qBAAS,KAAK,YAAY,IAAK,QAAI,qBAAS,KAAK,QAAQ,IAAK,IAC3D,KAAK,WACL,KAAK;AAET,QAAM,YAAY,KAAK,WAAW;AAClC,MAAK,WAAY;AAChB,eAAO;AAAA,UACN;AAAA;AAAA,YAEC,gBAAI,wCAAyC;AAAA,QAC7C,iBAAkB,iBAAiB,IAAK;AAAA,MACzC;AAAA,MACA;AAAA,QACC,MAAM,4CAAC,UAAK;AAAA,QACZ,MAAM,4CAAC,UAAK;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAGA,SAAO,4CAAC,UAAO,2BAAkB,KAAK,QAAQ,IAAK,GAAG;AACvD;AAEA,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,30 +1,44 @@
|
|
|
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 date_exports = {};
|
|
30
|
+
__export(date_exports, {
|
|
31
|
+
default: () => date_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(date_exports);
|
|
34
|
+
var import_i18n = require("@wordpress/i18n");
|
|
35
|
+
var import_date_view = __toESM(require("./date-view"));
|
|
18
36
|
const dateField = {
|
|
19
|
-
id:
|
|
20
|
-
type:
|
|
21
|
-
label: (0,
|
|
22
|
-
render:
|
|
37
|
+
id: "date",
|
|
38
|
+
type: "datetime",
|
|
39
|
+
label: (0, import_i18n.__)("Date"),
|
|
40
|
+
render: import_date_view.default,
|
|
23
41
|
filterBy: false
|
|
24
42
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* Date field for BasePost.
|
|
28
|
-
*/
|
|
29
|
-
var _default = exports.default = dateField;
|
|
30
|
-
//# sourceMappingURL=index.js.map
|
|
43
|
+
var date_default = dateField;
|
|
44
|
+
//# 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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAMnB,uBAAqB;AAErB,MAAM,YAA+B;AAAA,EACpC,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,MAAO;AAAA,EAClB,QAAQ,iBAAAA;AAAA,EACR,UAAU;AACX;AAKA,IAAO,eAAQ;",
|
|
6
|
+
"names": ["DateView"]
|
|
7
|
+
}
|