@atlaskit/media-card 77.11.3 → 77.12.1
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 +20 -0
- package/dist/cjs/card/card.js +5 -5
- package/dist/cjs/card/cardView.js +6 -10
- package/dist/cjs/card/inlinePlayerWrapperStyles.js +1 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/styles.js +1 -12
- package/dist/cjs/card/ui/wrapper/imageContainer.js +52 -0
- package/dist/cjs/card/ui/wrapper/index.js +8 -1
- package/dist/cjs/card/ui/wrapper/styles.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/cardViewV2.js +12 -17
- package/dist/cjs/card/v2/cardviews/cardViewWrapper.js +5 -9
- package/dist/cjs/card/v2/fileCard.js +66 -20
- package/dist/cjs/card/v2/svgView/helpers.js +16 -0
- package/dist/cjs/card/v2/svgView/index.js +12 -0
- package/dist/cjs/card/v2/svgView/svgView.js +134 -0
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +11 -11
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +5 -5
- package/dist/es2019/card/cardView.js +8 -12
- package/dist/es2019/card/inlinePlayerWrapperStyles.js +12 -12
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/styles.js +0 -11
- package/dist/es2019/card/ui/wrapper/imageContainer.js +44 -0
- package/dist/es2019/card/ui/wrapper/index.js +2 -1
- package/dist/es2019/card/ui/wrapper/styles.js +21 -21
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/cardViewV2.js +13 -18
- package/dist/es2019/card/v2/cardviews/cardViewWrapper.js +6 -10
- package/dist/es2019/card/v2/fileCard.js +51 -8
- package/dist/es2019/card/v2/svgView/helpers.js +12 -0
- package/dist/es2019/card/v2/svgView/index.js +1 -0
- package/dist/es2019/card/v2/svgView/svgView.js +113 -0
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +11 -11
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +5 -5
- package/dist/esm/card/cardView.js +8 -12
- package/dist/esm/card/inlinePlayerWrapperStyles.js +1 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/styles.js +0 -11
- package/dist/esm/card/ui/wrapper/imageContainer.js +45 -0
- package/dist/esm/card/ui/wrapper/index.js +2 -1
- package/dist/esm/card/ui/wrapper/styles.js +1 -1
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/cardViewV2.js +13 -18
- package/dist/esm/card/v2/cardviews/cardViewWrapper.js +6 -10
- package/dist/esm/card/v2/fileCard.js +66 -20
- package/dist/esm/card/v2/svgView/helpers.js +10 -0
- package/dist/esm/card/v2/svgView/index.js +1 -0
- package/dist/esm/card/v2/svgView/svgView.js +123 -0
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +11 -11
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/ui/iconWrapper/styles.d.ts +1 -1
- package/dist/types/card/ui/styles.d.ts +0 -1
- package/dist/types/card/ui/titleBox/styles.d.ts +1 -1
- package/dist/types/card/ui/wrapper/imageContainer.d.ts +15 -0
- package/dist/types/card/ui/wrapper/index.d.ts +1 -0
- package/dist/types/card/v2/svgView/helpers.d.ts +3 -0
- package/dist/types/card/v2/svgView/index.d.ts +1 -0
- package/dist/types/card/v2/svgView/svgView.d.ts +31 -0
- package/dist/types/utils/preventClickThrough.d.ts +1 -1
- package/dist/types/utils/viewportDetector.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/iconWrapper/styles.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/styles.d.ts +0 -1
- package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/wrapper/imageContainer.d.ts +15 -0
- package/dist/types-ts4.5/card/ui/wrapper/index.d.ts +1 -0
- package/dist/types-ts4.5/card/v2/svgView/helpers.d.ts +3 -0
- package/dist/types-ts4.5/card/v2/svgView/index.d.ts +1 -0
- package/dist/types-ts4.5/card/v2/svgView/svgView.d.ts +31 -0
- package/dist/types-ts4.5/utils/preventClickThrough.d.ts +1 -1
- package/dist/types-ts4.5/utils/viewportDetector.d.ts +1 -1
- package/example-helpers/DelayedRender.tsx +19 -19
- package/example-helpers/cardViewWrapper.tsx +18 -22
- package/example-helpers/cards.tsx +268 -331
- package/example-helpers/developmentUseMessage.tsx +8 -9
- package/example-helpers/index.tsx +100 -124
- package/example-helpers/selectableCard.tsx +32 -35
- package/example-helpers/ssrHelpers.tsx +19 -29
- package/example-helpers/styles.ts +73 -73
- package/example-helpers/svg-helpers/cardContainer.tsx +24 -0
- package/example-helpers/svg-helpers/controls.tsx +21 -0
- package/example-helpers/svg-helpers/delayApiResponses.ts +31 -0
- package/example-helpers/svg-helpers/dimensionPicker.tsx +116 -0
- package/example-helpers/svg-helpers/index.ts +7 -0
- package/example-helpers/svg-helpers/svgContainer.tsx +32 -0
- package/example-helpers/svg-helpers/toggle.tsx +42 -0
- package/example-helpers/svg-helpers/uploader.ts +44 -0
- package/package.json +13 -5
- package/report.api.md +227 -232
|
@@ -2,14 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import InlineMessage from '@atlaskit/inline-message';
|
|
3
3
|
|
|
4
4
|
const DevelopmentUseMessage: React.FC = () => (
|
|
5
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</div>
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
6
|
+
<div style={{ textAlign: 'center' }}>
|
|
7
|
+
<InlineMessage appearance="warning" title="Development use only">
|
|
8
|
+
The purpose of this example is to explore on edge cases for this component's feature. Some
|
|
9
|
+
ways of using the component in here might not be the standard way. It is discouraged to use
|
|
10
|
+
this code as a base for consumers.
|
|
11
|
+
</InlineMessage>
|
|
12
|
+
</div>
|
|
14
13
|
);
|
|
15
14
|
export default DevelopmentUseMessage;
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
import React, { type PropsWithChildren } from 'react';
|
|
4
4
|
import { type FileItem, type Identifier } from '@atlaskit/media-client';
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
createPollingMaxAttemptsError,
|
|
7
|
+
createRateLimitedError,
|
|
8
|
+
createStorybookMediaClientConfig,
|
|
9
|
+
enableMediaUfoLogger,
|
|
10
|
+
FeatureFlagsWrapper,
|
|
11
11
|
} from '@atlaskit/media-test-helpers';
|
|
12
12
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
13
|
-
import FabricAnalyticsListeners, {
|
|
14
|
-
type AnalyticsWebClient,
|
|
15
|
-
} from '@atlaskit/analytics-listeners';
|
|
13
|
+
import FabricAnalyticsListeners, { type AnalyticsWebClient } from '@atlaskit/analytics-listeners';
|
|
16
14
|
import { payloadPublisher } from '@atlassian/ufo';
|
|
17
15
|
|
|
18
16
|
import AnnotateIcon from '@atlaskit/icon/glyph/media-services/annotate';
|
|
@@ -24,159 +22,137 @@ import DevelopmentUseMessage from './developmentUseMessage';
|
|
|
24
22
|
const mediaClientConfig = createStorybookMediaClientConfig();
|
|
25
23
|
|
|
26
24
|
export const clickHandler = (result: CardEvent) => {
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
result.event.preventDefault();
|
|
26
|
+
console.log('click', result.mediaItemDetails);
|
|
29
27
|
};
|
|
30
28
|
|
|
31
29
|
export const mouseEnterHandler = (result: CardEvent) => {
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
result.event.preventDefault();
|
|
31
|
+
console.log('mouseEnter', result.mediaItemDetails);
|
|
34
32
|
};
|
|
35
33
|
|
|
36
|
-
export const createApiCards = (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
),
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
if (appearance === 'image') {
|
|
67
|
-
return [...apiCards, selectableCard];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return apiCards;
|
|
34
|
+
export const createApiCards = (appearance: CardAppearance, identifier: Identifier) => {
|
|
35
|
+
// API methods
|
|
36
|
+
const apiCards = [
|
|
37
|
+
{
|
|
38
|
+
title: 'not selectable',
|
|
39
|
+
content: (
|
|
40
|
+
<Card
|
|
41
|
+
mediaClientConfig={mediaClientConfig}
|
|
42
|
+
appearance={appearance}
|
|
43
|
+
identifier={identifier}
|
|
44
|
+
onClick={clickHandler}
|
|
45
|
+
onMouseEnter={mouseEnterHandler}
|
|
46
|
+
/>
|
|
47
|
+
),
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
const selectableCard = {
|
|
52
|
+
title: 'selectable',
|
|
53
|
+
content: <SelectableCard mediaClientConfig={mediaClientConfig} identifier={identifier} />,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
if (appearance === 'image') {
|
|
57
|
+
return [...apiCards, selectableCard];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return apiCards;
|
|
71
61
|
};
|
|
72
62
|
|
|
73
63
|
export const openAction = {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
label: 'Open',
|
|
65
|
+
handler: () => {
|
|
66
|
+
console.log('open');
|
|
67
|
+
},
|
|
78
68
|
};
|
|
79
69
|
export const closeAction = {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
label: 'Close',
|
|
71
|
+
handler: () => {
|
|
72
|
+
console.log('close');
|
|
73
|
+
},
|
|
84
74
|
};
|
|
85
75
|
export const deleteAction = {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
76
|
+
label: 'Delete',
|
|
77
|
+
handler: () => {
|
|
78
|
+
console.log('delete');
|
|
79
|
+
},
|
|
80
|
+
icon: <CrossIcon size="small" label="delete" />,
|
|
91
81
|
};
|
|
92
82
|
|
|
93
83
|
export const annotateCardAction: CardAction = {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
84
|
+
label: 'Annotate',
|
|
85
|
+
handler: () => {
|
|
86
|
+
console.log('annotate');
|
|
87
|
+
},
|
|
88
|
+
icon: <AnnotateIcon size="small" label="annotate" />,
|
|
99
89
|
};
|
|
100
90
|
|
|
101
|
-
export const actions = [
|
|
102
|
-
openAction,
|
|
103
|
-
closeAction,
|
|
104
|
-
annotateCardAction,
|
|
105
|
-
deleteAction,
|
|
106
|
-
];
|
|
91
|
+
export const actions = [openAction, closeAction, annotateCardAction, deleteAction];
|
|
107
92
|
|
|
108
93
|
export const anotherAction: CardAction = {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
94
|
+
label: 'Some other action',
|
|
95
|
+
handler: (item?: FileItem) => {
|
|
96
|
+
console.log('Some other action', item);
|
|
97
|
+
},
|
|
113
98
|
};
|
|
114
99
|
|
|
115
100
|
export const annotateAction: CardAction = {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
101
|
+
label: 'Annotate',
|
|
102
|
+
handler: (item?: FileItem) => {
|
|
103
|
+
console.log('annotate', item);
|
|
104
|
+
},
|
|
120
105
|
};
|
|
121
106
|
|
|
122
107
|
export const cardsActions = [anotherAction, annotateAction];
|
|
123
108
|
export const wrongMediaClientConfig = createStorybookMediaClientConfig({
|
|
124
|
-
|
|
109
|
+
authType: 'client',
|
|
125
110
|
});
|
|
126
111
|
export const wrongCollection = 'adfasdf';
|
|
127
112
|
|
|
128
113
|
export type MainWrapperProps = PropsWithChildren<{
|
|
129
|
-
|
|
130
|
-
|
|
114
|
+
developmentOnly?: boolean;
|
|
115
|
+
disableFeatureFlagWrapper?: boolean;
|
|
131
116
|
}>;
|
|
132
117
|
|
|
133
118
|
export const MainWrapper = ({
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
119
|
+
children,
|
|
120
|
+
developmentOnly,
|
|
121
|
+
disableFeatureFlagWrapper = false,
|
|
137
122
|
}: MainWrapperProps) => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
123
|
+
enableMediaUfoLogger(payloadPublisher);
|
|
124
|
+
return (
|
|
125
|
+
<>
|
|
126
|
+
{developmentOnly && <DevelopmentUseMessage />}
|
|
127
|
+
{!disableFeatureFlagWrapper ? (
|
|
128
|
+
<FeatureFlagsWrapper>{children}</FeatureFlagsWrapper>
|
|
129
|
+
) : (
|
|
130
|
+
<>{children}</>
|
|
131
|
+
)}
|
|
132
|
+
</>
|
|
133
|
+
);
|
|
149
134
|
};
|
|
150
135
|
|
|
151
|
-
export const mediaCardErrorState = (
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
case 'uploadError':
|
|
163
|
-
return new MediaCardError('upload');
|
|
164
|
-
default:
|
|
165
|
-
return undefined;
|
|
166
|
-
}
|
|
136
|
+
export const mediaCardErrorState = (error?: string): MediaCardError | undefined => {
|
|
137
|
+
switch (error) {
|
|
138
|
+
case 'rateLimitedError':
|
|
139
|
+
return new MediaCardError('error-file-state', createRateLimitedError());
|
|
140
|
+
case 'pollingMaxAttemptsError':
|
|
141
|
+
return new MediaCardError('error-file-state', createPollingMaxAttemptsError());
|
|
142
|
+
case 'uploadError':
|
|
143
|
+
return new MediaCardError('upload');
|
|
144
|
+
default:
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
167
147
|
};
|
|
168
148
|
|
|
169
149
|
export const SSRAnalyticsWrapper = ({ children }: PropsWithChildren<{}>) => {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
<FabricAnalyticsListeners client={mockClient}>
|
|
179
|
-
{children}
|
|
180
|
-
</FabricAnalyticsListeners>
|
|
181
|
-
);
|
|
150
|
+
const mockClient: AnalyticsWebClient = {
|
|
151
|
+
sendUIEvent: (e) => console.debug('UI event', e),
|
|
152
|
+
sendOperationalEvent: (e) => console.debug('Operational event', e),
|
|
153
|
+
sendTrackEvent: (e) => console.debug('Track event', e),
|
|
154
|
+
sendScreenEvent: (e) => console.debug('Screen event', e),
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
return <FabricAnalyticsListeners client={mockClient}>{children}</FabricAnalyticsListeners>;
|
|
182
158
|
};
|
|
@@ -5,45 +5,42 @@ import { type Identifier } from '@atlaskit/media-client';
|
|
|
5
5
|
import { Card } from '../src';
|
|
6
6
|
|
|
7
7
|
export interface SelectableCardProps {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
mediaClientConfig: MediaClientConfig;
|
|
9
|
+
identifier: Identifier;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export class SelectableCard extends Component<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
super(props);
|
|
18
|
-
this.state = { selected: false };
|
|
19
|
-
}
|
|
12
|
+
export class SelectableCard extends Component<SelectableCardProps, { selected: boolean }> {
|
|
13
|
+
constructor(props: SelectableCardProps) {
|
|
14
|
+
super(props);
|
|
15
|
+
this.state = { selected: false };
|
|
16
|
+
}
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
render() {
|
|
19
|
+
const { mediaClientConfig, identifier } = this.props;
|
|
20
|
+
const { selected } = this.state;
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (!mediaClientConfig) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
return (
|
|
27
|
+
<Card
|
|
28
|
+
mediaClientConfig={mediaClientConfig}
|
|
29
|
+
identifier={identifier}
|
|
30
|
+
appearance="image"
|
|
31
|
+
selectable={true}
|
|
32
|
+
selected={selected}
|
|
33
|
+
onClick={this.onClick}
|
|
34
|
+
actions={[{ label: 'add', handler: () => {} }]}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
private onClick = (): void => {
|
|
40
|
+
this.setState((prevState) => {
|
|
41
|
+
return {
|
|
42
|
+
selected: !prevState.selected,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
};
|
|
49
46
|
}
|
|
@@ -4,40 +4,30 @@ import ReactDOMServer from 'react-dom/server';
|
|
|
4
4
|
import { SSRAnalyticsWrapper } from '.';
|
|
5
5
|
|
|
6
6
|
export interface SimulateSsrParams
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
> {
|
|
11
|
-
serverPage: React.ReactNode;
|
|
12
|
-
hydratePage?: React.ReactNode;
|
|
7
|
+
extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
8
|
+
serverPage: React.ReactNode;
|
|
9
|
+
hydratePage?: React.ReactNode;
|
|
13
10
|
}
|
|
14
11
|
|
|
15
12
|
const randomStr = () => Math.random().toString(36).substr(2, 9);
|
|
16
13
|
const generateSsrPageId = () => `media-ssr-page-${randomStr()}-${randomStr()}`;
|
|
17
14
|
|
|
18
|
-
export const SimulateSsr = ({
|
|
19
|
-
|
|
20
|
-
hydratePage,
|
|
21
|
-
...divProps
|
|
22
|
-
}: SimulateSsrParams) => {
|
|
23
|
-
const id = useMemo(generateSsrPageId, []);
|
|
15
|
+
export const SimulateSsr = ({ serverPage, hydratePage, ...divProps }: SimulateSsrParams) => {
|
|
16
|
+
const id = useMemo(generateSsrPageId, []);
|
|
24
17
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}, [id, hydratePage, serverPage]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const txt = ReactDOMServer.renderToString(
|
|
20
|
+
<SSRAnalyticsWrapper>{serverPage}</SSRAnalyticsWrapper>,
|
|
21
|
+
);
|
|
22
|
+
const elem = document.querySelector(`#${id}`);
|
|
23
|
+
if (elem) {
|
|
24
|
+
elem.innerHTML = txt;
|
|
25
|
+
if (hydratePage) {
|
|
26
|
+
ReactDOM.hydrate(<SSRAnalyticsWrapper>{hydratePage}</SSRAnalyticsWrapper>, elem);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, [id, hydratePage, serverPage]);
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
32
|
+
return <div id={id} {...divProps}></div>;
|
|
43
33
|
};
|
|
@@ -2,121 +2,121 @@ import { token } from '@atlaskit/tokens';
|
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
|
|
4
4
|
export const editableCardOptionsStyles = css({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
padding: token('space.250', '20px'),
|
|
6
|
+
borderBottom: `1px solid ${token('color.border', '#ccc')}`,
|
|
7
|
+
maxWidth: '700px',
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
export const sliderWrapperStyles = css({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
display: 'flex',
|
|
12
|
+
width: '50%',
|
|
13
|
+
'> *': {
|
|
14
|
+
flex: 1,
|
|
15
|
+
margin: token('space.100', '8px'),
|
|
16
|
+
},
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
export const editableCardContentStyles = css({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
padding: token('space.250', '20px'),
|
|
21
|
+
border: '2px dashed',
|
|
22
|
+
margin: `${token('space.0', '0px')} ${token('space.150', '12px')} ${token(
|
|
23
|
+
'space.600',
|
|
24
|
+
'48px',
|
|
25
|
+
)} ${token('space.150', '12px')}`,
|
|
26
|
+
overflow: 'hidden',
|
|
27
|
+
background: token('color.background.accent.orange.subtlest', 'antiquewhite'),
|
|
28
|
+
boxSizing: 'border-box',
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
export const optionsWrapperStyles = css({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
display: 'flex',
|
|
33
|
+
'> *': {
|
|
34
|
+
flex: 1,
|
|
35
|
+
margin: token('space.100', '8px'),
|
|
36
|
+
},
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
export const cardDimensionsWrapperStyles = css({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
margin: `${token('space.100', '8px')} ${token('space.100', '8px')} ${token(
|
|
41
|
+
'space.250',
|
|
42
|
+
'20px',
|
|
43
|
+
)} ${token('space.100', '8px')}`,
|
|
44
|
+
display: 'flex',
|
|
45
|
+
'> div': {
|
|
46
|
+
border: `1px solid ${token('color.border.bold', 'black')}`,
|
|
47
|
+
margin: token('space.075', '6px'),
|
|
48
|
+
padding: token('space.075', '6px'),
|
|
49
|
+
borderRadius: '3px',
|
|
50
|
+
},
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
export const flexWrapperStyles = css({
|
|
54
|
-
|
|
54
|
+
display: 'flex',
|
|
55
55
|
});
|
|
56
56
|
export const cardPreviewWrapperStyles = css({
|
|
57
|
-
|
|
57
|
+
flex: 1,
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
export const cardWrapperStyles = css({
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
border: `1px solid ${token('color.border.bold', 'black')}`,
|
|
62
|
+
padding: token('space.150', '12px'),
|
|
63
|
+
margin: token('space.075', '6px'),
|
|
64
|
+
flexDirection: 'column',
|
|
65
|
+
width: '310px',
|
|
66
|
+
height: '280px',
|
|
67
|
+
overflow: 'auto',
|
|
68
|
+
display: 'inline-block',
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
export const cardFlowHeaderStyles = css({
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
margin: `${token('space.250', '20px')} auto`,
|
|
73
|
+
padding: `${token('space.150', '12px')} ${token('space.0', '0px')}`,
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
export const externalIdentifierWrapperStyles = css({
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
display: 'flex',
|
|
78
|
+
justifyContent: 'space-around',
|
|
79
|
+
margin: `${token('space.0', '0px')} auto`,
|
|
80
|
+
h2: {
|
|
81
|
+
marginBottom: token('space.150', '12px'),
|
|
82
|
+
},
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
export const unhandledErrorCardWrapperStyles = css({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
padding: token('space.250', '20px'),
|
|
87
|
+
'> div:first-child': {
|
|
88
|
+
display: 'flex',
|
|
89
|
+
marginBottom: token('space.250', '20px'),
|
|
90
|
+
},
|
|
91
|
+
label: {
|
|
92
|
+
marginRight: token('space.250', '20px'),
|
|
93
|
+
},
|
|
94
94
|
});
|
|
95
95
|
|
|
96
96
|
export const inlineCardVideoWrapperItemStyles = css({
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
padding: token('space.150', '12px'),
|
|
98
|
+
border: `1px solid ${token('color.border.bold', 'black')}`,
|
|
99
|
+
margin: token('space.150', '12px'),
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
export const mediaViewerExampleColumnStyles = css({
|
|
103
|
-
|
|
103
|
+
flex: 1,
|
|
104
104
|
});
|
|
105
105
|
|
|
106
106
|
export const mediaViewerExampleWrapperStyles = css({
|
|
107
|
-
|
|
107
|
+
display: 'flex',
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
export const mediaInlineWrapperStyles = css({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
display: 'flex',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
flexDirection: 'column',
|
|
114
|
+
margin: token('space.1000', '80px'),
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
export const mediaInlineTableStyles = css({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
width: '800px',
|
|
119
|
+
'tr, td': {
|
|
120
|
+
border: `1px solid ${token('color.border', '#ddd')}`,
|
|
121
|
+
},
|
|
122
122
|
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
|
|
6
|
+
export const CardBox = ({ title, children }: { title: string; children: React.ReactNode }) => (
|
|
7
|
+
<div style={{ marginBottom: '10px' }}>
|
|
8
|
+
<h3 style={{ textAlign: 'center' }}>{title}</h3>
|
|
9
|
+
{children}
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const CardRow = ({ children }: { children: React.ReactNode }) => (
|
|
14
|
+
<div
|
|
15
|
+
style={{
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexWrap: 'wrap',
|
|
18
|
+
gap: '10px',
|
|
19
|
+
marginBottom: '10px',
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
24
|
+
);
|