@wordpress/dataviews 14.1.1-next.v.202604201441.0 → 14.2.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 +6 -0
- package/build/components/dataform-controls/array.cjs +2 -2
- package/build/components/dataform-controls/array.cjs.map +2 -2
- package/build/components/dataform-layouts/card/index.cjs.map +2 -2
- package/build/components/dataviews-filters/search-widget.cjs +2 -7
- package/build/components/dataviews-filters/search-widget.cjs.map +2 -2
- package/build/components/dataviews-layouts/activity/activity-item.cjs +2 -3
- package/build/components/dataviews-layouts/activity/activity-item.cjs.map +2 -2
- package/build/components/dataviews-layouts/grid/composite-grid.cjs +2 -2
- package/build/components/dataviews-layouts/grid/composite-grid.cjs.map +2 -2
- package/build/components/dataviews-layouts/list/index.cjs +2 -2
- package/build/components/dataviews-layouts/list/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/picker-grid/index.cjs +2 -2
- package/build/components/dataviews-layouts/picker-grid/index.cjs.map +2 -2
- package/build-module/components/dataform-controls/array.mjs +2 -2
- package/build-module/components/dataform-controls/array.mjs.map +2 -2
- package/build-module/components/dataform-layouts/card/index.mjs.map +2 -2
- package/build-module/components/dataviews-filters/search-widget.mjs +3 -13
- package/build-module/components/dataviews-filters/search-widget.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/activity/activity-item.mjs +2 -3
- package/build-module/components/dataviews-layouts/activity/activity-item.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs +2 -2
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/list/index.mjs +2 -3
- package/build-module/components/dataviews-layouts/list/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/picker-grid/index.mjs +2 -2
- package/build-module/components/dataviews-layouts/picker-grid/index.mjs.map +2 -2
- package/build-types/components/dataform-controls/array.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/card/index.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/search-widget.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/activity/activity-item.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/list/index.d.ts.map +1 -1
- package/build-types/dataform/stories/index.story.d.ts.map +1 -1
- package/build-types/dataviews/stories/free-composition.d.ts.map +1 -1
- package/build-types/dataviews/stories/index.story.d.ts.map +1 -1
- package/build-types/dataviews/stories/with-card.d.ts.map +1 -1
- package/build-wp/index.js +121 -56
- package/package.json +16 -16
- package/src/components/dataform-controls/array.tsx +3 -2
- package/src/components/dataform-layouts/card/index.tsx +0 -3
- package/src/components/dataviews-filters/search-widget.tsx +4 -14
- package/src/components/dataviews-layouts/activity/activity-item.tsx +2 -3
- package/src/components/dataviews-layouts/grid/composite-grid.tsx +3 -3
- package/src/components/dataviews-layouts/list/index.tsx +2 -3
- package/src/components/dataviews-layouts/picker-grid/index.tsx +3 -3
- package/src/dataform/stories/layout-card.tsx +3 -3
- package/src/dataviews/stories/empty.tsx +2 -2
- package/src/dataviews/stories/fixtures.tsx +2 -2
- package/src/dataviews/stories/free-composition.tsx +8 -11
- package/src/dataviews/stories/layout-activity.tsx +2 -2
- package/src/dataviews/stories/with-card.tsx +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/dataviews",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.2.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",
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
"sideEffects": false,
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@ariakit/react": "^0.4.21",
|
|
56
|
-
"@wordpress/base-styles": "^
|
|
57
|
-
"@wordpress/components": "^33.0.
|
|
58
|
-
"@wordpress/compose": "^7.
|
|
59
|
-
"@wordpress/data": "^10.45.
|
|
60
|
-
"@wordpress/date": "^5.
|
|
61
|
-
"@wordpress/deprecated": "^4.
|
|
62
|
-
"@wordpress/element": "^6.
|
|
63
|
-
"@wordpress/i18n": "^6.
|
|
64
|
-
"@wordpress/icons": "^
|
|
65
|
-
"@wordpress/keycodes": "^4.
|
|
66
|
-
"@wordpress/primitives": "^4.
|
|
67
|
-
"@wordpress/private-apis": "^1.
|
|
68
|
-
"@wordpress/ui": "^0.12.
|
|
69
|
-
"@wordpress/warning": "^3.
|
|
56
|
+
"@wordpress/base-styles": "^7.0.0",
|
|
57
|
+
"@wordpress/components": "^33.0.0",
|
|
58
|
+
"@wordpress/compose": "^7.45.0",
|
|
59
|
+
"@wordpress/data": "^10.45.0",
|
|
60
|
+
"@wordpress/date": "^5.45.0",
|
|
61
|
+
"@wordpress/deprecated": "^4.45.0",
|
|
62
|
+
"@wordpress/element": "^6.45.0",
|
|
63
|
+
"@wordpress/i18n": "^6.18.0",
|
|
64
|
+
"@wordpress/icons": "^13.0.0",
|
|
65
|
+
"@wordpress/keycodes": "^4.45.0",
|
|
66
|
+
"@wordpress/primitives": "^4.45.0",
|
|
67
|
+
"@wordpress/private-apis": "^1.45.0",
|
|
68
|
+
"@wordpress/ui": "^0.12.0",
|
|
69
|
+
"@wordpress/warning": "^3.45.0",
|
|
70
70
|
"clsx": "^2.1.1",
|
|
71
71
|
"colord": "^2.7.0",
|
|
72
72
|
"date-fns": "^4.1.0",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"scripts": {
|
|
93
93
|
"build:wp": "node build.cjs"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "8c229eaed0e88c9827e2da3d73a78f9ddd77714b"
|
|
96
96
|
}
|
|
@@ -22,7 +22,8 @@ export default function ArrayControl< Item >( {
|
|
|
22
22
|
markWhenOptional,
|
|
23
23
|
validity,
|
|
24
24
|
}: DataFormControlProps< Item > ) {
|
|
25
|
-
const { label, placeholder, getValue, setValue, isValid } =
|
|
25
|
+
const { label, placeholder, description, getValue, setValue, isValid } =
|
|
26
|
+
field;
|
|
26
27
|
const value = getValue( { item: data } );
|
|
27
28
|
const disabled = field.isDisabled( { item: data, field } );
|
|
28
29
|
|
|
@@ -88,7 +89,7 @@ export default function ArrayControl< Item >( {
|
|
|
88
89
|
return true;
|
|
89
90
|
} }
|
|
90
91
|
__experimentalExpandOnFocus={ elements && elements.length > 0 }
|
|
91
|
-
|
|
92
|
+
help={ description ?? ( field.isValid?.elements ? '' : undefined ) }
|
|
92
93
|
displayTransform={ ( token: any ) => {
|
|
93
94
|
// For existing tokens (element objects), display their label
|
|
94
95
|
if ( typeof token === 'object' && 'label' in token ) {
|
|
@@ -9,9 +9,6 @@ import {
|
|
|
9
9
|
useRef,
|
|
10
10
|
useState,
|
|
11
11
|
} from '@wordpress/element';
|
|
12
|
-
// TODO: enable in the ESlint rule once we complete
|
|
13
|
-
// https://github.com/WordPress/gutenberg/issues/76135.
|
|
14
|
-
// eslint-disable-next-line @wordpress/use-recommended-components
|
|
15
12
|
import { Card, CollapsibleCard, Stack } from '@wordpress/ui';
|
|
16
13
|
|
|
17
14
|
/**
|
|
@@ -12,13 +12,9 @@ import clsx from 'clsx';
|
|
|
12
12
|
import { useInstanceId } from '@wordpress/compose';
|
|
13
13
|
import { __, sprintf } from '@wordpress/i18n';
|
|
14
14
|
import { useState, useMemo, useDeferredValue } from '@wordpress/element';
|
|
15
|
-
import {
|
|
16
|
-
VisuallyHidden,
|
|
17
|
-
Icon,
|
|
18
|
-
Composite,
|
|
19
|
-
Spinner,
|
|
20
|
-
} from '@wordpress/components';
|
|
15
|
+
import { Icon, Composite, Spinner } from '@wordpress/components';
|
|
21
16
|
import { search, check } from '@wordpress/icons';
|
|
17
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
22
18
|
|
|
23
19
|
/**
|
|
24
20
|
* Internal dependencies
|
|
@@ -267,15 +263,9 @@ function ComboboxList( { view, filter, onChangeView }: SearchWidgetProps ) {
|
|
|
267
263
|
setValue={ setSearchValue }
|
|
268
264
|
>
|
|
269
265
|
<div className="dataviews-filters__search-widget-filter-combobox__wrapper">
|
|
270
|
-
<Ariakit.ComboboxLabel
|
|
271
|
-
render={
|
|
272
|
-
<VisuallyHidden>
|
|
273
|
-
{ __( 'Search items' ) }
|
|
274
|
-
</VisuallyHidden>
|
|
275
|
-
}
|
|
276
|
-
>
|
|
266
|
+
<VisuallyHidden render={ <Ariakit.ComboboxLabel /> }>
|
|
277
267
|
{ __( 'Search items' ) }
|
|
278
|
-
</
|
|
268
|
+
</VisuallyHidden>
|
|
279
269
|
<Ariakit.Combobox
|
|
280
270
|
autoSelect="always"
|
|
281
271
|
placeholder={ __( 'Search' ) }
|
|
@@ -6,11 +6,10 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { VisuallyHidden } from '@wordpress/components';
|
|
10
9
|
import { useRef, useContext, useMemo } from '@wordpress/element';
|
|
11
10
|
import { useRegistry } from '@wordpress/data';
|
|
12
11
|
import { useViewportMatch } from '@wordpress/compose';
|
|
13
|
-
import { Stack } from '@wordpress/ui';
|
|
12
|
+
import { Stack, VisuallyHidden } from '@wordpress/ui';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Internal dependencies
|
|
@@ -162,8 +161,8 @@ function ActivityItem< Item >(
|
|
|
162
161
|
className="dataviews-view-activity__item-field"
|
|
163
162
|
>
|
|
164
163
|
<VisuallyHidden
|
|
165
|
-
as="span"
|
|
166
164
|
className="dataviews-view-activity__item-field-label"
|
|
165
|
+
render={ <span /> }
|
|
167
166
|
>
|
|
168
167
|
{ field.label }
|
|
169
168
|
</VisuallyHidden>
|
|
@@ -43,7 +43,7 @@ import type {
|
|
|
43
43
|
} from '../../../types';
|
|
44
44
|
import type { SetSelection } from '../../../types/private';
|
|
45
45
|
import { ItemClickWrapper } from '../utils/item-click-wrapper';
|
|
46
|
-
const { Badge } = unlock( componentsPrivateApis );
|
|
46
|
+
const { Badge: WCBadge } = unlock( componentsPrivateApis );
|
|
47
47
|
import { useGridColumns } from './preview-size-picker';
|
|
48
48
|
import { GridItems } from '../utils/grid-items';
|
|
49
49
|
import {
|
|
@@ -273,7 +273,7 @@ const GridItem = forwardRef< HTMLDivElement, GridItemProps< any > >(
|
|
|
273
273
|
>
|
|
274
274
|
{ badgeFields.map( ( field ) => {
|
|
275
275
|
return (
|
|
276
|
-
<
|
|
276
|
+
<WCBadge
|
|
277
277
|
key={ field.id }
|
|
278
278
|
className="dataviews-view-grid__field-value"
|
|
279
279
|
>
|
|
@@ -281,7 +281,7 @@ const GridItem = forwardRef< HTMLDivElement, GridItemProps< any > >(
|
|
|
281
281
|
item={ item }
|
|
282
282
|
field={ field }
|
|
283
283
|
/>
|
|
284
|
-
</
|
|
284
|
+
</WCBadge>
|
|
285
285
|
);
|
|
286
286
|
} ) }
|
|
287
287
|
</Stack>
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
Button,
|
|
12
12
|
privateApis as componentsPrivateApis,
|
|
13
13
|
Spinner,
|
|
14
|
-
VisuallyHidden,
|
|
15
14
|
Composite,
|
|
16
15
|
} from '@wordpress/components';
|
|
17
16
|
import {
|
|
@@ -25,7 +24,7 @@ import {
|
|
|
25
24
|
import { __, sprintf } from '@wordpress/i18n';
|
|
26
25
|
import { moreVertical } from '@wordpress/icons';
|
|
27
26
|
import { useRegistry } from '@wordpress/data';
|
|
28
|
-
import { Stack } from '@wordpress/ui';
|
|
27
|
+
import { Stack, VisuallyHidden } from '@wordpress/ui';
|
|
29
28
|
|
|
30
29
|
/**
|
|
31
30
|
* Internal dependencies
|
|
@@ -355,8 +354,8 @@ function ListItem< Item >( {
|
|
|
355
354
|
className="dataviews-view-list__field"
|
|
356
355
|
>
|
|
357
356
|
<VisuallyHidden
|
|
358
|
-
as="span"
|
|
359
357
|
className="dataviews-view-list__field-label"
|
|
358
|
+
render={ <span /> }
|
|
360
359
|
>
|
|
361
360
|
{ field.label }
|
|
362
361
|
</VisuallyHidden>
|
|
@@ -33,7 +33,7 @@ import type {
|
|
|
33
33
|
} from '../../../types';
|
|
34
34
|
import type { SetSelection } from '../../../types/private';
|
|
35
35
|
import { GridItems } from '../utils/grid-items';
|
|
36
|
-
const { Badge } = unlock( componentsPrivateApis );
|
|
36
|
+
const { Badge: WCBadge } = unlock( componentsPrivateApis );
|
|
37
37
|
import getDataByGroup from '../utils/get-data-by-group';
|
|
38
38
|
import { useGridColumns } from '../grid/preview-size-picker';
|
|
39
39
|
import {
|
|
@@ -175,7 +175,7 @@ function GridItem< Item >( {
|
|
|
175
175
|
>
|
|
176
176
|
{ badgeFields.map( ( field ) => {
|
|
177
177
|
return (
|
|
178
|
-
<
|
|
178
|
+
<WCBadge
|
|
179
179
|
key={ field.id }
|
|
180
180
|
className="dataviews-view-picker-grid__field-value"
|
|
181
181
|
>
|
|
@@ -183,7 +183,7 @@ function GridItem< Item >( {
|
|
|
183
183
|
item={ item }
|
|
184
184
|
field={ field }
|
|
185
185
|
/>
|
|
186
|
-
</
|
|
186
|
+
</WCBadge>
|
|
187
187
|
);
|
|
188
188
|
} ) }
|
|
189
189
|
</Stack>
|
|
@@ -11,7 +11,7 @@ import DataForm from '../index';
|
|
|
11
11
|
import type { Field, Form } from '../../types';
|
|
12
12
|
import { unlock } from '../../lock-unlock';
|
|
13
13
|
|
|
14
|
-
const { Badge } = unlock( privateApis );
|
|
14
|
+
const { Badge: WCBadge } = unlock( privateApis );
|
|
15
15
|
|
|
16
16
|
const LayoutCardComponent = ( {
|
|
17
17
|
withHeader,
|
|
@@ -115,7 +115,7 @@ const LayoutCardComponent = ( {
|
|
|
115
115
|
label: 'Due date',
|
|
116
116
|
type: 'text',
|
|
117
117
|
render: ( { item } ) => {
|
|
118
|
-
return <
|
|
118
|
+
return <WCBadge>Due on: { item.dueDate }</WCBadge>;
|
|
119
119
|
},
|
|
120
120
|
},
|
|
121
121
|
{
|
|
@@ -123,7 +123,7 @@ const LayoutCardComponent = ( {
|
|
|
123
123
|
type: 'text',
|
|
124
124
|
readOnly: true,
|
|
125
125
|
render: ( { item } ) => {
|
|
126
|
-
return <
|
|
126
|
+
return <WCBadge>{ item.plan }</WCBadge>;
|
|
127
127
|
},
|
|
128
128
|
},
|
|
129
129
|
];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useState } from '@wordpress/element';
|
|
5
|
-
import { __experimentalText as
|
|
5
|
+
import { __experimentalText as WCText } from '@wordpress/components';
|
|
6
6
|
import { Stack } from '@wordpress/ui';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -41,7 +41,7 @@ const PlanetIllustration = () => (
|
|
|
41
41
|
const CustomEmptyComponent = () => (
|
|
42
42
|
<Stack direction="column" align="center" justify="center" gap="md">
|
|
43
43
|
<PlanetIllustration />
|
|
44
|
-
<
|
|
44
|
+
<WCText>No celestial bodies found</WCText>
|
|
45
45
|
</Stack>
|
|
46
46
|
);
|
|
47
47
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { trash, image, Icon, category } from '@wordpress/icons';
|
|
5
|
-
import { Button, __experimentalText as
|
|
5
|
+
import { Button, __experimentalText as WCText } from '@wordpress/components';
|
|
6
6
|
import { Stack } from '@wordpress/ui';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -642,7 +642,7 @@ export const actions: Action< SpaceObject >[] = [
|
|
|
642
642
|
: `Are you sure you want to delete "${ items[ 0 ].name.title }"?`;
|
|
643
643
|
return (
|
|
644
644
|
<Stack direction="column" gap="xl">
|
|
645
|
-
<
|
|
645
|
+
<WCText>{ label }</WCText>
|
|
646
646
|
<Stack direction="row" gap="sm" justify="right">
|
|
647
647
|
<Button
|
|
648
648
|
__next40pxDefaultSize
|
|
@@ -8,13 +8,10 @@ import {
|
|
|
8
8
|
} from '@wordpress/element';
|
|
9
9
|
import {
|
|
10
10
|
__experimentalHeading as Heading,
|
|
11
|
-
__experimentalText as
|
|
11
|
+
__experimentalText as WCText,
|
|
12
12
|
Button,
|
|
13
13
|
} from '@wordpress/components';
|
|
14
14
|
import { __, _n } from '@wordpress/i18n';
|
|
15
|
-
// TODO: enable in the ESlint rule once we complete
|
|
16
|
-
// https://github.com/WordPress/gutenberg/issues/76135.
|
|
17
|
-
// eslint-disable-next-line @wordpress/use-recommended-components
|
|
18
15
|
import { Card, Stack } from '@wordpress/ui';
|
|
19
16
|
|
|
20
17
|
/**
|
|
@@ -56,7 +53,7 @@ function PlanetOverview( { planets }: { planets: SpaceObject[] } ) {
|
|
|
56
53
|
<Card.Root>
|
|
57
54
|
<Card.Content>
|
|
58
55
|
<Stack direction="column" gap="sm">
|
|
59
|
-
<
|
|
56
|
+
<WCText size={ 18 } as="p">
|
|
60
57
|
{ createInterpolateElement(
|
|
61
58
|
_n(
|
|
62
59
|
'<PlanetsNumber /> planet',
|
|
@@ -71,9 +68,9 @@ function PlanetOverview( { planets }: { planets: SpaceObject[] } ) {
|
|
|
71
68
|
),
|
|
72
69
|
}
|
|
73
70
|
) }
|
|
74
|
-
</
|
|
71
|
+
</WCText>
|
|
75
72
|
|
|
76
|
-
<
|
|
73
|
+
<WCText size={ 18 } as="p">
|
|
77
74
|
{ createInterpolateElement(
|
|
78
75
|
_n(
|
|
79
76
|
'<SatellitesNumber /> moon',
|
|
@@ -86,7 +83,7 @@ function PlanetOverview( { planets }: { planets: SpaceObject[] } ) {
|
|
|
86
83
|
),
|
|
87
84
|
}
|
|
88
85
|
) }
|
|
89
|
-
</
|
|
86
|
+
</WCText>
|
|
90
87
|
</Stack>
|
|
91
88
|
</Card.Content>
|
|
92
89
|
</Card.Root>
|
|
@@ -173,10 +170,10 @@ export const FreeCompositionComponent = () => {
|
|
|
173
170
|
align="center"
|
|
174
171
|
className="free-composition-dataviews-empty"
|
|
175
172
|
>
|
|
176
|
-
<
|
|
173
|
+
<WCText size={ 18 } as="p">
|
|
177
174
|
No planets
|
|
178
|
-
</
|
|
179
|
-
<
|
|
175
|
+
</WCText>
|
|
176
|
+
<WCText variant="muted">{ `Try a different search because “${ view.search }” returned no results.` }</WCText>
|
|
180
177
|
<Button variant="secondary">Create new planet</Button>
|
|
181
178
|
</Stack>
|
|
182
179
|
}
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
pin,
|
|
16
16
|
link,
|
|
17
17
|
} from '@wordpress/icons';
|
|
18
|
-
import { Button, __experimentalText as
|
|
18
|
+
import { Button, __experimentalText as WCText } from '@wordpress/components';
|
|
19
19
|
import { Stack } from '@wordpress/ui';
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -555,7 +555,7 @@ export const orderEventActions: Action< OrderEvent >[] = [
|
|
|
555
555
|
};
|
|
556
556
|
return (
|
|
557
557
|
<Stack direction="column" gap="xl">
|
|
558
|
-
<
|
|
558
|
+
<WCText>{ label }</WCText>
|
|
559
559
|
<Stack direction="row" gap="sm" justify="right">
|
|
560
560
|
<Button
|
|
561
561
|
__next40pxDefaultSize
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useState, useMemo } from '@wordpress/element';
|
|
5
|
-
// TODO: enable in the ESlint rule once we complete
|
|
6
|
-
// https://github.com/WordPress/gutenberg/issues/76135.
|
|
7
|
-
// eslint-disable-next-line @wordpress/use-recommended-components
|
|
8
5
|
import { Card } from '@wordpress/ui';
|
|
9
6
|
|
|
10
7
|
/**
|