@wordpress/fields 0.31.1-next.v.202602111440.0 → 0.32.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 +1 -1
- package/build/actions/duplicate-post.cjs.map +1 -1
- package/build/actions/reorder-page.cjs.map +1 -1
- package/build/components/create-template-part-modal/index.cjs +2 -5
- package/build/components/create-template-part-modal/index.cjs.map +3 -3
- package/build/components/media-edit/index.cjs +372 -157
- package/build/components/media-edit/index.cjs.map +3 -3
- package/build/components/media-edit/use-moving-animation.cjs +75 -0
- package/build/components/media-edit/use-moving-animation.cjs.map +7 -0
- package/build/fields/featured-image/index.cjs +2 -1
- package/build/fields/featured-image/index.cjs.map +2 -2
- package/build/fields/template/hooks.cjs +96 -0
- package/build/fields/template/hooks.cjs.map +7 -0
- package/build/fields/template/index.cjs +2 -0
- package/build/fields/template/index.cjs.map +2 -2
- package/build/fields/template/template-edit.cjs +33 -114
- package/build/fields/template/template-edit.cjs.map +3 -3
- package/build/fields/template/template-view.cjs +68 -0
- package/build/fields/template/template-view.cjs.map +7 -0
- package/build/fields/template/utils.cjs +91 -0
- package/build/fields/template/utils.cjs.map +7 -0
- package/build-module/actions/duplicate-post.mjs.map +1 -1
- package/build-module/actions/reorder-page.mjs.map +1 -1
- package/build-module/components/create-template-part-modal/index.mjs +3 -6
- package/build-module/components/create-template-part-modal/index.mjs.map +2 -2
- package/build-module/components/media-edit/index.mjs +379 -159
- package/build-module/components/media-edit/index.mjs.map +2 -2
- package/build-module/components/media-edit/use-moving-animation.mjs +54 -0
- package/build-module/components/media-edit/use-moving-animation.mjs.map +7 -0
- package/build-module/fields/featured-image/index.mjs +2 -1
- package/build-module/fields/featured-image/index.mjs.map +2 -2
- package/build-module/fields/template/hooks.mjs +71 -0
- package/build-module/fields/template/hooks.mjs.map +7 -0
- package/build-module/fields/template/index.mjs +2 -0
- package/build-module/fields/template/index.mjs.map +2 -2
- package/build-module/fields/template/template-edit.mjs +36 -123
- package/build-module/fields/template/template-edit.mjs.map +2 -2
- package/build-module/fields/template/template-view.mjs +43 -0
- package/build-module/fields/template/template-view.mjs.map +7 -0
- package/build-module/fields/template/utils.mjs +65 -0
- package/build-module/fields/template/utils.mjs.map +7 -0
- package/build-style/style-rtl.css +69 -61
- package/build-style/style.css +69 -61
- package/build-types/actions/duplicate-post.d.ts +1 -1
- package/build-types/actions/duplicate-post.d.ts.map +1 -1
- package/build-types/actions/reorder-page.d.ts +1 -1
- package/build-types/actions/reorder-page.d.ts.map +1 -1
- package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
- package/build-types/components/media-edit/index.d.ts +1 -1
- package/build-types/components/media-edit/index.d.ts.map +1 -1
- package/build-types/components/media-edit/use-moving-animation.d.ts +13 -0
- package/build-types/components/media-edit/use-moving-animation.d.ts.map +1 -0
- package/build-types/fields/template/hooks.d.ts +10 -0
- package/build-types/fields/template/hooks.d.ts.map +1 -0
- package/build-types/fields/template/index.d.ts.map +1 -1
- package/build-types/fields/template/template-edit.d.ts.map +1 -1
- package/build-types/fields/template/template-view.d.ts +4 -0
- package/build-types/fields/template/template-view.d.ts.map +1 -0
- package/build-types/fields/template/utils.d.ts +28 -0
- package/build-types/fields/template/utils.d.ts.map +1 -0
- package/package.json +27 -26
- package/src/actions/duplicate-post.tsx +1 -1
- package/src/actions/reorder-page.tsx +1 -1
- package/src/components/create-template-part-modal/index.tsx +5 -14
- package/src/components/media-edit/index.tsx +420 -163
- package/src/components/media-edit/style.scss +83 -30
- package/src/components/media-edit/use-moving-animation.ts +77 -0
- package/src/fields/featured-image/index.tsx +1 -1
- package/src/fields/template/hooks.ts +121 -0
- package/src/fields/template/index.ts +2 -0
- package/src/fields/template/template-edit.tsx +38 -149
- package/src/fields/template/template-view.tsx +52 -0
- package/src/fields/template/utils.ts +119 -0
- package/src/style.scss +0 -1
- package/src/fields/template/style.scss +0 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/template/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAMlD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/template/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAMlD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5C,QAAA,MAAM,aAAa,EAAE,KAAK,CAAE,QAAQ,CAQnC,CAAC;AAEF;;GAEG;AACH,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-edit.d.ts","sourceRoot":"","sources":["../../../src/fields/template/template-edit.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"template-edit.d.ts","sourceRoot":"","sources":["../../../src/fields/template/template-edit.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AASjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM5C,eAAO,MAAM,YAAY,GAAK,4BAI3B,oBAAoB,CAAE,QAAQ,CAAE,gCA4ElC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DataViewRenderFieldProps } from '@wordpress/dataviews';
|
|
2
|
+
import type { BasePost } from '../../types';
|
|
3
|
+
export declare const TemplateView: ({ item, field, }: DataViewRenderFieldProps<BasePost>) => import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=template-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-view.d.ts","sourceRoot":"","sources":["../../../src/fields/template/template-view.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAMrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,eAAO,MAAM,YAAY,GAAK,kBAG3B,wBAAwB,CAAE,QAAQ,CAAE,gCAiCtC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
5
|
+
/**
|
|
6
|
+
* Compute the template slug to look up in the template hierarchy.
|
|
7
|
+
*
|
|
8
|
+
* In `draft` status we might not have a slug available, so we use the
|
|
9
|
+
* `single` post type template slug (e.g. page, single-post,
|
|
10
|
+
* single-product, etc.). Pages do not need the `single` prefix to be
|
|
11
|
+
* prioritised through template hierarchy.
|
|
12
|
+
*
|
|
13
|
+
* @param postType The post type.
|
|
14
|
+
* @param slug The post slug.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getTemplateSlugToCheck(postType: string, slug: string | undefined): string;
|
|
17
|
+
/**
|
|
18
|
+
* Resolve the human-readable label for the default template that would
|
|
19
|
+
* apply to a post, given its type, ID and slug. Meant to be called inside a
|
|
20
|
+
* `useSelect` callback (receives `select` as its first argument).
|
|
21
|
+
*
|
|
22
|
+
* @param select The `select` function from a `useSelect` callback.
|
|
23
|
+
* @param postType The post type.
|
|
24
|
+
* @param postId The post ID.
|
|
25
|
+
* @param slug The post slug.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getDefaultTemplateLabel(select: (store: typeof coreStore) => any, postType: string | undefined, postId: string | number | undefined, slug: string | undefined): string;
|
|
28
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/fields/template/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAU1D;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GAAG,SAAS,GACtB,MAAM,CAOR;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,CAAE,KAAK,EAAE,OAAO,SAAS,KAAM,GAAG,EAC1C,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACnC,IAAI,EAAE,MAAM,GAAG,SAAS,GACtB,MAAM,CAmER"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/fields",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "DataViews is a component that provides an API to render datasets using different types of layouts (table, grid, list, etc.).",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -47,30 +47,31 @@
|
|
|
47
47
|
"src/**/*.scss"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@
|
|
51
|
-
"@wordpress/
|
|
52
|
-
"@wordpress/
|
|
53
|
-
"@wordpress/
|
|
54
|
-
"@wordpress/
|
|
55
|
-
"@wordpress/
|
|
56
|
-
"@wordpress/
|
|
57
|
-
"@wordpress/
|
|
58
|
-
"@wordpress/data": "^
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/
|
|
62
|
-
"@wordpress/
|
|
63
|
-
"@wordpress/
|
|
64
|
-
"@wordpress/
|
|
65
|
-
"@wordpress/
|
|
66
|
-
"@wordpress/
|
|
67
|
-
"@wordpress/
|
|
68
|
-
"@wordpress/
|
|
69
|
-
"@wordpress/
|
|
70
|
-
"@wordpress/
|
|
71
|
-
"@wordpress/
|
|
72
|
-
"@wordpress/
|
|
73
|
-
"@wordpress/
|
|
50
|
+
"@react-spring/web": "^9.4.5",
|
|
51
|
+
"@wordpress/api-fetch": "^7.40.0",
|
|
52
|
+
"@wordpress/base-styles": "^6.16.0",
|
|
53
|
+
"@wordpress/blob": "^4.40.0",
|
|
54
|
+
"@wordpress/block-editor": "^15.13.0",
|
|
55
|
+
"@wordpress/blocks": "^15.13.0",
|
|
56
|
+
"@wordpress/components": "^32.2.0",
|
|
57
|
+
"@wordpress/compose": "^7.40.0",
|
|
58
|
+
"@wordpress/core-data": "^7.40.0",
|
|
59
|
+
"@wordpress/data": "^10.40.0",
|
|
60
|
+
"@wordpress/dataviews": "^12.0.0",
|
|
61
|
+
"@wordpress/date": "^5.40.0",
|
|
62
|
+
"@wordpress/element": "^6.40.0",
|
|
63
|
+
"@wordpress/hooks": "^4.40.0",
|
|
64
|
+
"@wordpress/html-entities": "^4.40.0",
|
|
65
|
+
"@wordpress/i18n": "^6.13.0",
|
|
66
|
+
"@wordpress/icons": "^11.7.0",
|
|
67
|
+
"@wordpress/media-utils": "^5.40.0",
|
|
68
|
+
"@wordpress/notices": "^5.40.0",
|
|
69
|
+
"@wordpress/patterns": "^2.40.0",
|
|
70
|
+
"@wordpress/primitives": "^4.40.0",
|
|
71
|
+
"@wordpress/private-apis": "^1.40.0",
|
|
72
|
+
"@wordpress/router": "^1.40.0",
|
|
73
|
+
"@wordpress/url": "^4.40.0",
|
|
74
|
+
"@wordpress/warning": "^3.40.0",
|
|
74
75
|
"change-case": "4.1.2",
|
|
75
76
|
"client-zip": "^2.4.5",
|
|
76
77
|
"clsx": "2.1.1",
|
|
@@ -82,5 +83,5 @@
|
|
|
82
83
|
"publishConfig": {
|
|
83
84
|
"access": "public"
|
|
84
85
|
},
|
|
85
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "376124aa10dbc2cc0c81c964ec00b99fcfee5382"
|
|
86
87
|
}
|
|
@@ -30,7 +30,7 @@ interface Action< Item > {
|
|
|
30
30
|
label: string;
|
|
31
31
|
isEligible?: ( item: Item ) => boolean;
|
|
32
32
|
modalFocusOnMount?: string;
|
|
33
|
-
RenderModal: ( props: RenderModalProps< Item > ) => JSX.Element;
|
|
33
|
+
RenderModal: ( props: RenderModalProps< Item > ) => React.JSX.Element;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
const duplicatePost: Action< BasePost > = {
|
|
@@ -29,7 +29,7 @@ interface Action< Item > {
|
|
|
29
29
|
label: string;
|
|
30
30
|
isEligible?: ( item: Item ) => boolean;
|
|
31
31
|
modalFocusOnMount?: string;
|
|
32
|
-
RenderModal: ( props: RenderModalProps< Item > ) => JSX.Element;
|
|
32
|
+
RenderModal: ( props: RenderModalProps< Item > ) => React.JSX.Element;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function isItemValid( item: BasePost ): boolean {
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
footer as footerIcon,
|
|
22
22
|
header as headerIcon,
|
|
23
23
|
sidebar as sidebarIcon,
|
|
24
|
-
|
|
24
|
+
navigationOverlay as navigationOverlayIcon,
|
|
25
25
|
symbolFilled as symbolFilledIcon,
|
|
26
26
|
} from '@wordpress/icons';
|
|
27
27
|
import { store as noticesStore } from '@wordpress/notices';
|
|
@@ -86,30 +86,21 @@ export default function CreateTemplatePartModal( {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
|
-
* Helper function to retrieve the corresponding icon by area name
|
|
89
|
+
* Helper function to retrieve the corresponding icon by area name.
|
|
90
90
|
*
|
|
91
|
-
* @param {string} areaOrIconName The area name (e.g., 'header', 'navigation-overlay')
|
|
91
|
+
* @param {string} areaOrIconName The area name (e.g., 'header', 'navigation-overlay').
|
|
92
92
|
*
|
|
93
93
|
* @return {Object} The corresponding icon.
|
|
94
94
|
*/
|
|
95
95
|
const getTemplatePartIcon = ( areaOrIconName: string ) => {
|
|
96
|
-
// Handle area names first
|
|
97
96
|
if ( 'header' === areaOrIconName ) {
|
|
98
97
|
return headerIcon;
|
|
99
98
|
} else if ( 'footer' === areaOrIconName ) {
|
|
100
99
|
return footerIcon;
|
|
101
100
|
} else if ( 'sidebar' === areaOrIconName ) {
|
|
102
101
|
return sidebarIcon;
|
|
103
|
-
} else if ( 'overlay' === areaOrIconName ) {
|
|
104
|
-
|
|
105
|
-
// Using tableColumnAfter as a placeholder.
|
|
106
|
-
return overlayIcon;
|
|
107
|
-
}
|
|
108
|
-
// Handle icon names for backwards compatibility
|
|
109
|
-
if ( 'menu' === areaOrIconName ) {
|
|
110
|
-
// TODO: Replace with a proper overlay icon when available.
|
|
111
|
-
// Using tableColumnAfter as a placeholder.
|
|
112
|
-
return overlayIcon;
|
|
102
|
+
} else if ( 'navigation-overlay' === areaOrIconName ) {
|
|
103
|
+
return navigationOverlayIcon;
|
|
113
104
|
}
|
|
114
105
|
return symbolFilledIcon;
|
|
115
106
|
};
|