@atlaskit/media-card 77.10.6 → 77.10.8
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 +13 -0
- package/dist/cjs/card/card.js +4 -4
- package/dist/cjs/card/cardLoader.js +2 -2
- package/dist/cjs/card/cardView.js +1 -1
- package/dist/cjs/card/inlinePlayer.js +3 -3
- package/dist/cjs/card/inlinePlayerLazy.js +2 -2
- package/dist/cjs/card/media-card-analytics-error-boundary.js +2 -2
- package/dist/cjs/card/ui/actionsBar/actionsBar.js +1 -1
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionIconButton.js +3 -3
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +3 -3
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionsView.js +1 -1
- package/dist/cjs/card/ui/imageRenderer/imageRenderer.js +2 -2
- package/dist/cjs/card/ui/tickBox/types.js +1 -5
- package/dist/cjs/card/ui/unhandledErrorCard/index.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/cardV2Loader.js +2 -2
- package/dist/cjs/card/v2/cardViewV2.js +2 -2
- package/dist/cjs/card/v2/cardviews/index.js +2 -2
- package/dist/cjs/card/v2/externalImageCard.js +2 -2
- package/dist/cjs/card/v2/fileCard.js +2 -2
- package/dist/cjs/card/v2/inlinePlayerLazyV2.js +2 -2
- package/dist/cjs/card/v2/inlinePlayerV2.js +2 -2
- package/dist/cjs/errors.js +1 -1
- package/dist/cjs/inline/loader.js +4 -4
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
- package/dist/cjs/inline/mediaInlineCard.js +2 -2
- package/dist/cjs/utils/{analytics.js → analytics/analytics.js} +5 -5
- package/dist/cjs/utils/analytics/index.js +120 -0
- package/dist/cjs/utils/lightCards/cardError.js +3 -3
- package/dist/cjs/utils/lightCards/cardLoading.js +3 -3
- package/dist/cjs/utils/lightCards/errorIcon/index.js +1 -1
- package/dist/cjs/utils/objectURLCache.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/utils/viewportDetector.js +2 -2
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/getCardPreview/cache.js +1 -0
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/tickBox/types.js +0 -1
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/{analytics.js → analytics/analytics.js} +4 -4
- package/dist/es2019/utils/analytics/index.js +1 -0
- package/dist/es2019/utils/globalScope/globalScope.js +1 -0
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +2 -2
- package/dist/esm/card/cardView.js +1 -1
- package/dist/esm/card/getCardPreview/cache.js +1 -0
- package/dist/esm/card/inlinePlayer.js +1 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +2 -2
- package/dist/esm/card/ui/actionsBar/actionsBar.js +1 -1
- package/dist/esm/card/ui/actionsBar/cardActions/cardActionIconButton.js +1 -1
- package/dist/esm/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +1 -1
- package/dist/esm/card/ui/actionsBar/cardActions/cardActionsView.js +1 -1
- package/dist/esm/card/ui/tickBox/types.js +0 -1
- package/dist/esm/card/ui/unhandledErrorCard/index.js +1 -1
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/errors.js +1 -1
- package/dist/esm/inline/loader.js +2 -2
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
- package/dist/esm/utils/{analytics.js → analytics/analytics.js} +4 -4
- package/dist/esm/utils/analytics/index.js +1 -0
- package/dist/esm/utils/globalScope/globalScope.js +1 -0
- package/dist/esm/utils/lightCards/cardError.js +1 -1
- package/dist/esm/utils/lightCards/cardLoading.js +1 -1
- package/dist/esm/utils/lightCards/errorIcon/index.js +1 -1
- package/dist/esm/utils/objectURLCache.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/media-card-analytics-error-boundary.d.ts +3 -3
- package/dist/types/inline/loader.d.ts +3 -3
- package/dist/types/inline/mediaInlineAnalyticsErrorBoundary.d.ts +3 -3
- package/dist/{types-ts4.5/utils → types/utils/analytics}/analytics.d.ts +3 -3
- package/dist/types/utils/analytics/index.d.ts +2 -0
- package/dist/types/utils/viewportDetector.d.ts +4 -4
- package/dist/types-ts4.5/card/media-card-analytics-error-boundary.d.ts +3 -3
- package/dist/types-ts4.5/inline/loader.d.ts +3 -3
- package/dist/types-ts4.5/inline/mediaInlineAnalyticsErrorBoundary.d.ts +3 -3
- package/dist/{types/utils → types-ts4.5/utils/analytics}/analytics.d.ts +3 -3
- package/dist/types-ts4.5/utils/analytics/index.d.ts +2 -0
- package/dist/types-ts4.5/utils/viewportDetector.d.ts +4 -4
- package/example-helpers/cardViewWrapper.tsx +30 -15
- package/example-helpers/index.tsx +6 -6
- package/example-helpers/styles.ts +119 -136
- package/package.json +5 -5
|
@@ -5,7 +5,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
-
function _isNativeReflectConstruct() {
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import { LRUMap } from 'lru_map';
|
|
10
10
|
import { EventEmitter2 } from 'eventemitter2';
|
|
11
11
|
export var PREVIEW_CACHE_LRU_SIZE = 50;
|
|
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
7
7
|
import { MediaCardError } from '../errors';
|
|
8
8
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
9
9
|
var packageName = "@atlaskit/media-card";
|
|
10
|
-
var packageVersion = "77.10.
|
|
10
|
+
var packageVersion = "77.10.8";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
3
|
import { CardDimensions, CardOnClickCallback } from '../types';
|
|
4
4
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
|
-
export type MediaCardAnalyticsErrorBoundaryProps = {
|
|
5
|
+
export type MediaCardAnalyticsErrorBoundaryProps = PropsWithChildren<{
|
|
6
6
|
dimensions?: CardDimensions;
|
|
7
7
|
data?: {
|
|
8
8
|
[k: string]: any;
|
|
9
9
|
};
|
|
10
10
|
onClick?: CardOnClickCallback;
|
|
11
11
|
featureFlags?: MediaFeatureFlags;
|
|
12
|
-
} & WithAnalyticsEventsProps
|
|
12
|
+
} & WithAnalyticsEventsProps>;
|
|
13
13
|
declare const MediaCardAnalyticsErrorBoundary: React.ComponentType<MediaCardAnalyticsErrorBoundaryProps & WithAnalyticsEventsProps>;
|
|
14
14
|
export default MediaCardAnalyticsErrorBoundary;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { WithMediaClientConfigProps } from '@atlaskit/media-client-react';
|
|
3
3
|
import { MediaInlineCardProps } from './mediaInlineCard';
|
|
4
4
|
export type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<MediaInlineCardProps>;
|
|
5
5
|
type MediaInlineCardWithMediaClientConfigComponent = React.ComponentType<MediaInlineCardWithMediaClientConfigProps>;
|
|
6
|
-
type ErrorBoundaryComponent = React.ComponentType<{
|
|
6
|
+
type ErrorBoundaryComponent = React.ComponentType<PropsWithChildren<{
|
|
7
7
|
data?: {
|
|
8
8
|
[k: string]: any;
|
|
9
9
|
};
|
|
10
10
|
isSelected?: boolean;
|
|
11
|
-
}
|
|
11
|
+
}>>;
|
|
12
12
|
export interface MediaInlineCardLoaderState {
|
|
13
13
|
MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
14
14
|
ErrorBoundary?: ErrorBoundaryComponent;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
3
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
-
export type MediaInlineAnalyticsErrorBoundaryProps = {
|
|
4
|
+
export type MediaInlineAnalyticsErrorBoundaryProps = PropsWithChildren<{
|
|
5
5
|
isSelected?: boolean;
|
|
6
6
|
data?: {
|
|
7
7
|
[k: string]: any;
|
|
8
8
|
};
|
|
9
9
|
featureFlags?: MediaFeatureFlags;
|
|
10
|
-
} & WithAnalyticsEventsProps
|
|
10
|
+
} & WithAnalyticsEventsProps>;
|
|
11
11
|
declare const MediaInlineAnalyticsErrorBoundary: React.ComponentType<MediaInlineAnalyticsErrorBoundaryProps & WithAnalyticsEventsProps>;
|
|
12
12
|
export default MediaInlineAnalyticsErrorBoundary;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FileDetails, FileStatus, MediaClientErrorReason, RequestMetadata } from '@atlaskit/media-client';
|
|
2
|
-
import { FileAttributes, PerformanceAttributes, OperationalEventPayload, UIEventPayload, WithFileAttributes, WithPerformanceAttributes, SuccessAttributes, FailureAttributes, ScreenEventPayload, ScreenAttributes, MediaTraceContext, WithTraceContext } from '@atlaskit/media-common';
|
|
2
|
+
import { FileAttributes, PerformanceAttributes, OperationalEventPayload, UIEventPayload, WithFileAttributes, WithPerformanceAttributes, SuccessAttributes, FailureAttributes, ScreenEventPayload, ScreenAttributes, MediaTraceContext, WithTraceContext } from '@atlaskit/media-common/analytics';
|
|
3
3
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
-
import { MediaCardError, MediaCardErrorPrimaryReason } from '
|
|
5
|
-
import { CardPreviewSource, CardDimensions, CardStatus } from '
|
|
4
|
+
import { MediaCardError, MediaCardErrorPrimaryReason } from '../../errors';
|
|
5
|
+
import { CardPreviewSource, CardDimensions, CardStatus } from '../../types';
|
|
6
6
|
export type CardPreviewAttributes = {
|
|
7
7
|
fileId: string;
|
|
8
8
|
prevDimensions: CardDimensions | undefined;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type { CardPreviewAttributes, FileUriFailReason, FailedErrorFailReason, MediaCardErrorInfo, SSRStatusFail, SSRStatus, WithSSRReliability, RenderFailedEventPayload, ErrorEventPayload, ErrorBoundaryErrorInfo, AnalyticsErrorBoundaryAttributes, AnalyticsErrorBoundaryCardPayload, AnalyticsErrorBoundaryInlinePayload, RenderInlineCardSucceededEventPayload, RenderInlineCardFailedEventPayload, RenderSucceededEventPayload, RenderCommencedEventPayload, CacheHitEventPayload, RemoteSuccessEventPayload, CopiedFileEventPayload, ClickedEventPayload, RenderScreenEventPayload, MediaCardAnalyticsEventPayload, } from './analytics';
|
|
2
|
+
export { getFileAttributes, getRenderPreviewableCardPayload, getRenderCommencedEventPayload, getRenderSucceededEventPayload, getCacheHitEventPayload, getRemoteSuccessEventPayload, getRenderFailedExternalUriPayload, getRenderErrorFailReason, getRenderErrorErrorReason, getRenderErrorErrorDetail, getErrorTraceContext, getRenderErrorRequestMetadata, extractErrorInfo, getRenderErrorEventPayload, getErrorEventPayload, getRenderFailedFileStatusPayload, getCopiedFilePayload, fireMediaCardEvent, createAndFireMediaCardEvent, } from './analytics';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type ViewportDetectorProps = {
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export type ViewportDetectorProps = PropsWithChildren<{
|
|
3
3
|
cardEl: HTMLElement | null;
|
|
4
4
|
onVisible: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const ViewportDetector:
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ViewportDetector: ({ cardEl, onVisible, children, }: ViewportDetectorProps) => JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
3
|
import { CardDimensions, CardOnClickCallback } from '../types';
|
|
4
4
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
|
-
export type MediaCardAnalyticsErrorBoundaryProps = {
|
|
5
|
+
export type MediaCardAnalyticsErrorBoundaryProps = PropsWithChildren<{
|
|
6
6
|
dimensions?: CardDimensions;
|
|
7
7
|
data?: {
|
|
8
8
|
[k: string]: any;
|
|
9
9
|
};
|
|
10
10
|
onClick?: CardOnClickCallback;
|
|
11
11
|
featureFlags?: MediaFeatureFlags;
|
|
12
|
-
} & WithAnalyticsEventsProps
|
|
12
|
+
} & WithAnalyticsEventsProps>;
|
|
13
13
|
declare const MediaCardAnalyticsErrorBoundary: React.ComponentType<MediaCardAnalyticsErrorBoundaryProps & WithAnalyticsEventsProps>;
|
|
14
14
|
export default MediaCardAnalyticsErrorBoundary;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { WithMediaClientConfigProps } from '@atlaskit/media-client-react';
|
|
3
3
|
import { MediaInlineCardProps } from './mediaInlineCard';
|
|
4
4
|
export type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<MediaInlineCardProps>;
|
|
5
5
|
type MediaInlineCardWithMediaClientConfigComponent = React.ComponentType<MediaInlineCardWithMediaClientConfigProps>;
|
|
6
|
-
type ErrorBoundaryComponent = React.ComponentType<{
|
|
6
|
+
type ErrorBoundaryComponent = React.ComponentType<PropsWithChildren<{
|
|
7
7
|
data?: {
|
|
8
8
|
[k: string]: any;
|
|
9
9
|
};
|
|
10
10
|
isSelected?: boolean;
|
|
11
|
-
}
|
|
11
|
+
}>>;
|
|
12
12
|
export interface MediaInlineCardLoaderState {
|
|
13
13
|
MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
14
14
|
ErrorBoundary?: ErrorBoundaryComponent;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
3
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
-
export type MediaInlineAnalyticsErrorBoundaryProps = {
|
|
4
|
+
export type MediaInlineAnalyticsErrorBoundaryProps = PropsWithChildren<{
|
|
5
5
|
isSelected?: boolean;
|
|
6
6
|
data?: {
|
|
7
7
|
[k: string]: any;
|
|
8
8
|
};
|
|
9
9
|
featureFlags?: MediaFeatureFlags;
|
|
10
|
-
} & WithAnalyticsEventsProps
|
|
10
|
+
} & WithAnalyticsEventsProps>;
|
|
11
11
|
declare const MediaInlineAnalyticsErrorBoundary: React.ComponentType<MediaInlineAnalyticsErrorBoundaryProps & WithAnalyticsEventsProps>;
|
|
12
12
|
export default MediaInlineAnalyticsErrorBoundary;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FileDetails, FileStatus, MediaClientErrorReason, RequestMetadata } from '@atlaskit/media-client';
|
|
2
|
-
import { FileAttributes, PerformanceAttributes, OperationalEventPayload, UIEventPayload, WithFileAttributes, WithPerformanceAttributes, SuccessAttributes, FailureAttributes, ScreenEventPayload, ScreenAttributes, MediaTraceContext, WithTraceContext } from '@atlaskit/media-common';
|
|
2
|
+
import { FileAttributes, PerformanceAttributes, OperationalEventPayload, UIEventPayload, WithFileAttributes, WithPerformanceAttributes, SuccessAttributes, FailureAttributes, ScreenEventPayload, ScreenAttributes, MediaTraceContext, WithTraceContext } from '@atlaskit/media-common/analytics';
|
|
3
3
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
-
import { MediaCardError, MediaCardErrorPrimaryReason } from '
|
|
5
|
-
import { CardPreviewSource, CardDimensions, CardStatus } from '
|
|
4
|
+
import { MediaCardError, MediaCardErrorPrimaryReason } from '../../errors';
|
|
5
|
+
import { CardPreviewSource, CardDimensions, CardStatus } from '../../types';
|
|
6
6
|
export type CardPreviewAttributes = {
|
|
7
7
|
fileId: string;
|
|
8
8
|
prevDimensions: CardDimensions | undefined;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type { CardPreviewAttributes, FileUriFailReason, FailedErrorFailReason, MediaCardErrorInfo, SSRStatusFail, SSRStatus, WithSSRReliability, RenderFailedEventPayload, ErrorEventPayload, ErrorBoundaryErrorInfo, AnalyticsErrorBoundaryAttributes, AnalyticsErrorBoundaryCardPayload, AnalyticsErrorBoundaryInlinePayload, RenderInlineCardSucceededEventPayload, RenderInlineCardFailedEventPayload, RenderSucceededEventPayload, RenderCommencedEventPayload, CacheHitEventPayload, RemoteSuccessEventPayload, CopiedFileEventPayload, ClickedEventPayload, RenderScreenEventPayload, MediaCardAnalyticsEventPayload, } from './analytics';
|
|
2
|
+
export { getFileAttributes, getRenderPreviewableCardPayload, getRenderCommencedEventPayload, getRenderSucceededEventPayload, getCacheHitEventPayload, getRemoteSuccessEventPayload, getRenderFailedExternalUriPayload, getRenderErrorFailReason, getRenderErrorErrorReason, getRenderErrorErrorDetail, getErrorTraceContext, getRenderErrorRequestMetadata, extractErrorInfo, getRenderErrorEventPayload, getErrorEventPayload, getRenderFailedFileStatusPayload, getCopiedFilePayload, fireMediaCardEvent, createAndFireMediaCardEvent, } from './analytics';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type ViewportDetectorProps = {
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export type ViewportDetectorProps = PropsWithChildren<{
|
|
3
3
|
cardEl: HTMLElement | null;
|
|
4
4
|
onVisible: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const ViewportDetector:
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ViewportDetector: ({ cardEl, onVisible, children, }: ViewportDetectorProps) => JSX.Element;
|
|
@@ -1,29 +1,44 @@
|
|
|
1
1
|
/**@jsx jsx */
|
|
2
|
-
import {
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
3
4
|
import { token } from '@atlaskit/tokens';
|
|
4
5
|
|
|
5
6
|
type CardViewWrapperProps = {
|
|
6
|
-
|
|
7
|
+
small?: boolean;
|
|
7
8
|
displayInline?: boolean;
|
|
8
9
|
children?: JSX.Element;
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
const displayInlineStyles = (displayInline?: boolean) => {
|
|
12
|
-
return displayInline ? '
|
|
13
|
+
return displayInline ? 'inline-block;' : '';
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
// Minimum supported dimensions
|
|
17
|
+
const smallStyles = xcss({
|
|
18
|
+
width: '156px',
|
|
19
|
+
height: '108px',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Maximum supported dimensions
|
|
23
|
+
const largeStyles = xcss({
|
|
24
|
+
width: '600px',
|
|
25
|
+
height: '450px',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const cardWrapperStyles = ({ small, displayInline }: CardViewWrapperProps) =>
|
|
29
|
+
xcss({
|
|
30
|
+
display: displayInlineStyles(displayInline),
|
|
31
|
+
margin: `${token('space.200', '16px')} ${token('space.250', '20px')}`,
|
|
32
|
+
});
|
|
26
33
|
|
|
27
34
|
export const CardViewWrapper = (props: CardViewWrapperProps) => {
|
|
28
|
-
|
|
35
|
+
if (props.small) {
|
|
36
|
+
return (
|
|
37
|
+
<Box xcss={[cardWrapperStyles(props), smallStyles]}>{props.children}</Box>
|
|
38
|
+
);
|
|
39
|
+
} else {
|
|
40
|
+
return (
|
|
41
|
+
<Box xcss={[cardWrapperStyles(props), largeStyles]}>{props.children}</Box>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
29
44
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint-disable-line no-console
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { PropsWithChildren } from 'react';
|
|
4
4
|
import { FileItem, Identifier } from '@atlaskit/media-client';
|
|
5
5
|
import {
|
|
6
6
|
createPollingMaxAttemptsError,
|
|
@@ -125,16 +125,16 @@ export const wrongMediaClientConfig = createStorybookMediaClientConfig({
|
|
|
125
125
|
});
|
|
126
126
|
export const wrongCollection = 'adfasdf';
|
|
127
127
|
|
|
128
|
-
export type MainWrapperProps = {
|
|
128
|
+
export type MainWrapperProps = PropsWithChildren<{
|
|
129
129
|
developmentOnly?: boolean;
|
|
130
130
|
disableFeatureFlagWrapper?: boolean;
|
|
131
|
-
}
|
|
131
|
+
}>;
|
|
132
132
|
|
|
133
|
-
export const MainWrapper
|
|
133
|
+
export const MainWrapper = ({
|
|
134
134
|
children,
|
|
135
135
|
developmentOnly,
|
|
136
136
|
disableFeatureFlagWrapper = false,
|
|
137
|
-
}) => {
|
|
137
|
+
}: MainWrapperProps) => {
|
|
138
138
|
enableMediaUfoLogger(payloadPublisher);
|
|
139
139
|
return (
|
|
140
140
|
<>
|
|
@@ -166,7 +166,7 @@ export const mediaCardErrorState = (
|
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
-
export const SSRAnalyticsWrapper
|
|
169
|
+
export const SSRAnalyticsWrapper = ({ children }: PropsWithChildren<{}>) => {
|
|
170
170
|
const mockClient: AnalyticsWebClient = {
|
|
171
171
|
sendUIEvent: (e) => console.debug('UI event', e),
|
|
172
172
|
sendOperationalEvent: (e) => console.debug('Operational event', e),
|
|
@@ -1,139 +1,122 @@
|
|
|
1
1
|
import { token } from '@atlaskit/tokens';
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
|
|
4
|
-
export const editableCardOptionsStyles = css
|
|
5
|
-
padding:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
margin:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
`;
|
|
124
|
-
|
|
125
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
126
|
-
export const mediaInlineWrapperStyles = css`
|
|
127
|
-
display: flex;
|
|
128
|
-
align-items: center;
|
|
129
|
-
flex-direction: column;
|
|
130
|
-
margin: 100px;
|
|
131
|
-
`;
|
|
132
|
-
|
|
133
|
-
export const mediaInlineTableStyles = css`
|
|
134
|
-
width: 800px;
|
|
135
|
-
tr,
|
|
136
|
-
td {
|
|
137
|
-
border: 1px solid ${token('color.border', '#ddd')};
|
|
138
|
-
}
|
|
139
|
-
`;
|
|
4
|
+
export const editableCardOptionsStyles = css({
|
|
5
|
+
padding: token('space.250', '20px'),
|
|
6
|
+
borderBottom: `1px solid ${token('color.border', '#ccc')}`,
|
|
7
|
+
maxWidth: '700px',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const sliderWrapperStyles = css({
|
|
11
|
+
display: 'flex',
|
|
12
|
+
width: '50%',
|
|
13
|
+
'> *': {
|
|
14
|
+
flex: 1,
|
|
15
|
+
margin: token('space.100', '8px'),
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const editableCardContentStyles = css({
|
|
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
|
+
});
|
|
30
|
+
|
|
31
|
+
export const optionsWrapperStyles = css({
|
|
32
|
+
display: 'flex',
|
|
33
|
+
'> *': {
|
|
34
|
+
flex: 1,
|
|
35
|
+
margin: token('space.100', '8px'),
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const cardDimensionsWrapperStyles = css({
|
|
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
|
+
});
|
|
52
|
+
|
|
53
|
+
export const flexWrapperStyles = css({
|
|
54
|
+
display: 'flex',
|
|
55
|
+
});
|
|
56
|
+
export const cardPreviewWrapperStyles = css({
|
|
57
|
+
flex: 1,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export const cardWrapperStyles = css({
|
|
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
|
+
});
|
|
70
|
+
|
|
71
|
+
export const cardFlowHeaderStyles = css({
|
|
72
|
+
margin: `${token('space.250', '20px')} auto`,
|
|
73
|
+
padding: `${token('space.150', '12px')} ${token('space.0', '0px')}`,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export const externalIdentifierWrapperStyles = css({
|
|
77
|
+
display: 'flex',
|
|
78
|
+
justifyContent: 'space-around',
|
|
79
|
+
margin: `${token('space.0', '0px')} auto`,
|
|
80
|
+
h2: {
|
|
81
|
+
marginBottom: token('space.150', '12px'),
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const unhandledErrorCardWrapperStyles = css({
|
|
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
|
+
});
|
|
95
|
+
|
|
96
|
+
export const inlineCardVideoWrapperItemStyles = css({
|
|
97
|
+
padding: token('space.150', '12px'),
|
|
98
|
+
border: `1px solid ${token('color.border.bold', 'black')}`,
|
|
99
|
+
margin: token('space.150', '12px'),
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export const mediaViewerExampleColumnStyles = css({
|
|
103
|
+
flex: 1,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export const mediaViewerExampleWrapperStyles = css({
|
|
107
|
+
display: 'flex',
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export const mediaInlineWrapperStyles = css({
|
|
111
|
+
display: 'flex',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
flexDirection: 'column',
|
|
114
|
+
margin: token('space.1000', '80px'),
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export const mediaInlineTableStyles = css({
|
|
118
|
+
width: '800px',
|
|
119
|
+
'tr, td': {
|
|
120
|
+
border: `1px solid ${token('color.border', '#ddd')}`,
|
|
121
|
+
},
|
|
122
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "77.10.
|
|
3
|
+
"version": "77.10.8",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,20 +37,20 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
40
|
-
"@atlaskit/dropdown-menu": "^12.
|
|
40
|
+
"@atlaskit/dropdown-menu": "^12.8.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
42
42
|
"@atlaskit/icon": "^22.1.0",
|
|
43
43
|
"@atlaskit/media-client": "^26.2.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^2.0.0",
|
|
45
|
-
"@atlaskit/media-common": "^11.
|
|
45
|
+
"@atlaskit/media-common": "^11.1.0",
|
|
46
46
|
"@atlaskit/media-file-preview": "^0.5.0",
|
|
47
47
|
"@atlaskit/media-ui": "^25.4.0",
|
|
48
48
|
"@atlaskit/media-viewer": "^48.3.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
50
|
-
"@atlaskit/primitives": "^4.
|
|
50
|
+
"@atlaskit/primitives": "^4.1.0",
|
|
51
51
|
"@atlaskit/spinner": "^16.0.0",
|
|
52
52
|
"@atlaskit/theme": "^12.6.0",
|
|
53
|
-
"@atlaskit/tokens": "^1.
|
|
53
|
+
"@atlaskit/tokens": "^1.41.0",
|
|
54
54
|
"@atlaskit/tooltip": "^18.1.0",
|
|
55
55
|
"@atlaskit/ufo": "^0.2.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|