@wordpress/media-fields 0.15.1-next.v.202607070741.0 → 0.16.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/alt_text/index.cjs +18 -0
- package/build/alt_text/index.cjs.map +2 -2
- package/build-module/alt_text/index.mjs +19 -1
- package/build-module/alt_text/index.mjs.map +2 -2
- package/build-style/style-rtl.css +2 -2
- package/build-style/style.css +2 -2
- package/build-types/alt_text/index.d.ts.map +1 -1
- package/build-types/attached_to/edit.d.ts +1 -1
- package/build-types/attached_to/edit.d.ts.map +1 -1
- package/build-types/attached_to/view.d.ts +1 -1
- package/build-types/attached_to/view.d.ts.map +1 -1
- package/build-types/author/view.d.ts +1 -1
- package/build-types/author/view.d.ts.map +1 -1
- package/build-types/filename/view.d.ts +1 -1
- package/build-types/filename/view.d.ts.map +1 -1
- package/build-types/media_thumbnail/view.d.ts +1 -1
- package/build-types/media_thumbnail/view.d.ts.map +1 -1
- package/build-types/stories/index.story.d.ts +4 -3
- package/build-types/stories/index.story.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/alt_text/index.tsx +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.16.0 (2026-07-14)
|
|
6
|
+
|
|
7
|
+
### Enhancements
|
|
8
|
+
|
|
9
|
+
- Widen React peer dependency ranges to `^18 || ^19` to support both React 18 and React 19 environments ([#80024](https://github.com/WordPress/gutenberg/pull/80024)).
|
|
10
|
+
|
|
5
11
|
## 0.15.0 (2026-07-01)
|
|
6
12
|
|
|
7
13
|
## 0.14.0 (2026-06-24)
|
package/build/alt_text/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(alt_text_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(alt_text_exports);
|
|
26
26
|
var import_i18n = require("@wordpress/i18n");
|
|
27
27
|
var import_components = require("@wordpress/components");
|
|
28
|
+
var import_ui = require("@wordpress/ui");
|
|
28
29
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
30
|
var altTextField = {
|
|
30
31
|
id: "alt_text",
|
|
@@ -39,6 +40,23 @@ var altTextField = {
|
|
|
39
40
|
label: field.label,
|
|
40
41
|
value: data.alt_text || "",
|
|
41
42
|
onChange: (value) => onChange({ alt_text: value }),
|
|
43
|
+
help: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
import_ui.Link,
|
|
46
|
+
{
|
|
47
|
+
href: (
|
|
48
|
+
// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.
|
|
49
|
+
(0, import_i18n.__)(
|
|
50
|
+
"https://www.w3.org/WAI/tutorials/images/decision-tree/"
|
|
51
|
+
)
|
|
52
|
+
),
|
|
53
|
+
openInNewTab: true,
|
|
54
|
+
children: (0, import_i18n.__)("Describe the purpose of the image.")
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
|
|
58
|
+
(0, import_i18n.__)("Leave empty if decorative.")
|
|
59
|
+
] }),
|
|
42
60
|
rows: 2
|
|
43
61
|
}
|
|
44
62
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/alt_text/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { TextareaControl } from '@wordpress/components';\nimport type { Field } from '@wordpress/dataviews';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\n\nconst altTextField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'alt_text',\n\ttype: 'text',\n\tlabel: __( 'Alt text' ),\n\tisVisible: ( item ) => item?.media_type === 'image',\n\trender: ( { item } ) => item?.alt_text || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ data.alt_text || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { alt_text: value } ) }\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default altTextField;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,wBAAgC;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { TextareaControl } from '@wordpress/components';\nimport { Link } from '@wordpress/ui';\nimport type { Field } from '@wordpress/dataviews';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\n\nconst altTextField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'alt_text',\n\ttype: 'text',\n\tlabel: __( 'Alt text' ),\n\tisVisible: ( item ) => item?.media_type === 'image',\n\trender: ( { item } ) => item?.alt_text || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ data.alt_text || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { alt_text: value } ) }\n\t\t\t\thelp={\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\topenInNewTab\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Describe the purpose of the image.' ) }\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default altTextField;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,wBAAgC;AAChC,gBAAqB;AAiBhB;AAbL,IAAM,eAA4D;AAAA,EACjE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,UAAW;AAAA,EACtB,WAAW,CAAE,SAAU,MAAM,eAAe;AAAA,EAC5C,QAAQ,CAAE,EAAE,KAAK,MAAO,MAAM,YAAY;AAAA,EAC1C,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,OAAQ,KAAK,YAAY;AAAA,QACzB,UAAW,CAAE,UAAW,SAAU,EAAE,UAAU,MAAM,CAAE;AAAA,QACtD,MACC,4EACC;AAAA;AAAA,YAAC;AAAA;AAAA,cACA;AAAA;AAAA,oBAEC;AAAA,kBACC;AAAA,gBACD;AAAA;AAAA,cAED,cAAY;AAAA,cAEV,8BAAI,oCAAqC;AAAA;AAAA,UAC5C;AAAA,UACA,4CAAC,QAAG;AAAA,cACF,gBAAI,4BAA6B;AAAA,WACpC;AAAA,QAED,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// packages/media-fields/src/alt_text/index.tsx
|
|
2
2
|
import { __ } from "@wordpress/i18n";
|
|
3
3
|
import { TextareaControl } from "@wordpress/components";
|
|
4
|
-
import {
|
|
4
|
+
import { Link } from "@wordpress/ui";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
var altTextField = {
|
|
6
7
|
id: "alt_text",
|
|
7
8
|
type: "text",
|
|
@@ -15,6 +16,23 @@ var altTextField = {
|
|
|
15
16
|
label: field.label,
|
|
16
17
|
value: data.alt_text || "",
|
|
17
18
|
onChange: (value) => onChange({ alt_text: value }),
|
|
19
|
+
help: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
Link,
|
|
22
|
+
{
|
|
23
|
+
href: (
|
|
24
|
+
// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.
|
|
25
|
+
__(
|
|
26
|
+
"https://www.w3.org/WAI/tutorials/images/decision-tree/"
|
|
27
|
+
)
|
|
28
|
+
),
|
|
29
|
+
openInNewTab: true,
|
|
30
|
+
children: __("Describe the purpose of the image.")
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
34
|
+
__("Leave empty if decorative.")
|
|
35
|
+
] }),
|
|
18
36
|
rows: 2
|
|
19
37
|
}
|
|
20
38
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/alt_text/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { TextareaControl } from '@wordpress/components';\nimport type { Field } from '@wordpress/dataviews';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\n\nconst altTextField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'alt_text',\n\ttype: 'text',\n\tlabel: __( 'Alt text' ),\n\tisVisible: ( item ) => item?.media_type === 'image',\n\trender: ( { item } ) => item?.alt_text || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ data.alt_text || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { alt_text: value } ) }\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default altTextField;\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,uBAAuB;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { TextareaControl } from '@wordpress/components';\nimport { Link } from '@wordpress/ui';\nimport type { Field } from '@wordpress/dataviews';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\n\nconst altTextField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'alt_text',\n\ttype: 'text',\n\tlabel: __( 'Alt text' ),\n\tisVisible: ( item ) => item?.media_type === 'image',\n\trender: ( { item } ) => item?.alt_text || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ data.alt_text || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { alt_text: value } ) }\n\t\t\t\thelp={\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\topenInNewTab\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Describe the purpose of the image.' ) }\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default altTextField;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,uBAAuB;AAChC,SAAS,YAAY;AAiBhB,mBACC,KADD;AAbL,IAAM,eAA4D;AAAA,EACjE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO,GAAI,UAAW;AAAA,EACtB,WAAW,CAAE,SAAU,MAAM,eAAe;AAAA,EAC5C,QAAQ,CAAE,EAAE,KAAK,MAAO,MAAM,YAAY;AAAA,EAC1C,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,OAAQ,KAAK,YAAY;AAAA,QACzB,UAAW,CAAE,UAAW,SAAU,EAAE,UAAU,MAAM,CAAE;AAAA,QACtD,MACC,iCACC;AAAA;AAAA,YAAC;AAAA;AAAA,cACA;AAAA;AAAA,gBAEC;AAAA,kBACC;AAAA,gBACD;AAAA;AAAA,cAED,cAAY;AAAA,cAEV,aAAI,oCAAqC;AAAA;AAAA,UAC5C;AAAA,UACA,oBAAC,QAAG;AAAA,UACF,GAAI,4BAA6B;AAAA,WACpC;AAAA,QAED,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -193,8 +193,8 @@
|
|
|
193
193
|
padding: 0 16px;
|
|
194
194
|
width: 100%;
|
|
195
195
|
container-type: inline-size;
|
|
196
|
-
font-family: -apple-system,
|
|
197
|
-
font-weight: 400;
|
|
196
|
+
font-family: -apple-system, system-ui, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
197
|
+
font-weight: var(--wpds-typography-font-weight-default, 400);
|
|
198
198
|
font-size: 12px;
|
|
199
199
|
line-height: 16px;
|
|
200
200
|
}
|
package/build-style/style.css
CHANGED
|
@@ -193,8 +193,8 @@
|
|
|
193
193
|
padding: 0 16px;
|
|
194
194
|
width: 100%;
|
|
195
195
|
container-type: inline-size;
|
|
196
|
-
font-family: -apple-system,
|
|
197
|
-
font-weight: 400;
|
|
196
|
+
font-family: -apple-system, system-ui, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
197
|
+
font-weight: var(--wpds-typography-font-weight-default, 400);
|
|
198
198
|
font-size: 12px;
|
|
199
199
|
line-height: 16px;
|
|
200
200
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/alt_text/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/alt_text/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAElE,QAAA,MAAM,YAAY,EAAE,OAAO,CAAE,KAAK,CAAE,SAAS,CAAE,UAAU,CAAE,CAAE,CAmC5D,CAAC;eAEa,YAAY"}
|
|
@@ -25,5 +25,5 @@ export type SearchResult = {
|
|
|
25
25
|
*/
|
|
26
26
|
kind?: string;
|
|
27
27
|
};
|
|
28
|
-
export default function MediaAttachedToEdit({ data, onChange }: DataFormControlProps<MediaItem>): import("react").JSX.Element;
|
|
28
|
+
export default function MediaAttachedToEdit({ data, onChange, }: DataFormControlProps<MediaItem>): import("react").JSX.Element;
|
|
29
29
|
//# sourceMappingURL=edit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/attached_to/edit.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,MAAM,YAAY,GAAG;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAE,EAC5C,IAAI,EACJ,QAAQ,
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/attached_to/edit.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,MAAM,YAAY,GAAG;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAE,EAC5C,IAAI,EACJ,QAAQ,GACR,EAAE,oBAAoB,CAAE,SAAS,CAAE,+BA4InC"}
|
|
@@ -3,5 +3,5 @@ import type { DataViewRenderFieldProps } from '@wordpress/dataviews';
|
|
|
3
3
|
* Internal dependencies
|
|
4
4
|
*/
|
|
5
5
|
import type { MediaItem } from '../types';
|
|
6
|
-
export default function MediaAttachedToView({ item }: DataViewRenderFieldProps<MediaItem>): import("react").JSX.Element;
|
|
6
|
+
export default function MediaAttachedToView({ item, }: DataViewRenderFieldProps<MediaItem>): import("react").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/attached_to/view.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAE,EAC5C,IAAI,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/attached_to/view.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAE,EAC5C,IAAI,GACJ,EAAE,wBAAwB,CAAE,SAAS,CAAE,+BA0BvC"}
|
|
@@ -3,5 +3,5 @@ import type { DataViewRenderFieldProps } from '@wordpress/dataviews';
|
|
|
3
3
|
* Internal dependencies
|
|
4
4
|
*/
|
|
5
5
|
import type { MediaItem } from '../types';
|
|
6
|
-
export default function AuthorView({ item }: DataViewRenderFieldProps<MediaItem>): import("react").JSX.Element;
|
|
6
|
+
export default function AuthorView({ item, }: DataViewRenderFieldProps<MediaItem>): import("react").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/author/view.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAE,EACnC,IAAI,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/author/view.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAE,EACnC,IAAI,GACJ,EAAE,wBAAwB,CAAE,SAAS,CAAE,+BAsDvC"}
|
|
@@ -3,5 +3,5 @@ import type { DataViewRenderFieldProps } from '@wordpress/dataviews';
|
|
|
3
3
|
* Internal dependencies
|
|
4
4
|
*/
|
|
5
5
|
import type { MediaItem } from '../types';
|
|
6
|
-
export default function FileNameView({ item }: DataViewRenderFieldProps<MediaItem>): "" | import("react").JSX.Element;
|
|
6
|
+
export default function FileNameView({ item, }: DataViewRenderFieldProps<MediaItem>): "" | import("react").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/filename/view.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAO1C,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,EACrC,IAAI,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/filename/view.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAO1C,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,EACrC,IAAI,GACJ,EAAE,wBAAwB,CAAE,SAAS,CAAE,oCAkCvC"}
|
|
@@ -10,5 +10,5 @@ import type { MediaItem } from '../types';
|
|
|
10
10
|
* @param configSizes The target display size string (e.g. '900px').
|
|
11
11
|
*/
|
|
12
12
|
export declare function getBestImageUrl(featuredMedia: Attachment | MediaItem, configSizes?: string): string;
|
|
13
|
-
export default function MediaThumbnailView({ item, config }: DataViewRenderFieldProps<MediaItem>): import("react").JSX.Element | null;
|
|
13
|
+
export default function MediaThumbnailView({ item, config, }: DataViewRenderFieldProps<MediaItem>): import("react").JSX.Element | null;
|
|
14
14
|
//# sourceMappingURL=view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/media_thumbnail/view.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAKrE,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,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/media_thumbnail/view.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAKrE,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"}
|
|
@@ -4,10 +4,11 @@ declare const _default: {
|
|
|
4
4
|
component: typeof DataForm;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
|
+
declare const DataFormsComponent: ({ type }: {
|
|
8
|
+
type: 'regular' | 'panel';
|
|
9
|
+
}) => import("react").JSX.Element;
|
|
7
10
|
export declare const DataFormsPreview: {
|
|
8
|
-
render:
|
|
9
|
-
type: 'regular' | 'panel';
|
|
10
|
-
}) => import("react").JSX.Element;
|
|
11
|
+
render: typeof DataFormsComponent;
|
|
11
12
|
argTypes: {
|
|
12
13
|
type: {
|
|
13
14
|
control: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../src/stories/index.story.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAa,MAAM,sBAAsB,CAAC;;IAsB1D,KAAK;IACL,SAAS;;;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../src/stories/index.story.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAa,MAAM,sBAAsB,CAAC;;IAsB1D,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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/media-fields",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.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,19 +48,19 @@
|
|
|
48
48
|
"src/**/*.scss"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@wordpress/base-styles": "^
|
|
52
|
-
"@wordpress/components": "^37.0.
|
|
53
|
-
"@wordpress/compose": "^8.
|
|
54
|
-
"@wordpress/core-data": "^7.
|
|
55
|
-
"@wordpress/data": "^10.
|
|
56
|
-
"@wordpress/dataviews": "^17.
|
|
57
|
-
"@wordpress/date": "^5.
|
|
58
|
-
"@wordpress/element": "^8.
|
|
59
|
-
"@wordpress/i18n": "^6.
|
|
60
|
-
"@wordpress/icons": "^15.
|
|
61
|
-
"@wordpress/primitives": "^4.
|
|
62
|
-
"@wordpress/ui": "^0.18.
|
|
63
|
-
"@wordpress/url": "^4.
|
|
51
|
+
"@wordpress/base-styles": "^11.0.0",
|
|
52
|
+
"@wordpress/components": "^37.0.0",
|
|
53
|
+
"@wordpress/compose": "^8.4.0",
|
|
54
|
+
"@wordpress/core-data": "^7.51.0",
|
|
55
|
+
"@wordpress/data": "^10.51.0",
|
|
56
|
+
"@wordpress/dataviews": "^17.2.0",
|
|
57
|
+
"@wordpress/date": "^5.51.0",
|
|
58
|
+
"@wordpress/element": "^8.3.0",
|
|
59
|
+
"@wordpress/i18n": "^6.24.0",
|
|
60
|
+
"@wordpress/icons": "^15.2.0",
|
|
61
|
+
"@wordpress/primitives": "^4.51.0",
|
|
62
|
+
"@wordpress/ui": "^0.18.0",
|
|
63
|
+
"@wordpress/url": "^4.51.0",
|
|
64
64
|
"clsx": "^2.1.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"@types/jest": "^29.5.14"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@types/react": "^18
|
|
74
|
-
"react": "^18
|
|
73
|
+
"@types/react": "^18 || ^19",
|
|
74
|
+
"react": "^18 || ^19"
|
|
75
75
|
},
|
|
76
76
|
"peerDependenciesMeta": {
|
|
77
77
|
"@types/react": {
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "e9a74f9c14095a34398ecd4d1f7a908e55051205"
|
|
85
85
|
}
|
package/src/alt_text/index.tsx
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { TextareaControl } from '@wordpress/components';
|
|
6
|
+
import { Link } from '@wordpress/ui';
|
|
6
7
|
import type { Field } from '@wordpress/dataviews';
|
|
7
8
|
import type { Attachment, Updatable } from '@wordpress/core-data';
|
|
8
9
|
|
|
@@ -18,6 +19,23 @@ const altTextField: Partial< Field< Updatable< Attachment > > > = {
|
|
|
18
19
|
label={ field.label }
|
|
19
20
|
value={ data.alt_text || '' }
|
|
20
21
|
onChange={ ( value ) => onChange( { alt_text: value } ) }
|
|
22
|
+
help={
|
|
23
|
+
<>
|
|
24
|
+
<Link
|
|
25
|
+
href={
|
|
26
|
+
// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.
|
|
27
|
+
__(
|
|
28
|
+
'https://www.w3.org/WAI/tutorials/images/decision-tree/'
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
openInNewTab
|
|
32
|
+
>
|
|
33
|
+
{ __( 'Describe the purpose of the image.' ) }
|
|
34
|
+
</Link>
|
|
35
|
+
<br />
|
|
36
|
+
{ __( 'Leave empty if decorative.' ) }
|
|
37
|
+
</>
|
|
38
|
+
}
|
|
21
39
|
rows={ 2 }
|
|
22
40
|
/>
|
|
23
41
|
);
|