@centreon/ui 23.10.48 → 23.10.50
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/package.json +6 -6
- package/src/Dashboard/Dashboard.styles.ts +21 -18
- package/src/Dashboard/Item.tsx +2 -2
- package/src/Image/Image.tsx +11 -1
- package/src/RichTextEditor/ContentEditable.tsx +1 -1
- package/src/RichTextEditor/RichTextEditor.cypress.spec.tsx +1 -1
- package/src/RichTextEditor/plugins/FloatingLinkEditorPlugin.tsx +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@centreon/ui",
|
|
3
|
-
"version": "23.10.
|
|
3
|
+
"version": "23.10.50",
|
|
4
4
|
"description": "Centreon UI Components",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
"vite-plugin-turbosnap": "^1.0.2"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@lexical/link": "0.
|
|
105
|
-
"@lexical/react": "0.
|
|
106
|
-
"@lexical/selection": "0.
|
|
107
|
-
"@lexical/utils": "0.
|
|
104
|
+
"@lexical/link": "0.11.3",
|
|
105
|
+
"@lexical/react": "0.11.3",
|
|
106
|
+
"@lexical/selection": "0.11.3",
|
|
107
|
+
"@lexical/utils": "0.11.3",
|
|
108
108
|
"@visx/curve": "^2.1.0",
|
|
109
109
|
"@visx/pattern": "^3.0.0",
|
|
110
110
|
"@visx/scale": "^3.0.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"anylogger": "^1.0.11",
|
|
115
115
|
"d3-array": "3.2.0",
|
|
116
116
|
"humanize-duration": "^3.27.3",
|
|
117
|
-
"lexical": "0.
|
|
117
|
+
"lexical": "0.11.3",
|
|
118
118
|
"notistack": "^2.0.8",
|
|
119
119
|
"react-grid-layout": "^1.3.4",
|
|
120
120
|
"react-html-parser": "^2.0.2",
|
|
@@ -66,22 +66,25 @@ export const useDashboardLayoutStyles = makeStyles<boolean>()(
|
|
|
66
66
|
})
|
|
67
67
|
);
|
|
68
68
|
|
|
69
|
-
export const useDashboardItemStyles = makeStyles()(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
widgetContent: {
|
|
75
|
-
height: '100%'
|
|
76
|
-
},
|
|
77
|
-
widgetHeader: {
|
|
78
|
-
'&:hover': {
|
|
79
|
-
backgroundColor: theme.palette.action.hover
|
|
69
|
+
export const useDashboardItemStyles = makeStyles<{ hasHeader: boolean }>()(
|
|
70
|
+
(theme, { hasHeader }) => ({
|
|
71
|
+
widgetContainer: {
|
|
72
|
+
height: '100%',
|
|
73
|
+
width: '100%'
|
|
80
74
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
75
|
+
widgetContent: {
|
|
76
|
+
height: '100%'
|
|
77
|
+
},
|
|
78
|
+
widgetHeader: {
|
|
79
|
+
'&:hover': {
|
|
80
|
+
backgroundColor: theme.palette.action.hover
|
|
81
|
+
},
|
|
82
|
+
cursor: 'move',
|
|
83
|
+
padding: theme.spacing(0.5, 2)
|
|
84
|
+
},
|
|
85
|
+
widgetPadding: {
|
|
86
|
+
overflowX: 'auto',
|
|
87
|
+
padding: hasHeader ? theme.spacing(1, 2, 2) : theme.spacing(1, 2)
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
);
|
package/src/Dashboard/Item.tsx
CHANGED
|
@@ -41,10 +41,10 @@ const Item = forwardRef(
|
|
|
41
41
|
}: DashboardItemProps,
|
|
42
42
|
ref: ForwardedRef<HTMLDivElement>
|
|
43
43
|
): ReactElement => {
|
|
44
|
-
const { classes, cx } = useDashboardItemStyles();
|
|
45
|
-
|
|
46
44
|
const hasHeader = !isNil(header);
|
|
47
45
|
|
|
46
|
+
const { classes, cx } = useDashboardItemStyles({ hasHeader });
|
|
47
|
+
|
|
48
48
|
const listeners = {
|
|
49
49
|
onMouseDown,
|
|
50
50
|
onMouseUp,
|
package/src/Image/Image.tsx
CHANGED
|
@@ -22,6 +22,10 @@ interface Props {
|
|
|
22
22
|
|
|
23
23
|
const useStyles = makeStyles<Pick<Props, 'width' | 'height' | 'variant'>>()(
|
|
24
24
|
(_, { width, height, variant }) => ({
|
|
25
|
+
fallbackContainer: {
|
|
26
|
+
height: '100%',
|
|
27
|
+
width: '100%'
|
|
28
|
+
},
|
|
25
29
|
imageContent: {
|
|
26
30
|
height,
|
|
27
31
|
objectFit: variant,
|
|
@@ -41,14 +45,20 @@ const ImageContent = ({
|
|
|
41
45
|
}: Props): JSX.Element => {
|
|
42
46
|
const { classes, cx } = useStyles({ height, variant, width });
|
|
43
47
|
const isImageLoaded = useLoadImage({ alt, imageSrc: imagePath });
|
|
48
|
+
|
|
44
49
|
if (!isImageLoaded) {
|
|
45
|
-
return
|
|
50
|
+
return (
|
|
51
|
+
<div className={classes.fallbackContainer} data-testid={alt}>
|
|
52
|
+
{fallback}
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
return (
|
|
49
58
|
<img
|
|
50
59
|
alt={alt}
|
|
51
60
|
className={cx(classes.imageContent, className)}
|
|
61
|
+
data-testid={alt}
|
|
52
62
|
src={imagePath}
|
|
53
63
|
/>
|
|
54
64
|
);
|
|
@@ -106,7 +106,12 @@ const FloatingLinkEditor = ({
|
|
|
106
106
|
const yOffset = tooltipPosition.y - rootElementY + 30;
|
|
107
107
|
|
|
108
108
|
return (
|
|
109
|
-
<Popper
|
|
109
|
+
<Popper
|
|
110
|
+
open
|
|
111
|
+
anchorEl={rootElement}
|
|
112
|
+
placement="top-start"
|
|
113
|
+
sx={{ zIndex: 'tooltip' }}
|
|
114
|
+
>
|
|
110
115
|
<Paper
|
|
111
116
|
sx={{
|
|
112
117
|
transform: `translate3d(${xOffset}px, ${
|