@wordpress/fields 0.3.0 → 0.4.1-next.082ed6819.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 +20 -0
- package/build/actions/utils.js +2 -2
- package/build/actions/utils.js.map +1 -1
- package/build/fields/author/author-view.js +72 -0
- package/build/fields/author/author-view.js.map +1 -0
- package/build/fields/author/index.js +35 -0
- package/build/fields/author/index.js.map +1 -0
- package/build/fields/comment-status/index.js +40 -0
- package/build/fields/comment-status/index.js.map +1 -0
- package/build/fields/date/date-view.js +69 -0
- package/build/fields/date/date-view.js.map +1 -0
- package/build/fields/date/index.js +29 -0
- package/build/fields/date/index.js.map +1 -0
- package/build/fields/featured-image/featured-image-edit.js.map +1 -1
- package/build/fields/featured-image/featured-image-view.js.map +1 -1
- package/build/fields/featured-image/index.js +0 -3
- package/build/fields/featured-image/index.js.map +1 -1
- package/build/fields/index.js +35 -0
- package/build/fields/index.js.map +1 -1
- package/build/fields/order/index.js +1 -1
- package/build/fields/order/index.js.map +1 -1
- package/build/fields/parent/index.js +0 -3
- package/build/fields/parent/index.js.map +1 -1
- package/build/fields/parent/parent-edit.js +6 -6
- package/build/fields/parent/parent-edit.js.map +1 -1
- package/build/fields/parent/parent-view.js +1 -1
- package/build/fields/parent/parent-view.js.map +1 -1
- package/build/fields/password/edit.js +65 -0
- package/build/fields/password/edit.js.map +1 -0
- package/build/fields/password/index.js +30 -0
- package/build/fields/password/index.js.map +1 -0
- package/build/fields/slug/index.js +0 -3
- package/build/fields/slug/index.js.map +1 -1
- package/build/fields/slug/slug-edit.js +23 -26
- package/build/fields/slug/slug-edit.js.map +1 -1
- package/build/fields/slug/slug-view.js +3 -2
- package/build/fields/slug/slug-view.js.map +1 -1
- package/build/fields/slug/utils.js +21 -0
- package/build/fields/slug/utils.js.map +1 -0
- package/build/fields/status/index.js +37 -0
- package/build/fields/status/index.js.map +1 -0
- package/build/fields/status/status-elements.js +46 -0
- package/build/fields/status/status-elements.js.map +1 -0
- package/build/fields/status/status-view.js +41 -0
- package/build/fields/status/status-view.js.map +1 -0
- package/build/fields/title/index.js +5 -1
- package/build/fields/title/index.js.map +1 -1
- package/build/fields/title/title-view.js +61 -0
- package/build/fields/title/title-view.js.map +1 -0
- package/build/index.js.map +1 -1
- package/build/types.js.map +1 -1
- package/build-module/actions/utils.js +2 -2
- package/build-module/actions/utils.js.map +1 -1
- package/build-module/fields/author/author-view.js +64 -0
- package/build-module/fields/author/author-view.js.map +1 -0
- package/build-module/fields/author/index.js +29 -0
- package/build-module/fields/author/index.js.map +1 -0
- package/build-module/fields/comment-status/index.js +35 -0
- package/build-module/fields/comment-status/index.js.map +1 -0
- package/build-module/fields/date/date-view.js +62 -0
- package/build-module/fields/date/date-view.js.map +1 -0
- package/build-module/fields/date/index.js +23 -0
- package/build-module/fields/date/index.js.map +1 -0
- package/build-module/fields/featured-image/featured-image-edit.js +1 -2
- package/build-module/fields/featured-image/featured-image-edit.js.map +1 -1
- package/build-module/fields/featured-image/featured-image-view.js.map +1 -1
- package/build-module/fields/featured-image/index.js +2 -4
- package/build-module/fields/featured-image/index.js.map +1 -1
- package/build-module/fields/index.js +5 -0
- package/build-module/fields/index.js.map +1 -1
- package/build-module/fields/order/index.js +2 -1
- package/build-module/fields/order/index.js.map +1 -1
- package/build-module/fields/parent/index.js +2 -4
- package/build-module/fields/parent/index.js.map +1 -1
- package/build-module/fields/parent/parent-edit.js +10 -8
- package/build-module/fields/parent/parent-edit.js.map +1 -1
- package/build-module/fields/parent/parent-view.js +1 -1
- package/build-module/fields/parent/parent-view.js.map +1 -1
- package/build-module/fields/password/edit.js +58 -0
- package/build-module/fields/password/edit.js.map +1 -0
- package/build-module/fields/password/index.js +23 -0
- package/build-module/fields/password/index.js.map +1 -0
- package/build-module/fields/slug/index.js +2 -4
- package/build-module/fields/slug/index.js.map +1 -1
- package/build-module/fields/slug/slug-edit.js +25 -27
- package/build-module/fields/slug/slug-edit.js.map +1 -1
- package/build-module/fields/slug/slug-view.js +3 -2
- package/build-module/fields/slug/slug-view.js.map +1 -1
- package/build-module/fields/slug/utils.js +13 -0
- package/build-module/fields/slug/utils.js.map +1 -0
- package/build-module/fields/status/index.js +31 -0
- package/build-module/fields/status/index.js.map +1 -0
- package/build-module/fields/status/status-elements.js +40 -0
- package/build-module/fields/status/status-elements.js.map +1 -0
- package/build-module/fields/status/status-view.js +34 -0
- package/build-module/fields/status/status-view.js.map +1 -0
- package/build-module/fields/title/index.js +4 -1
- package/build-module/fields/title/index.js.map +1 -1
- package/build-module/fields/title/title-view.js +55 -0
- package/build-module/fields/title/title-view.js.map +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/types.js.map +1 -1
- package/build-style/{styles-rtl.css → style-rtl.css} +77 -0
- package/build-style/{styles.css → style.css} +77 -0
- package/build-types/fields/author/author-view.d.ts +9 -0
- package/build-types/fields/author/author-view.d.ts.map +1 -0
- package/build-types/fields/author/index.d.ts +14 -0
- package/build-types/fields/author/index.d.ts.map +1 -0
- package/build-types/fields/comment-status/index.d.ts +14 -0
- package/build-types/fields/comment-status/index.d.ts.map +1 -0
- package/build-types/fields/date/date-view.d.ts +9 -0
- package/build-types/fields/date/date-view.d.ts.map +1 -0
- package/build-types/fields/date/index.d.ts +14 -0
- package/build-types/fields/date/index.d.ts.map +1 -0
- 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 +1 -1
- package/build-types/fields/featured-image/featured-image-view.d.ts.map +1 -1
- package/build-types/fields/featured-image/index.d.ts.map +1 -1
- package/build-types/fields/index.d.ts +5 -0
- package/build-types/fields/index.d.ts.map +1 -1
- package/build-types/fields/order/index.d.ts.map +1 -1
- package/build-types/fields/parent/index.d.ts.map +1 -1
- package/build-types/fields/parent/parent-edit.d.ts +3 -0
- package/build-types/fields/parent/parent-edit.d.ts.map +1 -1
- package/build-types/fields/parent/parent-view.d.ts +1 -1
- package/build-types/fields/parent/parent-view.d.ts.map +1 -1
- package/build-types/fields/password/edit.d.ts +8 -0
- package/build-types/fields/password/edit.d.ts.map +1 -0
- package/build-types/fields/password/index.d.ts +14 -0
- package/build-types/fields/password/index.d.ts.map +1 -0
- package/build-types/fields/slug/index.d.ts.map +1 -1
- package/build-types/fields/slug/slug-edit.d.ts.map +1 -1
- package/build-types/fields/slug/slug-view.d.ts.map +1 -1
- package/build-types/fields/slug/utils.d.ts +6 -0
- package/build-types/fields/slug/utils.d.ts.map +1 -0
- package/build-types/fields/status/index.d.ts +14 -0
- package/build-types/fields/status/index.d.ts.map +1 -0
- package/build-types/fields/status/status-elements.d.ts +13 -0
- package/build-types/fields/status/status-elements.d.ts.map +1 -0
- package/build-types/fields/status/status-view.d.ts +9 -0
- package/build-types/fields/status/status-view.d.ts.map +1 -0
- package/build-types/fields/title/index.d.ts.map +1 -1
- package/build-types/fields/title/title-view.d.ts +9 -0
- package/build-types/fields/title/title-view.d.ts.map +1 -0
- package/build-types/index.d.ts +1 -0
- package/build-types/index.d.ts.map +1 -1
- package/build-types/lock-unlock.d.ts +1 -1
- package/build-types/lock-unlock.d.ts.map +1 -1
- package/build-types/types.d.ts +14 -1
- package/build-types/types.d.ts.map +1 -1
- package/package.json +23 -21
- package/src/actions/utils.ts +2 -2
- package/src/fields/author/author-view.tsx +63 -0
- package/src/fields/author/index.tsx +32 -0
- package/src/fields/comment-status/index.tsx +40 -0
- package/src/fields/date/date-view.tsx +92 -0
- package/src/fields/date/index.tsx +23 -0
- package/src/fields/featured-image/featured-image-edit.tsx +2 -1
- package/src/fields/featured-image/featured-image-view.tsx +1 -1
- package/src/fields/featured-image/index.ts +1 -2
- package/src/fields/featured-image/style.scss +2 -5
- package/src/fields/index.ts +5 -0
- package/src/fields/order/index.ts +2 -1
- package/src/fields/parent/index.ts +1 -2
- package/src/fields/parent/parent-edit.tsx +9 -9
- package/src/fields/parent/parent-view.tsx +2 -2
- package/src/fields/password/edit.tsx +68 -0
- package/src/fields/password/index.tsx +24 -0
- package/src/fields/slug/index.ts +1 -2
- package/src/fields/slug/slug-edit.tsx +21 -24
- package/src/fields/slug/slug-view.tsx +3 -2
- package/src/fields/slug/utils.ts +15 -0
- package/src/fields/status/index.tsx +32 -0
- package/src/fields/status/status-elements.tsx +50 -0
- package/src/fields/status/status-view.tsx +28 -0
- package/src/fields/title/index.ts +3 -0
- package/src/fields/title/title-view.tsx +62 -0
- package/src/index.ts +1 -0
- package/src/style.scss +2 -0
- package/src/types.ts +17 -1
- package/tsconfig.json +10 -9
- package/tsconfig.tsbuildinfo +1 -1
- package/src/styles.scss +0 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
8
|
var _i18n = require("@wordpress/i18n");
|
|
8
9
|
var _utils = require("../../actions/utils");
|
|
10
|
+
var _titleView = _interopRequireDefault(require("./title-view"));
|
|
9
11
|
/**
|
|
10
12
|
* WordPress dependencies
|
|
11
13
|
*/
|
|
@@ -21,7 +23,9 @@ const titleField = {
|
|
|
21
23
|
placeholder: (0, _i18n.__)('No title'),
|
|
22
24
|
getValue: ({
|
|
23
25
|
item
|
|
24
|
-
}) => (0, _utils.getItemTitle)(item)
|
|
26
|
+
}) => (0, _utils.getItemTitle)(item),
|
|
27
|
+
render: _titleView.default,
|
|
28
|
+
enableHiding: false
|
|
25
29
|
};
|
|
26
30
|
var _default = exports.default = titleField;
|
|
27
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_utils","titleField","type","id","label","__","placeholder","getValue","item","getItemTitle","_default","exports","default"],"sources":["@wordpress/fields/src/fields/title/index.ts"],"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 { getItemTitle } from '../../actions/utils';\n\nconst titleField: Field< BasePost > = {\n\ttype: 'text',\n\tid: 'title',\n\tlabel: __( 'Title' ),\n\tplaceholder: __( 'No title' ),\n\tgetValue: ( { item } ) => getItemTitle( item ),\n};\n\nexport default titleField;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_i18n","require","_utils","_titleView","_interopRequireDefault","titleField","type","id","label","__","placeholder","getValue","item","getItemTitle","render","TitleView","enableHiding","_default","exports","default"],"sources":["@wordpress/fields/src/fields/title/index.ts"],"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 { getItemTitle } from '../../actions/utils';\nimport TitleView from './title-view';\n\nconst titleField: Field< BasePost > = {\n\ttype: 'text',\n\tid: 'title',\n\tlabel: __( 'Title' ),\n\tplaceholder: __( 'No title' ),\n\tgetValue: ( { item } ) => getItemTitle( item ),\n\trender: TitleView,\n\tenableHiding: false,\n};\n\nexport default titleField;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAXA;AACA;AACA;;AAIA;AACA;AACA;;AAKA,MAAMI,UAA6B,GAAG;EACrCC,IAAI,EAAE,MAAM;EACZC,EAAE,EAAE,OAAO;EACXC,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,WAAW,EAAE,IAAAD,QAAE,EAAE,UAAW,CAAC;EAC7BE,QAAQ,EAAEA,CAAE;IAAEC;EAAK,CAAC,KAAM,IAAAC,mBAAY,EAAED,IAAK,CAAC;EAC9CE,MAAM,EAAEC,kBAAS;EACjBC,YAAY,EAAE;AACf,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _components = require("@wordpress/components");
|
|
8
|
+
var _htmlEntities = require("@wordpress/html-entities");
|
|
9
|
+
var _i18n = require("@wordpress/i18n");
|
|
10
|
+
var _data = require("@wordpress/data");
|
|
11
|
+
var _coreData = require("@wordpress/core-data");
|
|
12
|
+
var _utils = require("../../actions/utils");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
/**
|
|
15
|
+
* WordPress dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const TitleView = ({
|
|
23
|
+
item
|
|
24
|
+
}) => {
|
|
25
|
+
const {
|
|
26
|
+
frontPageId,
|
|
27
|
+
postsPageId
|
|
28
|
+
} = (0, _data.useSelect)(select => {
|
|
29
|
+
const {
|
|
30
|
+
getEntityRecord
|
|
31
|
+
} = select(_coreData.store);
|
|
32
|
+
const siteSettings = getEntityRecord('root', 'site', '');
|
|
33
|
+
return {
|
|
34
|
+
frontPageId: siteSettings?.page_on_front,
|
|
35
|
+
postsPageId: siteSettings?.page_for_posts
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
const renderedTitle = (0, _utils.getItemTitle)(item);
|
|
39
|
+
let suffix;
|
|
40
|
+
if (item.id === frontPageId) {
|
|
41
|
+
suffix = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
42
|
+
className: "edit-site-post-list__title-badge",
|
|
43
|
+
children: (0, _i18n.__)('Homepage')
|
|
44
|
+
});
|
|
45
|
+
} else if (item.id === postsPageId) {
|
|
46
|
+
suffix = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
47
|
+
className: "edit-site-post-list__title-badge",
|
|
48
|
+
children: (0, _i18n.__)('Posts Page')
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
52
|
+
className: "edit-site-post-list__title",
|
|
53
|
+
alignment: "center",
|
|
54
|
+
justify: "flex-start",
|
|
55
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
56
|
+
children: (0, _htmlEntities.decodeEntities)(renderedTitle) || (0, _i18n.__)('(no title)')
|
|
57
|
+
}), suffix]
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
var _default = exports.default = TitleView;
|
|
61
|
+
//# sourceMappingURL=title-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_htmlEntities","_i18n","_data","_coreData","_utils","_jsxRuntime","TitleView","item","frontPageId","postsPageId","useSelect","select","getEntityRecord","coreStore","siteSettings","page_on_front","page_for_posts","renderedTitle","getItemTitle","suffix","id","jsx","className","children","__","jsxs","__experimentalHStack","alignment","justify","decodeEntities","_default","exports","default"],"sources":["@wordpress/fields/src/fields/title/title-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Settings } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\nimport { getItemTitle } from '../../actions/utils';\n\nconst TitleView = ( { item }: { item: BasePost } ) => {\n\tconst { frontPageId, postsPageId } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst siteSettings: Settings | undefined = getEntityRecord(\n\t\t\t'root',\n\t\t\t'site',\n\t\t\t''\n\t\t);\n\t\treturn {\n\t\t\tfrontPageId: siteSettings?.page_on_front,\n\t\t\tpostsPageId: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\n\tconst renderedTitle = getItemTitle( item );\n\n\tlet suffix;\n\tif ( item.id === frontPageId ) {\n\t\tsuffix = (\n\t\t\t<span className=\"edit-site-post-list__title-badge\">\n\t\t\t\t{ __( 'Homepage' ) }\n\t\t\t</span>\n\t\t);\n\t} else if ( item.id === postsPageId ) {\n\t\tsuffix = (\n\t\t\t<span className=\"edit-site-post-list__title-badge\">\n\t\t\t\t{ __( 'Posts Page' ) }\n\t\t\t</span>\n\t\t);\n\t}\n\n\treturn (\n\t\t<HStack\n\t\t\tclassName=\"edit-site-post-list__title\"\n\t\t\talignment=\"center\"\n\t\t\tjustify=\"flex-start\"\n\t\t>\n\t\t\t<span>\n\t\t\t\t{ decodeEntities( renderedTitle ) || __( '(no title)' ) }\n\t\t\t</span>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n};\n\nexport default TitleView;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAOA,IAAAK,MAAA,GAAAL,OAAA;AAAmD,IAAAM,WAAA,GAAAN,OAAA;AAdnD;AACA;AACA;;AAQA;AACA;AACA;;AAIA,MAAMO,SAAS,GAAGA,CAAE;EAAEC;AAAyB,CAAC,KAAM;EACrD,MAAM;IAAEC,WAAW;IAAEC;EAAY,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC7D,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IAC/C,MAAMC,YAAkC,GAAGF,eAAe,CACzD,MAAM,EACN,MAAM,EACN,EACD,CAAC;IACD,OAAO;MACNJ,WAAW,EAAEM,YAAY,EAAEC,aAAa;MACxCN,WAAW,EAAEK,YAAY,EAAEE;IAC5B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,aAAa,GAAG,IAAAC,mBAAY,EAAEX,IAAK,CAAC;EAE1C,IAAIY,MAAM;EACV,IAAKZ,IAAI,CAACa,EAAE,KAAKZ,WAAW,EAAG;IAC9BW,MAAM,gBACL,IAAAd,WAAA,CAAAgB,GAAA;MAAMC,SAAS,EAAC,kCAAkC;MAAAC,QAAA,EAC/C,IAAAC,QAAE,EAAE,UAAW;IAAC,CACb,CACN;EACF,CAAC,MAAM,IAAKjB,IAAI,CAACa,EAAE,KAAKX,WAAW,EAAG;IACrCU,MAAM,gBACL,IAAAd,WAAA,CAAAgB,GAAA;MAAMC,SAAS,EAAC,kCAAkC;MAAAC,QAAA,EAC/C,IAAAC,QAAE,EAAE,YAAa;IAAC,CACf,CACN;EACF;EAEA,oBACC,IAAAnB,WAAA,CAAAoB,IAAA,EAAC3B,WAAA,CAAA4B,oBAAM;IACNJ,SAAS,EAAC,4BAA4B;IACtCK,SAAS,EAAC,QAAQ;IAClBC,OAAO,EAAC,YAAY;IAAAL,QAAA,gBAEpB,IAAAlB,WAAA,CAAAgB,GAAA;MAAAE,QAAA,EACG,IAAAM,4BAAc,EAAEZ,aAAc,CAAC,IAAI,IAAAO,QAAE,EAAE,YAAa;IAAC,CAClD,CAAC,EACLL,MAAM;EAAA,CACD,CAAC;AAEX,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa1B,SAAS","ignoreList":[]}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_fields","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_actions"],"sources":["@wordpress/fields/src/index.ts"],"sourcesContent":["export * from './fields';\nexport * from './actions';\n"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_fields","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_actions"],"sources":["@wordpress/fields/src/index.ts"],"sourcesContent":["export * from './fields';\nexport * from './actions';\nexport type * from './types';\n"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/fields/src/types.ts"],"sourcesContent":["type PostStatus =\n\t| '
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/fields/src/types.ts"],"sourcesContent":["type PostStatus =\n\t| 'publish'\n\t| 'draft'\n\t| 'pending'\n\t| 'private'\n\t| 'future'\n\t| 'auto-draft'\n\t| 'trash';\n\nexport interface CommonPost {\n\tstatus?: PostStatus;\n\ttitle: string | { rendered: string } | { raw: string };\n\tcontent: string | { raw: string; rendered: string };\n\ttype: string;\n\tid: string | number;\n\tblocks?: Object[];\n\t_links?: Links;\n}\n\ninterface Links {\n\t'predecessor-version'?: { href: string; id: number }[];\n\t'version-history'?: { href: string; count: number }[];\n\t[ key: string ]: { href: string }[] | undefined;\n}\n\ninterface Author {\n\tname: string;\n\tavatar_urls: Record< string, string >;\n}\n\ninterface EmbeddedAuthor {\n\tauthor: Author[];\n}\n\nexport interface BasePost extends CommonPost {\n\tcomment_status?: 'open' | 'closed';\n\texcerpt?: string | { raw: string; rendered: string };\n\tmeta?: Record< string, any >;\n\tparent?: number;\n\tpassword?: string;\n\ttemplate?: string;\n\tformat?: string;\n\tfeatured_media?: number;\n\tmenu_order?: number;\n\tping_status?: 'open' | 'closed';\n\tlink?: string;\n\tslug?: string;\n\tpermalink_template?: string;\n\tdate?: string;\n\tmodified?: string;\n\tauthor?: number;\n}\n\nexport interface BasePostWithEmbeddedAuthor extends BasePost {\n\t_embedded: EmbeddedAuthor;\n}\n\nexport interface Template extends CommonPost {\n\ttype: 'wp_template';\n\tis_custom: boolean;\n\tsource: string;\n\torigin: string;\n\tplugin?: string;\n\thas_theme_file: boolean;\n\tid: string;\n}\n\nexport interface TemplatePart extends CommonPost {\n\ttype: 'wp_template_part';\n\tsource: string;\n\torigin: string;\n\thas_theme_file: boolean;\n\tid: string;\n\tarea: string;\n\tplugin?: string;\n}\n\nexport interface Pattern extends CommonPost {\n\tslug: string;\n\ttitle: { raw: string };\n\twp_pattern_sync_status: string;\n}\n\nexport type Post = Template | TemplatePart | Pattern | BasePost;\n\nexport type PostWithPermissions = Post & {\n\tpermissions: {\n\t\tdelete: boolean;\n\t\tupdate: boolean;\n\t};\n};\n\nexport interface PostType {\n\tslug: string;\n\tviewable: boolean;\n\tsupports?: {\n\t\t'page-attributes'?: boolean;\n\t\ttitle?: boolean;\n\t\trevisions?: boolean;\n\t};\n}\n\n// Will be unnecessary after typescript 5.0 upgrade.\nexport type CoreDataError = { message?: string; code?: string };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -27,10 +27,10 @@ export function getItemTitle(item) {
|
|
|
27
27
|
if (typeof item.title === 'string') {
|
|
28
28
|
return decodeEntities(item.title);
|
|
29
29
|
}
|
|
30
|
-
if ('rendered' in item.title) {
|
|
30
|
+
if (item.title && 'rendered' in item.title) {
|
|
31
31
|
return decodeEntities(item.title.rendered);
|
|
32
32
|
}
|
|
33
|
-
if ('raw' in item.title) {
|
|
33
|
+
if (item.title && 'raw' in item.title) {
|
|
34
34
|
return decodeEntities(item.title.raw);
|
|
35
35
|
}
|
|
36
36
|
return '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["decodeEntities","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","isTemplate","post","type","isTemplatePart","isTemplateOrTemplatePart","p","getItemTitle","item","title","rendered","raw","isTemplateRemovable","template","source","includes","Boolean","has_theme_file"],"sources":["@wordpress/fields/src/actions/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport type { Post, TemplatePart, Template } from '../types';\n\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\n\nexport function isTemplate( post: Post ): post is Template {\n\treturn post.type === TEMPLATE_POST_TYPE;\n}\n\nexport function isTemplatePart( post: Post ): post is TemplatePart {\n\treturn post.type === TEMPLATE_PART_POST_TYPE;\n}\n\nexport function isTemplateOrTemplatePart(\n\tp: Post\n): p is Template | TemplatePart {\n\treturn p.type === TEMPLATE_POST_TYPE || p.type === TEMPLATE_PART_POST_TYPE;\n}\n\nexport function getItemTitle( item: Post ) {\n\tif ( typeof item.title === 'string' ) {\n\t\treturn decodeEntities( item.title );\n\t}\n\tif ( 'rendered' in item.title ) {\n\t\treturn decodeEntities( item.title.rendered );\n\t}\n\tif ( 'raw' in item.title ) {\n\t\treturn decodeEntities( item.title.raw );\n\t}\n\treturn '';\n}\n\n/**\n * Check if a template is removable.\n *\n * @param template The template entity to check.\n * @return Whether the template is removable.\n */\nexport function isTemplateRemovable( template: Template | TemplatePart ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\t// In patterns list page we map the templates parts to a different object\n\t// than the one returned from the endpoint. This is why we need to check for\n\t// two props whether is custom or has a theme file.\n\treturn (\n\t\t[ template.source, template.source ].includes(\n\t\t\tTEMPLATE_ORIGINS.custom\n\t\t) &&\n\t\t! Boolean( template.type === 'wp_template' && template?.plugin ) &&\n\t\t! template.has_theme_file\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;;AAGA,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAC/C,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB;AACzD,OAAO,MAAMC,gBAAgB,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AAED,OAAO,SAASC,UAAUA,CAAEC,IAAU,EAAqB;EAC1D,OAAOA,IAAI,CAACC,IAAI,KAAKR,kBAAkB;AACxC;AAEA,OAAO,SAASS,cAAcA,CAAEF,IAAU,EAAyB;EAClE,OAAOA,IAAI,CAACC,IAAI,KAAKP,uBAAuB;AAC7C;AAEA,OAAO,SAASS,wBAAwBA,CACvCC,CAAO,EACwB;EAC/B,OAAOA,CAAC,CAACH,IAAI,KAAKR,kBAAkB,IAAIW,CAAC,CAACH,IAAI,KAAKP,uBAAuB;AAC3E;AAEA,OAAO,SAASW,YAAYA,CAAEC,IAAU,EAAG;EAC1C,IAAK,OAAOA,IAAI,CAACC,KAAK,KAAK,QAAQ,EAAG;IACrC,OAAOf,cAAc,CAAEc,IAAI,CAACC,KAAM,CAAC;EACpC;EACA,
|
|
1
|
+
{"version":3,"names":["decodeEntities","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","isTemplate","post","type","isTemplatePart","isTemplateOrTemplatePart","p","getItemTitle","item","title","rendered","raw","isTemplateRemovable","template","source","includes","Boolean","has_theme_file"],"sources":["@wordpress/fields/src/actions/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport type { Post, TemplatePart, Template } from '../types';\n\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\n\nexport function isTemplate( post: Post ): post is Template {\n\treturn post.type === TEMPLATE_POST_TYPE;\n}\n\nexport function isTemplatePart( post: Post ): post is TemplatePart {\n\treturn post.type === TEMPLATE_PART_POST_TYPE;\n}\n\nexport function isTemplateOrTemplatePart(\n\tp: Post\n): p is Template | TemplatePart {\n\treturn p.type === TEMPLATE_POST_TYPE || p.type === TEMPLATE_PART_POST_TYPE;\n}\n\nexport function getItemTitle( item: Post ) {\n\tif ( typeof item.title === 'string' ) {\n\t\treturn decodeEntities( item.title );\n\t}\n\tif ( item.title && 'rendered' in item.title ) {\n\t\treturn decodeEntities( item.title.rendered );\n\t}\n\tif ( item.title && 'raw' in item.title ) {\n\t\treturn decodeEntities( item.title.raw );\n\t}\n\treturn '';\n}\n\n/**\n * Check if a template is removable.\n *\n * @param template The template entity to check.\n * @return Whether the template is removable.\n */\nexport function isTemplateRemovable( template: Template | TemplatePart ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\t// In patterns list page we map the templates parts to a different object\n\t// than the one returned from the endpoint. This is why we need to check for\n\t// two props whether is custom or has a theme file.\n\treturn (\n\t\t[ template.source, template.source ].includes(\n\t\t\tTEMPLATE_ORIGINS.custom\n\t\t) &&\n\t\t! Boolean( template.type === 'wp_template' && template?.plugin ) &&\n\t\t! template.has_theme_file\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;;AAGA,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAC/C,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB;AACzD,OAAO,MAAMC,gBAAgB,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AAED,OAAO,SAASC,UAAUA,CAAEC,IAAU,EAAqB;EAC1D,OAAOA,IAAI,CAACC,IAAI,KAAKR,kBAAkB;AACxC;AAEA,OAAO,SAASS,cAAcA,CAAEF,IAAU,EAAyB;EACl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+
*/
|
|
9
|
+
import { __ } from '@wordpress/i18n';
|
|
10
|
+
import { useState } from '@wordpress/element';
|
|
11
|
+
import { commentAuthorAvatar as authorIcon } from '@wordpress/icons';
|
|
12
|
+
import { __experimentalHStack as HStack, Icon } from '@wordpress/components';
|
|
13
|
+
import { useSelect } from '@wordpress/data';
|
|
14
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies
|
|
18
|
+
*/
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
function AuthorView({
|
|
21
|
+
item
|
|
22
|
+
}) {
|
|
23
|
+
const {
|
|
24
|
+
text,
|
|
25
|
+
imageUrl
|
|
26
|
+
} = useSelect(select => {
|
|
27
|
+
const {
|
|
28
|
+
getEntityRecord
|
|
29
|
+
} = select(coreStore);
|
|
30
|
+
let user;
|
|
31
|
+
if (!!item.author) {
|
|
32
|
+
user = getEntityRecord('root', 'user', item.author);
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
imageUrl: user?.avatar_urls?.[48],
|
|
36
|
+
text: user?.name
|
|
37
|
+
};
|
|
38
|
+
}, [item]);
|
|
39
|
+
const [isImageLoaded, setIsImageLoaded] = useState(false);
|
|
40
|
+
return /*#__PURE__*/_jsxs(HStack, {
|
|
41
|
+
alignment: "left",
|
|
42
|
+
spacing: 0,
|
|
43
|
+
children: [!!imageUrl && /*#__PURE__*/_jsx("div", {
|
|
44
|
+
className: clsx('page-templates-author-field__avatar', {
|
|
45
|
+
'is-loaded': isImageLoaded
|
|
46
|
+
}),
|
|
47
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
48
|
+
onLoad: () => setIsImageLoaded(true),
|
|
49
|
+
alt: __('Author avatar'),
|
|
50
|
+
src: imageUrl
|
|
51
|
+
})
|
|
52
|
+
}), !imageUrl && /*#__PURE__*/_jsx("div", {
|
|
53
|
+
className: "page-templates-author-field__icon",
|
|
54
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
55
|
+
icon: authorIcon
|
|
56
|
+
})
|
|
57
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
58
|
+
className: "page-templates-author-field__name",
|
|
59
|
+
children: text
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export default AuthorView;
|
|
64
|
+
//# sourceMappingURL=author-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["clsx","__","useState","commentAuthorAvatar","authorIcon","__experimentalHStack","HStack","Icon","useSelect","store","coreStore","jsx","_jsx","jsxs","_jsxs","AuthorView","item","text","imageUrl","select","getEntityRecord","user","author","avatar_urls","name","isImageLoaded","setIsImageLoaded","alignment","spacing","children","className","onLoad","alt","src","icon"],"sources":["@wordpress/fields/src/fields/author/author-view.tsx"],"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';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { User } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport type { BasePostWithEmbeddedAuthor } from '../../types';\n\nfunction AuthorView( { item }: { item: BasePostWithEmbeddedAuthor } ) {\n\tconst { text, imageUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tlet user: User | undefined;\n\t\t\tif ( !! item.author ) {\n\t\t\t\tuser = getEntityRecord( 'root', 'user', item.author );\n\t\t\t}\n\t\t\treturn {\n\t\t\t\timageUrl: user?.avatar_urls?.[ 48 ],\n\t\t\t\ttext: user?.name,\n\t\t\t};\n\t\t},\n\t\t[ item ]\n\t);\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,mBAAmB,IAAIC,UAAU,QAAQ,kBAAkB;AACpE,SAASC,oBAAoB,IAAIC,MAAM,EAAEC,IAAI,QAAQ,uBAAuB;AAC5E,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAGzD;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAKA,SAASC,UAAUA,CAAE;EAAEC;AAA2C,CAAC,EAAG;EACrE,MAAM;IAAEC,IAAI;IAAEC;EAAS,CAAC,GAAGV,SAAS,CACjCW,MAAM,IAAM;IACb,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAET,SAAU,CAAC;IAC/C,IAAIW,IAAsB;IAC1B,IAAK,CAAC,CAAEL,IAAI,CAACM,MAAM,EAAG;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
import AuthorView from './author-view';
|
|
12
|
+
const authorField = {
|
|
13
|
+
label: __('Author'),
|
|
14
|
+
id: 'author',
|
|
15
|
+
type: 'integer',
|
|
16
|
+
elements: [],
|
|
17
|
+
render: AuthorView,
|
|
18
|
+
sort: (a, b, direction) => {
|
|
19
|
+
const nameA = a._embedded?.author?.[0]?.name || '';
|
|
20
|
+
const nameB = b._embedded?.author?.[0]?.name || '';
|
|
21
|
+
return direction === 'asc' ? nameA.localeCompare(nameB) : nameB.localeCompare(nameA);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Author field for BasePost.
|
|
27
|
+
*/
|
|
28
|
+
export default authorField;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","AuthorView","authorField","label","id","type","elements","render","sort","a","b","direction","nameA","_embedded","author","name","nameB","localeCompare"],"sources":["@wordpress/fields/src/fields/author/index.tsx"],"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\n/**\n * Author field for BasePost.\n */\nexport default authorField;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,OAAOC,UAAU,MAAM,eAAe;AAEtC,MAAMC,WAAgD,GAAG;EACxDC,KAAK,EAAEH,EAAE,CAAE,QAAS,CAAC;EACrBI,EAAE,EAAE,QAAQ;EACZC,IAAI,EAAE,SAAS;EACfC,QAAQ,EAAE,EAAE;EACZC,MAAM,EAAEN,UAAU;EAClBO,IAAI,EAAEA,CAAEC,CAAC,EAAEC,CAAC,EAAEC,SAAS,KAAM;IAC5B,MAAMC,KAAK,GAAGH,CAAC,CAACI,SAAS,EAAEC,MAAM,GAAI,CAAC,CAAE,EAAEC,IAAI,IAAI,EAAE;IACpD,MAAMC,KAAK,GAAGN,CAAC,CAACG,SAAS,EAAEC,MAAM,GAAI,CAAC,CAAE,EAAEC,IAAI,IAAI,EAAE;IAEpD,OAAOJ,SAAS,KAAK,KAAK,GACvBC,KAAK,CAACK,aAAa,CAAED,KAAM,CAAC,GAC5BA,KAAK,CAACC,aAAa,CAAEL,KAAM,CAAC;EAChC;AACD,CAAC;;AAED;AACA;AACA;AACA,eAAeV,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const commentStatusField = {
|
|
12
|
+
id: 'comment_status',
|
|
13
|
+
label: __('Discussion'),
|
|
14
|
+
type: 'text',
|
|
15
|
+
Edit: 'radio',
|
|
16
|
+
enableSorting: false,
|
|
17
|
+
filterBy: {
|
|
18
|
+
operators: []
|
|
19
|
+
},
|
|
20
|
+
elements: [{
|
|
21
|
+
value: 'open',
|
|
22
|
+
label: __('Open'),
|
|
23
|
+
description: __('Visitors can add new comments and replies.')
|
|
24
|
+
}, {
|
|
25
|
+
value: 'closed',
|
|
26
|
+
label: __('Closed'),
|
|
27
|
+
description: __('Visitors cannot add new comments or replies. Existing comments remain visible.')
|
|
28
|
+
}]
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Comment status field for BasePost.
|
|
33
|
+
*/
|
|
34
|
+
export default commentStatusField;
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","commentStatusField","id","label","type","Edit","enableSorting","filterBy","operators","elements","value","description"],"sources":["@wordpress/fields/src/fields/comment-status/index.tsx"],"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: __( 'Discussion' ),\n\ttype: 'text',\n\tEdit: 'radio',\n\tenableSorting: false,\n\tfilterBy: {\n\t\toperators: [],\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: '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"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAGA,MAAMC,kBAAqC,GAAG;EAC7CC,EAAE,EAAE,gBAAgB;EACpBC,KAAK,EAAEH,EAAE,CAAE,YAAa,CAAC;EACzBI,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,OAAO;EACbC,aAAa,EAAE,KAAK;EACpBC,QAAQ,EAAE;IACTC,SAAS,EAAE;EACZ,CAAC;EACDC,QAAQ,EAAE,CACT;IACCC,KAAK,EAAE,MAAM;IACbP,KAAK,EAAEH,EAAE,CAAE,MAAO,CAAC;IACnBW,WAAW,EAAEX,EAAE,CAAE,4CAA6C;EAC/D,CAAC,EACD;IACCU,KAAK,EAAE,QAAQ;IACfP,KAAK,EAAEH,EAAE,CAAE,QAAS,CAAC;IACrBW,WAAW,EAAEX,EAAE,CACd,gFACD;EACD,CAAC;AAEH,CAAC;;AAED;AACA;AACA;AACA,eAAeC,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
import { createInterpolateElement } from '@wordpress/element';
|
|
6
|
+
import { dateI18n, getDate, getSettings } from '@wordpress/date';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
const getFormattedDate = dateToDisplay => dateI18n(getSettings().formats.datetimeAbbreviated, getDate(dateToDisplay));
|
|
13
|
+
const DateView = ({
|
|
14
|
+
item
|
|
15
|
+
}) => {
|
|
16
|
+
var _item$status, _item$modified, _item$date4, _item$date5;
|
|
17
|
+
const isDraftOrPrivate = ['draft', 'private'].includes((_item$status = item.status) !== null && _item$status !== void 0 ? _item$status : '');
|
|
18
|
+
if (isDraftOrPrivate) {
|
|
19
|
+
var _item$date;
|
|
20
|
+
return createInterpolateElement(sprintf(/* translators: %s: page creation or modification date. */
|
|
21
|
+
__('<span>Modified: <time>%s</time></span>'), getFormattedDate((_item$date = item.date) !== null && _item$date !== void 0 ? _item$date : null)), {
|
|
22
|
+
span: /*#__PURE__*/_jsx("span", {}),
|
|
23
|
+
time: /*#__PURE__*/_jsx("time", {})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const isScheduled = item.status === 'future';
|
|
27
|
+
if (isScheduled) {
|
|
28
|
+
var _item$date2;
|
|
29
|
+
return createInterpolateElement(sprintf(/* translators: %s: page creation date */
|
|
30
|
+
__('<span>Scheduled: <time>%s</time></span>'), getFormattedDate((_item$date2 = item.date) !== null && _item$date2 !== void 0 ? _item$date2 : null)), {
|
|
31
|
+
span: /*#__PURE__*/_jsx("span", {}),
|
|
32
|
+
time: /*#__PURE__*/_jsx("time", {})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const isPublished = item.status === 'publish';
|
|
36
|
+
if (isPublished) {
|
|
37
|
+
var _item$date3;
|
|
38
|
+
return createInterpolateElement(sprintf(/* translators: %s: page creation time */
|
|
39
|
+
__('<span>Published: <time>%s</time></span>'), getFormattedDate((_item$date3 = item.date) !== null && _item$date3 !== void 0 ? _item$date3 : null)), {
|
|
40
|
+
span: /*#__PURE__*/_jsx("span", {}),
|
|
41
|
+
time: /*#__PURE__*/_jsx("time", {})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Pending posts show the modified date if it's newer.
|
|
46
|
+
const dateToDisplay = getDate((_item$modified = item.modified) !== null && _item$modified !== void 0 ? _item$modified : null) > getDate((_item$date4 = item.date) !== null && _item$date4 !== void 0 ? _item$date4 : null) ? item.modified : item.date;
|
|
47
|
+
const isPending = item.status === 'pending';
|
|
48
|
+
if (isPending) {
|
|
49
|
+
return createInterpolateElement(sprintf(/* translators: %s: page creation or modification date. */
|
|
50
|
+
__('<span>Modified: <time>%s</time></span>'), getFormattedDate(dateToDisplay !== null && dateToDisplay !== void 0 ? dateToDisplay : null)), {
|
|
51
|
+
span: /*#__PURE__*/_jsx("span", {}),
|
|
52
|
+
time: /*#__PURE__*/_jsx("time", {})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Unknow status.
|
|
57
|
+
return /*#__PURE__*/_jsx("time", {
|
|
58
|
+
children: getFormattedDate((_item$date5 = item.date) !== null && _item$date5 !== void 0 ? _item$date5 : null)
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
export default DateView;
|
|
62
|
+
//# sourceMappingURL=date-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","sprintf","createInterpolateElement","dateI18n","getDate","getSettings","jsx","_jsx","getFormattedDate","dateToDisplay","formats","datetimeAbbreviated","DateView","item","_item$status","_item$modified","_item$date4","_item$date5","isDraftOrPrivate","includes","status","_item$date","date","span","time","isScheduled","_item$date2","isPublished","_item$date3","modified","isPending","children"],"sources":["@wordpress/fields/src/fields/date/date-view.tsx"],"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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,QAAQ,iBAAiB;;AAEhE;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAKA,MAAMC,gBAAgB,GAAKC,aAA4B,IACtDN,QAAQ,CACPE,WAAW,CAAC,CAAC,CAACK,OAAO,CAACC,mBAAmB,EACzCP,OAAO,CAAEK,aAAc,CACxB,CAAC;AAEF,MAAMG,QAAQ,GAAGA,CAAE;EAAEC;AAAyB,CAAC,KAAM;EAAA,IAAAC,YAAA,EAAAC,cAAA,EAAAC,WAAA,EAAAC,WAAA;EACpD,MAAMC,gBAAgB,GAAG,CAAE,OAAO,EAAE,SAAS,CA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AAAW,cAAA,GAAEF,IAAI,CAACgB,QAAQ,cAAAd,cAAA,cAAAA,cAAA,GAAI,IAAK,CAAC,GAAGX,OAAO,EAAAY,WAAA,GAAEH,IAAI,CAACS,IAAI,cAAAN,WAAA,cAAAA,WAAA,GAAI,IAAK,CAAC,GAC5DH,IAAI,CAACgB,QAAQ,GACbhB,IAAI,CAACS,IAAI;EAEb,MAAMQ,SAAS,GAAGjB,IAAI,CAACO,MAAM,KAAK,SAAS;EAC3C,IAAKU,SAAS,EAAG;IAChB,OAAO5B,wBAAwB,CAC9BD,OAAO,CACN;IACAD,EAAE,CAAE,wCAAyC,CAAC,EAC9CQ,gBAAgB,CAAEC,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAI,IAAK,CACzC,CAAC,EACD;MACCc,IAAI,eAAEhB,IAAA,WAAO,CAAC;MACdiB,IAAI,eAAEjB,IAAA,WAAO;IACd,CACD,CAAC;EACF;;EAEA;EACA,oBAAOA,IAAA;IAAAwB,QAAA,EAAQvB,gBAAgB,EAAAS,WAAA,GAAEJ,IAAI,CAACS,IAAI,cAAAL,WAAA,cAAAA,WAAA,GAAI,IAAK;EAAC,CAAQ,CAAC;AAC9D,CAAC;AAED,eAAeL,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import DateView from './date-view';
|
|
12
|
+
const dateField = {
|
|
13
|
+
id: 'date',
|
|
14
|
+
type: 'datetime',
|
|
15
|
+
label: __('Date'),
|
|
16
|
+
render: DateView
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Date field for BasePost.
|
|
21
|
+
*/
|
|
22
|
+
export default dateField;
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","DateView","dateField","id","type","label","render"],"sources":["@wordpress/fields/src/fields/date/index.tsx"],"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};\n\n/**\n * Date field for BasePost.\n */\nexport default dateField;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,OAAOC,QAAQ,MAAM,aAAa;AAElC,MAAMC,SAA4B,GAAG;EACpCC,EAAE,EAAE,MAAM;EACVC,IAAI,EAAE,UAAU;EAChBC,KAAK,EAAEL,EAAE,CAAE,MAAO,CAAC;EACnBM,MAAM,EAAEL;AACT,CAAC;;AAED;AACA;AACA;AACA,eAAeC,SAAS","ignoreList":[]}
|
|
@@ -8,12 +8,11 @@ import { useCallback, useRef } from '@wordpress/element';
|
|
|
8
8
|
import { MediaUpload } from '@wordpress/media-utils';
|
|
9
9
|
import { lineSolid } from '@wordpress/icons';
|
|
10
10
|
import { store as coreStore } from '@wordpress/core-data';
|
|
11
|
+
import { __ } from '@wordpress/i18n';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Internal dependencies
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
-
import { __ } from '@wordpress/i18n';
|
|
17
16
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
17
|
export const FeaturedImageEdit = ({
|
|
19
18
|
data,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","__experimentalGrid","Grid","useSelect","useCallback","useRef","MediaUpload","lineSolid","store","coreStore","__","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","FeaturedImageEdit","data","field","onChange","id","value","getValue","item","media","select","getEntityRecord","onChangeControl","newValue","url","source_url","title","rendered","ref","className","children","onSelect","selectedMedia","allowedTypes","render","open","role","tabIndex","onClick","onKeyDown","rowGap","columnGap","templateColumns","alt","width","height","src","style","size","icon","event","stopPropagation"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-edit.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, __experimentalGrid as Grid } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\n// @ts-ignore\nimport { MediaUpload } from '@wordpress/media-utils';\nimport { lineSolid } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\
|
|
1
|
+
{"version":3,"names":["Button","__experimentalGrid","Grid","useSelect","useCallback","useRef","MediaUpload","lineSolid","store","coreStore","__","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","FeaturedImageEdit","data","field","onChange","id","value","getValue","item","media","select","getEntityRecord","onChangeControl","newValue","url","source_url","title","rendered","ref","className","children","onSelect","selectedMedia","allowedTypes","render","open","role","tabIndex","onClick","onKeyDown","rowGap","columnGap","templateColumns","alt","width","height","src","style","size","icon","event","stopPropagation"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-edit.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, __experimentalGrid as Grid } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\n// @ts-ignore\nimport { MediaUpload } from '@wordpress/media-utils';\nimport { lineSolid } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport const FeaturedImageEdit = ( {\n\tdata,\n\tfield,\n\tonChange,\n}: DataFormControlProps< BasePost > ) => {\n\tconst { id } = field;\n\n\tconst value = field.getValue( { item: data } );\n\n\tconst media = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( 'root', 'media', value );\n\t\t},\n\t\t[ value ]\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\tconst url = media?.source_url;\n\tconst title = media?.title?.rendered;\n\tconst ref = useRef( null );\n\n\treturn (\n\t\t<fieldset className=\"fields-controls__featured-image\">\n\t\t\t<div className=\"fields-controls__featured-image-container\">\n\t\t\t\t<MediaUpload\n\t\t\t\t\tonSelect={ ( selectedMedia: { id: number } ) => {\n\t\t\t\t\t\tonChangeControl( selectedMedia.id );\n\t\t\t\t\t} }\n\t\t\t\t\tallowedTypes={ [ 'image' ] }\n\t\t\t\t\trender={ ( { open }: { open: () => void } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topen();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonKeyDown={ open }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Grid\n\t\t\t\t\t\t\t\t\trowGap={ 0 }\n\t\t\t\t\t\t\t\t\tcolumnGap={ 8 }\n\t\t\t\t\t\t\t\t\ttemplateColumns=\"24px 1fr 24px\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ url && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"fields-controls__featured-image-image\"\n\t\t\t\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\t\t\t\twidth={ 24 }\n\t\t\t\t\t\t\t\t\t\t\t\theight={ 24 }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"fields-controls__featured-image-title\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! url && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"fields-controls__featured-image-placeholder\"\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '24px',\n\t\t\t\t\t\t\t\t\t\t\t\t\theight: '24px',\n\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"fields-controls__featured-image-title\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Choose an image…' ) }\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ url && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"fields-controls__featured-image-remove-button\"\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ lineSolid }\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ (\n\t\t\t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;kBACbC,GAAG,EAAGtB;gBAAK,CACX,CAAC,eACFlB,IAAA;kBAAMuB,SAAS,EAAC,uCAAuC;kBAAAC,QAAA,EACpDJ;gBAAK,CACF,CAAC;cAAA,CACN,CACF,EACC,CAAEF,GAAG,iBACNd,KAAA,CAAAF,SAAA;gBAAAsB,QAAA,gBACCxB,IAAA;kBACCuB,SAAS,EAAC,6CAA6C;kBACvDkB,KAAK,EAAG;oBACPH,KAAK,EAAE,MAAM;oBACbC,MAAM,EAAE;kBACT;gBAAG,CACH,CAAC,eACFvC,IAAA;kBAAMuB,SAAS,EAAC,uCAAuC;kBAAAC,QAAA,EACpD1B,EAAE,CAAE,kBAAmB;gBAAC,CACrB,CAAC;cAAA,CACN,CACF,EACCoB,GAAG,iBACJlB,IAAA,CAAAE,SAAA;gBAAAsB,QAAA,eACCxB,IAAA,CAACZ,MAAM;kBACNsD,IAAI,EAAC,OAAO;kBACZnB,SAAS,EAAC,+CAA+C;kBACzDoB,IAAI,EAAGhD,SAAW;kBAClBqC,OAAO,EACNY,KAA4C,IACxC;oBACJA,KAAK,CAACC,eAAe,CAAC,CAAC;oBACvB7B,eAAe,CAAE,CAAE,CAAC;kBACrB;gBAAG,CACH;cAAC,CACD,CACF;YAAA,CACI;UAAC,CACH,CAAC;QAER;MAAG,CACH;IAAC,CACE;EAAC,CACG,CAAC;AAEb,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","jsx","_jsx","FeaturedImageView","item","mediaId","featured_media","media","select","getEntityRecord","url","source_url","className","src","alt"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","jsx","_jsx","FeaturedImageView","item","mediaId","featured_media","media","select","getEntityRecord","url","source_url","className","src","alt"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataViewRenderFieldProps } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport const FeaturedImageView = ( {\n\titem,\n}: DataViewRenderFieldProps< BasePost > ) => {\n\tconst mediaId = item.featured_media;\n\n\tconst media = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn mediaId ? getEntityRecord( 'root', 'media', mediaId ) : null;\n\t\t},\n\t\t[ mediaId ]\n\t);\n\tconst url = media?.source_url;\n\n\tif ( url ) {\n\t\treturn (\n\t\t\t<img\n\t\t\t\tclassName=\"fields-controls__featured-image-image\"\n\t\t\t\tsrc={ url }\n\t\t\t\talt=\"\"\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn <span className=\"fields-controls__featured-image-placeholder\" />;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAGzD;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAKA,OAAO,MAAMC,iBAAiB,GAAGA,CAAE;EAClCC;AACqC,CAAC,KAAM;EAC5C,MAAMC,OAAO,GAAGD,IAAI,CAACE,cAAc;EAEnC,MAAMC,KAAK,GAAGT,SAAS,CACpBU,MAAM,IAAM;IACb,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAER,SAAU,CAAC;IAC/C,OAAOK,OAAO,GAAGI,eAAe,CAAE,MAAM,EAAE,OAAO,EAAEJ,OAAQ,CAAC,GAAG,IAAI;EACpE,CAAC,EACD,CAAEA,OAAO,CACV,CAAC;EACD,MAAMK,GAAG,GAAGH,KAAK,EAAEI,UAAU;EAE7B,IAAKD,GAAG,EAAG;IACV,oBACCR,IAAA;MACCU,SAAS,EAAC,uCAAuC;MACjDC,GAAG,EAAGH,GAAK;MACXI,GAAG,EAAC;IAAE,CACN,CAAC;EAEJ;EAEA,oBAAOZ,IAAA;IAAMU,SAAS,EAAC;EAA6C,CAAE,CAAC;AACxE,CAAC","ignoreList":[]}
|
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Internal dependencies
|
|
7
9
|
*/
|
|
8
10
|
|
|
9
|
-
import { __ } from '@wordpress/i18n';
|
|
10
11
|
import { FeaturedImageEdit } from './featured-image-edit';
|
|
11
12
|
import { FeaturedImageView } from './featured-image-view';
|
|
12
13
|
const featuredImageField = {
|
|
13
14
|
id: 'featured_media',
|
|
14
15
|
type: 'text',
|
|
15
16
|
label: __('Featured Image'),
|
|
16
|
-
getValue: ({
|
|
17
|
-
item
|
|
18
|
-
}) => item.featured_media,
|
|
19
17
|
Edit: FeaturedImageEdit,
|
|
20
18
|
render: FeaturedImageView,
|
|
21
19
|
enableSorting: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","FeaturedImageEdit","FeaturedImageView","featuredImageField","id","type","label","
|
|
1
|
+
{"version":3,"names":["__","FeaturedImageEdit","FeaturedImageView","featuredImageField","id","type","label","Edit","render","enableSorting"],"sources":["@wordpress/fields/src/fields/featured-image/index.ts"],"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 { FeaturedImageEdit } from './featured-image-edit';\nimport { FeaturedImageView } from './featured-image-view';\n\nconst featuredImageField: Field< BasePost > = {\n\tid: 'featured_media',\n\ttype: 'text',\n\tlabel: __( 'Featured Image' ),\n\tEdit: FeaturedImageEdit,\n\trender: FeaturedImageView,\n\tenableSorting: false,\n};\n\nexport default featuredImageField;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,iBAAiB,QAAQ,uBAAuB;AAEzD,MAAMC,kBAAqC,GAAG;EAC7CC,EAAE,EAAE,gBAAgB;EACpBC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAEN,EAAE,CAAE,gBAAiB,CAAC;EAC7BO,IAAI,EAAEN,iBAAiB;EACvBO,MAAM,EAAEN,iBAAiB;EACzBO,aAAa,EAAE;AAChB,CAAC;AAED,eAAeN,kBAAkB","ignoreList":[]}
|
|
@@ -3,4 +3,9 @@ export { default as titleField } from './title';
|
|
|
3
3
|
export { default as orderField } from './order';
|
|
4
4
|
export { default as featuredImageField } from './featured-image';
|
|
5
5
|
export { default as parentField } from './parent';
|
|
6
|
+
export { default as passwordField } from './password';
|
|
7
|
+
export { default as statusField } from './status';
|
|
8
|
+
export { default as commentStatusField } from './comment-status';
|
|
9
|
+
export { default as dateField } from './date';
|
|
10
|
+
export { default as authorField } from './author';
|
|
6
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","slugField","titleField","orderField","featuredImageField","parentField"],"sources":["@wordpress/fields/src/fields/index.ts"],"sourcesContent":["export { default as slugField } from './slug';\nexport { default as titleField } from './title';\nexport { default as orderField } from './order';\nexport { default as featuredImageField } from './featured-image';\nexport { default as parentField } from './parent';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,SAAS,QAAQ,QAAQ;AAC7C,SAASD,OAAO,IAAIE,UAAU,QAAQ,SAAS;AAC/C,SAASF,OAAO,IAAIG,UAAU,QAAQ,SAAS;AAC/C,SAASH,OAAO,IAAII,kBAAkB,QAAQ,kBAAkB;AAChE,SAASJ,OAAO,IAAIK,WAAW,QAAQ,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["default","slugField","titleField","orderField","featuredImageField","parentField","passwordField","statusField","commentStatusField","dateField","authorField"],"sources":["@wordpress/fields/src/fields/index.ts"],"sourcesContent":["export { default as slugField } from './slug';\nexport { default as titleField } from './title';\nexport { default as orderField } from './order';\nexport { default as featuredImageField } from './featured-image';\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 dateField } from './date';\nexport { default as authorField } from './author';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,SAAS,QAAQ,QAAQ;AAC7C,SAASD,OAAO,IAAIE,UAAU,QAAQ,SAAS;AAC/C,SAASF,OAAO,IAAIG,UAAU,QAAQ,SAAS;AAC/C,SAASH,OAAO,IAAII,kBAAkB,QAAQ,kBAAkB;AAChE,SAASJ,OAAO,IAAIK,WAAW,QAAQ,UAAU;AACjD,SAASL,OAAO,IAAIM,aAAa,QAAQ,YAAY;AACrD,SAASN,OAAO,IAAIO,WAAW,QAAQ,UAAU;AACjD,SAASP,OAAO,IAAIQ,kBAAkB,QAAQ,kBAAkB;AAChE,SAASR,OAAO,IAAIS,SAAS,QAAQ,QAAQ;AAC7C,SAAST,OAAO,IAAIU,WAAW,QAAQ,UAAU","ignoreList":[]}
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
const orderField = {
|
|
11
|
-
type: 'integer',
|
|
12
12
|
id: 'menu_order',
|
|
13
|
+
type: 'integer',
|
|
13
14
|
label: __('Order'),
|
|
14
15
|
description: __('Determines the order of pages.')
|
|
15
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","orderField","
|
|
1
|
+
{"version":3,"names":["__","orderField","id","type","label","description"],"sources":["@wordpress/fields/src/fields/order/index.ts"],"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 orderField: Field< BasePost > = {\n\tid: 'menu_order',\n\ttype: 'integer',\n\tlabel: __( 'Order' ),\n\tdescription: __( 'Determines the order of pages.' ),\n};\n\nexport default orderField;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAGA,MAAMC,UAA6B,GAAG;EACrCC,EAAE,EAAE,YAAY;EAChBC,IAAI,EAAE,SAAS;EACfC,KAAK,EAAEJ,EAAE,CAAE,OAAQ,CAAC;EACpBK,WAAW,EAAEL,EAAE,CAAE,gCAAiC;AACnD,CAAC;AAED,eAAeC,UAAU","ignoreList":[]}
|
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Internal dependencies
|
|
7
9
|
*/
|
|
8
10
|
|
|
9
|
-
import { __ } from '@wordpress/i18n';
|
|
10
11
|
import { ParentEdit } from './parent-edit';
|
|
11
12
|
import { ParentView } from './parent-view';
|
|
12
13
|
const parentField = {
|
|
13
14
|
id: 'parent',
|
|
14
15
|
type: 'text',
|
|
15
16
|
label: __('Parent'),
|
|
16
|
-
getValue: ({
|
|
17
|
-
item
|
|
18
|
-
}) => item.parent,
|
|
19
17
|
Edit: ParentEdit,
|
|
20
18
|
render: ParentView,
|
|
21
19
|
enableSorting: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","ParentEdit","ParentView","parentField","id","type","label","
|
|
1
|
+
{"version":3,"names":["__","ParentEdit","ParentView","parentField","id","type","label","Edit","render","enableSorting"],"sources":["@wordpress/fields/src/fields/parent/index.ts"],"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 { ParentEdit } from './parent-edit';\nimport { ParentView } from './parent-view';\n\nconst parentField: Field< BasePost > = {\n\tid: 'parent',\n\ttype: 'text',\n\tlabel: __( 'Parent' ),\n\tEdit: ParentEdit,\n\trender: ParentView,\n\tenableSorting: true,\n};\n\n/**\n * This field is used to display the post parent.\n */\nexport default parentField;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,UAAU,QAAQ,eAAe;AAE1C,MAAMC,WAA8B,GAAG;EACtCC,EAAE,EAAE,QAAQ;EACZC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAEN,EAAE,CAAE,QAAS,CAAC;EACrBO,IAAI,EAAEN,UAAU;EAChBO,MAAM,EAAEN,UAAU;EAClBO,aAAa,EAAE;AAChB,CAAC;;AAED;AACA;AACA;AACA,eAAeN,WAAW","ignoreList":[]}
|