node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,154 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var designSystem = require('@strapi/design-system');
var formik = require('formik');
var isEmpty = require('lodash/isEmpty');
var reactIntl = require('react-intl');
var useBulkMove = require('../../hooks/useBulkMove.js');
var useFolderStructure = require('../../hooks/useFolderStructure.js');
require('byte-size');
require('date-fns');
var normalizeAPIError = require('../../utils/normalizeAPIError.js');
var getTrad = require('../../utils/getTrad.js');
require('qs');
require('../../constants.js');
require('../../utils/urlYupSchema.js');
var SelectTree = require('../SelectTree/SelectTree.js');
const BulkMoveDialog = ({ onClose, selected = [], currentFolder })=>{
const { formatMessage } = reactIntl.useIntl();
const { data: folderStructure, isLoading } = useFolderStructure.useFolderStructure();
const { move } = useBulkMove.useBulkMove();
if (!folderStructure) {
return null;
}
const handleSubmit = async (values, { setErrors })=>{
try {
if (typeof values.destination !== 'string') {
const destinationValue = values.destination.value;
await move(destinationValue, selected);
onClose();
}
} catch (error) {
const normalizedError = normalizeAPIError.normalizeAPIError(error);
if (normalizedError && 'errors' in normalizedError) {
const formikErrors = normalizedError.errors?.reduce((acc, error)=>{
acc[error.values?.path?.length || 'destination'] = error.defaultMessage;
return acc;
}, {});
if (!isEmpty(formikErrors)) {
setErrors(formikErrors);
}
}
}
};
if (isLoading) {
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Content, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Body, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
justifyContent: "center",
paddingTop: 4,
paddingBottom: 4,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Loader, {
children: formatMessage({
id: getTrad.getTrad('content.isLoading'),
defaultMessage: 'Content is loading.'
})
})
})
})
});
}
const initialFormData = {
destination: {
value: currentFolder?.id || '',
label: currentFolder?.name || folderStructure[0].label
}
};
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Content, {
children: /*#__PURE__*/ jsxRuntime.jsx(formik.Formik, {
validateOnChange: false,
onSubmit: handleSubmit,
initialValues: initialFormData,
children: ({ values, errors, setFieldValue })=>/*#__PURE__*/ jsxRuntime.jsxs(formik.Form, {
noValidate: true,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Header, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Title, {
children: formatMessage({
id: getTrad.getTrad('modal.folder.move.title'),
defaultMessage: 'Move elements to'
})
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Body, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Root, {
gap: 4,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
xs: 12,
col: 12,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
id: "folder-destination",
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
children: formatMessage({
id: getTrad.getTrad('form.input.label.folder-location'),
defaultMessage: 'Location'
})
}),
/*#__PURE__*/ jsxRuntime.jsx(SelectTree.SelectTree, {
options: folderStructure,
onChange: (value)=>{
setFieldValue('destination', value);
},
defaultValue: typeof values.destination !== 'string' ? values.destination : undefined,
name: "destination",
menuPortalTarget: document.querySelector('body'),
inputId: "folder-destination",
error: errors?.destination,
ariaErrorMessage: "destination-error"
}),
errors.destination && /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
variant: "pi",
tag: "p",
textColor: "danger600",
children: errors.destination
})
]
})
})
})
}),
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Modal.Footer, {
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Close, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Button, {
variant: "tertiary",
name: "cancel",
children: formatMessage({
id: 'cancel',
defaultMessage: 'Cancel'
})
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Button, {
type: "submit",
loading: isLoading,
children: formatMessage({
id: 'modal.folder.move.submit',
defaultMessage: 'Move'
})
})
]
})
]
})
})
});
};
exports.BulkMoveDialog = BulkMoveDialog;
//# sourceMappingURL=BulkMoveDialog.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,152 @@
import { jsx, jsxs } from 'react/jsx-runtime';
import { Modal, Flex, Loader, Grid, Field, Typography, Button } from '@strapi/design-system';
import { Formik, Form } from 'formik';
import isEmpty from 'lodash/isEmpty';
import { useIntl } from 'react-intl';
import { useBulkMove } from '../../hooks/useBulkMove.mjs';
import { useFolderStructure } from '../../hooks/useFolderStructure.mjs';
import 'byte-size';
import 'date-fns';
import { normalizeAPIError } from '../../utils/normalizeAPIError.mjs';
import { getTrad } from '../../utils/getTrad.mjs';
import 'qs';
import '../../constants.mjs';
import '../../utils/urlYupSchema.mjs';
import { SelectTree } from '../SelectTree/SelectTree.mjs';
const BulkMoveDialog = ({ onClose, selected = [], currentFolder })=>{
const { formatMessage } = useIntl();
const { data: folderStructure, isLoading } = useFolderStructure();
const { move } = useBulkMove();
if (!folderStructure) {
return null;
}
const handleSubmit = async (values, { setErrors })=>{
try {
if (typeof values.destination !== 'string') {
const destinationValue = values.destination.value;
await move(destinationValue, selected);
onClose();
}
} catch (error) {
const normalizedError = normalizeAPIError(error);
if (normalizedError && 'errors' in normalizedError) {
const formikErrors = normalizedError.errors?.reduce((acc, error)=>{
acc[error.values?.path?.length || 'destination'] = error.defaultMessage;
return acc;
}, {});
if (!isEmpty(formikErrors)) {
setErrors(formikErrors);
}
}
}
};
if (isLoading) {
return /*#__PURE__*/ jsx(Modal.Content, {
children: /*#__PURE__*/ jsx(Modal.Body, {
children: /*#__PURE__*/ jsx(Flex, {
justifyContent: "center",
paddingTop: 4,
paddingBottom: 4,
children: /*#__PURE__*/ jsx(Loader, {
children: formatMessage({
id: getTrad('content.isLoading'),
defaultMessage: 'Content is loading.'
})
})
})
})
});
}
const initialFormData = {
destination: {
value: currentFolder?.id || '',
label: currentFolder?.name || folderStructure[0].label
}
};
return /*#__PURE__*/ jsx(Modal.Content, {
children: /*#__PURE__*/ jsx(Formik, {
validateOnChange: false,
onSubmit: handleSubmit,
initialValues: initialFormData,
children: ({ values, errors, setFieldValue })=>/*#__PURE__*/ jsxs(Form, {
noValidate: true,
children: [
/*#__PURE__*/ jsx(Modal.Header, {
children: /*#__PURE__*/ jsx(Modal.Title, {
children: formatMessage({
id: getTrad('modal.folder.move.title'),
defaultMessage: 'Move elements to'
})
})
}),
/*#__PURE__*/ jsx(Modal.Body, {
children: /*#__PURE__*/ jsx(Grid.Root, {
gap: 4,
children: /*#__PURE__*/ jsx(Grid.Item, {
xs: 12,
col: 12,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsxs(Field.Root, {
id: "folder-destination",
children: [
/*#__PURE__*/ jsx(Field.Label, {
children: formatMessage({
id: getTrad('form.input.label.folder-location'),
defaultMessage: 'Location'
})
}),
/*#__PURE__*/ jsx(SelectTree, {
options: folderStructure,
onChange: (value)=>{
setFieldValue('destination', value);
},
defaultValue: typeof values.destination !== 'string' ? values.destination : undefined,
name: "destination",
menuPortalTarget: document.querySelector('body'),
inputId: "folder-destination",
error: errors?.destination,
ariaErrorMessage: "destination-error"
}),
errors.destination && /*#__PURE__*/ jsx(Typography, {
variant: "pi",
tag: "p",
textColor: "danger600",
children: errors.destination
})
]
})
})
})
}),
/*#__PURE__*/ jsxs(Modal.Footer, {
children: [
/*#__PURE__*/ jsx(Modal.Close, {
children: /*#__PURE__*/ jsx(Button, {
variant: "tertiary",
name: "cancel",
children: formatMessage({
id: 'cancel',
defaultMessage: 'Cancel'
})
})
}),
/*#__PURE__*/ jsx(Button, {
type: "submit",
loading: isLoading,
children: formatMessage({
id: 'modal.folder.move.submit',
defaultMessage: 'Move'
})
})
]
})
]
})
})
});
};
export { BulkMoveDialog };
//# sourceMappingURL=BulkMoveDialog.mjs.map

File diff suppressed because one or more lines are too long