@atlaskit/media-card 79.15.8 → 79.15.9
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/CHANGELOG.md +6 -0
- package/example-helpers/svg-helpers/cardContainer.tsx +9 -3
- package/example-helpers/svg-helpers/controls.tsx +1 -1
- package/example-helpers/svg-helpers/dimensionPicker.tsx +2 -2
- package/example-helpers/svg-helpers/mediaApiTweaks.ts +6 -6
- package/example-helpers/svg-helpers/svgContainer.tsx +2 -2
- package/example-helpers/svg-helpers/toggle.tsx +1 -1
- package/example-helpers/svg-helpers/uploader.ts +6 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,10 +4,16 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
|
|
10
|
-
export const CardBox = ({
|
|
10
|
+
export const CardBox = ({
|
|
11
|
+
title,
|
|
12
|
+
children,
|
|
13
|
+
}: {
|
|
14
|
+
title: string;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}): jsx.JSX.Element => (
|
|
11
17
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
12
18
|
<div style={{ marginBottom: '10px' }}>
|
|
13
19
|
{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/design-system/use-heading -- Ignored via go/DSP-18766 */}
|
|
@@ -16,7 +22,7 @@ export const CardBox = ({ title, children }: { title: string; children: React.Re
|
|
|
16
22
|
</div>
|
|
17
23
|
);
|
|
18
24
|
|
|
19
|
-
export const CardRow = ({ children }: { children: React.ReactNode }) => (
|
|
25
|
+
export const CardRow = ({ children }: { children: React.ReactNode }): jsx.JSX.Element => (
|
|
20
26
|
<div
|
|
21
27
|
style={{
|
|
22
28
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -17,6 +17,6 @@ const controlsBoxStyles = xcss({
|
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
export const ControlsBox = ({ children }: { children: ReactNode }) => (
|
|
20
|
+
export const ControlsBox = ({ children }: { children: ReactNode }): React.JSX.Element => (
|
|
21
21
|
<Box xcss={controlsBoxStyles}>{children}</Box>
|
|
22
22
|
);
|
|
@@ -29,7 +29,7 @@ export const DimensionPicker = ({
|
|
|
29
29
|
targetName: string;
|
|
30
30
|
dimensionName: string;
|
|
31
31
|
onChange: OnValue;
|
|
32
|
-
}) => {
|
|
32
|
+
}): React.JSX.Element => {
|
|
33
33
|
const rangeId = `range-${targetName}-${dimensionName}`;
|
|
34
34
|
|
|
35
35
|
const [isPercent, setIsPercent] = useState(initialUnit === '%');
|
|
@@ -83,7 +83,7 @@ export const DimensionsPicker = ({
|
|
|
83
83
|
onContainerHeight: OnValue;
|
|
84
84
|
onImageWidth: OnValue;
|
|
85
85
|
onImageHeight: OnValue;
|
|
86
|
-
}) => {
|
|
86
|
+
}): React.JSX.Element => {
|
|
87
87
|
return (
|
|
88
88
|
<Flex alignItems="stretch" direction="row" xcss={wrapperStyles}>
|
|
89
89
|
<DimensionPicker
|
|
@@ -7,7 +7,7 @@ type Endpoints = Partial<Record<keyof MediaApi, number>>;
|
|
|
7
7
|
export const delayApiResponses = (
|
|
8
8
|
mediaApi: MediaApi,
|
|
9
9
|
{ getImage, getItems, getFileBinary }: Endpoints,
|
|
10
|
-
) => {
|
|
10
|
+
): void => {
|
|
11
11
|
const baseGetImage = mediaApi.getImage;
|
|
12
12
|
mediaApi.getImage = async (...params) => {
|
|
13
13
|
await sleep(getImage);
|
|
@@ -28,7 +28,7 @@ export const delayApiResponses = (
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export const errorApiResponses = {
|
|
31
|
-
getFileBinary: (mediaApi: MediaApi, error?: Error) => {
|
|
31
|
+
getFileBinary: (mediaApi: MediaApi, error?: Error): void => {
|
|
32
32
|
mediaApi.getFileBinary = async () => {
|
|
33
33
|
throw (
|
|
34
34
|
error ||
|
|
@@ -39,7 +39,7 @@ export const errorApiResponses = {
|
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
41
|
},
|
|
42
|
-
getFileImage: (mediaApi: MediaApi, error?: Error) => {
|
|
42
|
+
getFileImage: (mediaApi: MediaApi, error?: Error): void => {
|
|
43
43
|
mediaApi.getImage = async () => {
|
|
44
44
|
throw (
|
|
45
45
|
error ||
|
|
@@ -50,7 +50,7 @@ export const errorApiResponses = {
|
|
|
50
50
|
);
|
|
51
51
|
};
|
|
52
52
|
},
|
|
53
|
-
getArtifactBinary: (mediaApi: MediaApi, error?: Error) => {
|
|
53
|
+
getArtifactBinary: (mediaApi: MediaApi, error?: Error): void => {
|
|
54
54
|
mediaApi.getArtifactBinary = async (...params) => {
|
|
55
55
|
throw (
|
|
56
56
|
error ||
|
|
@@ -61,7 +61,7 @@ export const errorApiResponses = {
|
|
|
61
61
|
);
|
|
62
62
|
};
|
|
63
63
|
},
|
|
64
|
-
uploadArtifact: (mediaApi: MediaApi, error?: Error) => {
|
|
64
|
+
uploadArtifact: (mediaApi: MediaApi, error?: Error): void => {
|
|
65
65
|
mediaApi.uploadArtifact = async (...params) => {
|
|
66
66
|
throw (
|
|
67
67
|
error ||
|
|
@@ -72,7 +72,7 @@ export const errorApiResponses = {
|
|
|
72
72
|
);
|
|
73
73
|
};
|
|
74
74
|
},
|
|
75
|
-
deleteArtifact: (mediaApi: MediaApi, error?: Error) => {
|
|
75
|
+
deleteArtifact: (mediaApi: MediaApi, error?: Error): void => {
|
|
76
76
|
mediaApi.deleteArtifact = async (...params) => {
|
|
77
77
|
throw (
|
|
78
78
|
error ||
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
@@ -28,7 +28,7 @@ export const SvgContainer = ({
|
|
|
28
28
|
children: React.ReactNode;
|
|
29
29
|
width?: string;
|
|
30
30
|
height?: string;
|
|
31
|
-
}) => {
|
|
31
|
+
}): jsx.JSX.Element => {
|
|
32
32
|
return (
|
|
33
33
|
<Box xcss={containerStyles} style={{ width, height }}>
|
|
34
34
|
{children}
|
|
@@ -3,12 +3,16 @@ import { type SyntheticEvent, useState } from 'react';
|
|
|
3
3
|
import { type FileIdentifier } from '@atlaskit/media-client';
|
|
4
4
|
import { useMediaClient } from '@atlaskit/media-client-react';
|
|
5
5
|
|
|
6
|
-
export const useSvgUploader = (collectionName?: string)
|
|
6
|
+
export const useSvgUploader = (collectionName?: string): {
|
|
7
|
+
status: string;
|
|
8
|
+
identifier: FileIdentifier | undefined;
|
|
9
|
+
uploadFn: (event: SyntheticEvent<HTMLInputElement>) => Promise<void>;
|
|
10
|
+
} => {
|
|
7
11
|
const mediaClient = useMediaClient();
|
|
8
12
|
const [identifier, setIdentifier] = useState<FileIdentifier>();
|
|
9
13
|
const [status, setStatus] = useState<string>('');
|
|
10
14
|
|
|
11
|
-
const uploadFn = async (event: SyntheticEvent<HTMLInputElement>) => {
|
|
15
|
+
const uploadFn = async (event: SyntheticEvent<HTMLInputElement>): Promise<void> => {
|
|
12
16
|
if (!event.currentTarget.files || !event.currentTarget.files.length) {
|
|
13
17
|
return;
|
|
14
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "79.15.
|
|
3
|
+
"version": "79.15.9",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/spinner": "^19.0.0",
|
|
50
50
|
"@atlaskit/theme": "^22.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^11.1.0",
|
|
52
|
-
"@atlaskit/tooltip": "^
|
|
52
|
+
"@atlaskit/tooltip": "^21.0.0",
|
|
53
53
|
"@atlaskit/ufo": "^0.4.0",
|
|
54
54
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
55
55
|
"@babel/runtime": "^7.0.0",
|