@wordpress/media-fields 0.16.0 → 0.18.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 +8 -0
- package/build/alt_text/index.cjs.map +2 -2
- package/build/attached_to/edit.cjs +5 -24
- package/build/attached_to/edit.cjs.map +2 -2
- package/build/attached_to/index.cjs.map +2 -2
- package/build/attached_to/view.cjs.map +2 -2
- package/build/author/index.cjs.map +2 -2
- package/build/author/view.cjs.map +2 -2
- package/build/caption/index.cjs.map +2 -2
- package/build/date_added/index.cjs.map +2 -2
- package/build/date_modified/index.cjs.map +2 -2
- package/build/description/index.cjs.map +2 -2
- package/build/filename/index.cjs.map +2 -2
- package/build/filename/view.cjs.map +2 -2
- package/build/filesize/index.cjs.map +2 -2
- package/build/media_dimensions/index.cjs.map +2 -2
- package/build/media_thumbnail/index.cjs.map +2 -2
- package/build/media_thumbnail/view.cjs.map +2 -2
- package/build/mime_type/index.cjs.map +2 -2
- package/build/types.cjs.map +1 -1
- package/build/utils/get-media-type-from-mime-type.cjs.map +2 -2
- package/build-module/alt_text/index.mjs.map +2 -2
- package/build-module/attached_to/edit.mjs +8 -27
- package/build-module/attached_to/edit.mjs.map +2 -2
- package/build-module/attached_to/index.mjs.map +2 -2
- package/build-module/attached_to/view.mjs.map +2 -2
- package/build-module/author/index.mjs.map +2 -2
- package/build-module/author/view.mjs.map +2 -2
- package/build-module/caption/index.mjs.map +2 -2
- package/build-module/date_added/index.mjs.map +2 -2
- package/build-module/date_modified/index.mjs.map +2 -2
- package/build-module/description/index.mjs.map +2 -2
- package/build-module/filename/index.mjs.map +2 -2
- package/build-module/filename/view.mjs.map +2 -2
- package/build-module/filesize/index.mjs.map +2 -2
- package/build-module/media_dimensions/index.mjs.map +2 -2
- package/build-module/media_thumbnail/index.mjs.map +2 -2
- package/build-module/media_thumbnail/view.mjs.map +2 -2
- package/build-module/mime_type/index.mjs.map +2 -2
- package/build-module/utils/get-media-type-from-mime-type.mjs.map +2 -2
- package/build-style/style-rtl.css +14 -3
- package/build-style/style.css +14 -3
- package/build-types/alt_text/index.d.ts.map +1 -1
- package/build-types/attached_to/edit.d.ts +0 -3
- package/build-types/attached_to/edit.d.ts.map +1 -1
- package/build-types/attached_to/index.d.ts +0 -3
- package/build-types/attached_to/index.d.ts.map +1 -1
- package/build-types/attached_to/view.d.ts +0 -3
- package/build-types/attached_to/view.d.ts.map +1 -1
- package/build-types/author/index.d.ts +0 -6
- package/build-types/author/index.d.ts.map +1 -1
- package/build-types/author/view.d.ts +0 -3
- package/build-types/author/view.d.ts.map +1 -1
- package/build-types/caption/index.d.ts.map +1 -1
- package/build-types/date_added/index.d.ts +0 -3
- package/build-types/date_added/index.d.ts.map +1 -1
- package/build-types/date_modified/index.d.ts +0 -3
- package/build-types/date_modified/index.d.ts.map +1 -1
- package/build-types/description/index.d.ts.map +1 -1
- package/build-types/filename/index.d.ts +0 -3
- package/build-types/filename/index.d.ts.map +1 -1
- package/build-types/filename/view.d.ts +0 -3
- package/build-types/filename/view.d.ts.map +1 -1
- package/build-types/filesize/index.d.ts +0 -3
- package/build-types/filesize/index.d.ts.map +1 -1
- package/build-types/media_dimensions/index.d.ts.map +1 -1
- package/build-types/media_thumbnail/index.d.ts +0 -3
- package/build-types/media_thumbnail/index.d.ts.map +1 -1
- package/build-types/media_thumbnail/view.d.ts.map +1 -1
- package/build-types/mime_type/index.d.ts.map +1 -1
- package/build-types/stories/index.story.d.ts.map +1 -1
- package/build-types/types.d.ts +0 -3
- package/build-types/types.d.ts.map +1 -1
- package/build-types/utils/get-media-type-from-mime-type.d.ts +0 -3
- package/build-types/utils/get-media-type-from-mime-type.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/alt_text/index.tsx +0 -3
- package/src/attached_to/edit.tsx +16 -34
- package/src/attached_to/index.tsx +0 -7
- package/src/attached_to/style.scss +36 -0
- package/src/attached_to/test/view.test.tsx +0 -11
- package/src/attached_to/view.tsx +0 -6
- package/src/author/index.tsx +0 -7
- package/src/author/view.tsx +0 -11
- package/src/caption/index.tsx +0 -7
- package/src/date_added/index.tsx +0 -7
- package/src/date_modified/index.tsx +0 -7
- package/src/description/index.tsx +0 -7
- package/src/filename/index.ts +0 -7
- package/src/filename/test/index.test.ts +0 -3
- package/src/filename/test/view.test.tsx +0 -11
- package/src/filename/view.tsx +0 -7
- package/src/filesize/index.tsx +0 -7
- package/src/filesize/test/index.test.tsx +0 -3
- package/src/media_dimensions/index.ts +0 -3
- package/src/media_dimensions/test/index.test.ts +0 -7
- package/src/media_thumbnail/index.tsx +0 -7
- package/src/media_thumbnail/test/get-best-image-url.test.ts +0 -3
- package/src/media_thumbnail/view.tsx +0 -10
- package/src/mime_type/index.ts +0 -3
- package/src/stories/index.story.tsx +0 -7
- package/src/style.scss +1 -0
- package/src/types.ts +0 -3
- package/src/utils/get-media-type-from-mime-type.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filesize/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filesize/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAsE1C,QAAA,MAAM,aAAa,EAAE,OAAO,CAAE,KAAK,CAAE,SAAS,CAAE,CAc/C,CAAC;eAEa,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/media_dimensions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/media_dimensions/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,QAAA,MAAM,oBAAoB,EAAE,OAAO,CAAE,KAAK,CAAE,SAAS,CAAE,UAAU,CAAE,CAAE,CAmBpE,CAAC;eAEa,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/media_thumbnail/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/media_thumbnail/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,QAAA,MAAM,mBAAmB,EAAE,OAAO,CAAE,KAAK,CAAE,SAAS,CAAE,CAOrD,CAAC;eAEa,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/media_thumbnail/view.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/media_thumbnail/view.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC9B,aAAa,EAAE,UAAU,GAAG,SAAS,EACrC,WAAW,CAAC,EAAE,MAAM,GAClB,MAAM,CAwCR;AA4FD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,EAC3C,IAAI,EACJ,MAAM,GACN,EAAE,wBAAwB,CAAE,SAAS,CAAE,sCA4CvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mime_type/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mime_type/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,QAAA,MAAM,aAAa,EAAE,OAAO,CAAE,KAAK,CAAE,SAAS,CAAE,UAAU,CAAE,CAAE,CAW7D,CAAC;eAEa,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../src/stories/index.story.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../src/stories/index.story.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAa,MAAM,sBAAsB,CAAC;;IAkB1D,KAAK;IACL,SAAS;;;AAuRV,QAAA,MAAM,kBAAkB,aAAe;IAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;CAAE,gCA4CnE,CAAC;AAEF,eAAO,MAAM,gBAAgB;IAC5B,MAAM;IACN,QAAQ;QACP,IAAI;YACH,OAAO;gBAAI,IAAI;;YACf,WAAW;YACX,OAAO;;;IAGT,IAAI;QACH,IAAI;;CAEL,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAsC5B,CAAC"}
|
package/build-types/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE9E,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC;AAEpE,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;CACxB;AAGD,MAAM,WAAW,SAAU,SAAQ,UAAU,CAAE,MAAM,CAAE;IAEtD,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE;QAEX,gBAAgB,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,CAAE,IAAI,CAAE,EAAE,CAAC;QAC9C,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,CAAE,IAAI,CAAE,EAAE,CAAC;KACpC,CAAC;CACF;AAED,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAE,UAAU,CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-media-type-from-mime-type.d.ts","sourceRoot":"","sources":["../../src/utils/get-media-type-from-mime-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-media-type-from-mime-type.d.ts","sourceRoot":"","sources":["../../src/utils/get-media-type-from-mime-type.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAE,QAAQ,EAAE,MAAM,GAAI,SAAS,CA8BtE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/media-fields",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Reusable field definitions for displaying and editing media attachment properties in WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -48,26 +48,26 @@
|
|
|
48
48
|
"src/**/*.scss"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@wordpress/base-styles": "^
|
|
52
|
-
"@wordpress/components": "^
|
|
53
|
-
"@wordpress/compose": "^8.
|
|
54
|
-
"@wordpress/core-data": "^7.
|
|
55
|
-
"@wordpress/data": "^10.
|
|
56
|
-
"@wordpress/dataviews": "^
|
|
57
|
-
"@wordpress/date": "^5.
|
|
58
|
-
"@wordpress/element": "^8.
|
|
59
|
-
"@wordpress/i18n": "^6.
|
|
60
|
-
"@wordpress/icons": "^15.
|
|
61
|
-
"@wordpress/primitives": "^4.
|
|
62
|
-
"@wordpress/ui": "^0.
|
|
63
|
-
"@wordpress/url": "^4.
|
|
51
|
+
"@wordpress/base-styles": "^12.1.0",
|
|
52
|
+
"@wordpress/components": "^39.0.0",
|
|
53
|
+
"@wordpress/compose": "^8.6.0",
|
|
54
|
+
"@wordpress/core-data": "^7.53.0",
|
|
55
|
+
"@wordpress/data": "^10.53.0",
|
|
56
|
+
"@wordpress/dataviews": "^18.0.0",
|
|
57
|
+
"@wordpress/date": "^5.53.0",
|
|
58
|
+
"@wordpress/element": "^8.5.0",
|
|
59
|
+
"@wordpress/i18n": "^6.26.0",
|
|
60
|
+
"@wordpress/icons": "^15.4.0",
|
|
61
|
+
"@wordpress/primitives": "^4.53.0",
|
|
62
|
+
"@wordpress/ui": "^0.20.0",
|
|
63
|
+
"@wordpress/url": "^4.53.0",
|
|
64
64
|
"clsx": "^2.1.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@testing-library/dom": "^10.4.1",
|
|
68
68
|
"@testing-library/jest-dom": "^6.9.1",
|
|
69
69
|
"@testing-library/react": "^16.3.2",
|
|
70
|
-
"@types/jest": "^
|
|
70
|
+
"@types/jest": "^30.0.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@types/react": "^18 || ^19",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "989764d42ff93e33684aaf0b96a5b7f3d9bbff52"
|
|
85
85
|
}
|
package/src/alt_text/index.tsx
CHANGED
package/src/attached_to/edit.tsx
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import {
|
|
5
2
|
__experimentalFetchLinkSuggestions as fetchLinkSuggestions,
|
|
6
3
|
store as coreStore,
|
|
7
4
|
} from '@wordpress/core-data';
|
|
8
|
-
import {
|
|
5
|
+
import { ComboboxControl } from '@wordpress/components';
|
|
9
6
|
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import { useState
|
|
11
|
-
import {
|
|
7
|
+
import { useState } from '@wordpress/element';
|
|
8
|
+
import { useDebounce, useEvent } from '@wordpress/compose';
|
|
12
9
|
import { useSelect } from '@wordpress/data';
|
|
13
10
|
import type { DataFormControlProps } from '@wordpress/dataviews';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
11
|
import type { MediaItem } from '../types';
|
|
19
12
|
import { getRenderedContent } from '../utils/get-rendered-content';
|
|
20
13
|
|
|
@@ -76,7 +69,6 @@ export default function MediaAttachedToEdit( {
|
|
|
76
69
|
_embedded: { ...data?._embedded, 'wp:attached-to': undefined },
|
|
77
70
|
} );
|
|
78
71
|
setValue( null );
|
|
79
|
-
setOptions( [] );
|
|
80
72
|
};
|
|
81
73
|
|
|
82
74
|
const onValueChange = async ( filterValue: string ) => {
|
|
@@ -104,6 +96,12 @@ export default function MediaAttachedToEdit( {
|
|
|
104
96
|
setIsLoading( false );
|
|
105
97
|
};
|
|
106
98
|
|
|
99
|
+
// `onValueChange` closes over state, so it's wrapped in `useEvent` to give
|
|
100
|
+
// `useDebounce` a stable function. Debouncing an inline function instead
|
|
101
|
+
// rebuilds the timer on every render, so nothing is debounced and each
|
|
102
|
+
// keystroke fires its own request.
|
|
103
|
+
const debouncedValueChange = useDebounce( useEvent( onValueChange ), 300 );
|
|
104
|
+
|
|
107
105
|
/**
|
|
108
106
|
* Handle selection.
|
|
109
107
|
*
|
|
@@ -150,38 +148,22 @@ export default function MediaAttachedToEdit( {
|
|
|
150
148
|
}
|
|
151
149
|
};
|
|
152
150
|
|
|
153
|
-
const help = createInterpolateElement(
|
|
154
|
-
__(
|
|
155
|
-
'Search for a post or page to attach this media to or <button>detach current</button>.'
|
|
156
|
-
),
|
|
157
|
-
{
|
|
158
|
-
button: (
|
|
159
|
-
<Button
|
|
160
|
-
__next40pxDefaultSize
|
|
161
|
-
onClick={ handleDetach }
|
|
162
|
-
variant="link"
|
|
163
|
-
accessibleWhenDisabled
|
|
164
|
-
disabled={ ! value }
|
|
165
|
-
/>
|
|
166
|
-
),
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
|
|
170
151
|
return (
|
|
171
152
|
<ComboboxControl
|
|
172
153
|
className="dataviews-media-field__attached-to"
|
|
173
154
|
isLoading={ isLoading }
|
|
174
155
|
label={ __( 'Attached to' ) }
|
|
175
|
-
help={
|
|
156
|
+
help={ __( 'Attach this file to a single post or page.' ) }
|
|
176
157
|
value={ value }
|
|
177
158
|
options={ options }
|
|
178
|
-
onFilterValueChange={
|
|
179
|
-
( filterValue
|
|
180
|
-
|
|
181
|
-
300
|
|
182
|
-
) }
|
|
159
|
+
onFilterValueChange={ ( filterValue: unknown ) =>
|
|
160
|
+
debouncedValueChange( filterValue as string )
|
|
161
|
+
}
|
|
183
162
|
onChange={ handleSelectOption }
|
|
184
163
|
hideLabelFromVision
|
|
164
|
+
// Opening the panel shouldn't imply the user has decided to change
|
|
165
|
+
// the attachment, so wait for them to search before showing the list.
|
|
166
|
+
expandOnFocus={ false }
|
|
185
167
|
/>
|
|
186
168
|
);
|
|
187
169
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import type { Field } from '@wordpress/dataviews';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
3
|
import type { MediaItem } from '../types';
|
|
11
4
|
import MediaAttachedToView from './view';
|
|
12
5
|
import MediaAttachedToEdit from './edit';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@use "@wordpress/base-styles/variables" as *;
|
|
2
|
+
|
|
3
|
+
// Height of the suggestion list: three rows, the most `fetchLinkSuggestions`
|
|
4
|
+
// returns while it is called with `isInitialSuggestions` (see the @TODO in
|
|
5
|
+
// edit.tsx).
|
|
6
|
+
$suggestions-height: $button-size-compact * 3;
|
|
7
|
+
|
|
8
|
+
// When this field is edited from a DataForm panel it renders inside a popover
|
|
9
|
+
// that floating-ui measures and places when it opens. `ComboboxControl` renders
|
|
10
|
+
// its suggestions inline, so they arrive after that measurement: the popover
|
|
11
|
+
// can't grow, and the list ends up scrolling inside a box too small to scroll
|
|
12
|
+
// comfortably — worst low on screen, where the space is smallest.
|
|
13
|
+
//
|
|
14
|
+
// See https://github.com/WordPress/gutenberg/issues/81122.
|
|
15
|
+
.components-popover__content:has(.dataviews-media-field__attached-to) {
|
|
16
|
+
// Reserve the space the suggestions will need before they exist. The popover
|
|
17
|
+
// is absolutely positioned, so it contains this margin rather than collapsing
|
|
18
|
+
// it, and floating-ui measures the reserved height when it decides which way
|
|
19
|
+
// to open — and caps the popover's height against it too, so the cap already
|
|
20
|
+
// allows for the suggestions. The margin is transparent, so nothing is
|
|
21
|
+
// visibly reserved.
|
|
22
|
+
margin-bottom: $suggestions-height;
|
|
23
|
+
|
|
24
|
+
// Once the suggestions are there they occupy that space instead, so the
|
|
25
|
+
// popover's total height is unchanged and it has no reason to move.
|
|
26
|
+
&:has(.components-form-token-field__suggestions-list) {
|
|
27
|
+
margin-bottom: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Hold the list at the reserved height rather than letting it grow and shrink
|
|
31
|
+
// with the number of matches, which would resize the popover as you type.
|
|
32
|
+
.components-form-token-field__suggestions-list {
|
|
33
|
+
height: $suggestions-height;
|
|
34
|
+
max-height: none;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { render, screen } from '@testing-library/react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import type { NormalizedField } from '@wordpress/dataviews';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
3
|
import MediaAttachedToView from '../view';
|
|
15
4
|
import type { MediaItem } from '../../types';
|
|
16
5
|
|
package/src/attached_to/view.tsx
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useState, useEffect } from '@wordpress/element';
|
|
5
2
|
import { __ } from '@wordpress/i18n';
|
|
6
3
|
import type { DataViewRenderFieldProps } from '@wordpress/dataviews';
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
4
|
import type { MediaItem } from '../types';
|
|
11
5
|
import { getRenderedContent } from '../utils/get-rendered-content';
|
|
12
6
|
|
package/src/author/index.tsx
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import type { Field } from '@wordpress/dataviews';
|
|
5
2
|
import { __ } from '@wordpress/i18n';
|
|
6
3
|
import { resolveSelect } from '@wordpress/data';
|
|
7
4
|
import { store as coreDataStore } from '@wordpress/core-data';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import type { MediaItem } from '../types';
|
|
13
6
|
import AuthorView from './view';
|
|
14
7
|
|
package/src/author/view.tsx
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { __ } from '@wordpress/i18n';
|
|
10
3
|
import { useState, useCallback, useEffect } from '@wordpress/element';
|
|
11
4
|
import { commentAuthorAvatar as authorIcon } from '@wordpress/icons';
|
|
@@ -14,10 +7,6 @@ import {
|
|
|
14
7
|
Icon as WCIcon,
|
|
15
8
|
} from '@wordpress/components';
|
|
16
9
|
import type { DataViewRenderFieldProps } from '@wordpress/dataviews';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
10
|
import type { MediaItem } from '../types';
|
|
22
11
|
|
|
23
12
|
export default function AuthorView( {
|
package/src/caption/index.tsx
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import { TextareaControl } from '@wordpress/components';
|
|
6
3
|
import type { Attachment, Updatable } from '@wordpress/core-data';
|
|
7
4
|
import type { Field } from '@wordpress/dataviews';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import { getRawContent } from '../utils/get-raw-content';
|
|
13
6
|
|
|
14
7
|
const captionField: Partial< Field< Updatable< Attachment > > > = {
|
package/src/date_added/index.tsx
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import type { Field } from '@wordpress/dataviews';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
3
|
import type { MediaItem } from '../types';
|
|
11
4
|
|
|
12
5
|
const dateAddedField: Partial< Field< MediaItem > > = {
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import type { Field } from '@wordpress/dataviews';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
3
|
import type { MediaItem } from '../types';
|
|
11
4
|
|
|
12
5
|
const dateModifiedField: Partial< Field< MediaItem > > = {
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import { TextareaControl } from '@wordpress/components';
|
|
6
3
|
import type { Attachment, Updatable } from '@wordpress/core-data';
|
|
7
4
|
import type { Field } from '@wordpress/dataviews';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import { getRawContent } from '../utils/get-raw-content';
|
|
13
6
|
|
|
14
7
|
const descriptionField: Partial< Field< Updatable< Attachment > > > = {
|
package/src/filename/index.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import { getFilename } from '@wordpress/url';
|
|
6
3
|
import type { Field } from '@wordpress/dataviews';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
4
|
import type { MediaItem } from '../types';
|
|
12
5
|
import FileNameView from './view';
|
|
13
6
|
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { render, screen } from '@testing-library/react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import type { NormalizedField } from '@wordpress/dataviews';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
3
|
import FileNameView from '../view';
|
|
15
4
|
import filenameField from '../index';
|
|
16
5
|
import type { MediaItem } from '../../types';
|
package/src/filename/view.tsx
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useMemo } from '@wordpress/element';
|
|
5
2
|
import { getFilename } from '@wordpress/url';
|
|
6
3
|
import type { DataViewRenderFieldProps } from '@wordpress/dataviews';
|
|
7
4
|
import { Tooltip } from '@wordpress/ui';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import type { MediaItem } from '../types';
|
|
13
6
|
|
|
14
7
|
// Proxy threshold for "long enough that the cell will visually truncate" —
|
package/src/filesize/index.tsx
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __, sprintf, _x } from '@wordpress/i18n';
|
|
5
2
|
import type { Field } from '@wordpress/dataviews';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
3
|
import type { MediaItem } from '../types';
|
|
11
4
|
|
|
12
5
|
const KB_IN_BYTES = 1024;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import type { Field } from '@wordpress/dataviews';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
3
|
import type { MediaItem } from '../types';
|
|
11
4
|
import MediaThumbnailView from './view';
|
|
12
5
|
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { useSelect } from '@wordpress/data';
|
|
10
3
|
import { store as coreStore } from '@wordpress/core-data';
|
|
11
4
|
import {
|
|
@@ -17,9 +10,6 @@ import { useState, useRef, useLayoutEffect } from '@wordpress/element';
|
|
|
17
10
|
import type { Attachment } from '@wordpress/core-data';
|
|
18
11
|
import { getFilename } from '@wordpress/url';
|
|
19
12
|
import type { DataViewRenderFieldProps } from '@wordpress/dataviews';
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
13
|
import { getMediaTypeFromMimeType } from '../utils/get-media-type-from-mime-type';
|
|
24
14
|
import type { MediaItem } from '../types';
|
|
25
15
|
|
package/src/mime_type/index.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useState } from '@wordpress/element';
|
|
5
2
|
import type { Field, View, Form } from '@wordpress/dataviews';
|
|
6
3
|
import { DataForm, DataViews } from '@wordpress/dataviews';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
4
|
import {
|
|
12
5
|
altTextField,
|
|
13
6
|
attachedToField,
|
package/src/style.scss
CHANGED
package/src/types.ts
CHANGED