@strapi/admin 4.10.1 → 4.10.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/admin/src/components/AuthenticatedApp/index.js +19 -24
  2. package/admin/src/components/DragLayer/DragLayer.js +53 -0
  3. package/admin/src/components/DragLayer/index.js +1 -0
  4. package/admin/src/components/LeftMenu/index.js +2 -2
  5. package/admin/src/components/Providers/index.js +11 -7
  6. package/admin/src/content-manager/contexts/index.js +0 -1
  7. package/admin/src/content-manager/hooks/index.js +0 -1
  8. package/admin/src/content-manager/hooks/useLazyComponents/index.js +7 -3
  9. package/admin/src/content-manager/hooks/useRelation/useRelation.js +1 -3
  10. package/admin/src/content-manager/pages/{ListSettingsView/components/CardPreview.js → App/components/CardDragPreview.js} +28 -28
  11. package/admin/src/content-manager/pages/App/components/ComponentDragPreview.js +75 -0
  12. package/admin/src/content-manager/{components/DragLayer → pages/App/components}/RelationDragPreview.js +7 -4
  13. package/admin/src/content-manager/pages/App/index.js +39 -2
  14. package/admin/src/content-manager/pages/EditSettingsView/components/ComponentFieldList.js +1 -1
  15. package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFieldButton.js +1 -1
  16. package/admin/src/content-manager/pages/EditSettingsView/components/DynamicZoneList.js +1 -1
  17. package/admin/src/content-manager/pages/EditSettingsView/components/FormModal.js +1 -1
  18. package/admin/src/content-manager/{components → pages/EditSettingsView/components}/LayoutDndProvider/index.js +3 -4
  19. package/admin/src/content-manager/pages/EditSettingsView/components/LinkToCTB.js +1 -1
  20. package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +1 -1
  21. package/admin/src/content-manager/pages/EditSettingsView/components/RowItemsLayout.js +1 -1
  22. package/admin/src/content-manager/pages/EditSettingsView/hooks/useLayoutDnd.js +6 -0
  23. package/admin/src/content-manager/pages/EditSettingsView/index.js +1 -1
  24. package/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js +6 -6
  25. package/admin/src/hooks/useMenu/index.js +2 -2
  26. package/admin/src/hooks/useReleaseNotification/index.js +2 -2
  27. package/admin/src/hooks/useSettingsMenu/index.js +2 -2
  28. package/admin/src/pages/Admin/Onboarding/index.js +2 -2
  29. package/admin/src/pages/App/index.js +2 -2
  30. package/admin/src/pages/HomePage/SocialLinks.js +2 -2
  31. package/admin/src/pages/MarketplacePage/index.js +2 -2
  32. package/admin/src/pages/ProfilePage/index.js +2 -2
  33. package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +2 -2
  34. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/updateValues.js +3 -3
  35. package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +2 -2
  36. package/admin/src/translations/fr.json +1 -1
  37. package/build/{5563.905daa13.chunk.js → 5563.986609ed.chunk.js} +2 -2
  38. package/build/{7259.b7d00cea.chunk.js → 7259.7a48aa2f.chunk.js} +1 -1
  39. package/build/7725.f717acdd.chunk.js +213 -0
  40. package/build/Admin-authenticatedApp.2fab70e4.chunk.js +79 -0
  41. package/build/{Admin_InternalErrorPage.15c6bf07.chunk.js → Admin_InternalErrorPage.96ceaae1.chunk.js} +1 -1
  42. package/build/{Admin_homePage.f9309c6d.chunk.js → Admin_homePage.9f7c0bb1.chunk.js} +5 -5
  43. package/build/{Admin_marketplace.56bc1008.chunk.js → Admin_marketplace.a60cde15.chunk.js} +5 -5
  44. package/build/{Admin_pluginsPage.f6b52ee9.chunk.js → Admin_pluginsPage.9e6fa51c.chunk.js} +1 -1
  45. package/build/{Admin_profilePage.9112cffc.chunk.js → Admin_profilePage.1b337b73.chunk.js} +2 -2
  46. package/build/{Admin_settingsPage.4604a16c.chunk.js → Admin_settingsPage.56e9641c.chunk.js} +2 -2
  47. package/build/{Upload_ConfigureTheView.eaaec495.chunk.js → Upload_ConfigureTheView.4fc648b5.chunk.js} +1 -1
  48. package/build/admin-app.9bfe4ec7.chunk.js +63 -0
  49. package/build/{admin-edit-roles-page.8a4063f7.chunk.js → admin-edit-roles-page.d0c9497b.chunk.js} +24 -24
  50. package/build/{admin-edit-users.7e14d85f.chunk.js → admin-edit-users.ba27c532.chunk.js} +2 -2
  51. package/build/{admin-roles-list.329c1f63.chunk.js → admin-roles-list.c759daa3.chunk.js} +1 -1
  52. package/build/{admin-users.d02de059.chunk.js → admin-users.ad5dd832.chunk.js} +2 -2
  53. package/build/{api-tokens-create-page.97595e12.chunk.js → api-tokens-create-page.973d2816.chunk.js} +1 -1
  54. package/build/{api-tokens-edit-page.cd36e30e.chunk.js → api-tokens-edit-page.29725c5e.chunk.js} +1 -1
  55. package/build/{api-tokens-list-page.6757c7b9.chunk.js → api-tokens-list-page.66c4fbdd.chunk.js} +2 -2
  56. package/build/{audit-logs-settings-page.19d90bda.chunk.js → audit-logs-settings-page.45cb4fb5.chunk.js} +1 -1
  57. package/build/content-manager.a0ff6cad.chunk.js +1111 -0
  58. package/build/{content-type-builder-list-view.9c2c020c.chunk.js → content-type-builder-list-view.5ff685ec.chunk.js} +1 -1
  59. package/build/{content-type-builder.68af11d2.chunk.js → content-type-builder.4737a30c.chunk.js} +3 -3
  60. package/build/{email-settings-page.1095e1ab.chunk.js → email-settings-page.dc07d518.chunk.js} +1 -1
  61. package/build/{fr-json.5947cf63.chunk.js → fr-json.73494bf5.chunk.js} +1 -1
  62. package/build/{i18n-settings-page.d95b32df.chunk.js → i18n-settings-page.8219dd99.chunk.js} +1 -1
  63. package/build/index.html +1 -1
  64. package/build/main.964e7203.js +2597 -0
  65. package/build/{review-workflows-settings.f7890c40.chunk.js → review-workflows-settings.089d7ec5.chunk.js} +1 -1
  66. package/build/{runtime~main.d4c8d6a2.js → runtime~main.c9593d59.js} +1 -1
  67. package/build/{sso-settings-page.1dd4886e.chunk.js → sso-settings-page.f44d95d8.chunk.js} +1 -1
  68. package/build/{transfer-tokens-create-page.ec2ca215.chunk.js → transfer-tokens-create-page.170acee6.chunk.js} +1 -1
  69. package/build/{transfer-tokens-edit-page.22bf28e5.chunk.js → transfer-tokens-edit-page.6cf23295.chunk.js} +1 -1
  70. package/build/{transfer-tokens-list-page.cf8c77f2.chunk.js → transfer-tokens-list-page.c3fec4c1.chunk.js} +2 -2
  71. package/build/{upload-settings.945fdcfa.chunk.js → upload-settings.dd2d987c.chunk.js} +1 -1
  72. package/build/{upload.a86b1054.chunk.js → upload.c8479232.chunk.js} +1 -1
  73. package/build/{users-advanced-settings-page.5b5a9baa.chunk.js → users-advanced-settings-page.c36cfd59.chunk.js} +1 -1
  74. package/build/{users-email-settings-page.e5506eb4.chunk.js → users-email-settings-page.2716ce8e.chunk.js} +5 -5
  75. package/build/{users-providers-settings-page.e32089c2.chunk.js → users-providers-settings-page.0d6304a5.chunk.js} +1 -1
  76. package/build/{users-roles-settings-page.20656f92.chunk.js → users-roles-settings-page.eeb3a339.chunk.js} +1 -1
  77. package/build/{webhook-edit-page.a3b62049.chunk.js → webhook-edit-page.f4db86f3.chunk.js} +2 -2
  78. package/build/{webhook-list-page.ca38eeef.chunk.js → webhook-list-page.30d73114.chunk.js} +1 -1
  79. package/ee/server/services/review-workflows/review-workflows.js +1 -1
  80. package/ee/server/utils/persisted-tables.js +3 -0
  81. package/jest.config.front.js +1 -0
  82. package/package.json +9 -9
  83. package/admin/src/components/AutoReloadOverlayBlockerProvider/Blocker.js +0 -95
  84. package/admin/src/components/AutoReloadOverlayBlockerProvider/Overlay.js +0 -42
  85. package/admin/src/components/AutoReloadOverlayBlockerProvider/index.js +0 -99
  86. package/admin/src/components/Notifications/Notification/index.js +0 -159
  87. package/admin/src/components/Notifications/index.js +0 -46
  88. package/admin/src/components/Notifications/reducer.js +0 -47
  89. package/admin/src/components/OverlayBlocker/index.js +0 -67
  90. package/admin/src/content-manager/components/DragLayer/ComponentDragPreview.js +0 -83
  91. package/admin/src/content-manager/components/DragLayer/index.js +0 -85
  92. package/admin/src/content-manager/contexts/LayoutDnd.js +0 -5
  93. package/admin/src/content-manager/hooks/useCallbackRef.js +0 -23
  94. package/admin/src/content-manager/hooks/useLayoutDnd.js +0 -6
  95. package/admin/src/content-manager/pages/ListSettingsView/utils/ellipsisCardTitle.js +0 -7
  96. package/build/8694.6522968d.chunk.js +0 -247
  97. package/build/Admin-authenticatedApp.5562aedc.chunk.js +0 -79
  98. package/build/admin-app.014adc27.chunk.js +0 -110
  99. package/build/content-manager.84f81966.chunk.js +0 -1130
  100. package/build/main.841e0dcb.js +0 -2280
@@ -1,67 +0,0 @@
1
- /**
2
- *
3
- * OverlayBlockerProvider
4
- *
5
- */
6
- import React, { useEffect, useState } from 'react';
7
- import ReactDOM from 'react-dom';
8
- import PropTypes from 'prop-types';
9
- import styled from 'styled-components';
10
- import { OverlayBlockerContext } from '@strapi/helper-plugin';
11
-
12
- const overlayContainer = document.createElement('div');
13
- overlayContainer.setAttribute('id', 'overlayBlocker');
14
-
15
- const Overlay = styled.div`
16
- position: fixed;
17
- top: 0;
18
- right: 0;
19
- bottom: 0;
20
- left: 0;
21
- z-index: 1140;
22
- `;
23
-
24
- const Portal = ({ isOpen }) => {
25
- useEffect(() => {
26
- document.body.appendChild(overlayContainer);
27
-
28
- return () => {
29
- document.body.removeChild(overlayContainer);
30
- };
31
- }, []);
32
-
33
- if (isOpen) {
34
- return ReactDOM.createPortal(<Overlay />, overlayContainer);
35
- }
36
-
37
- return null;
38
- };
39
-
40
- Portal.propTypes = {
41
- isOpen: PropTypes.bool.isRequired,
42
- };
43
-
44
- const OverlayBlockerProvider = ({ children }) => {
45
- const [isOpen, setIsOpen] = useState(false);
46
-
47
- const lockApp = () => {
48
- setIsOpen(true);
49
- };
50
-
51
- const unlockApp = () => {
52
- setIsOpen(false);
53
- };
54
-
55
- return (
56
- <OverlayBlockerContext.Provider value={{ lockApp, unlockApp }}>
57
- {children}
58
- <Portal isOpen={isOpen} />
59
- </OverlayBlockerContext.Provider>
60
- );
61
- };
62
-
63
- OverlayBlockerProvider.propTypes = {
64
- children: PropTypes.node.isRequired,
65
- };
66
-
67
- export default OverlayBlockerProvider;
@@ -1,83 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
4
- import { pxToRem } from '@strapi/helper-plugin';
5
- import { Box, Flex, Typography, IconButton } from '@strapi/design-system';
6
- import { Trash, Drag, CarretDown } from '@strapi/icons';
7
-
8
- const DragPreviewBox = styled(Box)`
9
- border: 1px solid ${({ theme }) => theme.colors.neutral200};
10
- `;
11
-
12
- const DropdownIconWrapper = styled(Box)`
13
- height: ${32 / 16}rem;
14
- width: ${32 / 16}rem;
15
- border-radius: 50%;
16
- display: flex;
17
- align-items: center;
18
- justify-content: center;
19
-
20
- svg {
21
- height: ${6 / 16}rem;
22
- width: ${11 / 16}rem;
23
- > path {
24
- fill: ${({ theme }) => theme.colors.neutral600};
25
- }
26
- }
27
- `;
28
-
29
- const ToggleButton = styled.button`
30
- border: none;
31
- background: transparent;
32
- display: block;
33
- width: 100%;
34
- text-align: unset;
35
- padding: 0;
36
- `;
37
-
38
- const DragPreview = ({ displayedValue }) => {
39
- return (
40
- <DragPreviewBox
41
- paddingLeft={3}
42
- paddingRight={3}
43
- paddingTop={3}
44
- paddingBottom={3}
45
- hasRadius
46
- background="neutral0"
47
- width={pxToRem(300)}
48
- >
49
- <Flex justifyContent="space-between">
50
- <ToggleButton type="button">
51
- <Flex>
52
- <DropdownIconWrapper background="neutral200">
53
- <CarretDown />
54
- </DropdownIconWrapper>
55
- <Flex gap={2} paddingLeft={6} maxWidth={pxToRem(150)}>
56
- <Typography textColor="neutral700" ellipsis>
57
- {displayedValue}
58
- </Typography>
59
- </Flex>
60
- </Flex>
61
- </ToggleButton>
62
- <Box paddingLeft={3}>
63
- <Flex>
64
- <IconButton noBorder>
65
- <Trash />
66
- </IconButton>
67
- <Box paddingLeft={2}>
68
- <IconButton noBorder>
69
- <Drag />
70
- </IconButton>
71
- </Box>
72
- </Flex>
73
- </Box>
74
- </Flex>
75
- </DragPreviewBox>
76
- );
77
- };
78
-
79
- DragPreview.propTypes = {
80
- displayedValue: PropTypes.string.isRequired,
81
- };
82
-
83
- export default DragPreview;
@@ -1,85 +0,0 @@
1
- import React from 'react';
2
- import { useDragLayer } from 'react-dnd';
3
- import LayoutDndProvider from '../LayoutDndProvider';
4
-
5
- import ItemTypes from '../../utils/ItemTypes';
6
- import CardPreview from '../../pages/ListSettingsView/components/CardPreview';
7
-
8
- import ComponentPreview from './ComponentDragPreview';
9
- import { RelationDragPreview } from './RelationDragPreview';
10
-
11
- const layerStyles = {
12
- position: 'fixed',
13
- pointerEvents: 'none',
14
- zIndex: 100,
15
- left: 0,
16
- top: 0,
17
- width: '100%',
18
- height: '100%',
19
- };
20
-
21
- function getItemStyles(initialOffset, currentOffset, mouseOffset) {
22
- if (!initialOffset || !currentOffset) {
23
- return { display: 'none' };
24
- }
25
-
26
- const { x, y } = mouseOffset;
27
- // TODO adjust
28
- const transform = `translate(${x}px, ${y}px)`;
29
-
30
- return {
31
- transform,
32
- WebkitTransform: transform,
33
- };
34
- }
35
-
36
- const CustomDragLayer = () => {
37
- const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer(
38
- (monitor) => ({
39
- item: monitor.getItem(),
40
- itemType: monitor.getItemType(),
41
- initialOffset: monitor.getInitialSourceClientOffset(),
42
- currentOffset: monitor.getSourceClientOffset(),
43
- isDragging: monitor.isDragging(),
44
- mouseOffset: monitor.getClientOffset(),
45
- })
46
- );
47
-
48
- if (!isDragging) {
49
- return null;
50
- }
51
-
52
- /**
53
- * Because a user may have multiple relations / dynamic zones / repeable fields in the same content type,
54
- * we append the fieldName for the item type to make them unique, however, we then want to extract that
55
- * first type to apply the correct preview.
56
- */
57
- const [actualType] = itemType.split('_');
58
-
59
- return (
60
- <LayoutDndProvider>
61
- <div style={layerStyles}>
62
- <div style={getItemStyles(initialOffset, currentOffset, mouseOffset)} className="col-md-2">
63
- {[ItemTypes.EDIT_FIELD, ItemTypes.FIELD].includes(itemType) && (
64
- <CardPreview labelField={item.labelField} />
65
- )}
66
- {actualType === ItemTypes.COMPONENT && (
67
- <ComponentPreview displayedValue={item.displayedValue} />
68
- )}
69
- {actualType === ItemTypes.DYNAMIC_ZONE && (
70
- <ComponentPreview displayedValue={item.displayedValue} />
71
- )}
72
- {actualType === ItemTypes.RELATION && (
73
- <RelationDragPreview
74
- displayedValue={item.displayedValue}
75
- status={item.status}
76
- width={item.width}
77
- />
78
- )}
79
- </div>
80
- </div>
81
- </LayoutDndProvider>
82
- );
83
- };
84
-
85
- export default CustomDragLayer;
@@ -1,5 +0,0 @@
1
- import { createContext } from 'react';
2
-
3
- const LayoutDndContext = createContext();
4
-
5
- export default LayoutDndContext;
@@ -1,23 +0,0 @@
1
- import * as React from 'react';
2
-
3
- /**
4
- * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
5
- * prop or avoid re-executing effects when passed as a dependency
6
- *
7
- * @type {<T extends (...args: any[]) => any>(callback: T | undefined) => T}
8
- */
9
- export const useCallbackRef = (callback) => {
10
- const callbackRef = React.useRef(callback);
11
-
12
- React.useEffect(() => {
13
- callbackRef.current = callback;
14
- });
15
-
16
- // https://github.com/facebook/react/issues/19240
17
- return React.useMemo(
18
- () =>
19
- (...args) =>
20
- callbackRef.current?.(...args),
21
- []
22
- );
23
- };
@@ -1,6 +0,0 @@
1
- import { useContext } from 'react';
2
- import LayoutDndContext from '../contexts/LayoutDnd';
3
-
4
- const useLayoutDnd = () => useContext(LayoutDndContext);
5
-
6
- export default useLayoutDnd;
@@ -1,7 +0,0 @@
1
- const ellipsisCardTitle = (title) => {
2
- const formatedTitle = title.length > 20 ? `${title.substring(0, 20)}...` : title;
3
-
4
- return formatedTitle;
5
- };
6
-
7
- export default ellipsisCardTitle;