@strapi/upload 5.0.0-beta.6 → 5.0.0-beta.7
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/dist/_chunks/{index-BI7qD8h6.mjs → index-2C3ZYD4e.mjs} +18 -27
- package/dist/_chunks/index-2C3ZYD4e.mjs.map +1 -0
- package/dist/_chunks/{index-ZXpABToX.mjs → index-ASLx4V_D.mjs} +176 -162
- package/dist/_chunks/index-ASLx4V_D.mjs.map +1 -0
- package/dist/_chunks/{index-BNV9vUuq.js → index-BbFs7_Gx.js} +19 -29
- package/dist/_chunks/index-BbFs7_Gx.js.map +1 -0
- package/dist/_chunks/{index-DU4hcIHO.js → index-BxUjcUMp.js} +89 -68
- package/dist/_chunks/index-BxUjcUMp.js.map +1 -0
- package/dist/_chunks/index-CRhNpXFr.js.map +1 -1
- package/dist/_chunks/{index-jJSqYu6S.js → index-DJC1L27M.js} +59 -34
- package/dist/_chunks/index-DJC1L27M.js.map +1 -0
- package/dist/_chunks/{index-CtyJq8P-.js → index-PKgX3DYk.js} +222 -210
- package/dist/_chunks/index-PKgX3DYk.js.map +1 -0
- package/dist/_chunks/index-VKvfSVC7.mjs.map +1 -1
- package/dist/_chunks/{index-BL34bU2o.mjs → index-fmt8afwE.mjs} +91 -70
- package/dist/_chunks/index-fmt8afwE.mjs.map +1 -0
- package/dist/_chunks/{index-CWDl5PEs.mjs → index-q-dRjRbA.mjs} +61 -36
- package/dist/_chunks/index-q-dRjRbA.mjs.map +1 -0
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +2 -1
- package/dist/admin/index.mjs.map +1 -1
- package/dist/server/src/services/extensions/content-manager/entity-manager.d.ts.map +1 -1
- package/dist/server/src/services/extensions/utils.d.ts.map +1 -1
- package/package.json +10 -11
- package/dist/_chunks/index-BI7qD8h6.mjs.map +0 -1
- package/dist/_chunks/index-BL34bU2o.mjs.map +0 -1
- package/dist/_chunks/index-BNV9vUuq.js.map +0 -1
- package/dist/_chunks/index-CWDl5PEs.mjs.map +0 -1
- package/dist/_chunks/index-CtyJq8P-.js.map +0 -1
- package/dist/_chunks/index-DU4hcIHO.js.map +0 -1
- package/dist/_chunks/index-ZXpABToX.mjs.map +0 -1
- package/dist/_chunks/index-jJSqYu6S.js.map +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { ChevronUp, ChevronDown, Cross, CaretDown, Link, FilePdf, File as File$1, Check, Trash, Download, Crop, Pencil, Folder, Eye, CaretUp, Plus, Filter, ChevronLeft, ChevronRight, Search, List, GridFour, PlusCircle, Images } from "@strapi/icons";
|
|
1
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
3
|
import * as React from "react";
|
|
3
|
-
import { useEffect, useState,
|
|
4
|
+
import { useEffect, useState, useMemo, useRef, useCallback, forwardRef, createElement, createContext, useContext, useLayoutEffect } from "react";
|
|
4
5
|
import PropTypes from "prop-types";
|
|
5
|
-
import { useNotification, useFetchClient, useRBAC, useTracking, ConfirmDialog, useQueryParams, Page, translatedErrors, useField } from "@strapi/admin/strapi-admin";
|
|
6
|
-
import { useNotifyAT, Box, Grid, GridItem, Flex, Typography, ModalHeader, IconButton, ProgressBar, Badge, Menu, FocusTrap, VisuallyHidden, Button, ModalLayout, Loader, ModalFooter, ModalBody,
|
|
6
|
+
import { useNotification, useFetchClient, useRBAC, useTracking, ConfirmDialog, useQueryParams, Layouts, Page, translatedErrors, useField } from "@strapi/admin/strapi-admin";
|
|
7
|
+
import { useNotifyAT, Box, Grid, GridItem, Flex, Typography, ModalHeader, IconButton, ProgressBar, Badge, Menu, FocusTrap, VisuallyHidden, Button, ModalLayout, Loader, ModalFooter, ModalBody, Field, TextInput, CardAction, Card as Card$1, CardHeader, CardCheckbox, CardBody, CardContent, CardTitle, CardSubtitle, CardBadge, CardAsset as CardAsset$2, CardTimer, KeyboardNavigable, CrumbSimpleMenu, MenuItem, Breadcrumbs as Breadcrumbs$1, CrumbLink, Crumb, SingleSelect, SingleSelectOption, Initials, Avatar, Tbody, Tr, Td, BaseCheckbox, Table, Thead, Th, Tooltip, Tag, DateTimePicker, Popover, SearchForm, Searchbar, Divider, TabGroup, Tabs, Tab, TabPanels, TabPanel, Textarea, CarouselActions, CarouselInput, CarouselSlide } from "@strapi/design-system";
|
|
7
8
|
import { useIntl } from "react-intl";
|
|
8
|
-
import styled,
|
|
9
|
+
import { styled, useTheme } from "styled-components";
|
|
9
10
|
import byteSize from "byte-size";
|
|
10
11
|
import { intervalToDuration } from "date-fns";
|
|
11
12
|
import { stringify } from "qs";
|
|
@@ -13,8 +14,6 @@ import { useQuery, useMutation, useQueryClient } from "react-query";
|
|
|
13
14
|
import { Formik, Form } from "formik";
|
|
14
15
|
import isEqual from "lodash/isEqual";
|
|
15
16
|
import * as yup from "yup";
|
|
16
|
-
import axios from "axios";
|
|
17
|
-
import { ChevronUp, ChevronDown, Cross, CaretDown, Link, FilePdf, File as File$1, Check, Trash, Download, Crop, Pencil, Folder, Eye, CaretUp, Plus, Filter, ChevronLeft, ChevronRight, Search, List, GridFour, PlusCircle, Images } from "@strapi/icons";
|
|
18
17
|
import ReactSelect, { components } from "react-select";
|
|
19
18
|
import Cropper from "cropperjs";
|
|
20
19
|
import "cropperjs/dist/cropper.css";
|
|
@@ -33,7 +32,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
|
33
32
|
});
|
|
34
33
|
};
|
|
35
34
|
const name$1 = "@strapi/upload";
|
|
36
|
-
const version = "5.0.0-beta.
|
|
35
|
+
const version = "5.0.0-beta.6";
|
|
37
36
|
const description = "Makes it easy to upload images and files to your Strapi Application.";
|
|
38
37
|
const license = "SEE LICENSE IN LICENSE";
|
|
39
38
|
const author = {
|
|
@@ -81,11 +80,10 @@ const scripts = {
|
|
|
81
80
|
watch: "pack-up watch"
|
|
82
81
|
};
|
|
83
82
|
const dependencies = {
|
|
84
|
-
"@strapi/design-system": "2.0.0-beta.
|
|
85
|
-
"@strapi/icons": "2.0.0-beta.
|
|
86
|
-
"@strapi/provider-upload-local": "5.0.0-beta.
|
|
87
|
-
"@strapi/utils": "5.0.0-beta.
|
|
88
|
-
axios: "1.6.8",
|
|
83
|
+
"@strapi/design-system": "2.0.0-beta.3",
|
|
84
|
+
"@strapi/icons": "2.0.0-beta.3",
|
|
85
|
+
"@strapi/provider-upload-local": "5.0.0-beta.6",
|
|
86
|
+
"@strapi/utils": "5.0.0-beta.6",
|
|
89
87
|
"byte-size": "8.1.1",
|
|
90
88
|
cropperjs: "1.6.1",
|
|
91
89
|
"date-fns": "2.30.0",
|
|
@@ -107,9 +105,9 @@ const dependencies = {
|
|
|
107
105
|
yup: "0.32.9"
|
|
108
106
|
};
|
|
109
107
|
const devDependencies = {
|
|
110
|
-
"@strapi/admin": "5.0.0-beta.
|
|
108
|
+
"@strapi/admin": "5.0.0-beta.6",
|
|
111
109
|
"@strapi/pack-up": "5.0.0",
|
|
112
|
-
"@strapi/types": "5.0.0-beta.
|
|
110
|
+
"@strapi/types": "5.0.0-beta.6",
|
|
113
111
|
"@testing-library/dom": "9.2.0",
|
|
114
112
|
"@testing-library/react": "14.0.0",
|
|
115
113
|
"@testing-library/user-event": "14.4.3",
|
|
@@ -124,14 +122,14 @@ const devDependencies = {
|
|
|
124
122
|
react: "^18.2.0",
|
|
125
123
|
"react-dom": "^18.2.0",
|
|
126
124
|
"react-router-dom": "6.22.3",
|
|
127
|
-
"styled-components": "
|
|
125
|
+
"styled-components": "6.1.8"
|
|
128
126
|
};
|
|
129
127
|
const peerDependencies = {
|
|
130
128
|
"@strapi/admin": "^5.0.0 || ^5.0.0-beta || ^5.0.0-alpha || ^5.0.0-rc",
|
|
131
129
|
react: "^17.0.0 || ^18.0.0",
|
|
132
130
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
133
131
|
"react-router-dom": "^6.0.0",
|
|
134
|
-
"styled-components": "^
|
|
132
|
+
"styled-components": "^6.0.0"
|
|
135
133
|
};
|
|
136
134
|
const engines = {
|
|
137
135
|
node: ">=18.0.0 <=20.x.x",
|
|
@@ -875,7 +873,7 @@ const moveElement = (array, index2, offset) => {
|
|
|
875
873
|
const newIndex = index2 + offset;
|
|
876
874
|
return move(array, index2, newIndex);
|
|
877
875
|
};
|
|
878
|
-
const editAssetRequest = (asset, file,
|
|
876
|
+
const editAssetRequest = (asset, file, signal, onProgress, post) => {
|
|
879
877
|
const endpoint2 = `/${pluginId}?id=${asset.id}`;
|
|
880
878
|
const formData = new FormData();
|
|
881
879
|
if (file) {
|
|
@@ -891,13 +889,7 @@ const editAssetRequest = (asset, file, cancelToken, onProgress, post) => {
|
|
|
891
889
|
})
|
|
892
890
|
);
|
|
893
891
|
return post(endpoint2, formData, {
|
|
894
|
-
|
|
895
|
-
onUploadProgress({ total, loaded }) {
|
|
896
|
-
onProgress(loaded / total * 100);
|
|
897
|
-
},
|
|
898
|
-
headers: {
|
|
899
|
-
"Content-Type": "multipart/form-data"
|
|
900
|
-
}
|
|
892
|
+
signal
|
|
901
893
|
}).then((res) => res.data);
|
|
902
894
|
};
|
|
903
895
|
const useEditAsset = () => {
|
|
@@ -905,10 +897,11 @@ const useEditAsset = () => {
|
|
|
905
897
|
const { formatMessage } = useIntl();
|
|
906
898
|
const { toggleNotification } = useNotification();
|
|
907
899
|
const queryClient = useQueryClient();
|
|
908
|
-
const
|
|
900
|
+
const abortController = new AbortController();
|
|
901
|
+
const signal = abortController.signal;
|
|
909
902
|
const { post } = useFetchClient();
|
|
910
903
|
const mutation = useMutation(
|
|
911
|
-
({ asset, file }) => editAssetRequest(asset, file,
|
|
904
|
+
({ asset, file }) => editAssetRequest(asset, file, signal, setProgress, post),
|
|
912
905
|
{
|
|
913
906
|
onSuccess() {
|
|
914
907
|
queryClient.refetchQueries([pluginId, "assets"], { active: true });
|
|
@@ -928,9 +921,7 @@ const useEditAsset = () => {
|
|
|
928
921
|
}
|
|
929
922
|
);
|
|
930
923
|
const editAsset = (asset, file) => mutation.mutateAsync({ asset, file });
|
|
931
|
-
const cancel = () =>
|
|
932
|
-
formatMessage({ id: getTrad("modal.upload.cancelled"), defaultMessage: "" })
|
|
933
|
-
);
|
|
924
|
+
const cancel = () => abortController.abort();
|
|
934
925
|
return { ...mutation, cancel, editAsset, progress, status: mutation.status };
|
|
935
926
|
};
|
|
936
927
|
const recursiveRenameKeys = (obj, fn) => Object.fromEntries(
|
|
@@ -1023,7 +1014,7 @@ const Option = ({ children, data, selectProps, ...props }) => {
|
|
|
1023
1014
|
id: "app.utils.toggle",
|
|
1024
1015
|
defaultMessage: "Toggle"
|
|
1025
1016
|
}),
|
|
1026
|
-
|
|
1017
|
+
tag: "button",
|
|
1027
1018
|
alignItems: "center",
|
|
1028
1019
|
hasRadius: true,
|
|
1029
1020
|
justifyContent: "center",
|
|
@@ -1166,7 +1157,7 @@ const IconBox = styled(Box)`
|
|
|
1166
1157
|
`;
|
|
1167
1158
|
const ClearIndicator = (props) => {
|
|
1168
1159
|
const Component = components.ClearIndicator;
|
|
1169
|
-
return /* @__PURE__ */ jsx(Component, { ...props, children: /* @__PURE__ */ jsx(IconBox, {
|
|
1160
|
+
return /* @__PURE__ */ jsx(Component, { ...props, children: /* @__PURE__ */ jsx(IconBox, { tag: "button", type: "button", children: /* @__PURE__ */ jsx(Cross, {}) }) });
|
|
1170
1161
|
};
|
|
1171
1162
|
const CarretBox = styled(IconBox)`
|
|
1172
1163
|
display: flex;
|
|
@@ -1315,7 +1306,7 @@ SelectTree.propTypes = {
|
|
|
1315
1306
|
};
|
|
1316
1307
|
const DialogHeader = () => {
|
|
1317
1308
|
const { formatMessage } = useIntl();
|
|
1318
|
-
return /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800",
|
|
1309
|
+
return /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800", tag: "h2", id: "title", children: formatMessage({ id: "global.details", defaultMessage: "Details" }) }) });
|
|
1319
1310
|
};
|
|
1320
1311
|
const QUALITY = 1;
|
|
1321
1312
|
const useCropImg = () => {
|
|
@@ -1388,7 +1379,7 @@ const useCropImg = () => {
|
|
|
1388
1379
|
};
|
|
1389
1380
|
};
|
|
1390
1381
|
const endpoint = `/${pluginId}`;
|
|
1391
|
-
const uploadAsset = (asset, folderId,
|
|
1382
|
+
const uploadAsset = (asset, folderId, signal, onProgress, post) => {
|
|
1392
1383
|
const { rawFile, caption, name: name2, alternativeText } = asset;
|
|
1393
1384
|
const formData = new FormData();
|
|
1394
1385
|
formData.append("files", rawFile);
|
|
@@ -1402,24 +1393,18 @@ const uploadAsset = (asset, folderId, cancelToken, onProgress, post) => {
|
|
|
1402
1393
|
})
|
|
1403
1394
|
);
|
|
1404
1395
|
return post(endpoint, formData, {
|
|
1405
|
-
|
|
1406
|
-
"Content-Type": "multipart/form-data"
|
|
1407
|
-
},
|
|
1408
|
-
cancelToken: cancelToken.token,
|
|
1409
|
-
onUploadProgress({ total, loaded }) {
|
|
1410
|
-
onProgress(loaded / total * 100);
|
|
1411
|
-
}
|
|
1396
|
+
signal
|
|
1412
1397
|
}).then((res) => res.data);
|
|
1413
1398
|
};
|
|
1414
1399
|
const useUpload = () => {
|
|
1415
1400
|
const [progress, setProgress] = useState(0);
|
|
1416
|
-
const { formatMessage } = useIntl();
|
|
1417
1401
|
const queryClient = useQueryClient();
|
|
1418
|
-
const
|
|
1402
|
+
const abortController = new AbortController();
|
|
1403
|
+
const signal = abortController.signal;
|
|
1419
1404
|
const { post } = useFetchClient();
|
|
1420
1405
|
const mutation = useMutation(
|
|
1421
1406
|
({ asset, folderId }) => {
|
|
1422
|
-
return uploadAsset(asset, folderId,
|
|
1407
|
+
return uploadAsset(asset, folderId, signal, setProgress, post);
|
|
1423
1408
|
},
|
|
1424
1409
|
{
|
|
1425
1410
|
onSuccess() {
|
|
@@ -1429,9 +1414,7 @@ const useUpload = () => {
|
|
|
1429
1414
|
}
|
|
1430
1415
|
);
|
|
1431
1416
|
const upload = (asset, folderId) => mutation.mutateAsync({ asset, folderId });
|
|
1432
|
-
const cancel = () =>
|
|
1433
|
-
formatMessage({ id: getTrad("modal.upload.cancelled"), defaultMessage: "" })
|
|
1434
|
-
);
|
|
1417
|
+
const cancel = () => abortController.abort();
|
|
1435
1418
|
return {
|
|
1436
1419
|
upload,
|
|
1437
1420
|
cancel,
|
|
@@ -1537,7 +1520,7 @@ const UploadProgress = ({ onCancel, progress, error }) => {
|
|
|
1537
1520
|
return /* @__PURE__ */ jsx(BoxWrapper, { alignItems: "center", background: error ? "danger100" : "neutral150", error, children: error ? /* @__PURE__ */ jsx(Cross, { "aria-label": error?.message }) : /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 2, width: "100%", children: [
|
|
1538
1521
|
/* @__PURE__ */ jsx(ProgressBar, { value: progress, children: `${progress}/100%` }),
|
|
1539
1522
|
/* @__PURE__ */ jsx(CancelButton, { type: "button", onClick: onCancel, children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
1540
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi",
|
|
1523
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", tag: "span", textColor: "inherit", children: formatMessage({
|
|
1541
1524
|
id: "app.components.Button.cancel",
|
|
1542
1525
|
defaultMessage: "Cancel"
|
|
1543
1526
|
}) }),
|
|
@@ -1671,7 +1654,7 @@ const Wrapper$1 = styled.div`
|
|
|
1671
1654
|
`;
|
|
1672
1655
|
const ActionRow = styled(Flex)`
|
|
1673
1656
|
height: 5.2rem;
|
|
1674
|
-
background-color: ${({ blurry }) => blurry ? `rgba(33, 33, 52, 0.4)` : void 0};
|
|
1657
|
+
background-color: ${({ $blurry }) => $blurry ? `rgba(33, 33, 52, 0.4)` : void 0};
|
|
1675
1658
|
`;
|
|
1676
1659
|
const CroppingActionRow = styled(Flex)`
|
|
1677
1660
|
z-index: 1;
|
|
@@ -1708,7 +1691,7 @@ const CroppingActions = ({ onCancel, onValidate, onDuplicate }) => {
|
|
|
1708
1691
|
),
|
|
1709
1692
|
/* @__PURE__ */ jsxs(Menu.Root, { children: [
|
|
1710
1693
|
/* @__PURE__ */ jsxs(Trigger, { variant: "tertiary", paddingLeft: 2, paddingRight: 2, endIcon: null, children: [
|
|
1711
|
-
/* @__PURE__ */ jsx(VisuallyHidden, {
|
|
1694
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { tag: "span", children: formatMessage({
|
|
1712
1695
|
id: getTrad("control-card.crop"),
|
|
1713
1696
|
defaultMessage: "Crop"
|
|
1714
1697
|
}) }),
|
|
@@ -1930,7 +1913,7 @@ const PreviewBox = ({
|
|
|
1930
1913
|
paddingLeft: 2,
|
|
1931
1914
|
paddingRight: 2,
|
|
1932
1915
|
justifyContent: "flex-end",
|
|
1933
|
-
blurry: isInCroppingMode,
|
|
1916
|
+
$blurry: isInCroppingMode,
|
|
1934
1917
|
children: isInCroppingMode && width && height && /* @__PURE__ */ jsx(BadgeOverride, { background: "neutral900", color: "neutral0", children: width && height ? `${height}✕${width}` : "N/A" })
|
|
1935
1918
|
}
|
|
1936
1919
|
)
|
|
@@ -2171,54 +2154,64 @@ const EditAssetDialog = ({
|
|
|
2171
2154
|
]
|
|
2172
2155
|
}
|
|
2173
2156
|
),
|
|
2174
|
-
/* @__PURE__ */
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2157
|
+
/* @__PURE__ */ jsxs(Field.Root, { name: "name", error: errors.name, children: [
|
|
2158
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
2159
|
+
id: getTrad("form.input.label.file-name"),
|
|
2160
|
+
defaultMessage: "File name"
|
|
2161
|
+
}) }),
|
|
2162
|
+
/* @__PURE__ */ jsx(
|
|
2163
|
+
TextInput,
|
|
2164
|
+
{
|
|
2165
|
+
value: values.name,
|
|
2166
|
+
onChange: handleChange,
|
|
2167
|
+
disabled: formDisabled
|
|
2168
|
+
}
|
|
2169
|
+
),
|
|
2170
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
2171
|
+
] }),
|
|
2172
|
+
/* @__PURE__ */ jsxs(
|
|
2173
|
+
Field.Root,
|
|
2190
2174
|
{
|
|
2191
|
-
label: formatMessage({
|
|
2192
|
-
id: getTrad("form.input.label.file-alt"),
|
|
2193
|
-
defaultMessage: "Alternative text"
|
|
2194
|
-
}),
|
|
2195
2175
|
name: "alternativeText",
|
|
2196
2176
|
hint: formatMessage({
|
|
2197
2177
|
id: getTrad("form.input.decription.file-alt"),
|
|
2198
2178
|
defaultMessage: "This text will be displayed if the asset can’t be shown."
|
|
2199
2179
|
}),
|
|
2200
|
-
value: values.alternativeText,
|
|
2201
2180
|
error: errors.alternativeText,
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2181
|
+
children: [
|
|
2182
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
2183
|
+
id: getTrad("form.input.label.file-alt"),
|
|
2184
|
+
defaultMessage: "Alternative text"
|
|
2185
|
+
}) }),
|
|
2186
|
+
/* @__PURE__ */ jsx(
|
|
2187
|
+
TextInput,
|
|
2188
|
+
{
|
|
2189
|
+
value: values.alternativeText,
|
|
2190
|
+
onChange: handleChange,
|
|
2191
|
+
disabled: formDisabled
|
|
2192
|
+
}
|
|
2193
|
+
),
|
|
2194
|
+
/* @__PURE__ */ jsx(Field.Hint, {}),
|
|
2195
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
2196
|
+
]
|
|
2218
2197
|
}
|
|
2219
2198
|
),
|
|
2220
|
-
/* @__PURE__ */ jsxs(
|
|
2221
|
-
/* @__PURE__ */ jsx(
|
|
2199
|
+
/* @__PURE__ */ jsxs(Field.Root, { name: "caption", error: errors.caption, children: [
|
|
2200
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
2201
|
+
id: getTrad("form.input.label.file-caption"),
|
|
2202
|
+
defaultMessage: "Caption"
|
|
2203
|
+
}) }),
|
|
2204
|
+
/* @__PURE__ */ jsx(
|
|
2205
|
+
TextInput,
|
|
2206
|
+
{
|
|
2207
|
+
value: values.caption,
|
|
2208
|
+
onChange: handleChange,
|
|
2209
|
+
disabled: formDisabled
|
|
2210
|
+
}
|
|
2211
|
+
)
|
|
2212
|
+
] }),
|
|
2213
|
+
/* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 1, children: /* @__PURE__ */ jsxs(Field.Root, { name: "parent", id: "asset-folder", children: [
|
|
2214
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
2222
2215
|
id: getTrad("form.input.label.file-location"),
|
|
2223
2216
|
defaultMessage: "Location"
|
|
2224
2217
|
}) }),
|
|
@@ -2238,7 +2231,7 @@ const EditAssetDialog = ({
|
|
|
2238
2231
|
ariaErrorMessage: "folder-parent-error"
|
|
2239
2232
|
}
|
|
2240
2233
|
)
|
|
2241
|
-
] })
|
|
2234
|
+
] }) })
|
|
2242
2235
|
] }),
|
|
2243
2236
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(
|
|
2244
2237
|
"button",
|
|
@@ -2356,7 +2349,7 @@ const useEditFolder = () => {
|
|
|
2356
2349
|
};
|
|
2357
2350
|
const EditFolderModalHeader = ({ isEditing }) => {
|
|
2358
2351
|
const { formatMessage } = useIntl();
|
|
2359
|
-
return /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800",
|
|
2352
|
+
return /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800", tag: "h2", id: "title", children: formatMessage(
|
|
2360
2353
|
isEditing ? {
|
|
2361
2354
|
id: getTrad("modal.folder.edit.title"),
|
|
2362
2355
|
defaultMessage: "Edit folder"
|
|
@@ -2505,22 +2498,23 @@ const EditFolderDialog = ({ onClose, folder, location, parentFolderId }) => {
|
|
|
2505
2498
|
]
|
|
2506
2499
|
}
|
|
2507
2500
|
) }),
|
|
2508
|
-
/* @__PURE__ */ jsx(GridItem, { xs: 12, col: 6, children: /* @__PURE__ */
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2501
|
+
/* @__PURE__ */ jsx(GridItem, { xs: 12, col: 6, children: /* @__PURE__ */ jsxs(Field.Root, { name: "name", error: errors.name, children: [
|
|
2502
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
2503
|
+
id: getTrad("form.input.label.folder-name"),
|
|
2504
|
+
defaultMessage: "Name"
|
|
2505
|
+
}) }),
|
|
2506
|
+
/* @__PURE__ */ jsx(
|
|
2507
|
+
TextInput,
|
|
2508
|
+
{
|
|
2509
|
+
value: values.name,
|
|
2510
|
+
onChange: handleChange,
|
|
2511
|
+
disabled: formDisabled
|
|
2512
|
+
}
|
|
2513
|
+
),
|
|
2514
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
2515
|
+
] }) }),
|
|
2516
|
+
/* @__PURE__ */ jsx(GridItem, { xs: 12, col: 6, children: /* @__PURE__ */ jsxs(Field.Root, { id: "folder-parent", children: [
|
|
2517
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
2524
2518
|
id: getTrad("form.input.label.folder-location"),
|
|
2525
2519
|
defaultMessage: "Location"
|
|
2526
2520
|
}) }),
|
|
@@ -2545,7 +2539,7 @@ const EditFolderDialog = ({ onClose, folder, location, parentFolderId }) => {
|
|
|
2545
2539
|
Typography,
|
|
2546
2540
|
{
|
|
2547
2541
|
variant: "pi",
|
|
2548
|
-
|
|
2542
|
+
tag: "p",
|
|
2549
2543
|
id: "folder-parent-error",
|
|
2550
2544
|
textColor: "danger600",
|
|
2551
2545
|
children: errors.parent
|
|
@@ -2713,7 +2707,7 @@ const AssetCardBase = ({
|
|
|
2713
2707
|
] }),
|
|
2714
2708
|
/* @__PURE__ */ jsxs(CardBody, { children: [
|
|
2715
2709
|
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
2716
|
-
/* @__PURE__ */ jsx(Box, { paddingTop: 1, children: /* @__PURE__ */ jsx(CardTitle, {
|
|
2710
|
+
/* @__PURE__ */ jsx(Box, { paddingTop: 1, children: /* @__PURE__ */ jsx(CardTitle, { tag: "h2", children: name2 }) }),
|
|
2717
2711
|
/* @__PURE__ */ jsxs(CardSubtitle, { children: [
|
|
2718
2712
|
/* @__PURE__ */ jsx(Extension$1, { children: extension }),
|
|
2719
2713
|
subtitle
|
|
@@ -2863,7 +2857,7 @@ const VideoPreview = ({ url, mime, onLoadDuration, alt, ...props }) => {
|
|
|
2863
2857
|
return;
|
|
2864
2858
|
video.play();
|
|
2865
2859
|
};
|
|
2866
|
-
return /* @__PURE__ */ createElement(Box, {
|
|
2860
|
+
return /* @__PURE__ */ createElement(Box, { tag: "figure", ...props, key: url }, /* @__PURE__ */ jsx(
|
|
2867
2861
|
"video",
|
|
2868
2862
|
{
|
|
2869
2863
|
muted: true,
|
|
@@ -2873,7 +2867,7 @@ const VideoPreview = ({ url, mime, onLoadDuration, alt, ...props }) => {
|
|
|
2873
2867
|
onTimeUpdate: handleTimeUpdate,
|
|
2874
2868
|
children: /* @__PURE__ */ jsx("source", { type: mime })
|
|
2875
2869
|
}
|
|
2876
|
-
), /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
2870
|
+
), /* @__PURE__ */ jsx(VisuallyHidden, { tag: "figcaption", children: alt }));
|
|
2877
2871
|
};
|
|
2878
2872
|
VideoPreview.defaultProps = {
|
|
2879
2873
|
onLoadDuration() {
|
|
@@ -3022,7 +3016,7 @@ const AssetGridList = ({
|
|
|
3022
3016
|
title
|
|
3023
3017
|
}) => {
|
|
3024
3018
|
return /* @__PURE__ */ jsxs(KeyboardNavigable, { tagName: "article", children: [
|
|
3025
|
-
title && /* @__PURE__ */ jsx(Box, { paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsx(Typography, {
|
|
3019
|
+
title && /* @__PURE__ */ jsx(Box, { paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "delta", fontWeight: "semiBold", children: title }) }),
|
|
3026
3020
|
/* @__PURE__ */ jsx(Grid, { gap: 4, children: assets.map((asset, index2) => {
|
|
3027
3021
|
const isSelected = !!selectedAssets.find((currentAsset) => currentAsset.id === asset.id);
|
|
3028
3022
|
if (onReorderAsset) {
|
|
@@ -3100,7 +3094,7 @@ const CrumbSimpleMenuAsync = ({ parentsToOmit, currentFolderId, onChangeFolder }
|
|
|
3100
3094
|
return /* @__PURE__ */ jsx(
|
|
3101
3095
|
MenuItem,
|
|
3102
3096
|
{
|
|
3103
|
-
|
|
3097
|
+
tag: "button",
|
|
3104
3098
|
type: "button",
|
|
3105
3099
|
onClick: () => onChangeFolder(ascendant.id, ascendant.path),
|
|
3106
3100
|
children: ascendant.label
|
|
@@ -3112,7 +3106,7 @@ const CrumbSimpleMenuAsync = ({ parentsToOmit, currentFolderId, onChangeFolder }
|
|
|
3112
3106
|
folder: ascendant?.id,
|
|
3113
3107
|
folderPath: ascendant?.path
|
|
3114
3108
|
});
|
|
3115
|
-
return /* @__PURE__ */ jsx(MenuItem, { isLink: true,
|
|
3109
|
+
return /* @__PURE__ */ jsx(MenuItem, { isLink: true, tag: NavLink, to: url, children: ascendant.label }, ascendant.id);
|
|
3116
3110
|
})
|
|
3117
3111
|
]
|
|
3118
3112
|
}
|
|
@@ -3147,7 +3141,7 @@ const Breadcrumbs = ({ breadcrumbs, onChangeFolder, currentFolderId, ...props })
|
|
|
3147
3141
|
return /* @__PURE__ */ jsx(
|
|
3148
3142
|
CrumbLink,
|
|
3149
3143
|
{
|
|
3150
|
-
|
|
3144
|
+
tag: onChangeFolder ? "button" : NavLink,
|
|
3151
3145
|
type: onChangeFolder && "button",
|
|
3152
3146
|
to: onChangeFolder ? void 0 : crumb.href,
|
|
3153
3147
|
onClick: onChangeFolder && (() => onChangeFolder(crumb.id, crumb.path)),
|
|
@@ -3183,21 +3177,12 @@ const EmptyAssetCard = styled(Box)`
|
|
|
3183
3177
|
);
|
|
3184
3178
|
opacity: 0.33;
|
|
3185
3179
|
`;
|
|
3186
|
-
const GridColSize = {
|
|
3187
|
-
S: 180,
|
|
3188
|
-
M: 250
|
|
3189
|
-
};
|
|
3190
3180
|
const PlaceholderSize = {
|
|
3191
3181
|
S: 138,
|
|
3192
3182
|
M: 234
|
|
3193
3183
|
};
|
|
3194
|
-
const GridLayout = styled(Box)`
|
|
3195
|
-
display: grid;
|
|
3196
|
-
grid-template-columns: repeat(auto-fit, minmax(${({ size }) => `${GridColSize[size]}px`}, 1fr));
|
|
3197
|
-
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
3198
|
-
`;
|
|
3199
3184
|
const EmptyAssetGrid = ({ count, size }) => {
|
|
3200
|
-
return /* @__PURE__ */ jsx(
|
|
3185
|
+
return /* @__PURE__ */ jsx(Layouts.Grid, { size, children: Array(count).fill(null).map((_, idx) => /* @__PURE__ */ jsx(
|
|
3201
3186
|
EmptyAssetCard,
|
|
3202
3187
|
{
|
|
3203
3188
|
height: `${PlaceholderSize[size]}px`,
|
|
@@ -3216,7 +3201,7 @@ const EmptyAssets = ({ icon: Icon = EmptyDocuments, content, action, size, count
|
|
|
3216
3201
|
/* @__PURE__ */ jsx(Box, { position: "absolute", top: 11, width: "100%", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 4, textAlign: "center", children: [
|
|
3217
3202
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 6, children: [
|
|
3218
3203
|
/* @__PURE__ */ jsx(Icon, { width: "160px", height: "88px" }),
|
|
3219
|
-
/* @__PURE__ */ jsx(Typography, { variant: "delta",
|
|
3204
|
+
/* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "p", textColor: "neutral600", children: content })
|
|
3220
3205
|
] }),
|
|
3221
3206
|
action
|
|
3222
3207
|
] }) })
|
|
@@ -3283,7 +3268,7 @@ const FolderCard = forwardRef(
|
|
|
3283
3268
|
FauxClickWrapper,
|
|
3284
3269
|
{
|
|
3285
3270
|
to: to || void 0,
|
|
3286
|
-
|
|
3271
|
+
tag: to ? NavLink : "button",
|
|
3287
3272
|
type: to ? void 0 : "button",
|
|
3288
3273
|
onClick,
|
|
3289
3274
|
tabIndex: -1,
|
|
@@ -3375,14 +3360,14 @@ const FolderCardBodyAction = ({ to, ...props }) => {
|
|
|
3375
3360
|
BoxTextDecoration,
|
|
3376
3361
|
{
|
|
3377
3362
|
padding: 1,
|
|
3378
|
-
|
|
3363
|
+
tag: NavLink,
|
|
3379
3364
|
maxWidth: "100%",
|
|
3380
3365
|
to,
|
|
3381
3366
|
...props
|
|
3382
3367
|
}
|
|
3383
3368
|
);
|
|
3384
3369
|
}
|
|
3385
|
-
return /* @__PURE__ */ jsx(BoxOutline, { padding: 1,
|
|
3370
|
+
return /* @__PURE__ */ jsx(BoxOutline, { padding: 1, tag: "button", type: "button", maxWidth: "100%", ...props });
|
|
3386
3371
|
};
|
|
3387
3372
|
FolderCardBodyAction.defaultProps = {
|
|
3388
3373
|
to: void 0
|
|
@@ -3392,7 +3377,7 @@ FolderCardBodyAction.propTypes = {
|
|
|
3392
3377
|
};
|
|
3393
3378
|
const FolderGridList = ({ title, children }) => {
|
|
3394
3379
|
return /* @__PURE__ */ jsxs(KeyboardNavigable, { tagName: "article", children: [
|
|
3395
|
-
title && /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: /* @__PURE__ */ jsx(Typography, {
|
|
3380
|
+
title && /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "delta", fontWeight: "semiBold", children: title }) }),
|
|
3396
3381
|
/* @__PURE__ */ jsx(Grid, { gap: 4, children })
|
|
3397
3382
|
] });
|
|
3398
3383
|
};
|
|
@@ -3596,7 +3581,7 @@ const TableRows = ({
|
|
|
3596
3581
|
contentType === "folder" && /* @__PURE__ */ jsx(
|
|
3597
3582
|
IconButton,
|
|
3598
3583
|
{
|
|
3599
|
-
|
|
3584
|
+
tag: folderURL ? Link$1 : void 0,
|
|
3600
3585
|
label: formatMessage({
|
|
3601
3586
|
id: getTrad("list.folders.link-label"),
|
|
3602
3587
|
defaultMessage: "Access folder"
|
|
@@ -3697,7 +3682,7 @@ const TableList = ({
|
|
|
3697
3682
|
Typography,
|
|
3698
3683
|
{
|
|
3699
3684
|
onClick: () => handleClickSort(isSorted, name2),
|
|
3700
|
-
|
|
3685
|
+
tag: isSorted ? "span" : "button",
|
|
3701
3686
|
label: !isSorted ? sortLabel : "",
|
|
3702
3687
|
textColor: "neutral600",
|
|
3703
3688
|
variant: "sigma",
|
|
@@ -4263,7 +4248,7 @@ const PageSize = ({ onChangePageSize, pageSize }) => {
|
|
|
4263
4248
|
]
|
|
4264
4249
|
}
|
|
4265
4250
|
),
|
|
4266
|
-
/* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral600",
|
|
4251
|
+
/* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral600", tag: "label", htmlFor: "page-size", children: formatMessage({
|
|
4267
4252
|
id: "components.PageFooter.select",
|
|
4268
4253
|
defaultMessage: "Entries per page"
|
|
4269
4254
|
}) }) })
|
|
@@ -4281,16 +4266,44 @@ const PaginationText = styled(Typography)`
|
|
|
4281
4266
|
const LinkWrapper = styled.button`
|
|
4282
4267
|
padding: ${({ theme }) => theme.spaces[3]};
|
|
4283
4268
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
4284
|
-
box-shadow: ${({ active, theme }) => active ? theme.shadows.filterShadow : void 0};
|
|
4269
|
+
box-shadow: ${({ $active, theme }) => $active ? theme.shadows.filterShadow : void 0};
|
|
4285
4270
|
text-decoration: none;
|
|
4286
4271
|
display: flex;
|
|
4272
|
+
position: relative;
|
|
4273
|
+
outline: none;
|
|
4274
|
+
|
|
4275
|
+
&:after {
|
|
4276
|
+
transition-property: all;
|
|
4277
|
+
transition-duration: 0.2s;
|
|
4278
|
+
border-radius: 8px;
|
|
4279
|
+
content: '';
|
|
4280
|
+
position: absolute;
|
|
4281
|
+
top: -4px;
|
|
4282
|
+
bottom: -4px;
|
|
4283
|
+
left: -4px;
|
|
4284
|
+
right: -4px;
|
|
4285
|
+
border: 2px solid transparent;
|
|
4286
|
+
}
|
|
4287
|
+
|
|
4288
|
+
&:focus-visible {
|
|
4289
|
+
outline: none;
|
|
4287
4290
|
|
|
4288
|
-
|
|
4291
|
+
&:after {
|
|
4292
|
+
border-radius: 8px;
|
|
4293
|
+
content: '';
|
|
4294
|
+
position: absolute;
|
|
4295
|
+
top: -5px;
|
|
4296
|
+
bottom: -5px;
|
|
4297
|
+
left: -5px;
|
|
4298
|
+
right: -5px;
|
|
4299
|
+
border: 2px solid ${(props) => props.theme.colors.primary600};
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4289
4302
|
`;
|
|
4290
4303
|
LinkWrapper.defaultProps = { type: "button" };
|
|
4291
4304
|
const PageLinkWrapper = styled(LinkWrapper)`
|
|
4292
|
-
color: ${({ theme, active }) => active ? theme.colors.primary700 : theme.colors.neutral800};
|
|
4293
|
-
background: ${({ theme, active }) => active ? theme.colors.neutral0 : void 0};
|
|
4305
|
+
color: ${({ theme, $active }) => $active ? theme.colors.primary700 : theme.colors.neutral800};
|
|
4306
|
+
background: ${({ theme, $active }) => $active ? theme.colors.neutral0 : void 0};
|
|
4294
4307
|
|
|
4295
4308
|
&:hover {
|
|
4296
4309
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
@@ -4335,12 +4348,12 @@ const NextLink = ({ children, ...props }) => {
|
|
|
4335
4348
|
const PageLink = ({ number, children, ...props }) => {
|
|
4336
4349
|
const { activePage } = usePagination();
|
|
4337
4350
|
const isActive = activePage === number;
|
|
4338
|
-
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(PageLinkWrapper, { ...props, active: isActive, children: [
|
|
4351
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(PageLinkWrapper, { ...props, $active: isActive, children: [
|
|
4339
4352
|
/* @__PURE__ */ jsx(VisuallyHidden, { children }),
|
|
4340
4353
|
/* @__PURE__ */ jsx(PaginationText, { "aria-hidden": true, variant: "pi", fontWeight: isActive ? "bold" : "", children: number })
|
|
4341
4354
|
] }) });
|
|
4342
4355
|
};
|
|
4343
|
-
const Dots = ({ children, ...props }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(DotsWrapper, { ...props,
|
|
4356
|
+
const Dots = ({ children, ...props }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(DotsWrapper, { ...props, tag: "div", children: [
|
|
4344
4357
|
/* @__PURE__ */ jsx(VisuallyHidden, { children }),
|
|
4345
4358
|
/* @__PURE__ */ jsx(PaginationText, { "aria-hidden": true, small: true, children: "…" })
|
|
4346
4359
|
] }) });
|
|
@@ -4358,7 +4371,7 @@ Dots.propTypes = {
|
|
|
4358
4371
|
};
|
|
4359
4372
|
const Pagination = ({ children, label, activePage, pageCount }) => {
|
|
4360
4373
|
const paginationValue = useMemo(() => ({ activePage, pageCount }), [activePage, pageCount]);
|
|
4361
|
-
return /* @__PURE__ */ jsx(PaginationContext.Provider, { value: paginationValue, children: /* @__PURE__ */ jsx(Box, {
|
|
4374
|
+
return /* @__PURE__ */ jsx(PaginationContext.Provider, { value: paginationValue, children: /* @__PURE__ */ jsx(Box, { tag: "nav", "aria-label": label, children: /* @__PURE__ */ jsx(Flex, { tag: "ul", gap: 1, children }) }) });
|
|
4362
4375
|
};
|
|
4363
4376
|
Pagination.defaultProps = {
|
|
4364
4377
|
label: "pagination"
|
|
@@ -4694,7 +4707,7 @@ const BrowseStep = ({
|
|
|
4694
4707
|
Breadcrumbs,
|
|
4695
4708
|
{
|
|
4696
4709
|
onChangeFolder,
|
|
4697
|
-
|
|
4710
|
+
tag: "nav",
|
|
4698
4711
|
label: formatMessage({
|
|
4699
4712
|
id: getTrad("header.breadcrumbs.nav.label"),
|
|
4700
4713
|
defaultMessage: "Folders navigation"
|
|
@@ -4780,7 +4793,7 @@ const BrowseStep = ({
|
|
|
4780
4793
|
FolderCardBodyAction,
|
|
4781
4794
|
{
|
|
4782
4795
|
onClick: () => handleClickFolderCard(folder.id, folder.path),
|
|
4783
|
-
children: /* @__PURE__ */ jsxs(Flex, {
|
|
4796
|
+
children: /* @__PURE__ */ jsxs(Flex, { tag: "h2", direction: "column", alignItems: "start", maxWidth: "100%", children: [
|
|
4784
4797
|
/* @__PURE__ */ jsxs(TypographyMaxWidth, { fontWeight: "semiBold", ellipsis: true, children: [
|
|
4785
4798
|
folder.name,
|
|
4786
4799
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: "-" })
|
|
@@ -4788,7 +4801,7 @@ const BrowseStep = ({
|
|
|
4788
4801
|
/* @__PURE__ */ jsx(
|
|
4789
4802
|
TypographyMaxWidth,
|
|
4790
4803
|
{
|
|
4791
|
-
|
|
4804
|
+
tag: "span",
|
|
4792
4805
|
textColor: "neutral600",
|
|
4793
4806
|
variant: "pi",
|
|
4794
4807
|
ellipsis: true,
|
|
@@ -5290,14 +5303,14 @@ const FromComputerForm = ({ onClose, onAddAssets, trackedLocation }) => {
|
|
|
5290
5303
|
onDrop: handleDrop,
|
|
5291
5304
|
children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxs(Wrapper, { children: [
|
|
5292
5305
|
/* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(PlusCircle, { "aria-hidden": true, width: "3.2rem", height: "3.2rem" }) }),
|
|
5293
|
-
/* @__PURE__ */ jsx(Box, { paddingTop: 3, paddingBottom: 5, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral600",
|
|
5306
|
+
/* @__PURE__ */ jsx(Box, { paddingTop: 3, paddingBottom: 5, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral600", tag: "span", children: formatMessage({
|
|
5294
5307
|
id: getTrad("input.label"),
|
|
5295
5308
|
defaultMessage: "Drag & Drop here or"
|
|
5296
5309
|
}) }) }),
|
|
5297
5310
|
/* @__PURE__ */ jsx(
|
|
5298
5311
|
OpaqueBox,
|
|
5299
5312
|
{
|
|
5300
|
-
|
|
5313
|
+
tag: "input",
|
|
5301
5314
|
position: "absolute",
|
|
5302
5315
|
left: 0,
|
|
5303
5316
|
right: 0,
|
|
@@ -5438,18 +5451,20 @@ const FromUrlForm = ({ onClose, onAddAsset, trackedLocation }) => {
|
|
|
5438
5451
|
validationSchema: urlSchema,
|
|
5439
5452
|
validateOnChange: false,
|
|
5440
5453
|
children: ({ values, errors, handleChange }) => /* @__PURE__ */ jsxs(Form, { noValidate: true, children: [
|
|
5441
|
-
/* @__PURE__ */ jsx(Box, { paddingLeft: 8, paddingRight: 8, paddingBottom: 6, paddingTop: 6, children: /* @__PURE__ */
|
|
5442
|
-
|
|
5454
|
+
/* @__PURE__ */ jsx(Box, { paddingLeft: 8, paddingRight: 8, paddingBottom: 6, paddingTop: 6, children: /* @__PURE__ */ jsxs(
|
|
5455
|
+
Field.Root,
|
|
5443
5456
|
{
|
|
5444
|
-
label: formatMessage({ id: getTrad("input.url.label"), defaultMessage: "URL" }),
|
|
5445
|
-
id: "urls",
|
|
5446
5457
|
hint: formatMessage({
|
|
5447
5458
|
id: getTrad("input.url.description"),
|
|
5448
5459
|
defaultMessage: "Separate your URL links by a carriage return."
|
|
5449
5460
|
}),
|
|
5450
5461
|
error: error?.message || (errors.urls ? formatMessage({ id: errors.urls, defaultMessage: "An error occured" }) : void 0),
|
|
5451
|
-
|
|
5452
|
-
|
|
5462
|
+
children: [
|
|
5463
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({ id: getTrad("input.url.label"), defaultMessage: "URL" }) }),
|
|
5464
|
+
/* @__PURE__ */ jsx(Textarea, { onChange: handleChange, value: values.urls }),
|
|
5465
|
+
/* @__PURE__ */ jsx(Field.Hint, {}),
|
|
5466
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
5467
|
+
]
|
|
5453
5468
|
}
|
|
5454
5469
|
) }),
|
|
5455
5470
|
/* @__PURE__ */ jsx(
|
|
@@ -5477,7 +5492,7 @@ FromUrlForm.propTypes = {
|
|
|
5477
5492
|
const AddAssetStep = ({ onClose, onAddAsset, trackedLocation }) => {
|
|
5478
5493
|
const { formatMessage } = useIntl();
|
|
5479
5494
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5480
|
-
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800",
|
|
5495
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800", tag: "h2", id: "title", children: formatMessage({
|
|
5481
5496
|
id: getTrad("header.actions.add-assets"),
|
|
5482
5497
|
defaultMessage: "Add new assets"
|
|
5483
5498
|
}) }) }),
|
|
@@ -5591,7 +5606,7 @@ const UploadingAssetCard = ({
|
|
|
5591
5606
|
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(UploadProgressWrapper, { children: /* @__PURE__ */ jsx(UploadProgress, { error, onCancel: handleCancel, progress }) }) }),
|
|
5592
5607
|
/* @__PURE__ */ jsxs(CardBody, { children: [
|
|
5593
5608
|
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
5594
|
-
/* @__PURE__ */ jsx(Box, { paddingTop: 1, children: /* @__PURE__ */ jsx(CardTitle, {
|
|
5609
|
+
/* @__PURE__ */ jsx(Box, { paddingTop: 1, children: /* @__PURE__ */ jsx(CardTitle, { tag: "h2", children: asset.name }) }),
|
|
5595
5610
|
/* @__PURE__ */ jsx(CardSubtitle, { children: /* @__PURE__ */ jsx(Extension, { children: asset.ext }) })
|
|
5596
5611
|
] }),
|
|
5597
5612
|
/* @__PURE__ */ jsx(Flex, { paddingTop: 1, grow: 1, children: /* @__PURE__ */ jsx(CardBadge, { children: badgeContent }) })
|
|
@@ -5679,7 +5694,7 @@ const PendingAssetStep = ({
|
|
|
5679
5694
|
}
|
|
5680
5695
|
};
|
|
5681
5696
|
return /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, children: [
|
|
5682
|
-
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800",
|
|
5697
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: "neutral800", tag: "h2", id: "title", children: formatMessage({
|
|
5683
5698
|
id: getTrad("header.actions.add-assets"),
|
|
5684
5699
|
defaultMessage: "Add new assets"
|
|
5685
5700
|
}) }) }),
|
|
@@ -5960,7 +5975,7 @@ const CarouselAsset = ({ asset }) => {
|
|
|
5960
5975
|
return /* @__PURE__ */ jsx(
|
|
5961
5976
|
Box,
|
|
5962
5977
|
{
|
|
5963
|
-
|
|
5978
|
+
tag: "img",
|
|
5964
5979
|
maxHeight: "100%",
|
|
5965
5980
|
maxWidth: "100%",
|
|
5966
5981
|
src: createAssetUrl(asset, true),
|
|
@@ -6066,7 +6081,7 @@ const EmptyStateAsset = ({ disabled, onClick, onDropAsset }) => {
|
|
|
6066
6081
|
alignItems: "center",
|
|
6067
6082
|
height: "100%",
|
|
6068
6083
|
width: "100%",
|
|
6069
|
-
|
|
6084
|
+
tag: "button",
|
|
6070
6085
|
type: "button",
|
|
6071
6086
|
disabled,
|
|
6072
6087
|
onClick,
|
|
@@ -6093,7 +6108,7 @@ const EmptyStateAsset = ({ disabled, onClick, onDropAsset }) => {
|
|
|
6093
6108
|
fontWeight: "bold",
|
|
6094
6109
|
textColor: "neutral600",
|
|
6095
6110
|
style: { textAlign: "center" },
|
|
6096
|
-
|
|
6111
|
+
tag: "span",
|
|
6097
6112
|
children: formatMessage({
|
|
6098
6113
|
id: getTrad("mediaLibraryInput.placeholder"),
|
|
6099
6114
|
defaultMessage: "Click to add an asset or drag and drop one in this area"
|
|
@@ -6430,7 +6445,6 @@ MediaLibraryInput.propTypes = {
|
|
|
6430
6445
|
name: PropTypes.string.isRequired,
|
|
6431
6446
|
required: PropTypes.bool
|
|
6432
6447
|
};
|
|
6433
|
-
const PluginIcon = () => /* @__PURE__ */ jsx(Images, {});
|
|
6434
6448
|
const prefixPluginTranslations = (trad, pluginId2) => {
|
|
6435
6449
|
if (!pluginId2) {
|
|
6436
6450
|
throw new TypeError("pluginId can't be empty");
|
|
@@ -6445,13 +6459,13 @@ const index = {
|
|
|
6445
6459
|
register(app) {
|
|
6446
6460
|
app.addMenuLink({
|
|
6447
6461
|
to: `plugins/${pluginId}`,
|
|
6448
|
-
icon:
|
|
6462
|
+
icon: Images,
|
|
6449
6463
|
intlLabel: {
|
|
6450
6464
|
id: `${pluginId}.plugin.name`,
|
|
6451
6465
|
defaultMessage: "Media Library"
|
|
6452
6466
|
},
|
|
6453
6467
|
permissions: PERMISSIONS.main,
|
|
6454
|
-
Component: () => import("./index-
|
|
6468
|
+
Component: () => import("./index-2C3ZYD4e.mjs")
|
|
6455
6469
|
});
|
|
6456
6470
|
app.addSettingsLink("global", {
|
|
6457
6471
|
id: "media-library-settings",
|
|
@@ -6460,7 +6474,7 @@ const index = {
|
|
|
6460
6474
|
defaultMessage: "Media Library"
|
|
6461
6475
|
},
|
|
6462
6476
|
to: "media-library",
|
|
6463
|
-
Component: () => import("./index-
|
|
6477
|
+
Component: () => import("./index-fmt8afwE.mjs"),
|
|
6464
6478
|
permissions: PERMISSIONS.settings
|
|
6465
6479
|
});
|
|
6466
6480
|
app.addFields({ type: "media", Component: MediaLibraryInput });
|
|
@@ -6531,4 +6545,4 @@ export {
|
|
|
6531
6545
|
FolderCardBodyAction as y,
|
|
6532
6546
|
AssetGridList as z
|
|
6533
6547
|
};
|
|
6534
|
-
//# sourceMappingURL=index-
|
|
6548
|
+
//# sourceMappingURL=index-ASLx4V_D.mjs.map
|