@wordpress/fields 0.3.0 → 0.4.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 +16 -0
- package/build/actions/utils.js +2 -2
- package/build/actions/utils.js.map +1 -1
- 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 +28 -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/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/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 +4 -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/types.js.map +1 -1
- package/build-style/{styles-rtl.css → style-rtl.css} +79 -0
- package/build-style/{styles.css → style.css} +79 -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 +4 -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/lock-unlock.d.ts +1 -1
- package/build-types/lock-unlock.d.ts.map +1 -1
- package/build-types/types.d.ts +3 -1
- package/build-types/types.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/actions/utils.ts +2 -2
- 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/index.ts +4 -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/style.scss +2 -0
- package/src/types.ts +3 -1
- package/tsconfig.json +10 -9
- package/tsconfig.tsbuildinfo +1 -1
- package/src/styles.scss +0 -1
|
@@ -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 SlugEdit from './slug-edit';
|
|
11
12
|
import SlugView from './slug-view';
|
|
12
13
|
const slugField = {
|
|
13
14
|
id: 'slug',
|
|
14
15
|
type: 'text',
|
|
15
16
|
label: __('Slug'),
|
|
16
|
-
getValue: ({
|
|
17
|
-
item
|
|
18
|
-
}) => item.slug,
|
|
19
17
|
Edit: SlugEdit,
|
|
20
18
|
render: SlugView
|
|
21
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","SlugEdit","SlugView","slugField","id","type","label","
|
|
1
|
+
{"version":3,"names":["__","SlugEdit","SlugView","slugField","id","type","label","Edit","render"],"sources":["@wordpress/fields/src/fields/slug/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 SlugEdit from './slug-edit';\nimport SlugView from './slug-view';\n\nconst slugField: Field< BasePost > = {\n\tid: 'slug',\n\ttype: 'text',\n\tlabel: __( 'Slug' ),\n\tEdit: SlugEdit,\n\trender: SlugView,\n};\n\nexport default slugField;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,QAAQ,MAAM,aAAa;AAElC,MAAMC,SAA4B,GAAG;EACpCC,EAAE,EAAE,MAAM;EACVC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAEN,EAAE,CAAE,MAAO,CAAC;EACnBO,IAAI,EAAEN,QAAQ;EACdO,MAAM,EAAEN;AACT,CAAC;AAED,eAAeC,SAAS","ignoreList":[]}
|
|
@@ -13,19 +13,20 @@ import { __ } from '@wordpress/i18n';
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
import { getSlug } from './utils';
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
19
|
const SlugEdit = ({
|
|
18
20
|
field,
|
|
19
21
|
onChange,
|
|
20
22
|
data
|
|
21
23
|
}) => {
|
|
22
|
-
var _field$getValue;
|
|
23
24
|
const {
|
|
24
25
|
id
|
|
25
26
|
} = field;
|
|
26
|
-
const slug =
|
|
27
|
+
const slug = field.getValue({
|
|
27
28
|
item: data
|
|
28
|
-
})
|
|
29
|
+
}) || getSlug(data);
|
|
29
30
|
const permalinkTemplate = data.permalink_template || '';
|
|
30
31
|
const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;
|
|
31
32
|
const [prefix, suffix] = permalinkTemplate.split(PERMALINK_POSTNAME_REGEX);
|
|
@@ -90,29 +91,26 @@ const SlugEdit = ({
|
|
|
90
91
|
onChangeControl(originalSlugRef.current);
|
|
91
92
|
}
|
|
92
93
|
},
|
|
93
|
-
"aria-describedby": postUrlSlugDescriptionId
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
})]
|
|
114
|
-
})
|
|
115
|
-
})
|
|
94
|
+
"aria-describedby": postUrlSlugDescriptionId
|
|
95
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
96
|
+
className: "fields-controls__slug-help",
|
|
97
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
98
|
+
className: "fields-controls__slug-help-visual-label",
|
|
99
|
+
children: __('Permalink:')
|
|
100
|
+
}), /*#__PURE__*/_jsxs(ExternalLink, {
|
|
101
|
+
className: "fields-controls__slug-help-link",
|
|
102
|
+
href: permalink,
|
|
103
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
104
|
+
className: "fields-controls__slug-help-prefix",
|
|
105
|
+
children: permalinkPrefix
|
|
106
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
107
|
+
className: "fields-controls__slug-help-slug",
|
|
108
|
+
children: slugToDisplay
|
|
109
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
110
|
+
className: "fields-controls__slug-help-suffix",
|
|
111
|
+
children: permalinkSuffix
|
|
112
|
+
})]
|
|
113
|
+
})]
|
|
116
114
|
})]
|
|
117
115
|
}), !isEditable && /*#__PURE__*/_jsx(ExternalLink, {
|
|
118
116
|
className: "fields-controls__slug-help",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","ExternalLink","__experimentalInputControl","InputControl","__experimentalInputControlPrefixWrapper","InputControlPrefixWrapper","__experimentalVStack","VStack","copySmall","useCopyToClipboard","useInstanceId","useDispatch","useCallback","useEffect","useRef","store","noticesStore","safeDecodeURIComponent","__","jsx","_jsx","jsxs","_jsxs","
|
|
1
|
+
{"version":3,"names":["Button","ExternalLink","__experimentalInputControl","InputControl","__experimentalInputControlPrefixWrapper","InputControlPrefixWrapper","__experimentalVStack","VStack","copySmall","useCopyToClipboard","useInstanceId","useDispatch","useCallback","useEffect","useRef","store","noticesStore","safeDecodeURIComponent","__","getSlug","jsx","_jsx","jsxs","_jsxs","SlugEdit","field","onChange","data","id","slug","getValue","item","permalinkTemplate","permalink_template","PERMALINK_POSTNAME_REGEX","prefix","suffix","split","permalinkPrefix","permalinkSuffix","isEditable","test","originalSlugRef","slugToDisplay","current","permalink","link","undefined","onChangeControl","newValue","createNotice","copyButtonRef","isDismissible","type","postUrlSlugDescriptionId","className","children","spacing","href","__next40pxDefaultSize","icon","ref","label","hideLabelFromVision","value","autoComplete","spellCheck","onBlur"],"sources":["@wordpress/fields/src/fields/slug/slug-edit.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tExternalLink,\n\t__experimentalInputControl as InputControl,\n\t__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { copySmall } from '@wordpress/icons';\nimport { useCopyToClipboard, useInstanceId } from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { safeDecodeURIComponent } from '@wordpress/url';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\nimport { getSlug } from './utils';\n\nconst SlugEdit = ( {\n\tfield,\n\tonChange,\n\tdata,\n}: DataFormControlProps< BasePost > ) => {\n\tconst { id } = field;\n\n\tconst slug = field.getValue( { item: data } ) || getSlug( data );\n\tconst permalinkTemplate = data.permalink_template || '';\n\tconst PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;\n\tconst [ prefix, suffix ] = permalinkTemplate.split(\n\t\tPERMALINK_POSTNAME_REGEX\n\t);\n\tconst permalinkPrefix = prefix;\n\tconst permalinkSuffix = suffix;\n\tconst isEditable = PERMALINK_POSTNAME_REGEX.test( permalinkTemplate );\n\tconst originalSlugRef = useRef( slug );\n\tconst slugToDisplay = slug || originalSlugRef.current;\n\tconst permalink = isEditable\n\t\t? `${ permalinkPrefix }${ slugToDisplay }${ permalinkSuffix }`\n\t\t: safeDecodeURIComponent( data.link || '' );\n\n\tuseEffect( () => {\n\t\tif ( slug && originalSlugRef.current === undefined ) {\n\t\t\toriginalSlugRef.current = slug;\n\t\t}\n\t}, [ slug ] );\n\n\tconst onChangeControl = useCallback(\n\t\t( newValue?: string ) =>\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 { createNotice } = useDispatch( noticesStore );\n\n\tconst copyButtonRef = useCopyToClipboard( permalink, () => {\n\t\tcreateNotice( 'info', __( 'Copied Permalink to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\tconst postUrlSlugDescriptionId =\n\t\t'editor-post-url__slug-description-' + useInstanceId( SlugEdit );\n\n\treturn (\n\t\t<fieldset className=\"fields-controls__slug\">\n\t\t\t{ isEditable && (\n\t\t\t\t<VStack>\n\t\t\t\t\t<VStack spacing=\"0px\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Customize the last part of the Permalink.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<ExternalLink href=\"https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink\">\n\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t</VStack>\n\t\t\t\t\t<InputControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tprefix={\n\t\t\t\t\t\t\t<InputControlPrefixWrapper>\n\t\t\t\t\t\t\t\t/\n\t\t\t\t\t\t\t</InputControlPrefixWrapper>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsuffix={\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\ticon={ copySmall }\n\t\t\t\t\t\t\t\tref={ copyButtonRef }\n\t\t\t\t\t\t\t\tlabel={ __( 'Copy' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ slug }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclassName=\"fields-controls__slug-input\"\n\t\t\t\t\t\tonChange={ ( newValue?: string ) => {\n\t\t\t\t\t\t\tonChangeControl( newValue );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonBlur={ () => {\n\t\t\t\t\t\t\tif ( slug === '' ) {\n\t\t\t\t\t\t\t\tonChangeControl( originalSlugRef.current );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\taria-describedby={ postUrlSlugDescriptionId }\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"fields-controls__slug-help\">\n\t\t\t\t\t\t<span className=\"fields-controls__slug-help-visual-label\">\n\t\t\t\t\t\t\t{ __( 'Permalink:' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\tclassName=\"fields-controls__slug-help-link\"\n\t\t\t\t\t\t\thref={ permalink }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"fields-controls__slug-help-prefix\">\n\t\t\t\t\t\t\t\t{ permalinkPrefix }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span className=\"fields-controls__slug-help-slug\">\n\t\t\t\t\t\t\t\t{ slugToDisplay }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span className=\"fields-controls__slug-help-suffix\">\n\t\t\t\t\t\t\t\t{ permalinkSuffix }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t</div>\n\t\t\t\t</VStack>\n\t\t\t) }\n\t\t\t{ ! isEditable && (\n\t\t\t\t<ExternalLink\n\t\t\t\t\tclassName=\"fields-controls__slug-help\"\n\t\t\t\t\thref={ permalink }\n\t\t\t\t>\n\t\t\t\t\t{ permalink }\n\t\t\t\t</ExternalLink>\n\t\t\t) }\n\t\t</fieldset>\n\t);\n};\n\nexport default SlugEdit;\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -7,10 +7,11 @@ import { useEffect, useRef } from '@wordpress/element';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import { getSlug } from './utils';
|
|
10
11
|
const SlugView = ({
|
|
11
12
|
item
|
|
12
13
|
}) => {
|
|
13
|
-
const slug = item
|
|
14
|
+
const slug = typeof item === 'object' ? getSlug(item) : '';
|
|
14
15
|
const originalSlugRef = useRef(slug);
|
|
15
16
|
useEffect(() => {
|
|
16
17
|
if (slug && originalSlugRef.current === undefined) {
|
|
@@ -18,7 +19,7 @@ const SlugView = ({
|
|
|
18
19
|
}
|
|
19
20
|
}, [slug]);
|
|
20
21
|
const slugToDisplay = slug || originalSlugRef.current;
|
|
21
|
-
return
|
|
22
|
+
return `${slugToDisplay}`;
|
|
22
23
|
};
|
|
23
24
|
export default SlugView;
|
|
24
25
|
//# sourceMappingURL=slug-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","SlugView","item","slug","originalSlugRef","current","undefined","slugToDisplay"],"sources":["@wordpress/fields/src/fields/slug/slug-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nconst SlugView = ( { item }: { item: BasePost } ) => {\n\tconst slug = item
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","getSlug","SlugView","item","slug","originalSlugRef","current","undefined","slugToDisplay"],"sources":["@wordpress/fields/src/fields/slug/slug-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\nimport { getSlug } from './utils';\n\nconst SlugView = ( { item }: { item: BasePost } ) => {\n\tconst slug = typeof item === 'object' ? getSlug( item ) : '';\n\tconst originalSlugRef = useRef( slug );\n\n\tuseEffect( () => {\n\t\tif ( slug && originalSlugRef.current === undefined ) {\n\t\t\toriginalSlugRef.current = slug;\n\t\t}\n\t}, [ slug ] );\n\n\tconst slugToDisplay = slug || originalSlugRef.current;\n\n\treturn `${ slugToDisplay }`;\n};\n\nexport default SlugView;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;;AAEtD;AACA;AACA;;AAEA,SAASC,OAAO,QAAQ,SAAS;AAEjC,MAAMC,QAAQ,GAAGA,CAAE;EAAEC;AAAyB,CAAC,KAAM;EACpD,MAAMC,IAAI,GAAG,OAAOD,IAAI,KAAK,QAAQ,GAAGF,OAAO,CAAEE,IAAK,CAAC,GAAG,EAAE;EAC5D,MAAME,eAAe,GAAGL,MAAM,CAAEI,IAAK,CAAC;EAEtCL,SAAS,CAAE,MAAM;IAChB,IAAKK,IAAI,IAAIC,eAAe,CAACC,OAAO,KAAKC,SAAS,EAAG;MACpDF,eAAe,CAACC,OAAO,GAAGF,IAAI;IAC/B;EACD,CAAC,EAAE,CAAEA,IAAI,CAAG,CAAC;EAEb,MAAMI,aAAa,GAAGJ,IAAI,IAAIC,eAAe,CAACC,OAAO;EAErD,OAAO,GAAIE,aAAa,EAAG;AAC5B,CAAC;AAED,eAAeN,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { cleanForSlug } from '@wordpress/url';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { getItemTitle } from '../../actions/utils';
|
|
10
|
+
export const getSlug = item => {
|
|
11
|
+
return item.slug || cleanForSlug(getItemTitle(item)) || item.id.toString();
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cleanForSlug","getItemTitle","getSlug","item","slug","id","toString"],"sources":["@wordpress/fields/src/fields/slug/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cleanForSlug } from '@wordpress/url';\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\nimport { getItemTitle } from '../../actions/utils';\n\nexport const getSlug = ( item: BasePost ): string => {\n\treturn (\n\t\titem.slug || cleanForSlug( getItemTitle( item ) ) || item.id.toString()\n\t);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C;AACA;AACA;;AAEA,SAASC,YAAY,QAAQ,qBAAqB;AAElD,OAAO,MAAMC,OAAO,GAAKC,IAAc,IAAc;EACpD,OACCA,IAAI,CAACC,IAAI,IAAIJ,YAAY,CAAEC,YAAY,CAAEE,IAAK,CAAE,CAAC,IAAIA,IAAI,CAACE,EAAE,CAACC,QAAQ,CAAC,CAAC;AAEzE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import StatusView from './status-view';
|
|
12
|
+
import STATUSES from './status-elements';
|
|
13
|
+
const OPERATOR_IS_ANY = 'isAny';
|
|
14
|
+
const statusField = {
|
|
15
|
+
label: __('Status'),
|
|
16
|
+
id: 'status',
|
|
17
|
+
type: 'text',
|
|
18
|
+
elements: STATUSES,
|
|
19
|
+
render: StatusView,
|
|
20
|
+
Edit: 'radio',
|
|
21
|
+
enableSorting: false,
|
|
22
|
+
filterBy: {
|
|
23
|
+
operators: [OPERATOR_IS_ANY]
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Status field for BasePost.
|
|
29
|
+
*/
|
|
30
|
+
export default statusField;
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","StatusView","STATUSES","OPERATOR_IS_ANY","statusField","label","id","type","elements","render","Edit","enableSorting","filterBy","operators"],"sources":["@wordpress/fields/src/fields/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';\nimport StatusView from './status-view';\nimport STATUSES from './status-elements';\n\nconst OPERATOR_IS_ANY = 'isAny';\n\nconst statusField: Field< BasePost > = {\n\tlabel: __( 'Status' ),\n\tid: 'status',\n\ttype: 'text',\n\telements: STATUSES,\n\trender: StatusView,\n\tEdit: 'radio',\n\tenableSorting: false,\n\tfilterBy: {\n\t\toperators: [ OPERATOR_IS_ANY ],\n\t},\n};\n\n/**\n * Status field for BasePost.\n */\nexport default statusField;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,QAAQ,MAAM,mBAAmB;AAExC,MAAMC,eAAe,GAAG,OAAO;AAE/B,MAAMC,WAA8B,GAAG;EACtCC,KAAK,EAAEL,EAAE,CAAE,QAAS,CAAC;EACrBM,EAAE,EAAE,QAAQ;EACZC,IAAI,EAAE,MAAM;EACZC,QAAQ,EAAEN,QAAQ;EAClBO,MAAM,EAAER,UAAU;EAClBS,IAAI,EAAE,OAAO;EACbC,aAAa,EAAE,KAAK;EACpBC,QAAQ,EAAE;IACTC,SAAS,EAAE,CAAEV,eAAe;EAC7B;AACD,CAAC;;AAED;AACA;AACA;AACA,eAAeC,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { trash, drafts, published, scheduled, pending, notAllowed } from '@wordpress/icons';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
// See https://github.com/WordPress/gutenberg/issues/55886
|
|
8
|
+
// We do not support custom statutes at the moment.
|
|
9
|
+
const STATUSES = [{
|
|
10
|
+
value: 'draft',
|
|
11
|
+
label: __('Draft'),
|
|
12
|
+
icon: drafts,
|
|
13
|
+
description: __('Not ready to publish.')
|
|
14
|
+
}, {
|
|
15
|
+
value: 'future',
|
|
16
|
+
label: __('Scheduled'),
|
|
17
|
+
icon: scheduled,
|
|
18
|
+
description: __('Publish automatically on a chosen date.')
|
|
19
|
+
}, {
|
|
20
|
+
value: 'pending',
|
|
21
|
+
label: __('Pending Review'),
|
|
22
|
+
icon: pending,
|
|
23
|
+
description: __('Waiting for review before publishing.')
|
|
24
|
+
}, {
|
|
25
|
+
value: 'private',
|
|
26
|
+
label: __('Private'),
|
|
27
|
+
icon: notAllowed,
|
|
28
|
+
description: __('Only visible to site admins and editors.')
|
|
29
|
+
}, {
|
|
30
|
+
value: 'publish',
|
|
31
|
+
label: __('Published'),
|
|
32
|
+
icon: published,
|
|
33
|
+
description: __('Visible to everyone.')
|
|
34
|
+
}, {
|
|
35
|
+
value: 'trash',
|
|
36
|
+
label: __('Trash'),
|
|
37
|
+
icon: trash
|
|
38
|
+
}];
|
|
39
|
+
export default STATUSES;
|
|
40
|
+
//# sourceMappingURL=status-elements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["trash","drafts","published","scheduled","pending","notAllowed","__","STATUSES","value","label","icon","description"],"sources":["@wordpress/fields/src/fields/status/status-elements.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\ttrash,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n// See https://github.com/WordPress/gutenberg/issues/55886\n// We do not support custom statutes at the moment.\nconst STATUSES = [\n\t{\n\t\tvalue: 'draft',\n\t\tlabel: __( 'Draft' ),\n\t\ticon: drafts,\n\t\tdescription: __( 'Not ready to publish.' ),\n\t},\n\t{\n\t\tvalue: 'future',\n\t\tlabel: __( 'Scheduled' ),\n\t\ticon: scheduled,\n\t\tdescription: __( 'Publish automatically on a chosen date.' ),\n\t},\n\t{\n\t\tvalue: 'pending',\n\t\tlabel: __( 'Pending Review' ),\n\t\ticon: pending,\n\t\tdescription: __( 'Waiting for review before publishing.' ),\n\t},\n\t{\n\t\tvalue: 'private',\n\t\tlabel: __( 'Private' ),\n\t\ticon: notAllowed,\n\t\tdescription: __( 'Only visible to site admins and editors.' ),\n\t},\n\t{\n\t\tvalue: 'publish',\n\t\tlabel: __( 'Published' ),\n\t\ticon: published,\n\t\tdescription: __( 'Visible to everyone.' ),\n\t},\n\t{ value: 'trash', label: __( 'Trash' ), icon: trash },\n];\n\nexport default STATUSES;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,UAAU,QACJ,kBAAkB;AACzB,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA,MAAMC,QAAQ,GAAG,CAChB;EACCC,KAAK,EAAE,OAAO;EACdC,KAAK,EAAEH,EAAE,CAAE,OAAQ,CAAC;EACpBI,IAAI,EAAET,MAAM;EACZU,WAAW,EAAEL,EAAE,CAAE,uBAAwB;AAC1C,CAAC,EACD;EACCE,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAEH,EAAE,CAAE,WAAY,CAAC;EACxBI,IAAI,EAAEP,SAAS;EACfQ,WAAW,EAAEL,EAAE,CAAE,yCAA0C;AAC5D,CAAC,EACD;EACCE,KAAK,EAAE,SAAS;EAChBC,KAAK,EAAEH,EAAE,CAAE,gBAAiB,CAAC;EAC7BI,IAAI,EAAEN,OAAO;EACbO,WAAW,EAAEL,EAAE,CAAE,uCAAwC;AAC1D,CAAC,EACD;EACCE,KAAK,EAAE,SAAS;EAChBC,KAAK,EAAEH,EAAE,CAAE,SAAU,CAAC;EACtBI,IAAI,EAAEL,UAAU;EAChBM,WAAW,EAAEL,EAAE,CAAE,0CAA2C;AAC7D,CAAC,EACD;EACCE,KAAK,EAAE,SAAS;EAChBC,KAAK,EAAEH,EAAE,CAAE,WAAY,CAAC;EACxBI,IAAI,EAAER,SAAS;EACfS,WAAW,EAAEL,EAAE,CAAE,sBAAuB;AACzC,CAAC,EACD;EAAEE,KAAK,EAAE,OAAO;EAAEC,KAAK,EAAEH,EAAE,CAAE,OAAQ,CAAC;EAAEI,IAAI,EAAEV;AAAM,CAAC,CACrD;AAED,eAAeO,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalHStack as HStack, Icon } from '@wordpress/components';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import STATUSES from './status-elements';
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
function StatusView({
|
|
13
|
+
item
|
|
14
|
+
}) {
|
|
15
|
+
const status = STATUSES.find(({
|
|
16
|
+
value
|
|
17
|
+
}) => value === item.status);
|
|
18
|
+
const label = status?.label || item.status;
|
|
19
|
+
const icon = status?.icon;
|
|
20
|
+
return /*#__PURE__*/_jsxs(HStack, {
|
|
21
|
+
alignment: "left",
|
|
22
|
+
spacing: 0,
|
|
23
|
+
children: [icon && /*#__PURE__*/_jsx("div", {
|
|
24
|
+
className: "edit-site-post-list__status-icon",
|
|
25
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
26
|
+
icon: icon
|
|
27
|
+
})
|
|
28
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
29
|
+
children: label
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export default StatusView;
|
|
34
|
+
//# sourceMappingURL=status-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__experimentalHStack","HStack","Icon","STATUSES","jsx","_jsx","jsxs","_jsxs","StatusView","item","status","find","value","label","icon","alignment","spacing","children","className"],"sources":["@wordpress/fields/src/fields/status/status-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack, Icon } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\nimport STATUSES from './status-elements';\n\nfunction StatusView( { item }: { item: BasePost } ) {\n\tconst status = STATUSES.find( ( { value } ) => value === item.status );\n\tconst label = status?.label || item.status;\n\tconst icon = status?.icon;\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 0 }>\n\t\t\t{ icon && (\n\t\t\t\t<div className=\"edit-site-post-list__status-icon\">\n\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<span>{ label }</span>\n\t\t</HStack>\n\t);\n}\n\nexport default StatusView;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,oBAAoB,IAAIC,MAAM,EAAEC,IAAI,QAAQ,uBAAuB;;AAE5E;AACA;AACA;;AAEA,OAAOC,QAAQ,MAAM,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEzC,SAASC,UAAUA,CAAE;EAAEC;AAAyB,CAAC,EAAG;EACnD,MAAMC,MAAM,GAAGP,QAAQ,CAACQ,IAAI,CAAE,CAAE;IAAEC;EAAM,CAAC,KAAMA,KAAK,KAAKH,IAAI,CAACC,MAAO,CAAC;EACtE,MAAMG,KAAK,GAAGH,MAAM,EAAEG,KAAK,IAAIJ,IAAI,CAACC,MAAM;EAC1C,MAAMI,IAAI,GAAGJ,MAAM,EAAEI,IAAI;EACzB,oBACCP,KAAA,CAACN,MAAM;IAACc,SAAS,EAAC,MAAM;IAACC,OAAO,EAAG,CAAG;IAAAC,QAAA,GACnCH,IAAI,iBACLT,IAAA;MAAKa,SAAS,EAAC,kCAAkC;MAAAD,QAAA,eAChDZ,IAAA,CAACH,IAAI;QAACY,IAAI,EAAGA;MAAM,CAAE;IAAC,CAClB,CACL,eACDT,IAAA;MAAAY,QAAA,EAAQJ;IAAK,CAAQ,CAAC;EAAA,CACf,CAAC;AAEX;AAEA,eAAeL,UAAU","ignoreList":[]}
|
|
@@ -9,6 +9,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { getItemTitle } from '../../actions/utils';
|
|
12
|
+
import TitleView from './title-view';
|
|
12
13
|
const titleField = {
|
|
13
14
|
type: 'text',
|
|
14
15
|
id: 'title',
|
|
@@ -16,7 +17,9 @@ const titleField = {
|
|
|
16
17
|
placeholder: __('No title'),
|
|
17
18
|
getValue: ({
|
|
18
19
|
item
|
|
19
|
-
}) => getItemTitle(item)
|
|
20
|
+
}) => getItemTitle(item),
|
|
21
|
+
render: TitleView,
|
|
22
|
+
enableHiding: false
|
|
20
23
|
};
|
|
21
24
|
export default titleField;
|
|
22
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","getItemTitle","titleField","type","id","label","placeholder","getValue","item"],"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":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,SAASC,YAAY,QAAQ,qBAAqB;
|
|
1
|
+
{"version":3,"names":["__","getItemTitle","TitleView","titleField","type","id","label","placeholder","getValue","item","render","enableHiding"],"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":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,SAASC,YAAY,QAAQ,qBAAqB;AAClD,OAAOC,SAAS,MAAM,cAAc;AAEpC,MAAMC,UAA6B,GAAG;EACrCC,IAAI,EAAE,MAAM;EACZC,EAAE,EAAE,OAAO;EACXC,KAAK,EAAEN,EAAE,CAAE,OAAQ,CAAC;EACpBO,WAAW,EAAEP,EAAE,CAAE,UAAW,CAAC;EAC7BQ,QAAQ,EAAEA,CAAE;IAAEC;EAAK,CAAC,KAAMR,YAAY,CAAEQ,IAAK,CAAC;EAC9CC,MAAM,EAAER,SAAS;EACjBS,YAAY,EAAE;AACf,CAAC;AAED,eAAeR,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalHStack as HStack } from '@wordpress/components';
|
|
5
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
import { useSelect } from '@wordpress/data';
|
|
8
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { getItemTitle } from '../../actions/utils';
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
const TitleView = ({
|
|
17
|
+
item
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
frontPageId,
|
|
21
|
+
postsPageId
|
|
22
|
+
} = useSelect(select => {
|
|
23
|
+
const {
|
|
24
|
+
getEntityRecord
|
|
25
|
+
} = select(coreStore);
|
|
26
|
+
const siteSettings = getEntityRecord('root', 'site', '');
|
|
27
|
+
return {
|
|
28
|
+
frontPageId: siteSettings?.page_on_front,
|
|
29
|
+
postsPageId: siteSettings?.page_for_posts
|
|
30
|
+
};
|
|
31
|
+
}, []);
|
|
32
|
+
const renderedTitle = getItemTitle(item);
|
|
33
|
+
let suffix;
|
|
34
|
+
if (item.id === frontPageId) {
|
|
35
|
+
suffix = /*#__PURE__*/_jsx("span", {
|
|
36
|
+
className: "edit-site-post-list__title-badge",
|
|
37
|
+
children: __('Homepage')
|
|
38
|
+
});
|
|
39
|
+
} else if (item.id === postsPageId) {
|
|
40
|
+
suffix = /*#__PURE__*/_jsx("span", {
|
|
41
|
+
className: "edit-site-post-list__title-badge",
|
|
42
|
+
children: __('Posts Page')
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return /*#__PURE__*/_jsxs(HStack, {
|
|
46
|
+
className: "edit-site-post-list__title",
|
|
47
|
+
alignment: "center",
|
|
48
|
+
justify: "flex-start",
|
|
49
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
50
|
+
children: decodeEntities(renderedTitle) || __('(no title)')
|
|
51
|
+
}), suffix]
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
export default TitleView;
|
|
55
|
+
//# sourceMappingURL=title-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__experimentalHStack","HStack","decodeEntities","__","useSelect","store","coreStore","getItemTitle","jsx","_jsx","jsxs","_jsxs","TitleView","item","frontPageId","postsPageId","select","getEntityRecord","siteSettings","page_on_front","page_for_posts","renderedTitle","suffix","id","className","children","alignment","justify"],"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":"AAAA;AACA;AACA;AACA,SAASA,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAGzD;AACA;AACA;;AAEA,SAASC,YAAY,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnD,MAAMC,SAAS,GAAGA,CAAE;EAAEC;AAAyB,CAAC,KAAM;EACrD,MAAM;IAAEC,WAAW;IAAEC;EAAY,CAAC,GAAGX,SAAS,CAAIY,MAAM,IAAM;IAC7D,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEV,SAAU,CAAC;IAC/C,MAAMY,YAAkC,GAAGD,eAAe,CACzD,MAAM,EACN,MAAM,EACN,EACD,CAAC;IACD,OAAO;MACNH,WAAW,EAAEI,YAAY,EAAEC,aAAa;MACxCJ,WAAW,EAAEG,YAAY,EAAEE;IAC5B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,aAAa,GAAGd,YAAY,CAAEM,IAAK,CAAC;EAE1C,IAAIS,MAAM;EACV,IAAKT,IAAI,CAACU,EAAE,KAAKT,WAAW,EAAG;IAC9BQ,MAAM,gBACLb,IAAA;MAAMe,SAAS,EAAC,kCAAkC;MAAAC,QAAA,EAC/CtB,EAAE,CAAE,UAAW;IAAC,CACb,CACN;EACF,CAAC,MAAM,IAAKU,IAAI,CAACU,EAAE,KAAKR,WAAW,EAAG;IACrCO,MAAM,gBACLb,IAAA;MAAMe,SAAS,EAAC,kCAAkC;MAAAC,QAAA,EAC/CtB,EAAE,CAAE,YAAa;IAAC,CACf,CACN;EACF;EAEA,oBACCQ,KAAA,CAACV,MAAM;IACNuB,SAAS,EAAC,4BAA4B;IACtCE,SAAS,EAAC,QAAQ;IAClBC,OAAO,EAAC,YAAY;IAAAF,QAAA,gBAEpBhB,IAAA;MAAAgB,QAAA,EACGvB,cAAc,CAAEmB,aAAc,CAAC,IAAIlB,EAAE,CAAE,YAAa;IAAC,CAClD,CAAC,EACLmB,MAAM;EAAA,CACD,CAAC;AAEX,CAAC;AAED,eAAeV,SAAS","ignoreList":[]}
|
|
@@ -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\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}\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":[]}
|
|
@@ -131,4 +131,83 @@
|
|
|
131
131
|
}
|
|
132
132
|
.fields-controls__slug .fields-controls__slug-help .fields-controls__slug-help-slug {
|
|
133
133
|
font-weight: 600;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.fields-controls__featured-image-placeholder {
|
|
137
|
+
border-radius: 2px;
|
|
138
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
|
|
139
|
+
display: inline-block;
|
|
140
|
+
padding: 0;
|
|
141
|
+
background: #fff linear-gradient(45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.fields-controls__featured-image-title {
|
|
145
|
+
width: 100%;
|
|
146
|
+
color: #1e1e1e;
|
|
147
|
+
white-space: nowrap;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.fields-controls__featured-image-image {
|
|
153
|
+
width: 100%;
|
|
154
|
+
height: 100%;
|
|
155
|
+
border-radius: 2px;
|
|
156
|
+
align-self: center;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.fields-controls__featured-image-container .fields-controls__featured-image-placeholder {
|
|
160
|
+
margin: 0;
|
|
161
|
+
}
|
|
162
|
+
.fields-controls__featured-image-container span {
|
|
163
|
+
margin-left: auto;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-container {
|
|
167
|
+
border: 1px solid #ddd;
|
|
168
|
+
border-radius: 2px;
|
|
169
|
+
padding: 8px 12px;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
}
|
|
172
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-container:hover {
|
|
173
|
+
background-color: #f0f0f0;
|
|
174
|
+
}
|
|
175
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-placeholder {
|
|
176
|
+
width: 24px;
|
|
177
|
+
height: 24px;
|
|
178
|
+
}
|
|
179
|
+
fieldset.fields-controls__featured-image span {
|
|
180
|
+
align-self: center;
|
|
181
|
+
text-align: start;
|
|
182
|
+
white-space: nowrap;
|
|
183
|
+
}
|
|
184
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-upload-button {
|
|
185
|
+
padding: 0;
|
|
186
|
+
height: -moz-fit-content;
|
|
187
|
+
height: fit-content;
|
|
188
|
+
}
|
|
189
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-upload-button:hover, fieldset.fields-controls__featured-image .fields-controls__featured-image-upload-button:focus {
|
|
190
|
+
border: 0;
|
|
191
|
+
color: unset;
|
|
192
|
+
}
|
|
193
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-remove-button {
|
|
194
|
+
place-self: end;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.dataforms-layouts-panel__field-control .fields-controls__featured-image-image {
|
|
198
|
+
width: 16px;
|
|
199
|
+
height: 16px;
|
|
200
|
+
}
|
|
201
|
+
.dataforms-layouts-panel__field-control .fields-controls__featured-image-placeholder {
|
|
202
|
+
width: 16px;
|
|
203
|
+
height: 16px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.dataviews-view-table__cell-content-wrapper .fields-controls__featured-image-image {
|
|
207
|
+
width: 32px;
|
|
208
|
+
height: 32px;
|
|
209
|
+
}
|
|
210
|
+
.dataviews-view-table__cell-content-wrapper .fields-controls__featured-image-placeholder {
|
|
211
|
+
width: 32px;
|
|
212
|
+
height: 32px;
|
|
134
213
|
}
|
|
@@ -131,4 +131,83 @@
|
|
|
131
131
|
}
|
|
132
132
|
.fields-controls__slug .fields-controls__slug-help .fields-controls__slug-help-slug {
|
|
133
133
|
font-weight: 600;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.fields-controls__featured-image-placeholder {
|
|
137
|
+
border-radius: 2px;
|
|
138
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
|
|
139
|
+
display: inline-block;
|
|
140
|
+
padding: 0;
|
|
141
|
+
background: #fff linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.fields-controls__featured-image-title {
|
|
145
|
+
width: 100%;
|
|
146
|
+
color: #1e1e1e;
|
|
147
|
+
white-space: nowrap;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.fields-controls__featured-image-image {
|
|
153
|
+
width: 100%;
|
|
154
|
+
height: 100%;
|
|
155
|
+
border-radius: 2px;
|
|
156
|
+
align-self: center;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.fields-controls__featured-image-container .fields-controls__featured-image-placeholder {
|
|
160
|
+
margin: 0;
|
|
161
|
+
}
|
|
162
|
+
.fields-controls__featured-image-container span {
|
|
163
|
+
margin-right: auto;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-container {
|
|
167
|
+
border: 1px solid #ddd;
|
|
168
|
+
border-radius: 2px;
|
|
169
|
+
padding: 8px 12px;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
}
|
|
172
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-container:hover {
|
|
173
|
+
background-color: #f0f0f0;
|
|
174
|
+
}
|
|
175
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-placeholder {
|
|
176
|
+
width: 24px;
|
|
177
|
+
height: 24px;
|
|
178
|
+
}
|
|
179
|
+
fieldset.fields-controls__featured-image span {
|
|
180
|
+
align-self: center;
|
|
181
|
+
text-align: start;
|
|
182
|
+
white-space: nowrap;
|
|
183
|
+
}
|
|
184
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-upload-button {
|
|
185
|
+
padding: 0;
|
|
186
|
+
height: -moz-fit-content;
|
|
187
|
+
height: fit-content;
|
|
188
|
+
}
|
|
189
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-upload-button:hover, fieldset.fields-controls__featured-image .fields-controls__featured-image-upload-button:focus {
|
|
190
|
+
border: 0;
|
|
191
|
+
color: unset;
|
|
192
|
+
}
|
|
193
|
+
fieldset.fields-controls__featured-image .fields-controls__featured-image-remove-button {
|
|
194
|
+
place-self: end;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.dataforms-layouts-panel__field-control .fields-controls__featured-image-image {
|
|
198
|
+
width: 16px;
|
|
199
|
+
height: 16px;
|
|
200
|
+
}
|
|
201
|
+
.dataforms-layouts-panel__field-control .fields-controls__featured-image-placeholder {
|
|
202
|
+
width: 16px;
|
|
203
|
+
height: 16px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.dataviews-view-table__cell-content-wrapper .fields-controls__featured-image-image {
|
|
207
|
+
width: 32px;
|
|
208
|
+
height: 32px;
|
|
209
|
+
}
|
|
210
|
+
.dataviews-view-table__cell-content-wrapper .fields-controls__featured-image-placeholder {
|
|
211
|
+
width: 32px;
|
|
212
|
+
height: 32px;
|
|
134
213
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Field } from '@wordpress/dataviews';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import type { BasePost } from '../../types';
|
|
9
|
+
declare const commentStatusField: Field<BasePost>;
|
|
10
|
+
/**
|
|
11
|
+
* Comment status field for BasePost.
|
|
12
|
+
*/
|
|
13
|
+
export default commentStatusField;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/comment-status/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAGlD;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAE,QAAQ,CAuBxC,CAAC;AAEF;;GAEG;AACH,eAAe,kBAAkB,CAAC"}
|