Chore: Apply eslint import sorting fix

This commit is contained in:
Gustav Hansen 2023-06-12 16:22:11 +02:00
parent dfbe582cd7
commit dca5778d8e
1018 changed files with 4571 additions and 3243 deletions

View File

@ -1,27 +1,29 @@
import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import { lightTheme, darkTheme } from '@strapi/design-system';
import { darkTheme, lightTheme } from '@strapi/design-system';
import invariant from 'invariant';
import isFunction from 'lodash/isFunction';
import merge from 'lodash/merge';
import pick from 'lodash/pick';
import isFunction from 'lodash/isFunction';
import invariant from 'invariant';
import { Helmet } from 'react-helmet';
import { basename, createHook } from './core/utils';
import configureStore from './core/store/configureStore';
import { customFields, Plugin } from './core/apis';
import App from './pages/App';
import { BrowserRouter } from 'react-router-dom';
import Logo from './assets/images/logo-strapi-2022.svg';
import localStorageKey from './components/LanguageProvider/utils/localStorageKey';
import Providers from './components/Providers';
import languageNativeNames from './translations/languageNativeNames';
import { customFields, Plugin } from './core/apis';
import configureStore from './core/store/configureStore';
import { basename, createHook } from './core/utils';
import {
INJECT_COLUMN_IN_TABLE,
MUTATE_COLLECTION_TYPES_LINKS,
MUTATE_EDIT_VIEW_LAYOUT,
MUTATE_SINGLE_TYPES_LINKS,
} from './exposedHooks';
import injectionZones from './injectionZones';
import favicon from './favicon.png';
import localStorageKey from './components/LanguageProvider/utils/localStorageKey';
import injectionZones from './injectionZones';
import App from './pages/App';
import languageNativeNames from './translations/languageNativeNames';
class StrapiApp {
constructor({ adminConfig, appPlugins, library, middlewares, reducers }) {

View File

@ -1,18 +1,22 @@
import React, { useState, useEffect } from 'react';
// TODO: DS add loader
import React, { useEffect, useState } from 'react';
import {
AppInfoProvider,
auth,
LoadingIndicatorPage,
AppInfoProvider,
useGuidedTour,
useNotification,
} from '@strapi/helper-plugin';
import { useQueries } from 'react-query';
import get from 'lodash/get';
import { useQueries } from 'react-query';
// TODO: DS add loader
import packageJSON from '../../../../package.json';
import { useConfigurations } from '../../hooks';
import { getFullName, hashAdminUserEmail } from '../../utils';
import PluginsInitializer from '../PluginsInitializer';
import RBACProvider from '../RBACProvider';
import {
fetchAppInfo,
fetchCurrentUserPermissions,
@ -20,7 +24,6 @@ import {
fetchUserRoles,
} from './utils/api';
import checkLatestStrapiVersion from './utils/checkLatestStrapiVersion';
import { getFullName, hashAdminUserEmail } from '../../utils';
const strapiVersion = packageJSON.version;

View File

@ -1,21 +1,23 @@
import React from 'react';
import PropTypes from 'prop-types';
import { render, waitFor } from '@testing-library/react';
import { QueryClientProvider, QueryClient } from 'react-query';
import { darkTheme, lightTheme } from '@strapi/design-system';
import { useGuidedTour } from '@strapi/helper-plugin';
import { lightTheme, darkTheme } from '@strapi/design-system';
import { render, waitFor } from '@testing-library/react';
import PropTypes from 'prop-types';
import { IntlProvider } from 'react-intl';
import { QueryClient, QueryClientProvider } from 'react-query';
import AuthenticatedApp from '..';
import packageJSON from '../../../../../package.json';
import { ConfigurationsContext } from '../../../contexts';
import Theme from '../../Theme';
import ThemeToggleProvider from '../../ThemeToggleProvider';
import {
fetchAppInfo,
fetchCurrentUserPermissions,
fetchStrapiLatestRelease,
fetchUserRoles,
} from '../utils/api';
import packageJSON from '../../../../../package.json';
import Theme from '../../Theme';
import ThemeToggleProvider from '../../ThemeToggleProvider';
import AuthenticatedApp from '..';
const strapiVersion = packageJSON.version;

View File

@ -1,7 +1,9 @@
import { getFetchClient } from '@strapi/helper-plugin';
import checkLatestStrapiVersion from './checkLatestStrapiVersion';
import packageJSON from '../../../../../package.json';
import checkLatestStrapiVersion from './checkLatestStrapiVersion';
const strapiVersion = packageJSON.version;
const showUpdateNotif = !JSON.parse(localStorage.getItem('STRAPI_UPDATE_NOTIF'));
const { get } = getFetchClient();

View File

@ -1,6 +1,9 @@
import React, { useCallback, useMemo, useReducer } from 'react';
import PropTypes from 'prop-types';
import { ConfigurationsContext } from '../../contexts';
import reducer, { initialState } from './reducer';
const ConfigurationsProvider = ({

View File

@ -1,7 +1,9 @@
import React from 'react';
import { render, fireEvent, screen } from '@testing-library/react';
import ConfigurationsProvider from '../index';
import { fireEvent, render, screen } from '@testing-library/react';
import { useConfigurations } from '../../../hooks';
import ConfigurationsProvider from '../index';
describe('ConfigurationsProvider', () => {
it('should not crash', () => {

View File

@ -1,7 +1,8 @@
import * as React from 'react';
import { Box } from '@strapi/design-system';
import PropTypes from 'prop-types';
import { useDragLayer } from 'react-dnd';
import { Box } from '@strapi/design-system';
function getStyle(initialOffset, currentOffset, mouseOffset) {
if (!initialOffset || !currentOffset) {

View File

@ -1,11 +1,13 @@
import React from 'react';
import { useIntl } from 'react-intl';
import PropTypes from 'prop-types';
import { Box, Flex, Typography } from '@strapi/design-system';
import { pxToRem } from '@strapi/helper-plugin';
import { Typography, Box, Flex } from '@strapi/design-system';
import StepNumber from '../../Stepper/StepNumber';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { IS_ACTIVE, IS_DONE, IS_NOT_DONE } from '../../constants';
import StepLine from '../../Stepper/StepLine';
import { IS_DONE, IS_ACTIVE, IS_NOT_DONE } from '../../constants';
import StepNumber from '../../Stepper/StepNumber';
const StepHomepage = ({ type, title, number, content, hasLine }) => {
const { formatMessage } = useIntl();

View File

@ -1,8 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Box } from '@strapi/design-system';
import PropTypes from 'prop-types';
import { IS_ACTIVE, IS_DONE, IS_NOT_DONE } from '../../constants';
import StepHomepage from './Step';
import { IS_DONE, IS_ACTIVE, IS_NOT_DONE } from '../../constants';
const getType = (activeSectionIndex, index) => {
if (activeSectionIndex === -1) {

View File

@ -1,7 +1,9 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { render } from '@testing-library/react';
import { IntlProvider } from 'react-intl';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import Stepper from '../Stepper';
const sections = [

View File

@ -1,11 +1,14 @@
import React from 'react';
import { useGuidedTour, useTracking, LinkButton } from '@strapi/helper-plugin';
import { useIntl } from 'react-intl';
import { Flex, Box, Typography, Button } from '@strapi/design-system';
import { Box, Button, Flex, Typography } from '@strapi/design-system';
import { LinkButton, useGuidedTour, useTracking } from '@strapi/helper-plugin';
import { ArrowRight } from '@strapi/icons';
import StepperHomepage from './components/Stepper';
import { useIntl } from 'react-intl';
import layout from '../layout';
import StepperHomepage from './components/Stepper';
const GuidedTourHomepage = () => {
const { guidedTourState, setSkipped } = useGuidedTour();
const { formatMessage } = useIntl();

View File

@ -1,10 +1,12 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { TrackingProvider, useGuidedTour } from '@strapi/helper-plugin';
import { render, screen } from '@testing-library/react';
import { Router } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import { IntlProvider } from 'react-intl';
import { useGuidedTour, TrackingProvider } from '@strapi/helper-plugin';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { Router } from 'react-router-dom';
import GuidedTourHomepage from '../index';
jest.mock('@strapi/helper-plugin', () => ({

View File

@ -1,8 +1,9 @@
import React from 'react';
import { Box, Flex, Typography } from '@strapi/design-system';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { Flex, Box, Typography } from '@strapi/design-system';
import { useIntl } from 'react-intl';
import styled from 'styled-components';
const LiStyled = styled.li`
list-style: disc;

View File

@ -1,10 +1,11 @@
import React from 'react';
import styled from 'styled-components';
import { Box, Button, Flex, FocusTrap, IconButton, Portal } from '@strapi/design-system';
import { pxToRem } from '@strapi/helper-plugin';
import { Cross } from '@strapi/icons';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { pxToRem } from '@strapi/helper-plugin';
import { Portal, FocusTrap, Flex, Box, IconButton, Button } from '@strapi/design-system';
import { Cross } from '@strapi/icons';
import styled from 'styled-components';
const ModalWrapper = styled(Flex)`
position: fixed;

View File

@ -1,6 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Box } from '@strapi/design-system';
import PropTypes from 'prop-types';
import StepNumber from '../../Stepper/StepNumber';
const StepNumberWithPadding = ({ number, last, type }) => (

View File

@ -1,13 +1,16 @@
import React from 'react';
import { Box, Button, Flex, Typography } from '@strapi/design-system';
import { LinkButton, pxToRem } from '@strapi/helper-plugin';
import { ArrowRight } from '@strapi/icons';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { pxToRem, LinkButton } from '@strapi/helper-plugin';
import { Typography, Button, Box, Flex } from '@strapi/design-system';
import { ArrowRight } from '@strapi/icons';
import Content from './Content';
import { IS_ACTIVE, IS_DONE } from '../../constants';
import StepLine from '../../Stepper/StepLine';
import Content from './Content';
import StepNumberWithPadding from './StepNumberWithPadding';
import { IS_DONE, IS_ACTIVE } from '../../constants';
const StepperModal = ({
title,

View File

@ -1,10 +1,13 @@
import React, { useEffect, useState, useReducer } from 'react';
import at from 'lodash/at';
import React, { useEffect, useReducer, useState } from 'react';
import { useGuidedTour, useTracking } from '@strapi/helper-plugin';
import at from 'lodash/at';
import layout from '../layout';
import Modal from './components/Modal';
import reducer, { initialState } from './reducer';
import StepperModal from './components/Stepper';
import reducer, { initialState } from './reducer';
const GuidedTourModal = () => {
const {

View File

@ -1,8 +1,10 @@
import React from 'react';
import { darkTheme, lightTheme } from '@strapi/design-system';
import { useGuidedTour } from '@strapi/helper-plugin';
import { render, screen } from '@testing-library/react';
import { IntlProvider } from 'react-intl';
import { useGuidedTour } from '@strapi/helper-plugin';
import { lightTheme, darkTheme } from '@strapi/design-system';
import Theme from '../../../Theme';
import ThemeToggleProvider from '../../../ThemeToggleProvider';
import GuidedTourModal from '../index';

View File

@ -1,8 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import { pxToRem } from '@strapi/helper-plugin';
import { Box } from '@strapi/design-system';
import { IS_DONE, IS_ACTIVE, IS_NOT_DONE } from '../constants';
import { pxToRem } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import { IS_ACTIVE, IS_DONE, IS_NOT_DONE } from '../constants';
const StepLine = ({ type, ...props }) => {
return (

View File

@ -1,9 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import { pxToRem } from '@strapi/helper-plugin';
import { Flex, Icon, Typography } from '@strapi/design-system';
import { pxToRem } from '@strapi/helper-plugin';
import { Check } from '@strapi/icons';
import { IS_DONE, IS_ACTIVE, IS_NOT_DONE } from '../constants';
import PropTypes from 'prop-types';
import { IS_ACTIVE, IS_DONE, IS_NOT_DONE } from '../constants';
const StepNumber = ({ type, number }) => {
if (type === IS_DONE) {

View File

@ -1,12 +1,14 @@
import React, { useReducer } from 'react';
import PropTypes from 'prop-types';
import get from 'lodash/get';
import { GuidedTourProvider } from '@strapi/helper-plugin';
import persistStateToLocaleStorage from './utils/persistStateToLocaleStorage';
import get from 'lodash/get';
import PropTypes from 'prop-types';
import init from './init';
import reducer, { initialState } from './reducer';
import arePreviousSectionsDone from './utils/arePreviousSectionsDone';
import arePreviousStepsDone from './utils/arePreviousStepsDone';
import reducer, { initialState } from './reducer';
import init from './init';
import persistStateToLocaleStorage from './utils/persistStateToLocaleStorage';
const GuidedTour = ({ children }) => {
const [{ currentStep, guidedTourState, isGuidedTourVisible, isSkipped }, dispatch] = useReducer(

View File

@ -1,4 +1,5 @@
import set from 'lodash/set';
import persistStateToLocaleStorage, {
COMPLETED_STEPS,
CURRENT_STEP,

View File

@ -1,6 +1,8 @@
import React, { useEffect } from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import { useGuidedTour } from '@strapi/helper-plugin/';
import { fireEvent, render, screen } from '@testing-library/react';
import GuidedTour from '../index';
describe('GuidedTour', () => {

View File

@ -1,4 +1,5 @@
import cloneDeep from 'lodash/cloneDeep';
import init from '../init';
import { initialState } from '../reducer';

View File

@ -7,13 +7,16 @@
*/
import React, { useEffect, useReducer } from 'react';
import defaultsDeep from 'lodash/defaultsDeep';
import PropTypes from 'prop-types';
import { IntlProvider } from 'react-intl';
import defaultsDeep from 'lodash/defaultsDeep';
import LocalesProvider from '../LocalesProvider';
import localStorageKey from './utils/localStorageKey';
import init from './init';
import reducer, { initialState } from './reducer';
import localStorageKey from './utils/localStorageKey';
const LanguageProvider = ({ children, localeNames, messages }) => {
const [{ locale }, dispatch] = useReducer(reducer, initialState, () => init(localeNames));

View File

@ -1,10 +1,12 @@
import React from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import { fireEvent, render, screen } from '@testing-library/react';
import { useIntl } from 'react-intl';
import useLocalesProvider from '../../LocalesProvider/useLocalesProvider';
import LanguageProvider from '../index';
import en from '../../../translations/en.json';
import fr from '../../../translations/fr.json';
import useLocalesProvider from '../../LocalesProvider/useLocalesProvider';
import LanguageProvider from '../index';
const messages = { en, fr };
const localeNames = { en: 'English', fr: 'Français' };

View File

@ -1,27 +1,29 @@
import React, { useRef, useState } from 'react';
import styled from 'styled-components';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { NavLink as RouterNavLink, useLocation, useHistory } from 'react-router-dom';
import { Divider, FocusTrap, Box, Typography, Flex } from '@strapi/design-system';
import { Box, Divider, Flex, FocusTrap, Typography } from '@strapi/design-system';
import {
MainNav,
NavBrand,
NavSections,
NavLink,
NavSection,
NavUser,
NavCondense,
NavFooter,
NavLink,
NavSection,
NavSections,
NavUser,
} from '@strapi/design-system/v2';
import { Write, Exit } from '@strapi/icons';
import {
auth,
usePersistentState,
useAppInfo,
useTracking,
getFetchClient,
useAppInfo,
usePersistentState,
useTracking,
} from '@strapi/helper-plugin';
import { Exit, Write } from '@strapi/icons';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { NavLink as RouterNavLink, useHistory, useLocation } from 'react-router-dom';
import styled from 'styled-components';
import { useConfigurations } from '../../hooks';
const LinkUserWrapper = styled(Box)`

View File

@ -1,5 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import LocalesProviderContext from './context';
const LocalesProvider = ({ changeLocale, children, localeNames }) => {

View File

@ -1,5 +1,7 @@
import React from 'react';
import { render } from '@testing-library/react';
import LocalesProvider from '../index';
describe('LocalesProvider', () => {

View File

@ -1,4 +1,5 @@
import { useContext } from 'react';
import LocalesProviderContext from './context';
const useLocalesProvider = () => {

View File

@ -1,5 +1,7 @@
import React, { useReducer, useRef } from 'react';
import { LoadingIndicatorPage, useStrapiApp } from '@strapi/helper-plugin';
import Admin from '../../pages/Admin';
import init from './init';

View File

@ -1,6 +1,8 @@
import React from 'react';
import { StrapiAppProvider } from '@strapi/helper-plugin';
import { render } from '@testing-library/react';
import PluginsInitializer from '../index';
jest.mock('../../../pages/Admin', () => () => {

View File

@ -8,9 +8,10 @@
*/
import React, { memo } from 'react';
import { Redirect, Route, useLocation } from 'react-router-dom';
import PropTypes from 'prop-types';
import { auth } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import { Redirect, Route, useLocation } from 'react-router-dom';
/* eslint-disable react/jsx-curly-newline */

View File

@ -1,9 +1,10 @@
import React from 'react';
import { Router, Route, Switch } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import { act, render, screen, waitFor } from '@testing-library/react';
import { auth } from '@strapi/helper-plugin';
import { act, render, screen, waitFor } from '@testing-library/react';
import { createMemoryHistory } from 'history';
import { Route, Router, Switch } from 'react-router-dom';
import PrivateRoute from '..';
const ProtectedPage = () => {

View File

@ -1,21 +1,23 @@
import React from 'react';
import PropTypes from 'prop-types';
import { QueryClientProvider, QueryClient } from 'react-query';
import {
LibraryProvider,
CustomFieldsProvider,
StrapiAppProvider,
AutoReloadOverlayBlockerProvider,
OverlayBlockerProvider,
CustomFieldsProvider,
LibraryProvider,
NotificationsProvider,
OverlayBlockerProvider,
StrapiAppProvider,
} from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import { QueryClient, QueryClientProvider } from 'react-query';
import { Provider } from 'react-redux';
import { AdminContext } from '../../contexts';
import ConfigurationsProvider from '../ConfigurationsProvider';
import LanguageProvider from '../LanguageProvider';
import GuidedTour from '../GuidedTour';
import ThemeToggleProvider from '../ThemeToggleProvider';
import LanguageProvider from '../LanguageProvider';
import Theme from '../Theme';
import ThemeToggleProvider from '../ThemeToggleProvider';
const queryClient = new QueryClient({
defaultOptions: {

View File

@ -1,7 +1,9 @@
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { LoadingIndicatorPage, RBACProviderContext } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import { useDispatch, useSelector } from 'react-redux';
import { resetStore, setPermissions } from './actions';
const RBACProvider = ({ children, permissions, refetchPermissions }) => {

View File

@ -1,6 +1,6 @@
import { fixtures } from '@strapi/admin-test-utils';
import { setPermissions, resetStore } from '../actions';
import { resetStore, setPermissions } from '../actions';
import rbacProviderReducer, { initialState } from '../reducer';
describe('rbacProviderReducer', () => {

View File

@ -1,7 +1,9 @@
import React from 'react';
import { DesignSystemProvider } from '@strapi/design-system';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { useThemeToggle } from '../../hooks';
import GlobalStyle from '../GlobalStyle';

View File

@ -4,8 +4,10 @@
*
*/
import React, { useState, useMemo, useCallback } from 'react';
import React, { useCallback, useMemo, useState } from 'react';
import PropTypes from 'prop-types';
import { ThemeToggleContext } from '../../contexts';
const THEME_KEY = 'STRAPI_THEME';

View File

@ -1,5 +1,7 @@
import React from 'react';
import styled from 'styled-components';
import { useConfigurations } from '../../hooks';
const Img = styled.img`

View File

@ -1,9 +1,10 @@
import React, { useRef, useState } from 'react';
import { Box, Button } from '@strapi/design-system';
import { FilterListURLQuery, FilterPopoverURLQuery, useTracking } from '@strapi/helper-plugin';
import { Filter } from '@strapi/icons';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { Box, Button } from '@strapi/design-system';
import { Filter } from '@strapi/icons';
import { FilterListURLQuery, FilterPopoverURLQuery, useTracking } from '@strapi/helper-plugin';
const Filters = ({ displayedFilters }) => {
const [isVisible, setIsVisible] = useState(false);

View File

@ -1,5 +1,5 @@
import { findMatchingPermissions, useRBACProvider } from '@strapi/helper-plugin';
import get from 'lodash/get';
import { useRBACProvider, findMatchingPermissions } from '@strapi/helper-plugin';
const NOT_ALLOWED_FILTERS = ['json', 'component', 'media', 'richtext', 'dynamiczone', 'password'];
const TIMESTAMPS = ['createdAt', 'updatedAt'];

View File

@ -1,8 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import useAllowedAttributes from './hooks/useAllowedAttributes';
import Filters from './Filters';
import useAllowedAttributes from './hooks/useAllowedAttributes';
const AttributeFilter = ({ contentType, slug, metadatas }) => {
const { formatMessage } = useIntl();

View File

@ -1,27 +1,23 @@
import { memo, useCallback, useEffect, useMemo, useRef } from 'react';
import { useQueryClient } from 'react-query';
import { useHistory } from 'react-router-dom';
import axios from 'axios';
import get from 'lodash/get';
import {
useTracking,
useNotification,
useQueryParams,
formatContentTypeData,
contentManagementUtilRemoveFieldsFromData,
useGuidedTour,
formatContentTypeData,
useAPIErrorHandler,
useFetchClient,
useGuidedTour,
useNotification,
useQueryParams,
useTracking,
} from '@strapi/helper-plugin';
import { useSelector, useDispatch } from 'react-redux';
import PropTypes from 'prop-types';
import axios from 'axios';
import get from 'lodash/get';
import isEqual from 'lodash/isEqual';
import {
createDefaultForm,
getTrad,
getRequestUrl,
removePasswordFieldsFromData,
} from '../../utils';
import PropTypes from 'prop-types';
import { useQueryClient } from 'react-query';
import { useDispatch, useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom';
import { useFindRedirectionLink } from '../../hooks';
import {
getData,
@ -33,6 +29,12 @@ import {
submitSucceeded,
} from '../../sharedReducers/crudReducer/actions';
import selectCrudReducer from '../../sharedReducers/crudReducer/selectors';
import {
createDefaultForm,
getRequestUrl,
getTrad,
removePasswordFieldsFromData,
} from '../../utils';
// This container is used to handle the CRUD
const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }) => {

View File

@ -1,7 +1,8 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Flex, Icon } from '@strapi/design-system';
import PropTypes from 'prop-types';
import { COMPONENT_ICONS } from './constants';
export function ComponentIcon({ showBackground = true, size = 'M', icon }) {

View File

@ -1,10 +1,12 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { useIntl } from 'react-intl';
import { PlusCircle } from '@strapi/icons';
import { Box, Flex, Typography } from '@strapi/design-system';
import { pxToRem } from '@strapi/helper-plugin';
import { PlusCircle } from '@strapi/icons';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import styled from 'styled-components';
import { getTrad } from '../../utils';
const IconWrapper = styled.span`

View File

@ -1,13 +1,15 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Button, Dialog, DialogBody, DialogFooter, Flex, Typography } from '@strapi/design-system';
import { useTracking } from '@strapi/helper-plugin';
import { Check, ExclamationMarkCircle, Trash } from '@strapi/icons';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { useSelector } from 'react-redux';
import { useTracking } from '@strapi/helper-plugin';
import { listViewDomain } from '../../../pages/ListView/selectors';
import { getTrad } from '../../../utils';
import InjectionZoneList from '../../InjectionZoneList';
import { listViewDomain } from '../../../pages/ListView/selectors';
const ConfirmBulkActionDialog = ({ onToggleDialog, isOpen, dialogBody, endAction }) => {
const { formatMessage } = useIntl();

View File

@ -1,8 +1,10 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { render, screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { IntlProvider } from 'react-intl';
import BulkActionsBar from '../index';
jest.mock('@strapi/helper-plugin', () => ({

View File

@ -1,7 +1,7 @@
import parseISO from 'date-fns/parseISO';
import toString from 'lodash/toString';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import toString from 'lodash/toString';
import parseISO from 'date-fns/parseISO';
const CellValue = ({ type, value }) => {
const { formatDate, formatTime, formatNumber } = useIntl();

View File

@ -1,7 +1,8 @@
import React from 'react';
import { Flex, Typography } from '@strapi/design-system';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { Flex, Typography } from '@strapi/design-system';
const Wrapper = styled(Flex)`
position: relative;

View File

@ -1,7 +1,8 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Avatar, Tooltip } from '@strapi/design-system';
import { getFileExtension, prefixFileUrlWithBackendUrl } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import FileWrapper from './FileWrapper';

View File

@ -1,6 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import { AvatarGroup } from '@strapi/design-system';
import PropTypes from 'prop-types';
import Media from './Media';
import FileWrapper from './Media/FileWrapper';

View File

@ -1,7 +1,8 @@
import React from 'react';
import { Status, Typography } from '@strapi/design-system';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { Status, Typography } from '@strapi/design-system';
import { getTrad } from '../../../../utils';

View File

@ -1,6 +1,7 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { render } from '@testing-library/react';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { IntlProvider } from 'react-intl';
import { PublicationState } from '..';

View File

@ -1,3 +1,5 @@
import React, { useMemo, useState } from 'react';
import {
Badge,
Box,
@ -10,10 +12,10 @@ import {
} from '@strapi/design-system';
import { stopPropagation, useFetchClient } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import React, { useMemo, useState } from 'react';
import { useIntl } from 'react-intl';
import { useQuery } from 'react-query';
import styled from 'styled-components';
import { getRequestUrl, getTrad } from '../../../../utils';
import CellValue from '../CellValue';

View File

@ -1,10 +1,11 @@
import React from 'react';
import { render, fireEvent, screen, waitFor } from '@testing-library/react';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { IntlProvider } from 'react-intl';
import { QueryClientProvider, QueryClient } from 'react-query';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { useFetchClient } from '@strapi/helper-plugin';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { IntlProvider } from 'react-intl';
import { QueryClient, QueryClientProvider } from 'react-query';
import RelationMultiple from '../index';
jest.mock('@strapi/helper-plugin', () => ({

View File

@ -1,7 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Typography } from '@strapi/design-system';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import CellValue from '../CellValue';
const TypographyMaxWidth = styled(Typography)`

View File

@ -1,6 +1,7 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { render } from '@testing-library/react';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { IntlProvider } from 'react-intl';
import RelationSingle from '../index';

View File

@ -1,9 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { useIntl } from 'react-intl';
import { Badge, Box, Typography, SimpleMenu, MenuItem } from '@strapi/design-system';
import { Badge, Box, MenuItem, SimpleMenu, Typography } from '@strapi/design-system';
import { stopPropagation } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import styled from 'styled-components';
import CellValue from '../CellValue';

View File

@ -1,7 +1,8 @@
import React from 'react';
import { Tooltip, Typography } from '@strapi/design-system';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { Tooltip, Typography } from '@strapi/design-system';
import CellValue from '../CellValue';

View File

@ -1,14 +1,16 @@
import React from 'react';
import { Tooltip, Typography } from '@strapi/design-system';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { Typography, Tooltip } from '@strapi/design-system';
import CellValue from './CellValue';
import Media from './Media';
import MultipleMedias from './MultipleMedias';
import RelationMultiple from './RelationMultiple';
import RelationSingle from './RelationSingle';
import RepeatableComponent from './RepeatableComponent';
import SingleComponent from './SingleComponent';
import CellValue from './CellValue';
import hasContent from './utils/hasContent';
import isSingleRelation from './utils/isSingleRelation';

View File

@ -1,4 +1,5 @@
import React from 'react';
import { render } from '@testing-library/react';
import { IntlProvider } from 'react-intl';

View File

@ -1,9 +1,10 @@
import isEmpty from 'lodash/isEmpty';
import isNumber from 'lodash/isNumber';
import isSingleRelation from './isSingleRelation';
import isFieldTypeNumber from '../../../../utils/isFieldTypeNumber';
import isSingleRelation from './isSingleRelation';
export default function hasContent(type, content, metadatas, fieldSchema) {
if (type === 'component') {
const {

View File

@ -1,8 +1,10 @@
import React from 'react';
import { Button, Dialog, DialogBody, DialogFooter, Flex, Typography } from '@strapi/design-system';
import { ExclamationMarkCircle, Trash } from '@strapi/icons';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { Dialog, DialogBody, DialogFooter, Flex, Typography, Button } from '@strapi/design-system';
import { ExclamationMarkCircle, Trash } from '@strapi/icons';
import InjectionZoneList from '../../InjectionZoneList';
const ConfirmDialogDelete = ({ isConfirmButtonLoading, isOpen, onToggleDialog, onConfirm }) => {

View File

@ -1,18 +1,14 @@
import React from 'react';
import { BaseCheckbox, Box, Flex, IconButton, Tbody, Td, Tr } from '@strapi/design-system';
import { onRowClick, stopPropagation, useTracking } from '@strapi/helper-plugin';
import { Duplicate, Pencil, Trash } from '@strapi/icons';
import PropTypes from 'prop-types';
import { Link, useHistory } from 'react-router-dom';
import { useIntl } from 'react-intl';
import { BaseCheckbox, Box, IconButton, Tbody, Td, Tr, Flex } from '@strapi/design-system';
import { Trash, Duplicate, Pencil } from '@strapi/icons';
import { useTracking, stopPropagation, onRowClick } from '@strapi/helper-plugin';
import { usePluginsQueryParams } from '../../../hooks';
import { Link, useHistory } from 'react-router-dom';
import { getFullName } from '../../../../utils';
import { usePluginsQueryParams } from '../../../hooks';
import CellContent from '../CellContent';
const TableRows = ({

View File

@ -1,17 +1,19 @@
import React, { useMemo } from 'react';
import { DynamicTable as Table, useStrapiApp } from '@strapi/helper-plugin';
import getReviewWorkflowsColumn from 'ee_else_ce/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { DynamicTable as Table, useStrapiApp } from '@strapi/helper-plugin';
import { useSelector } from 'react-redux';
import getReviewWorkflowsColumn from 'ee_else_ce/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn';
import { INJECT_COLUMN_IN_TABLE } from '../../../exposedHooks';
import { selectDisplayedHeaders } from '../../pages/ListView/selectors';
import { getTrad } from '../../utils';
import TableRows from './TableRows';
import ConfirmDialogDelete from './ConfirmDialogDelete';
import { PublicationState } from './CellContent/PublicationState/PublicationState';
import BulkActionsBar from './BulkActionsBar';
import { PublicationState } from './CellContent/PublicationState/PublicationState';
import ConfirmDialogDelete from './ConfirmDialogDelete';
import TableRows from './TableRows';
const DynamicTable = ({
canCreate,

View File

@ -5,10 +5,11 @@
*/
import React from 'react';
import { BaseButton, Flex, Typography } from '@strapi/design-system';
import { PlusCircle } from '@strapi/icons';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { PlusCircle } from '@strapi/icons';
import { BaseButton, Flex, Typography } from '@strapi/design-system';
export const AddComponentButton = ({ hasError, isDisabled, isOpen, children, onClick }) => {
return (

View File

@ -5,12 +5,12 @@
*/
import React from 'react';
import { Box, Flex, Typography } from '@strapi/design-system';
import { pxToRem } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { Box, Typography, Flex } from '@strapi/design-system';
import { pxToRem } from '@strapi/helper-plugin';
import { ComponentIcon } from '../../ComponentIcon';
const ComponentBox = styled(Box)`

View File

@ -1,16 +1,17 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
Accordion,
AccordionToggle,
AccordionContent,
AccordionToggle,
Box,
Flex,
Typography,
} from '@strapi/design-system';
import { pxToRem } from '@strapi/helper-plugin';
import styled from 'styled-components';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import styled from 'styled-components';
import { ComponentIcon } from '../../ComponentIcon';

View File

@ -1,7 +1,8 @@
import React, { useEffect, useState } from 'react';
import { Box, Flex, KeyboardNavigable, Typography } from '@strapi/design-system';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { KeyboardNavigable, Box, Flex, Typography } from '@strapi/design-system';
import { getTrad } from '../../../utils';

View File

@ -1,28 +1,27 @@
import React, { useEffect, useMemo, useState } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { useIntl } from 'react-intl';
import get from 'lodash/get';
import { getEmptyImage } from 'react-dnd-html5-backend';
import {
Accordion,
AccordionToggle,
AccordionContent,
IconButton,
AccordionToggle,
Box,
Flex,
IconButton,
VisuallyHidden,
} from '@strapi/design-system';
import { Menu, MenuItem } from '@strapi/design-system/v2';
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
import { Trash, Drag, More } from '@strapi/icons';
import { Drag, More, Trash } from '@strapi/icons';
import get from 'lodash/get';
import PropTypes from 'prop-types';
import { getEmptyImage } from 'react-dnd-html5-backend';
import { useIntl } from 'react-intl';
import styled from 'styled-components';
import { useContentTypeLayout, useDragAndDrop } from '../../../hooks';
import { composeRefs, getTrad, ItemTypes } from '../../../utils';
import FieldComponent from '../../FieldComponent';
import { ComponentIcon } from '../../ComponentIcon';
import FieldComponent from '../../FieldComponent';
export const DynamicComponent = ({
componentUid,

View File

@ -5,10 +5,11 @@
*/
import React from 'react';
import { useIntl } from 'react-intl';
import PropTypes from 'prop-types';
import { pxToRem } from '@strapi/helper-plugin';
import { Box, Flex, Typography } from '@strapi/design-system';
import { pxToRem } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
export const DynamicZoneLabel = ({
label,

View File

@ -1,7 +1,8 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { render as renderRTL } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { IntlProvider } from 'react-intl';
import { AddComponentButton } from '../AddComponentButton';

View File

@ -1,10 +1,9 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { fireEvent, render } from '@testing-library/react';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import GlobalStyle from '../../../../../components/GlobalStyle';
import ComponentCard from '../ComponentCard';
describe('ComponentCard', () => {

View File

@ -1,7 +1,8 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { render as renderRTL } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { IntlProvider } from 'react-intl';
import { ComponentCategory } from '../ComponentCategory';

View File

@ -1,7 +1,8 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { render as renderRTL } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { IntlProvider } from 'react-intl';
import { ComponentPicker } from '../ComponentPicker';

View File

@ -1,14 +1,15 @@
import React from 'react';
import { render as renderRTL, fireEvent } from '@testing-library/react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { fireEvent, render as renderRTL } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { IntlProvider } from 'react-intl';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import { IntlProvider } from 'react-intl';
import { DynamicComponent } from '../DynamicComponent';
import { layoutData, dynamicComponentsByCategory } from './fixtures';
import { dynamicComponentsByCategory, layoutData } from './fixtures';
jest.mock('../../../../hooks', () => ({
...jest.requireActual('../../../../hooks'),

View File

@ -1,9 +1,9 @@
import React from 'react';
import { IntlProvider } from 'react-intl';
import { render as renderRTL } from '@testing-library/react';
import { ThemeProvider, lightTheme, Tooltip } from '@strapi/design-system';
import { lightTheme, ThemeProvider, Tooltip } from '@strapi/design-system';
import { Earth } from '@strapi/icons';
import { render as renderRTL } from '@testing-library/react';
import { IntlProvider } from 'react-intl';
import { DynamicZoneLabel } from '../DynamicZoneLabel';

View File

@ -1,17 +1,17 @@
import React, { useMemo, useState } from 'react';
import PropTypes from 'prop-types';
import { Box, Flex, VisuallyHidden } from '@strapi/design-system';
import { NotAllowedInput, useNotification, useCMEditViewDataManager } from '@strapi/helper-plugin';
import { NotAllowedInput, useCMEditViewDataManager, useNotification } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { useContentTypeLayout } from '../../hooks';
import { getTrad } from '../../utils';
import { DynamicComponent } from './components/DynamicComponent';
import { AddComponentButton } from './components/AddComponentButton';
import { DynamicZoneLabel } from './components/DynamicZoneLabel';
import { ComponentPicker } from './components/ComponentPicker';
import { useContentTypeLayout } from '../../hooks';
import { DynamicComponent } from './components/DynamicComponent';
import { DynamicZoneLabel } from './components/DynamicZoneLabel';
const DynamicZone = ({ name, labelAction, fieldSchema, metadatas }) => {
// We cannot use the default props here

View File

@ -1,11 +1,12 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
import { render as renderRTL } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
import { IntlProvider } from 'react-intl';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import { IntlProvider } from 'react-intl';
import { DynamicZone } from '../index';

View File

@ -1,37 +1,35 @@
/* eslint-disable react/jsx-no-constructed-context-values */
import React, { useCallback, useEffect, useMemo, useRef, useReducer } from 'react';
import isEmpty from 'lodash/isEmpty';
import cloneDeep from 'lodash/cloneDeep';
import get from 'lodash/get';
import isEqual from 'lodash/isEqual';
import set from 'lodash/set';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { Prompt, Redirect } from 'react-router-dom';
import { flushSync } from 'react-dom';
import { useDispatch, useSelector } from 'react-redux';
import React, { useCallback, useEffect, useMemo, useReducer, useRef } from 'react';
import { Main } from '@strapi/design-system';
import {
LoadingIndicatorPage,
ContentManagerEditViewDataManagerContext,
getAPIInnerErrors,
getYupInnerErrors,
LoadingIndicatorPage,
useNotification,
useOverlayBlocker,
useTracking,
getYupInnerErrors,
getAPIInnerErrors,
} from '@strapi/helper-plugin';
import cloneDeep from 'lodash/cloneDeep';
import get from 'lodash/get';
import isEmpty from 'lodash/isEmpty';
import isEqual from 'lodash/isEqual';
import set from 'lodash/set';
import PropTypes from 'prop-types';
import { flushSync } from 'react-dom';
import { useIntl } from 'react-intl';
import { useDispatch, useSelector } from 'react-redux';
import { Prompt, Redirect } from 'react-router-dom';
import { createYupSchema, getTrad } from '../../utils';
import { usePrev } from '../../hooks';
import { clearSetModifiedDataOnly } from '../../sharedReducers/crudReducer/actions';
import selectCrudReducer from '../../sharedReducers/crudReducer/selectors';
import { createYupSchema, getTrad } from '../../utils';
import reducer, { initialState } from './reducer';
import { cleanData } from './utils';
import { clearSetModifiedDataOnly } from '../../sharedReducers/crudReducer/actions';
import { usePrev } from '../../hooks';
const EditViewDataManagerProvider = ({
allLayoutData,
allowedActions: { canRead, canUpdate },

View File

@ -1,14 +1,15 @@
import { generateNKeysBetween } from 'fractional-indexing';
import produce from 'immer';
import unset from 'lodash/unset';
import cloneDeep from 'lodash/cloneDeep';
import get from 'lodash/get';
import set from 'lodash/set';
import take from 'lodash/take';
import cloneDeep from 'lodash/cloneDeep';
import uniqBy from 'lodash/uniqBy';
import { generateNKeysBetween } from 'fractional-indexing';
import unset from 'lodash/unset';
import { getMaxTempKey } from '../../utils';
import { findAllAndReplace, moveFields } from './utils';
import { getMaxTempKey } from '../../utils';
const initialState = {
componentsDataStructure: {},

View File

@ -1,6 +1,7 @@
import get from 'lodash/get';
import isArray from 'lodash/isArray';
import isObject from 'lodash/isObject';
import { getInitialDataPathUsingTempKeys } from '../../../utils/paths';
/* eslint-disable indent */

View File

@ -1,3 +1,3 @@
export { default as moveFields } from './moveFields';
export { default as cleanData } from './cleanData';
export { findAllAndReplace } from './findAllAndReplace';
export { default as moveFields } from './moveFields';

View File

@ -1,8 +1,9 @@
import React from 'react';
import { Box, Flex, Typography } from '@strapi/design-system';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import styled from 'styled-components';
import { Box, Flex, Typography } from '@strapi/design-system';
const LabelAction = styled(Box)`
svg path {

View File

@ -1,22 +1,23 @@
/* eslint-disable import/no-cycle */
import React, { memo, useMemo } from 'react';
import PropTypes from 'prop-types';
import size from 'lodash/size';
import isEqual from 'lodash/isEqual';
import { useIntl } from 'react-intl';
import { Box, Flex, IconButton } from '@strapi/design-system';
import { NotAllowedInput } from '@strapi/helper-plugin';
import { Trash } from '@strapi/icons';
import { Box, IconButton, Flex } from '@strapi/design-system';
import isEqual from 'lodash/isEqual';
import size from 'lodash/size';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import connect from './utils/connect';
import select from './utils/select';
import Label from './Label';
import { useContentTypeLayout } from '../../hooks';
import { getTrad } from '../../utils';
import ComponentInitializer from '../ComponentInitializer';
import NonRepeatableComponent from '../NonRepeatableComponent';
import RepeatableComponent from '../RepeatableComponent';
import { useContentTypeLayout } from '../../hooks';
import { getTrad } from '../../utils';
import Label from './Label';
import connect from './utils/connect';
import select from './utils/select';
const FieldComponent = ({
addNonRepeatableComponentToField,

View File

@ -1,10 +1,11 @@
import { useMemo } from 'react';
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
import get from 'lodash/get';
import take from 'lodash/take';
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
import { getFieldName } from '../../../utils';
import { useContentTypeLayout } from '../../../hooks';
import { getFieldName } from '../../../utils';
function useSelect({ isFromDynamicZone, name }) {
const {

View File

@ -1,21 +1,22 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Box } from '@strapi/design-system';
import { useCustomFields } from '@strapi/helper-plugin';
import {
Date,
Boolean,
Component,
Date,
DynamicZone,
Email,
Enumeration,
Json,
Media,
Number,
Relation,
Text,
Uid,
Number,
Json,
Component,
DynamicZone,
} from '@strapi/icons';
import PropTypes from 'prop-types';
const iconByTypes = {
biginteger: <Number />,

View File

@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Typography } from '@strapi/design-system';
import PropTypes from 'prop-types';
export const Hint = ({ id, error, name, hint }) => {
if (hint.length === 0 || error) {

View File

@ -1,6 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Box } from '@strapi/design-system';
import PropTypes from 'prop-types';
import { useInjectionZone } from '../../../shared/hooks';
const InjectionZoneList = ({ area, ...props }) => {

View File

@ -1,5 +1,5 @@
import { FieldAction, Flex } from '@strapi/design-system';
import styled, { keyframes } from 'styled-components';
import { Flex, FieldAction } from '@strapi/design-system';
export const FieldActionWrapper = styled(FieldAction)`
svg {

View File

@ -1,19 +1,21 @@
import React, { useEffect, useState, useRef } from 'react';
import PropTypes from 'prop-types';
import React, { useEffect, useRef, useState } from 'react';
import { Flex, TextInput, Typography } from '@strapi/design-system';
import {
useAPIErrorHandler,
useCMEditViewDataManager,
useFetchClient,
useNotification,
useAPIErrorHandler,
} from '@strapi/helper-plugin';
import { CheckCircle, ExclamationMarkCircle, Loader, Refresh } from '@strapi/icons';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { Flex, TextInput, Typography } from '@strapi/design-system';
import { Refresh, CheckCircle, ExclamationMarkCircle, Loader } from '@strapi/icons';
import { getRequestUrl } from '../../utils';
import useDebounce from '../../../hooks/useDebounce';
import { getRequestUrl } from '../../utils';
import { FieldActionWrapper, LoadingWrapper, TextValidation } from './endActionStyle';
import UID_REGEX from './regex';
import { FieldActionWrapper, TextValidation, LoadingWrapper } from './endActionStyle';
const InputUID = ({
attribute,

View File

@ -1,10 +1,11 @@
import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { fireEvent, render, waitFor } from '@testing-library/react';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import { IntlProvider } from 'react-intl';
import userEvent from '@testing-library/user-event';
import { rest } from 'msw';
import { setupServer } from 'msw/node';
import { IntlProvider } from 'react-intl';
import InputUID from '../index';

View File

@ -1,16 +1,18 @@
import React, { memo, useMemo } from 'react';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { GenericInput, NotAllowedInput, useLibrary } from '@strapi/helper-plugin';
import get from 'lodash/get';
import isEqual from 'lodash/isEqual';
import omit from 'lodash/omit';
import take from 'lodash/take';
import isEqual from 'lodash/isEqual';
import { GenericInput, NotAllowedInput, useLibrary } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { useContentTypeLayout } from '../../hooks';
import { getFieldName } from '../../utils';
import Wysiwyg from '../Wysiwyg';
import InputUID from '../InputUID';
import { RelationInputDataManager } from '../RelationInputDataManager';
import Wysiwyg from '../Wysiwyg';
import { connect, generateOptions, getInputType, select, VALIDATIONS_TO_OMIT } from './utils';

View File

@ -1,6 +1,7 @@
import { useMemo } from 'react';
import get from 'lodash/get';
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
import get from 'lodash/get';
function useSelect(keys) {
const {

View File

@ -2,12 +2,14 @@
/* eslint-disable import/no-cycle */
import React, { useMemo } from 'react';
import { Box, Flex, Grid, GridItem } from '@strapi/design-system';
import PropTypes from 'prop-types';
import { Box, Grid, GridItem, Flex } from '@strapi/design-system';
import { useContentTypeLayout } from '../../hooks';
import useLazyComponents from '../../hooks/useLazyComponents';
import FieldComponent from '../FieldComponent';
import Inputs from '../Inputs';
import useLazyComponents from '../../hooks/useLazyComponents';
const NonRepeatableComponent = ({ componentUid, isFromDynamicZone, isNested, name }) => {
const { getComponentLayout } = useContentTypeLayout();

View File

@ -6,6 +6,7 @@
*/
import React, { memo, useMemo } from 'react';
import PropTypes from 'prop-types';
import md from './utils/mdRenderer';

View File

@ -1,6 +1,6 @@
/* eslint-disable prefer-template */
import { getLanguage, highlight, highlightAuto } from 'highlight.js';
import Markdown from 'markdown-it';
import { getLanguage, highlightAuto, highlight } from 'highlight.js';
import abbr from 'markdown-it-abbr';
import container from 'markdown-it-container';
import deflist from 'markdown-it-deflist';

View File

@ -1,37 +1,37 @@
import React, { useRef, useState, useMemo, useEffect } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { FixedSizeList as List } from 'react-window';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import {
Box,
Field,
FieldError,
FieldHint,
FieldLabel,
Icon,
Link,
Status,
TextButton,
Tooltip,
Typography,
VisuallyHidden,
} from '@strapi/design-system';
/**
* TODO: this will come in another PR.
*/
// eslint-disable-next-line no-restricted-imports
import { ReactSelect } from '@strapi/helper-plugin';
import {
Status,
Box,
Link,
Icon,
FieldLabel,
FieldError,
FieldHint,
Field,
TextButton,
Typography,
Tooltip,
VisuallyHidden,
} from '@strapi/design-system';
import { Cross, Refresh } from '@strapi/icons';
import PropTypes from 'prop-types';
import { FixedSizeList as List } from 'react-window';
import styled from 'styled-components';
import { usePrev } from '../../hooks';
import { Option } from './components/Option';
import { Relation } from './components/Relation';
import { RelationItem } from './components/RelationItem';
import { RelationList } from './components/RelationList';
import { Option } from './components/Option';
import { RELATION_GUTTER, RELATION_ITEM_HEIGHT } from './constants';
import { usePrev } from '../../hooks';
export const LinkEllipsis = styled(Link)`
display: block;

View File

@ -1,11 +1,11 @@
import React from 'react';
import styled from 'styled-components';
import { components } from 'react-select';
import { useIntl } from 'react-intl';
import PropTypes from 'prop-types';
import { pxToRem } from '@strapi/helper-plugin';
import { Flex, Typography } from '@strapi/design-system';
import { pxToRem } from '@strapi/helper-plugin';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { components } from 'react-select';
import styled from 'styled-components';
import { getTrad } from '../../../utils';

Some files were not shown because too many files have changed in this diff Show More