@wordpress/fields 0.40.1 → 0.41.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/CHANGELOG.md +2 -0
- package/README.md +44 -0
- package/build/actions/rename-post.cjs +0 -1
- package/build/actions/rename-post.cjs.map +2 -2
- package/build/components/create-template-part-modal/index.cjs +0 -1
- package/build/components/create-template-part-modal/index.cjs.map +2 -2
- package/build/components/media-edit/index.cjs.map +2 -2
- package/build/fields/description/index.cjs +70 -0
- package/build/fields/description/index.cjs.map +7 -0
- package/build/fields/index.cjs +24 -2
- package/build/fields/index.cjs.map +2 -2
- package/build/fields/last-edited/index.cjs +51 -0
- package/build/fields/last-edited/index.cjs.map +7 -0
- package/build/fields/last-edited/last-edited-date-view.cjs +40 -0
- package/build/fields/last-edited/last-edited-date-view.cjs.map +7 -0
- package/build/fields/parent/parent-edit.cjs +1 -1
- package/build/fields/parent/parent-edit.cjs.map +2 -2
- package/build/fields/password/edit.cjs +0 -1
- package/build/fields/password/edit.cjs.map +2 -2
- package/build/fields/pattern-title/view.cjs.map +2 -2
- package/build/fields/posts-page-title/index.cjs +47 -0
- package/build/fields/posts-page-title/index.cjs.map +7 -0
- package/build/fields/posts-per-page/index.cjs +42 -0
- package/build/fields/posts-per-page/index.cjs.map +7 -0
- package/build/fields/{date/scheduled → scheduled-date}/index.cjs +6 -6
- package/build/fields/scheduled-date/index.cjs.map +7 -0
- package/build/fields/site-discussion/index.cjs +58 -0
- package/build/fields/site-discussion/index.cjs.map +7 -0
- package/build/fields/template-author/index.cjs +81 -0
- package/build/fields/template-author/index.cjs.map +7 -0
- package/build/fields/template-author/view.cjs +101 -0
- package/build/fields/template-author/view.cjs.map +7 -0
- package/build/fields/template-title/index.cjs +1 -1
- package/build/fields/template-title/index.cjs.map +2 -2
- package/build/types.cjs.map +1 -1
- package/build-module/actions/rename-post.mjs +0 -1
- package/build-module/actions/rename-post.mjs.map +2 -2
- package/build-module/components/create-template-part-modal/index.mjs +0 -1
- package/build-module/components/create-template-part-modal/index.mjs.map +2 -2
- package/build-module/components/media-edit/index.mjs.map +2 -2
- package/build-module/fields/description/index.mjs +45 -0
- package/build-module/fields/description/index.mjs.map +7 -0
- package/build-module/fields/index.mjs +33 -13
- package/build-module/fields/index.mjs.map +2 -2
- package/build-module/fields/last-edited/index.mjs +20 -0
- package/build-module/fields/last-edited/index.mjs.map +7 -0
- package/build-module/fields/last-edited/last-edited-date-view.mjs +19 -0
- package/build-module/fields/last-edited/last-edited-date-view.mjs.map +7 -0
- package/build-module/fields/parent/parent-edit.mjs +1 -1
- package/build-module/fields/parent/parent-edit.mjs.map +2 -2
- package/build-module/fields/password/edit.mjs +0 -1
- package/build-module/fields/password/edit.mjs.map +2 -2
- package/build-module/fields/pattern-title/view.mjs.map +2 -2
- package/build-module/fields/posts-page-title/index.mjs +26 -0
- package/build-module/fields/posts-page-title/index.mjs.map +7 -0
- package/build-module/fields/posts-per-page/index.mjs +21 -0
- package/build-module/fields/posts-per-page/index.mjs.map +7 -0
- package/build-module/fields/{date/scheduled → scheduled-date}/index.mjs +3 -3
- package/build-module/fields/scheduled-date/index.mjs.map +7 -0
- package/build-module/fields/site-discussion/index.mjs +37 -0
- package/build-module/fields/site-discussion/index.mjs.map +7 -0
- package/build-module/fields/template-author/index.mjs +45 -0
- package/build-module/fields/template-author/index.mjs.map +7 -0
- package/build-module/fields/template-author/view.mjs +75 -0
- package/build-module/fields/template-author/view.mjs.map +7 -0
- package/build-module/fields/template-title/index.mjs +1 -1
- package/build-module/fields/template-title/index.mjs.map +2 -2
- package/build-types/actions/rename-post.d.ts.map +1 -1
- package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
- package/build-types/components/media-edit/index.d.ts.map +1 -1
- package/build-types/fields/description/index.d.ts +20 -0
- package/build-types/fields/description/index.d.ts.map +1 -0
- package/build-types/fields/index.d.ts +7 -1
- package/build-types/fields/index.d.ts.map +1 -1
- package/build-types/fields/last-edited/index.d.ts +14 -0
- package/build-types/fields/last-edited/index.d.ts.map +1 -0
- package/build-types/fields/last-edited/last-edited-date-view.d.ts +8 -0
- package/build-types/fields/last-edited/last-edited-date-view.d.ts.map +1 -0
- package/build-types/fields/password/edit.d.ts.map +1 -1
- package/build-types/fields/pattern-title/view.d.ts.map +1 -1
- package/build-types/fields/posts-page-title/index.d.ts +14 -0
- package/build-types/fields/posts-page-title/index.d.ts.map +1 -0
- package/build-types/fields/posts-per-page/index.d.ts +14 -0
- package/build-types/fields/posts-per-page/index.d.ts.map +1 -0
- package/build-types/fields/{date/scheduled → scheduled-date}/index.d.ts +1 -1
- package/build-types/fields/scheduled-date/index.d.ts.map +1 -0
- package/build-types/fields/site-discussion/index.d.ts +14 -0
- package/build-types/fields/site-discussion/index.d.ts.map +1 -0
- package/build-types/fields/template-author/index.d.ts +14 -0
- package/build-types/fields/template-author/index.d.ts.map +1 -0
- package/build-types/fields/template-author/view.d.ts +8 -0
- package/build-types/fields/template-author/view.d.ts.map +1 -0
- package/build-types/types.d.ts +17 -2
- package/build-types/types.d.ts.map +1 -1
- package/package.json +33 -28
- package/src/actions/rename-post.tsx +0 -1
- package/src/components/create-template-part-modal/index.tsx +0 -1
- package/src/components/media-edit/index.tsx +0 -1
- package/src/fields/description/index.tsx +65 -0
- package/src/fields/index.ts +13 -1
- package/src/fields/last-edited/index.tsx +29 -0
- package/src/fields/last-edited/last-edited-date-view.tsx +26 -0
- package/src/fields/password/edit.tsx +0 -1
- package/src/fields/pattern-title/view.tsx +0 -1
- package/src/fields/posts-page-title/index.ts +35 -0
- package/src/fields/posts-per-page/index.ts +30 -0
- package/src/fields/{date/scheduled → scheduled-date}/index.tsx +1 -1
- package/src/fields/site-discussion/index.ts +48 -0
- package/src/fields/template-author/index.tsx +60 -0
- package/src/fields/template-author/view.tsx +95 -0
- package/src/fields/template-title/index.ts +1 -1
- package/src/types.ts +18 -2
- package/build/fields/date/scheduled/index.cjs.map +0 -7
- package/build-module/fields/date/scheduled/index.mjs.map +0 -7
- package/build-types/fields/date/scheduled/index.d.ts.map +0 -1
- package/build-types/index.native.d.ts +0 -1
- package/build-types/index.native.d.ts.map +0 -1
package/build/fields/index.cjs
CHANGED
|
@@ -33,10 +33,12 @@ __export(fields_exports, {
|
|
|
33
33
|
authorField: () => import_author.default,
|
|
34
34
|
commentStatusField: () => import_comment_status.default,
|
|
35
35
|
dateField: () => import_date.default,
|
|
36
|
+
descriptionField: () => import_description.default,
|
|
36
37
|
discussionField: () => import_discussion.default,
|
|
37
38
|
excerptField: () => import_excerpt.default,
|
|
38
39
|
featuredImageField: () => import_featured_image.default,
|
|
39
40
|
formatField: () => import_format.default,
|
|
41
|
+
lastEditedDateField: () => import_last_edited.default,
|
|
40
42
|
notesField: () => import_notes.default,
|
|
41
43
|
orderField: () => import_order.default,
|
|
42
44
|
pageTitleField: () => import_page_title.default,
|
|
@@ -45,11 +47,17 @@ __export(fields_exports, {
|
|
|
45
47
|
patternTitleField: () => import_pattern_title.default,
|
|
46
48
|
pingStatusField: () => import_ping_status.default,
|
|
47
49
|
postContentInfoField: () => import_post_content_info.default,
|
|
48
|
-
|
|
50
|
+
postsPageTitleField: () => import_posts_page_title.default,
|
|
51
|
+
postsPerPageField: () => import_posts_per_page.default,
|
|
52
|
+
readOnlyDescriptionField: () => import_description.readOnlyDescriptionField,
|
|
53
|
+
scheduledDateField: () => import_scheduled_date.default,
|
|
54
|
+
siteDiscussionField: () => import_site_discussion.default,
|
|
49
55
|
slugField: () => import_slug.default,
|
|
50
56
|
statusField: () => import_status.default,
|
|
51
57
|
stickyField: () => import_sticky.default,
|
|
58
|
+
templateAuthorField: () => import_template_author.templateAuthorField,
|
|
52
59
|
templateField: () => import_template.default,
|
|
60
|
+
templatePartAuthorField: () => import_template_author.templatePartAuthorField,
|
|
53
61
|
templateTitleField: () => import_template_title.default,
|
|
54
62
|
titleField: () => import_title.default
|
|
55
63
|
});
|
|
@@ -69,22 +77,30 @@ var import_comment_status = __toESM(require("./comment-status/index.cjs"));
|
|
|
69
77
|
var import_ping_status = __toESM(require("./ping-status/index.cjs"));
|
|
70
78
|
var import_discussion = __toESM(require("./discussion/index.cjs"));
|
|
71
79
|
var import_date = __toESM(require("./date/index.cjs"));
|
|
72
|
-
var
|
|
80
|
+
var import_scheduled_date = __toESM(require("./scheduled-date/index.cjs"));
|
|
81
|
+
var import_last_edited = __toESM(require("./last-edited/index.cjs"));
|
|
73
82
|
var import_author = __toESM(require("./author/index.cjs"));
|
|
83
|
+
var import_template_author = require("./template-author/index.cjs");
|
|
74
84
|
var import_notes = __toESM(require("./notes/index.cjs"));
|
|
75
85
|
var import_excerpt = __toESM(require("./excerpt/index.cjs"));
|
|
86
|
+
var import_description = __toESM(require("./description/index.cjs"));
|
|
76
87
|
var import_format = __toESM(require("./format/index.cjs"));
|
|
77
88
|
var import_post_content_info = __toESM(require("./post-content-info/index.cjs"));
|
|
78
89
|
var import_sticky = __toESM(require("./sticky/index.cjs"));
|
|
90
|
+
var import_posts_per_page = __toESM(require("./posts-per-page/index.cjs"));
|
|
91
|
+
var import_site_discussion = __toESM(require("./site-discussion/index.cjs"));
|
|
92
|
+
var import_posts_page_title = __toESM(require("./posts-page-title/index.cjs"));
|
|
79
93
|
// Annotate the CommonJS export names for ESM import in node:
|
|
80
94
|
0 && (module.exports = {
|
|
81
95
|
authorField,
|
|
82
96
|
commentStatusField,
|
|
83
97
|
dateField,
|
|
98
|
+
descriptionField,
|
|
84
99
|
discussionField,
|
|
85
100
|
excerptField,
|
|
86
101
|
featuredImageField,
|
|
87
102
|
formatField,
|
|
103
|
+
lastEditedDateField,
|
|
88
104
|
notesField,
|
|
89
105
|
orderField,
|
|
90
106
|
pageTitleField,
|
|
@@ -93,11 +109,17 @@ var import_sticky = __toESM(require("./sticky/index.cjs"));
|
|
|
93
109
|
patternTitleField,
|
|
94
110
|
pingStatusField,
|
|
95
111
|
postContentInfoField,
|
|
112
|
+
postsPageTitleField,
|
|
113
|
+
postsPerPageField,
|
|
114
|
+
readOnlyDescriptionField,
|
|
96
115
|
scheduledDateField,
|
|
116
|
+
siteDiscussionField,
|
|
97
117
|
slugField,
|
|
98
118
|
statusField,
|
|
99
119
|
stickyField,
|
|
120
|
+
templateAuthorField,
|
|
100
121
|
templateField,
|
|
122
|
+
templatePartAuthorField,
|
|
101
123
|
templateTitleField,
|
|
102
124
|
titleField
|
|
103
125
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/fields/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as slugField } from './slug';\nexport { default as titleField } from './title';\nexport { default as pageTitleField } from './page-title';\nexport { default as templateTitleField } from './template-title';\nexport { default as patternTitleField } from './pattern-title';\nexport { default as orderField } from './order';\nexport { default as featuredImageField } from './featured-image';\nexport { default as templateField } from './template';\nexport { default as parentField } from './parent';\nexport { default as passwordField } from './password';\nexport { default as statusField } from './status';\nexport { default as commentStatusField } from './comment-status';\nexport { default as pingStatusField } from './ping-status';\nexport { default as discussionField } from './discussion';\nexport { default as dateField } from './date';\nexport { default as scheduledDateField } from './date
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqC;AACrC,mBAAsC;AACtC,wBAA0C;AAC1C,4BAA8C;AAC9C,2BAA6C;AAC7C,mBAAsC;AACtC,4BAA8C;AAC9C,sBAAyC;AACzC,oBAAuC;AACvC,sBAAyC;AACzC,oBAAuC;AACvC,4BAA8C;AAC9C,yBAA2C;AAC3C,wBAA2C;AAC3C,kBAAqC;AACrC,
|
|
4
|
+
"sourcesContent": ["export { default as slugField } from './slug';\nexport { default as titleField } from './title';\nexport { default as pageTitleField } from './page-title';\nexport { default as templateTitleField } from './template-title';\nexport { default as patternTitleField } from './pattern-title';\nexport { default as orderField } from './order';\nexport { default as featuredImageField } from './featured-image';\nexport { default as templateField } from './template';\nexport { default as parentField } from './parent';\nexport { default as passwordField } from './password';\nexport { default as statusField } from './status';\nexport { default as commentStatusField } from './comment-status';\nexport { default as pingStatusField } from './ping-status';\nexport { default as discussionField } from './discussion';\nexport { default as dateField } from './date';\nexport { default as scheduledDateField } from './scheduled-date';\nexport { default as lastEditedDateField } from './last-edited';\nexport { default as authorField } from './author';\nexport {\n\ttemplateAuthorField,\n\ttemplatePartAuthorField,\n} from './template-author';\nexport { default as notesField } from './notes';\nexport { default as excerptField } from './excerpt';\nexport {\n\tdefault as descriptionField,\n\treadOnlyDescriptionField,\n} from './description';\nexport { default as formatField } from './format';\nexport { default as postContentInfoField } from './post-content-info';\nexport { default as stickyField } from './sticky';\nexport { default as postsPerPageField } from './posts-per-page';\nexport { default as siteDiscussionField } from './site-discussion';\nexport { default as postsPageTitleField } from './posts-page-title';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqC;AACrC,mBAAsC;AACtC,wBAA0C;AAC1C,4BAA8C;AAC9C,2BAA6C;AAC7C,mBAAsC;AACtC,4BAA8C;AAC9C,sBAAyC;AACzC,oBAAuC;AACvC,sBAAyC;AACzC,oBAAuC;AACvC,4BAA8C;AAC9C,yBAA2C;AAC3C,wBAA2C;AAC3C,kBAAqC;AACrC,4BAA8C;AAC9C,yBAA+C;AAC/C,oBAAuC;AACvC,6BAGO;AACP,mBAAsC;AACtC,qBAAwC;AACxC,yBAGO;AACP,oBAAuC;AACvC,+BAAgD;AAChD,oBAAuC;AACvC,4BAA6C;AAC7C,6BAA+C;AAC/C,8BAA+C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
|
|
30
|
+
// packages/fields/src/fields/last-edited/index.tsx
|
|
31
|
+
var last_edited_exports = {};
|
|
32
|
+
__export(last_edited_exports, {
|
|
33
|
+
default: () => last_edited_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(last_edited_exports);
|
|
36
|
+
var import_i18n = require("@wordpress/i18n");
|
|
37
|
+
var import_last_edited_date_view = __toESM(require("./last-edited-date-view.cjs"));
|
|
38
|
+
var lastEditedDateField = {
|
|
39
|
+
id: "last_edited_date",
|
|
40
|
+
type: "datetime",
|
|
41
|
+
label: (0, import_i18n.__)("Last edited"),
|
|
42
|
+
render: import_last_edited_date_view.default,
|
|
43
|
+
getValue: ({ item }) => item.modified,
|
|
44
|
+
isVisible: (item) => !!item.modified,
|
|
45
|
+
readOnly: true,
|
|
46
|
+
enableHiding: false,
|
|
47
|
+
enableSorting: false,
|
|
48
|
+
filterBy: false
|
|
49
|
+
};
|
|
50
|
+
var last_edited_default = lastEditedDateField;
|
|
51
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/last-edited/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 LastEditedDateView from './last-edited-date-view';\n\nconst lastEditedDateField: Field< BasePost > = {\n\tid: 'last_edited_date',\n\ttype: 'datetime',\n\tlabel: __( 'Last edited' ),\n\trender: LastEditedDateView,\n\tgetValue: ( { item } ) => item.modified,\n\tisVisible: ( item ) => !! item.modified,\n\treadOnly: true,\n\tenableHiding: false,\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\n/**\n * Last edited date field for BasePost.\n */\nexport default lastEditedDateField;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAMnB,mCAA+B;AAE/B,IAAM,sBAAyC;AAAA,EAC9C,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,aAAc;AAAA,EACzB,QAAQ,6BAAAA;AAAA,EACR,UAAU,CAAE,EAAE,KAAK,MAAO,KAAK;AAAA,EAC/B,WAAW,CAAE,SAAU,CAAC,CAAE,KAAK;AAAA,EAC/B,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,UAAU;AACX;AAKA,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["LastEditedDateView"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
|
|
20
|
+
// packages/fields/src/fields/last-edited/last-edited-date-view.tsx
|
|
21
|
+
var last_edited_date_view_exports = {};
|
|
22
|
+
__export(last_edited_date_view_exports, {
|
|
23
|
+
default: () => LastEditedDateView
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(last_edited_date_view_exports);
|
|
26
|
+
var import_ui = require("@wordpress/ui");
|
|
27
|
+
var import_i18n = require("@wordpress/i18n");
|
|
28
|
+
var import_date = require("@wordpress/date");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
function LastEditedDateView({ item }) {
|
|
31
|
+
if (!item.modified) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Text, { children: (0, import_i18n.sprintf)(
|
|
35
|
+
// translators: %s: Human-readable time difference, e.g. "2 days ago".
|
|
36
|
+
(0, import_i18n.__)("Last edited %s."),
|
|
37
|
+
(0, import_date.humanTimeDiff)(item.modified)
|
|
38
|
+
) });
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=last-edited-date-view.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/last-edited/last-edited-date-view.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Text } from '@wordpress/ui';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport default function LastEditedDateView( { item }: { item: BasePost } ) {\n\tif ( ! item.modified ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Text>\n\t\t\t{ sprintf(\n\t\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t\t__( 'Last edited %s.' ),\n\t\t\t\thumanTimeDiff( item.modified )\n\t\t\t) }\n\t\t</Text>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gBAAqB;AACrB,kBAA4B;AAC5B,kBAA8B;AAY5B;AALa,SAAR,mBAAqC,EAAE,KAAK,GAAwB;AAC1E,MAAK,CAAE,KAAK,UAAW;AACtB,WAAO;AAAA,EACR;AACA,SACC,4CAAC,kBACE;AAAA;AAAA,QAED,gBAAI,iBAAkB;AAAA,QACtB,2BAAe,KAAK,QAAS;AAAA,EAC9B,GACD;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -140,7 +140,7 @@ function PageAttributesParent({
|
|
|
140
140
|
const mappedNodes = tree2.map((treeNode) => [
|
|
141
141
|
{
|
|
142
142
|
value: treeNode.id,
|
|
143
|
-
label: "
|
|
143
|
+
label: "— ".repeat(level) + (0, import_html_entities.decodeEntities)(treeNode.name),
|
|
144
144
|
rawName: treeNode.name
|
|
145
145
|
},
|
|
146
146
|
...getOptionsFromTree(treeNode.children || [], level + 1)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/fields/parent/parent-edit.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { ComboboxControl, ExternalLink } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tcreateInterpolateElement,\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n} from '@wordpress/element';\n// @ts-ignore\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport { debounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { filterURLForDisplay } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\nimport { getTitleWithFallbackName } from './utils';\n\ntype TreeBase = {\n\tid: number;\n\tname: string;\n\t[ key: string ]: any;\n};\n\ntype TreeWithParent = TreeBase & {\n\tparent: number;\n};\n\ntype TreeWithoutParent = TreeBase & {\n\tparent: null;\n};\n\ntype Tree = TreeWithParent | TreeWithoutParent;\n\nfunction buildTermsTree( flatTerms: Tree[] ) {\n\tconst flatTermsWithParentAndChildren = flatTerms.map( ( term ) => {\n\t\treturn {\n\t\t\tchildren: [],\n\t\t\t...term,\n\t\t};\n\t} );\n\n\t// All terms should have a `parent` because we're about to index them by it.\n\tif (\n\t\tflatTermsWithParentAndChildren.some(\n\t\t\t( { parent } ) => parent === null || parent === undefined\n\t\t)\n\t) {\n\t\treturn flatTermsWithParentAndChildren as TreeWithParent[];\n\t}\n\n\tconst termsByParent = (\n\t\tflatTermsWithParentAndChildren as TreeWithParent[]\n\t ).reduce(\n\t\t( acc, term ) => {\n\t\t\tconst { parent } = term;\n\t\t\tif ( ! acc[ parent ] ) {\n\t\t\t\tacc[ parent ] = [];\n\t\t\t}\n\t\t\tacc[ parent ].push( term );\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record< string, Array< TreeWithParent > >\n\t);\n\n\tconst fillWithChildren = (\n\t\tterms: Array< TreeWithParent >\n\t): Array< TreeWithParent > => {\n\t\treturn terms.map( ( term ) => {\n\t\t\tconst children = termsByParent[ term.id ];\n\t\t\treturn {\n\t\t\t\t...term,\n\t\t\t\tchildren:\n\t\t\t\t\tchildren && children.length\n\t\t\t\t\t\t? fillWithChildren( children )\n\t\t\t\t\t\t: [],\n\t\t\t};\n\t\t} );\n\t};\n\n\treturn fillWithChildren( termsByParent[ '0' ] || [] );\n}\n\nexport const getItemPriority = ( name: string, searchValue: string ) => {\n\tconst normalizedName = removeAccents( name || '' ).toLowerCase();\n\tconst normalizedSearch = removeAccents( searchValue || '' ).toLowerCase();\n\tif ( normalizedName === normalizedSearch ) {\n\t\treturn 0;\n\t}\n\n\tif ( normalizedName.startsWith( normalizedSearch ) ) {\n\t\treturn normalizedName.length;\n\t}\n\n\treturn Infinity;\n};\n\nexport function PageAttributesParent( {\n\tdata,\n\tonChangeControl,\n}: {\n\tdata: BasePost;\n\tonChangeControl: ( newValue: number ) => void;\n} ) {\n\tconst [ fieldValue, setFieldValue ] = useState< string >( '' );\n\n\tconst pageId = data.parent;\n\tconst postId = data.id;\n\tconst postTypeSlug = data.type;\n\n\tconst { parentPostTitle, pageItems, isHierarchical } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, getEntityRecords, getPostType } =\n\t\t\t\tselect( coreStore );\n\n\t\t\tconst postTypeInfo = getPostType( postTypeSlug );\n\n\t\t\tconst postIsHierarchical =\n\t\t\t\tpostTypeInfo?.hierarchical && postTypeInfo.viewable;\n\n\t\t\tconst parentPost = pageId\n\t\t\t\t? getEntityRecord< BasePost >(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostTypeSlug,\n\t\t\t\t\t\tpageId\n\t\t\t\t )\n\t\t\t\t: null;\n\n\t\t\tconst query = {\n\t\t\t\tper_page: 100,\n\t\t\t\texclude: postId,\n\t\t\t\tparent_exclude: postId,\n\t\t\t\torderby: 'menu_order',\n\t\t\t\torder: 'asc',\n\t\t\t\t_fields: 'id,title,parent',\n\t\t\t\t...( !! fieldValue && {\n\t\t\t\t\t// Perform a search by relevance when the field is changed.\n\t\t\t\t\tsearch: fieldValue,\n\t\t\t\t\torderby: 'relevance',\n\t\t\t\t\tsearch_columns: [ 'post_title' ],\n\t\t\t\t} ),\n\t\t\t};\n\n\t\t\treturn {\n\t\t\t\tisHierarchical: postIsHierarchical,\n\t\t\t\tparentPostTitle: parentPost\n\t\t\t\t\t? getTitleWithFallbackName( parentPost )\n\t\t\t\t\t: '',\n\t\t\t\tpageItems: postIsHierarchical\n\t\t\t\t\t? getEntityRecords< BasePost >(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tpostTypeSlug,\n\t\t\t\t\t\t\tquery\n\t\t\t\t\t )\n\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ fieldValue, pageId, postId, postTypeSlug ]\n\t);\n\n\t/**\n\t * This logic has been copied from https://github.com/WordPress/gutenberg/blob/0249771b519d5646171fb9fae422006c8ab773f2/packages/editor/src/components/page-attributes/parent.js#L106.\n\t */\n\tconst parentOptions = useMemo( () => {\n\t\tconst getOptionsFromTree = (\n\t\t\ttree: Array< Tree >,\n\t\t\tlevel = 0\n\t\t): Array< {\n\t\t\tvalue: number;\n\t\t\tlabel: string;\n\t\t\trawName: string;\n\t\t} > => {\n\t\t\tconst mappedNodes = tree.map( ( treeNode ) => [\n\t\t\t\t{\n\t\t\t\t\tvalue: treeNode.id,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t'
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,4BAA0B;AAK1B,wBAA8C;AAC9C,kBAA0B;AAC1B,qBAKO;AAEP,uBAAmC;AAEnC,qBAAyB;AACzB,2BAA+B;AAC/B,kBAA4B;AAC5B,iBAAoC;AAMpC,mBAAyC;AA0OvC;AAxNF,SAAS,eAAgB,WAAoB;AAC5C,QAAM,iCAAiC,UAAU,IAAK,CAAE,SAAU;AACjE,WAAO;AAAA,MACN,UAAU,CAAC;AAAA,MACX,GAAG;AAAA,IACJ;AAAA,EACD,CAAE;AAGF,MACC,+BAA+B;AAAA,IAC9B,CAAE,EAAE,OAAO,MAAO,WAAW,QAAQ,WAAW;AAAA,EACjD,GACC;AACD,WAAO;AAAA,EACR;AAEA,QAAM,gBACL,+BACE;AAAA,IACF,CAAE,KAAK,SAAU;AAChB,YAAM,EAAE,OAAO,IAAI;AACnB,UAAK,CAAE,IAAK,MAAO,GAAI;AACtB,YAAK,MAAO,IAAI,CAAC;AAAA,MAClB;AACA,UAAK,MAAO,EAAE,KAAM,IAAK;AACzB,aAAO;AAAA,IACR;AAAA,IACA,CAAC;AAAA,EACF;AAEA,QAAM,mBAAmB,CACxB,UAC6B;AAC7B,WAAO,MAAM,IAAK,CAAE,SAAU;AAC7B,YAAM,WAAW,cAAe,KAAK,EAAG;AACxC,aAAO;AAAA,QACN,GAAG;AAAA,QACH,UACC,YAAY,SAAS,SAClB,iBAAkB,QAAS,IAC3B,CAAC;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AAA,UACA;AAAA,QACA,IACA;AAAA,MACJ;AAAA,IACD;AAAA,IACA,CAAE,YAAY,QAAQ,QAAQ,YAAa;AAAA,EAC5C;AAKA,QAAM,oBAAgB,wBAAS,MAAM;AACpC,UAAM,qBAAqB,CAC1BC,OACA,QAAQ,MAKF;AACN,YAAM,cAAcA,MAAK,IAAK,CAAE,aAAc;AAAA,QAC7C;AAAA,UACC,OAAO,SAAS;AAAA,UAChB,OACC,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { ComboboxControl, ExternalLink } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tcreateInterpolateElement,\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n} from '@wordpress/element';\n// @ts-ignore\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport { debounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { filterURLForDisplay } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\nimport { getTitleWithFallbackName } from './utils';\n\ntype TreeBase = {\n\tid: number;\n\tname: string;\n\t[ key: string ]: any;\n};\n\ntype TreeWithParent = TreeBase & {\n\tparent: number;\n};\n\ntype TreeWithoutParent = TreeBase & {\n\tparent: null;\n};\n\ntype Tree = TreeWithParent | TreeWithoutParent;\n\nfunction buildTermsTree( flatTerms: Tree[] ) {\n\tconst flatTermsWithParentAndChildren = flatTerms.map( ( term ) => {\n\t\treturn {\n\t\t\tchildren: [],\n\t\t\t...term,\n\t\t};\n\t} );\n\n\t// All terms should have a `parent` because we're about to index them by it.\n\tif (\n\t\tflatTermsWithParentAndChildren.some(\n\t\t\t( { parent } ) => parent === null || parent === undefined\n\t\t)\n\t) {\n\t\treturn flatTermsWithParentAndChildren as TreeWithParent[];\n\t}\n\n\tconst termsByParent = (\n\t\tflatTermsWithParentAndChildren as TreeWithParent[]\n\t ).reduce(\n\t\t( acc, term ) => {\n\t\t\tconst { parent } = term;\n\t\t\tif ( ! acc[ parent ] ) {\n\t\t\t\tacc[ parent ] = [];\n\t\t\t}\n\t\t\tacc[ parent ].push( term );\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record< string, Array< TreeWithParent > >\n\t);\n\n\tconst fillWithChildren = (\n\t\tterms: Array< TreeWithParent >\n\t): Array< TreeWithParent > => {\n\t\treturn terms.map( ( term ) => {\n\t\t\tconst children = termsByParent[ term.id ];\n\t\t\treturn {\n\t\t\t\t...term,\n\t\t\t\tchildren:\n\t\t\t\t\tchildren && children.length\n\t\t\t\t\t\t? fillWithChildren( children )\n\t\t\t\t\t\t: [],\n\t\t\t};\n\t\t} );\n\t};\n\n\treturn fillWithChildren( termsByParent[ '0' ] || [] );\n}\n\nexport const getItemPriority = ( name: string, searchValue: string ) => {\n\tconst normalizedName = removeAccents( name || '' ).toLowerCase();\n\tconst normalizedSearch = removeAccents( searchValue || '' ).toLowerCase();\n\tif ( normalizedName === normalizedSearch ) {\n\t\treturn 0;\n\t}\n\n\tif ( normalizedName.startsWith( normalizedSearch ) ) {\n\t\treturn normalizedName.length;\n\t}\n\n\treturn Infinity;\n};\n\nexport function PageAttributesParent( {\n\tdata,\n\tonChangeControl,\n}: {\n\tdata: BasePost;\n\tonChangeControl: ( newValue: number ) => void;\n} ) {\n\tconst [ fieldValue, setFieldValue ] = useState< string >( '' );\n\n\tconst pageId = data.parent;\n\tconst postId = data.id;\n\tconst postTypeSlug = data.type;\n\n\tconst { parentPostTitle, pageItems, isHierarchical } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, getEntityRecords, getPostType } =\n\t\t\t\tselect( coreStore );\n\n\t\t\tconst postTypeInfo = getPostType( postTypeSlug );\n\n\t\t\tconst postIsHierarchical =\n\t\t\t\tpostTypeInfo?.hierarchical && postTypeInfo.viewable;\n\n\t\t\tconst parentPost = pageId\n\t\t\t\t? getEntityRecord< BasePost >(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostTypeSlug,\n\t\t\t\t\t\tpageId\n\t\t\t\t )\n\t\t\t\t: null;\n\n\t\t\tconst query = {\n\t\t\t\tper_page: 100,\n\t\t\t\texclude: postId,\n\t\t\t\tparent_exclude: postId,\n\t\t\t\torderby: 'menu_order',\n\t\t\t\torder: 'asc',\n\t\t\t\t_fields: 'id,title,parent',\n\t\t\t\t...( !! fieldValue && {\n\t\t\t\t\t// Perform a search by relevance when the field is changed.\n\t\t\t\t\tsearch: fieldValue,\n\t\t\t\t\torderby: 'relevance',\n\t\t\t\t\tsearch_columns: [ 'post_title' ],\n\t\t\t\t} ),\n\t\t\t};\n\n\t\t\treturn {\n\t\t\t\tisHierarchical: postIsHierarchical,\n\t\t\t\tparentPostTitle: parentPost\n\t\t\t\t\t? getTitleWithFallbackName( parentPost )\n\t\t\t\t\t: '',\n\t\t\t\tpageItems: postIsHierarchical\n\t\t\t\t\t? getEntityRecords< BasePost >(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tpostTypeSlug,\n\t\t\t\t\t\t\tquery\n\t\t\t\t\t )\n\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ fieldValue, pageId, postId, postTypeSlug ]\n\t);\n\n\t/**\n\t * This logic has been copied from https://github.com/WordPress/gutenberg/blob/0249771b519d5646171fb9fae422006c8ab773f2/packages/editor/src/components/page-attributes/parent.js#L106.\n\t */\n\tconst parentOptions = useMemo( () => {\n\t\tconst getOptionsFromTree = (\n\t\t\ttree: Array< Tree >,\n\t\t\tlevel = 0\n\t\t): Array< {\n\t\t\tvalue: number;\n\t\t\tlabel: string;\n\t\t\trawName: string;\n\t\t} > => {\n\t\t\tconst mappedNodes = tree.map( ( treeNode ) => [\n\t\t\t\t{\n\t\t\t\t\tvalue: treeNode.id,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t'— '.repeat( level ) + decodeEntities( treeNode.name ),\n\t\t\t\t\trawName: treeNode.name,\n\t\t\t\t},\n\t\t\t\t...getOptionsFromTree( treeNode.children || [], level + 1 ),\n\t\t\t] );\n\n\t\t\tconst sortedNodes = mappedNodes.sort( ( [ a ], [ b ] ) => {\n\t\t\t\tconst priorityA = getItemPriority( a.rawName, fieldValue );\n\t\t\t\tconst priorityB = getItemPriority( b.rawName, fieldValue );\n\t\t\t\treturn priorityA >= priorityB ? 1 : -1;\n\t\t\t} );\n\n\t\t\treturn sortedNodes.flat();\n\t\t};\n\n\t\tif ( ! pageItems ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet tree = pageItems.map( ( item ) => ( {\n\t\t\tid: item.id as number,\n\t\t\tparent: item.parent ?? null,\n\t\t\tname: getTitleWithFallbackName( item ),\n\t\t} ) );\n\n\t\t// Only build a hierarchical tree when not searching.\n\t\tif ( ! fieldValue ) {\n\t\t\ttree = buildTermsTree( tree );\n\t\t}\n\n\t\tconst opts = getOptionsFromTree( tree );\n\n\t\t// Ensure the current parent is in the options list.\n\t\tconst optsHasParent = opts.find( ( item ) => item.value === pageId );\n\t\tif ( pageId && parentPostTitle && ! optsHasParent ) {\n\t\t\topts.unshift( {\n\t\t\t\tvalue: pageId,\n\t\t\t\tlabel: parentPostTitle,\n\t\t\t\trawName: '',\n\t\t\t} );\n\t\t}\n\t\treturn opts.map( ( option ) => ( {\n\t\t\t...option,\n\t\t\tvalue: option.value.toString(),\n\t\t} ) );\n\t}, [ pageItems, fieldValue, parentPostTitle, pageId ] );\n\n\tif ( ! isHierarchical ) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Handle user input.\n\t *\n\t * @param {string} inputValue The current value of the input field.\n\t */\n\tconst handleKeydown = ( inputValue: string ) => {\n\t\tsetFieldValue( inputValue );\n\t};\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {Object} selectedPostId The selected Author.\n\t */\n\tconst handleChange = ( selectedPostId: string | null | undefined ) => {\n\t\tif ( selectedPostId ) {\n\t\t\treturn onChangeControl( parseInt( selectedPostId, 10 ) ?? 0 );\n\t\t}\n\n\t\tonChangeControl( 0 );\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Parent' ) }\n\t\t\thelp={ __( 'Choose a parent page.' ) }\n\t\t\tvalue={ pageId?.toString() }\n\t\t\toptions={ parentOptions }\n\t\t\tonFilterValueChange={ debounce(\n\t\t\t\t( value: unknown ) => handleKeydown( value as string ),\n\t\t\t\t300\n\t\t\t) }\n\t\t\tonChange={ handleChange }\n\t\t\thideLabelFromVision\n\t\t/>\n\t);\n}\n\nexport const ParentEdit = ( {\n\tdata,\n\tfield,\n\tonChange,\n}: DataFormControlProps< BasePost > ) => {\n\tconst { id } = field;\n\n\tconst homeUrl = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getEntityRecord< {\n\t\t\thome: string;\n\t\t} >( 'root', '__unstableBase' )?.home as string;\n\t}, [] );\n\n\tconst onChangeControl = useCallback(\n\t\t( newValue?: number ) =>\n\t\t\tonChange( {\n\t\t\t\t[ id ]: newValue,\n\t\t\t} ),\n\t\t[ id, onChange ]\n\t);\n\n\treturn (\n\t\t<fieldset className=\"fields-controls__parent\">\n\t\t\t<div>\n\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %1$s The home URL of the WordPress installation without the scheme. */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Child pages inherit characteristics from their parent, such as URL structure. For instance, if \"Pricing\" is a child of \"Services\", its URL would be %1$s<wbr />/services<wbr />/pricing.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tfilterURLForDisplay( homeUrl ).replace(\n\t\t\t\t\t\t\t/([/.])/g,\n\t\t\t\t\t\t\t'<wbr />$1'\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\twbr: <wbr />,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\t<p>\n\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'They also show up as sub-items in the default navigation menu. <a>Learn more.</a>'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tchildren={ undefined }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t\t<PageAttributesParent\n\t\t\t\t\tdata={ data }\n\t\t\t\t\tonChangeControl={ onChangeControl }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,4BAA0B;AAK1B,wBAA8C;AAC9C,kBAA0B;AAC1B,qBAKO;AAEP,uBAAmC;AAEnC,qBAAyB;AACzB,2BAA+B;AAC/B,kBAA4B;AAC5B,iBAAoC;AAMpC,mBAAyC;AA0OvC;AAxNF,SAAS,eAAgB,WAAoB;AAC5C,QAAM,iCAAiC,UAAU,IAAK,CAAE,SAAU;AACjE,WAAO;AAAA,MACN,UAAU,CAAC;AAAA,MACX,GAAG;AAAA,IACJ;AAAA,EACD,CAAE;AAGF,MACC,+BAA+B;AAAA,IAC9B,CAAE,EAAE,OAAO,MAAO,WAAW,QAAQ,WAAW;AAAA,EACjD,GACC;AACD,WAAO;AAAA,EACR;AAEA,QAAM,gBACL,+BACE;AAAA,IACF,CAAE,KAAK,SAAU;AAChB,YAAM,EAAE,OAAO,IAAI;AACnB,UAAK,CAAE,I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iB,GAAG;AAAA,EAClC,GAAG,CAAC,CAAE;AAEN,QAAM,sBAAkB;AAAA,IACvB,CAAE,aACD,SAAU;AAAA,MACT,CAAE,EAAG,GAAG;AAAA,IACT,CAAE;AAAA,IACH,CAAE,IAAI,QAAS;AAAA,EAChB;AAEA,SACC,4CAAC,cAAS,WAAU,2BACnB,uDAAC,SACE;AAAA;AAAA,UACD;AAAA;AAAA,YAEC;AAAA,UACC;AAAA,QACD;AAAA,YACA,gCAAqB,OAAQ,EAAE;AAAA,UAC9B;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,QACC,KAAK,4CAAC,SAAI;AAAA,MACX;AAAA,IACD;AAAA,IACA,4CAAC,OACE;AAAA,UACD;AAAA,QACC;AAAA,MACD;AAAA,MACA;AAAA,QACC,GACC;AAAA,UAAC;AAAA;AAAA,YACA,UAAO;AAAA,cACN;AAAA,YACD;AAAA,YACA,UAAW;AAAA;AAAA,QACZ;AAAA,MAEF;AAAA,IACD,GACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KACD,GACD;AAEF;",
|
|
6
6
|
"names": ["removeAccents", "coreStore", "tree"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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\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\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAIO;AAEP,qBAAyB;AACzB,kBAAmB;AAwBjB;AAjBF,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,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,
|
|
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\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\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;AAGA,wBAIO;AAEP,qBAAyB;AACzB,kBAAmB;AAwBjB;AAjBF,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,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,WAAY;AAAA;AAAA,QACb,GACD;AAAA;AAAA;AAAA,EAEF;AAEF;AACA,IAAO,eAAQ;",
|
|
6
6
|
"names": ["VStack"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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';\n// @ts-ignore\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAAgC;AAEhC,sBAAkD;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, lockSmall } from '@wordpress/icons';\n// @ts-ignore\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\nimport { Tooltip, VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport type { CommonPost } from '../../types';\n\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\tconst lockMessage = __( 'This pattern cannot be edited.' );\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<>\n\t\t\t\t\t<VisuallyHidden>{ lockMessage }</VisuallyHidden>\n\t\t\t\t\t<Tooltip.Root>\n\t\t\t\t\t\t<Tooltip.Trigger\n\t\t\t\t\t\t\trender={ <Icon icon={ lockSmall } size={ 24 } /> }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Tooltip.Popup>{ lockMessage }</Tooltip.Popup>\n\t\t\t\t\t</Tooltip.Root>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</BaseTitleView>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAAgC;AAEhC,sBAAkD;AAClD,gBAAwC;AAOxC,kBAA8B;AAC9B,yBAAuB;AASnB;AAPG,IAAM,EAAE,cAAc,QAAI,2BAAQ,gBAAAA,WAAmB;AAE7C,SAAR,iBAAmC,EAAE,KAAK,GAA0B;AAC1E,QAAM,kBAAc,gBAAI,gCAAiC;AACzD,SACC,4CAAC,6BAAc,MAAc,WAAU,+BACpC,eAAK,SAAS,cAAc,SAC7B,4EACC;AAAA,gDAAC,4BAAiB,uBAAa;AAAA,IAC/B,6CAAC,kBAAQ,MAAR,EACA;AAAA;AAAA,QAAC,kBAAQ;AAAA,QAAR;AAAA,UACA,QAAS,4CAAC,qBAAK,MAAO,wBAAY,MAAO,IAAK;AAAA;AAAA,MAC/C;AAAA,MACA,4CAAC,kBAAQ,OAAR,EAAgB,uBAAa;AAAA,OAC/B;AAAA,KACD,GAEF;AAEF;",
|
|
6
6
|
"names": ["patternPrivateApis"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
|
|
20
|
+
// packages/fields/src/fields/posts-page-title/index.ts
|
|
21
|
+
var posts_page_title_exports = {};
|
|
22
|
+
__export(posts_page_title_exports, {
|
|
23
|
+
default: () => posts_page_title_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(posts_page_title_exports);
|
|
26
|
+
var import_i18n = require("@wordpress/i18n");
|
|
27
|
+
var postsPageTitleField = {
|
|
28
|
+
id: "posts_page_title",
|
|
29
|
+
type: "text",
|
|
30
|
+
label: (0, import_i18n.__)("Blog title"),
|
|
31
|
+
description: (0, import_i18n.__)(
|
|
32
|
+
"Set the Posts Page title. Appears in search results, and when the page is shared on social media."
|
|
33
|
+
),
|
|
34
|
+
getValue: ({ item }) => {
|
|
35
|
+
const title = item.title;
|
|
36
|
+
if (typeof title === "string") {
|
|
37
|
+
return title;
|
|
38
|
+
}
|
|
39
|
+
return title?.raw ?? "";
|
|
40
|
+
},
|
|
41
|
+
setValue: ({ value }) => ({ title: value }),
|
|
42
|
+
enableSorting: false,
|
|
43
|
+
enableHiding: false,
|
|
44
|
+
filterBy: false
|
|
45
|
+
};
|
|
46
|
+
var posts_page_title_default = postsPageTitleField;
|
|
47
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/posts-page-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 { PostsPage } from '../../types';\n\nconst postsPageTitleField: Field< PostsPage > = {\n\tid: 'posts_page_title',\n\ttype: 'text',\n\tlabel: __( 'Blog title' ),\n\tdescription: __(\n\t\t'Set the Posts Page title. Appears in search results, and when the page is shared on social media.'\n\t),\n\tgetValue: ( { item } ) => {\n\t\tconst title = item.title;\n\t\tif ( typeof title === 'string' ) {\n\t\t\treturn title;\n\t\t}\n\t\treturn title?.raw ?? '';\n\t},\n\tsetValue: ( { value } ) => ( { title: value } ),\n\tenableSorting: false,\n\tenableHiding: false,\n\tfilterBy: false,\n};\n\n/**\n * Title field for the posts page (the `page` assigned as `page_for_posts`).\n */\nexport default postsPageTitleField;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAOnB,IAAM,sBAA0C;AAAA,EAC/C,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,YAAa;AAAA,EACxB,iBAAa;AAAA,IACZ;AAAA,EACD;AAAA,EACA,UAAU,CAAE,EAAE,KAAK,MAAO;AACzB,UAAM,QAAQ,KAAK;AACnB,QAAK,OAAO,UAAU,UAAW;AAChC,aAAO;AAAA,IACR;AACA,WAAO,OAAO,OAAO;AAAA,EACtB;AAAA,EACA,UAAU,CAAE,EAAE,MAAM,OAAS,EAAE,OAAO,MAAM;AAAA,EAC5C,eAAe;AAAA,EACf,cAAc;AAAA,EACd,UAAU;AACX;AAKA,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
|
|
20
|
+
// packages/fields/src/fields/posts-per-page/index.ts
|
|
21
|
+
var posts_per_page_exports = {};
|
|
22
|
+
__export(posts_per_page_exports, {
|
|
23
|
+
default: () => posts_per_page_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(posts_per_page_exports);
|
|
26
|
+
var import_i18n = require("@wordpress/i18n");
|
|
27
|
+
var postsPerPageField = {
|
|
28
|
+
id: "posts_per_page",
|
|
29
|
+
type: "integer",
|
|
30
|
+
label: (0, import_i18n.__)("Posts per page"),
|
|
31
|
+
description: (0, import_i18n.__)(
|
|
32
|
+
"Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."
|
|
33
|
+
),
|
|
34
|
+
getValue: ({ item }) => item.posts_per_page ?? 1,
|
|
35
|
+
setValue: ({ value }) => ({ posts_per_page: value }),
|
|
36
|
+
isValid: { min: 1 },
|
|
37
|
+
enableSorting: false,
|
|
38
|
+
enableHiding: false,
|
|
39
|
+
filterBy: false
|
|
40
|
+
};
|
|
41
|
+
var posts_per_page_default = postsPerPageField;
|
|
42
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/posts-per-page/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 { SiteSettings } from '../../types';\n\nconst postsPerPageField: Field< SiteSettings > = {\n\tid: 'posts_per_page',\n\ttype: 'integer',\n\tlabel: __( 'Posts per page' ),\n\tdescription: __(\n\t\t'Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.'\n\t),\n\tgetValue: ( { item } ) => item.posts_per_page ?? 1,\n\tsetValue: ( { value } ) => ( { posts_per_page: value } ),\n\tisValid: { min: 1 },\n\tenableSorting: false,\n\tenableHiding: false,\n\tfilterBy: false,\n};\n\n/**\n * Posts per page field for the `root/site` entity.\n */\nexport default postsPerPageField;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAOnB,IAAM,oBAA2C;AAAA,EAChD,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,gBAAiB;AAAA,EAC5B,iBAAa;AAAA,IACZ;AAAA,EACD;AAAA,EACA,UAAU,CAAE,EAAE,KAAK,MAAO,KAAK,kBAAkB;AAAA,EACjD,UAAU,CAAE,EAAE,MAAM,OAAS,EAAE,gBAAgB,MAAM;AAAA,EACrD,SAAS,EAAE,KAAK,EAAE;AAAA,EAClB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,UAAU;AACX;AAKA,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -17,12 +17,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// packages/fields/src/fields/date/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
default: () =>
|
|
20
|
+
// packages/fields/src/fields/scheduled-date/index.tsx
|
|
21
|
+
var scheduled_date_exports = {};
|
|
22
|
+
__export(scheduled_date_exports, {
|
|
23
|
+
default: () => scheduled_date_default
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(scheduled_date_exports);
|
|
26
26
|
var import_i18n = require("@wordpress/i18n");
|
|
27
27
|
var scheduledDateField = {
|
|
28
28
|
id: "scheduled_date",
|
|
@@ -39,5 +39,5 @@ var scheduledDateField = {
|
|
|
39
39
|
enableSorting: false,
|
|
40
40
|
filterBy: false
|
|
41
41
|
};
|
|
42
|
-
var
|
|
42
|
+
var scheduled_date_default = scheduledDateField;
|
|
43
43
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/scheduled-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';\n\nconst scheduledDateField: Field< BasePost > = {\n\tid: 'scheduled_date',\n\ttype: 'datetime',\n\tlabel: __( 'Scheduled Date' ),\n\tgetValue: ( { item } ) => item.date,\n\tsetValue: ( { value } ) => ( { date: value } ),\n\tisVisible: ( item ) => item.status === 'future',\n\tEdit: {\n\t\tcontrol: 'datetime',\n\t\tcompact: true,\n\t},\n\tenableHiding: false,\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\n/**\n * ScheduledDate Field.\n */\nexport default scheduledDateField;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAOnB,IAAM,qBAAwC;AAAA,EAC7C,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,gBAAiB;AAAA,EAC5B,UAAU,CAAE,EAAE,KAAK,MAAO,KAAK;AAAA,EAC/B,UAAU,CAAE,EAAE,MAAM,OAAS,EAAE,MAAM,MAAM;AAAA,EAC3C,WAAW,CAAE,SAAU,KAAK,WAAW;AAAA,EACvC,MAAM;AAAA,IACL,SAAS;AAAA,IACT,SAAS;AAAA,EACV;AAAA,EACA,cAAc;AAAA,EACd,eAAe;AAAA,EACf,UAAU;AACX;AAKA,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
|
|
20
|
+
// packages/fields/src/fields/site-discussion/index.ts
|
|
21
|
+
var site_discussion_exports = {};
|
|
22
|
+
__export(site_discussion_exports, {
|
|
23
|
+
default: () => site_discussion_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(site_discussion_exports);
|
|
26
|
+
var import_i18n = require("@wordpress/i18n");
|
|
27
|
+
var siteDiscussionField = {
|
|
28
|
+
id: "default_comment_status",
|
|
29
|
+
type: "text",
|
|
30
|
+
label: (0, import_i18n.__)("Discussion"),
|
|
31
|
+
Edit: "radio",
|
|
32
|
+
getValue: ({ item }) => item.default_comment_status || "",
|
|
33
|
+
setValue: ({ value }) => ({
|
|
34
|
+
default_comment_status: value || null
|
|
35
|
+
}),
|
|
36
|
+
render: ({ item }) => {
|
|
37
|
+
return item.default_comment_status === "open" ? (0, import_i18n.__)("Comments open") : (0, import_i18n.__)("Comments closed");
|
|
38
|
+
},
|
|
39
|
+
elements: [
|
|
40
|
+
{
|
|
41
|
+
value: "open",
|
|
42
|
+
label: (0, import_i18n.__)("Open"),
|
|
43
|
+
description: (0, import_i18n.__)("Visitors can add new comments and replies.")
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: "",
|
|
47
|
+
label: (0, import_i18n.__)("Closed"),
|
|
48
|
+
description: (0, import_i18n.__)(
|
|
49
|
+
"Visitors cannot add new comments or replies. Existing comments remain visible."
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
enableSorting: false,
|
|
54
|
+
enableHiding: false,
|
|
55
|
+
filterBy: false
|
|
56
|
+
};
|
|
57
|
+
var site_discussion_default = siteDiscussionField;
|
|
58
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/site-discussion/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 { SiteSettings } from '../../types';\n\nconst siteDiscussionField: Field< SiteSettings > = {\n\tid: 'default_comment_status',\n\ttype: 'text',\n\tlabel: __( 'Discussion' ),\n\tEdit: 'radio',\n\tgetValue: ( { item } ) => item.default_comment_status || '',\n\tsetValue: ( { value } ) => ( {\n\t\tdefault_comment_status: value || null,\n\t} ),\n\trender: ( { item } ) => {\n\t\treturn item.default_comment_status === 'open'\n\t\t\t? __( 'Comments open' )\n\t\t\t: __( 'Comments closed' );\n\t},\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: '',\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\tenableSorting: false,\n\tenableHiding: false,\n\tfilterBy: false,\n};\n\n/**\n * Discussion field for the `root/site` entity.\n */\nexport default siteDiscussionField;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AAOnB,IAAM,sBAA6C;AAAA,EAClD,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,YAAa;AAAA,EACxB,MAAM;AAAA,EACN,UAAU,CAAE,EAAE,KAAK,MAAO,KAAK,0BAA0B;AAAA,EACzD,UAAU,CAAE,EAAE,MAAM,OAAS;AAAA,IAC5B,wBAAwB,SAAS;AAAA,EAClC;AAAA,EACA,QAAQ,CAAE,EAAE,KAAK,MAAO;AACvB,WAAO,KAAK,2BAA2B,aACpC,gBAAI,eAAgB,QACpB,gBAAI,iBAAkB;AAAA,EAC1B;AAAA,EACA,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;AAAA,EACA,eAAe;AAAA,EACf,cAAc;AAAA,EACd,UAAU;AACX;AAKA,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|