@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.
Files changed (83) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/card/card.js +4 -4
  3. package/dist/cjs/card/cardLoader.js +2 -2
  4. package/dist/cjs/card/cardView.js +1 -1
  5. package/dist/cjs/card/inlinePlayer.js +3 -3
  6. package/dist/cjs/card/inlinePlayerLazy.js +2 -2
  7. package/dist/cjs/card/media-card-analytics-error-boundary.js +2 -2
  8. package/dist/cjs/card/ui/actionsBar/actionsBar.js +1 -1
  9. package/dist/cjs/card/ui/actionsBar/cardActions/cardActionIconButton.js +3 -3
  10. package/dist/cjs/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +3 -3
  11. package/dist/cjs/card/ui/actionsBar/cardActions/cardActionsView.js +1 -1
  12. package/dist/cjs/card/ui/imageRenderer/imageRenderer.js +2 -2
  13. package/dist/cjs/card/ui/tickBox/types.js +1 -5
  14. package/dist/cjs/card/ui/unhandledErrorCard/index.js +1 -1
  15. package/dist/cjs/card/v2/cardV2.js +1 -1
  16. package/dist/cjs/card/v2/cardV2Loader.js +2 -2
  17. package/dist/cjs/card/v2/cardViewV2.js +2 -2
  18. package/dist/cjs/card/v2/cardviews/index.js +2 -2
  19. package/dist/cjs/card/v2/externalImageCard.js +2 -2
  20. package/dist/cjs/card/v2/fileCard.js +2 -2
  21. package/dist/cjs/card/v2/inlinePlayerLazyV2.js +2 -2
  22. package/dist/cjs/card/v2/inlinePlayerV2.js +2 -2
  23. package/dist/cjs/errors.js +1 -1
  24. package/dist/cjs/inline/loader.js +4 -4
  25. package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
  26. package/dist/cjs/inline/mediaInlineCard.js +2 -2
  27. package/dist/cjs/utils/{analytics.js → analytics/analytics.js} +5 -5
  28. package/dist/cjs/utils/analytics/index.js +120 -0
  29. package/dist/cjs/utils/lightCards/cardError.js +3 -3
  30. package/dist/cjs/utils/lightCards/cardLoading.js +3 -3
  31. package/dist/cjs/utils/lightCards/errorIcon/index.js +1 -1
  32. package/dist/cjs/utils/objectURLCache.js +1 -1
  33. package/dist/cjs/utils/ufoExperiences.js +1 -1
  34. package/dist/cjs/utils/viewportDetector.js +2 -2
  35. package/dist/es2019/card/card.js +1 -1
  36. package/dist/es2019/card/getCardPreview/cache.js +1 -0
  37. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
  38. package/dist/es2019/card/ui/tickBox/types.js +0 -1
  39. package/dist/es2019/card/v2/cardV2.js +1 -1
  40. package/dist/es2019/inline/loader.js +1 -1
  41. package/dist/es2019/utils/{analytics.js → analytics/analytics.js} +4 -4
  42. package/dist/es2019/utils/analytics/index.js +1 -0
  43. package/dist/es2019/utils/globalScope/globalScope.js +1 -0
  44. package/dist/es2019/utils/ufoExperiences.js +1 -1
  45. package/dist/esm/card/card.js +2 -2
  46. package/dist/esm/card/cardView.js +1 -1
  47. package/dist/esm/card/getCardPreview/cache.js +1 -0
  48. package/dist/esm/card/inlinePlayer.js +1 -1
  49. package/dist/esm/card/media-card-analytics-error-boundary.js +2 -2
  50. package/dist/esm/card/ui/actionsBar/actionsBar.js +1 -1
  51. package/dist/esm/card/ui/actionsBar/cardActions/cardActionIconButton.js +1 -1
  52. package/dist/esm/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +1 -1
  53. package/dist/esm/card/ui/actionsBar/cardActions/cardActionsView.js +1 -1
  54. package/dist/esm/card/ui/tickBox/types.js +0 -1
  55. package/dist/esm/card/ui/unhandledErrorCard/index.js +1 -1
  56. package/dist/esm/card/v2/cardV2.js +1 -1
  57. package/dist/esm/errors.js +1 -1
  58. package/dist/esm/inline/loader.js +2 -2
  59. package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
  60. package/dist/esm/utils/{analytics.js → analytics/analytics.js} +4 -4
  61. package/dist/esm/utils/analytics/index.js +1 -0
  62. package/dist/esm/utils/globalScope/globalScope.js +1 -0
  63. package/dist/esm/utils/lightCards/cardError.js +1 -1
  64. package/dist/esm/utils/lightCards/cardLoading.js +1 -1
  65. package/dist/esm/utils/lightCards/errorIcon/index.js +1 -1
  66. package/dist/esm/utils/objectURLCache.js +1 -1
  67. package/dist/esm/utils/ufoExperiences.js +1 -1
  68. package/dist/types/card/media-card-analytics-error-boundary.d.ts +3 -3
  69. package/dist/types/inline/loader.d.ts +3 -3
  70. package/dist/types/inline/mediaInlineAnalyticsErrorBoundary.d.ts +3 -3
  71. package/dist/{types-ts4.5/utils → types/utils/analytics}/analytics.d.ts +3 -3
  72. package/dist/types/utils/analytics/index.d.ts +2 -0
  73. package/dist/types/utils/viewportDetector.d.ts +4 -4
  74. package/dist/types-ts4.5/card/media-card-analytics-error-boundary.d.ts +3 -3
  75. package/dist/types-ts4.5/inline/loader.d.ts +3 -3
  76. package/dist/types-ts4.5/inline/mediaInlineAnalyticsErrorBoundary.d.ts +3 -3
  77. package/dist/{types/utils → types-ts4.5/utils/analytics}/analytics.d.ts +3 -3
  78. package/dist/types-ts4.5/utils/analytics/index.d.ts +2 -0
  79. package/dist/types-ts4.5/utils/viewportDetector.d.ts +4 -4
  80. package/example-helpers/cardViewWrapper.tsx +30 -15
  81. package/example-helpers/index.tsx +6 -6
  82. package/example-helpers/styles.ts +119 -136
  83. 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() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
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.6";
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 '../errors';
5
- import { CardPreviewSource, CardDimensions, CardStatus } from '../types';
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 React from 'react';
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: React.FC<ViewportDetectorProps>;
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 '../errors';
5
- import { CardPreviewSource, CardDimensions, CardStatus } from '../types';
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 React from 'react';
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: React.FC<ViewportDetectorProps>;
5
+ }>;
6
+ export declare const ViewportDetector: ({ cardEl, onVisible, children, }: ViewportDetectorProps) => JSX.Element;
@@ -1,29 +1,44 @@
1
1
  /**@jsx jsx */
2
- import { css, jsx } from '@emotion/react';
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
- wrapperDimensions: { width: string; height: string };
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 ? 'display: inline-block;' : '';
13
+ return displayInline ? 'inline-block;' : '';
13
14
  };
14
15
 
15
- const cardWrapperStyles = ({
16
- wrapperDimensions,
17
- displayInline,
18
- }: CardViewWrapperProps) =>
19
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
20
- css`
21
- ${displayInlineStyles(displayInline)}
22
- width: ${wrapperDimensions.width};
23
- height: ${wrapperDimensions.height};
24
- margin: 15px ${token('space.250', '20px')};
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
- return <div css={cardWrapperStyles(props)}>{props.children}</div>;
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: React.FC<MainWrapperProps> = ({
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: React.FC = ({ children }) => {
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: ${token('space.250', '20px')};
6
- border-bottom: 1px solid ${token('color.border', '#ccc')};
7
- max-width: 700px;
8
- `;
9
-
10
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
11
- export const sliderWrapperStyles = css`
12
- display: flex;
13
- width: 50%;
14
-
15
- > * {
16
- flex: 1;
17
- margin: 10px;
18
- }
19
- `;
20
-
21
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
22
- export const editableCardContentStyles = css`
23
- /* Not making the wrapper fancier or center elements in order to have a more realistic scenario */
24
- padding: ${token('space.250', '20px')};
25
- border: 2px dashed;
26
- margin: 0 10px 50px 10px;
27
- overflow: hidden;
28
- background: ${token(
29
- 'color.background.accent.orange.subtlest',
30
- 'antiquewhite',
31
- )};
32
- box-sizing: border-box;
33
- `;
34
-
35
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
36
- export const optionsWrapperStyles = css`
37
- display: flex;
38
-
39
- > * {
40
- flex: 1;
41
- margin: 10px;
42
- }
43
- `;
44
-
45
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
46
- export const cardDimensionsWrapperStyles = css`
47
- margin: 10px 10px ${token('space.250', '20px')} 10px;
48
- display: flex;
49
-
50
- > div {
51
- border: 1px solid ${token('color.border.bold', 'black')};
52
- margin: 5px;
53
- padding: 5px;
54
- border-radius: 3px;
55
- }
56
- `;
57
-
58
- export const flexWrapperStyles = css`
59
- display: flex;
60
- `;
61
- export const cardPreviewWrapperStyles = css`
62
- flex: 1;
63
- `;
64
-
65
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
66
- export const cardWrapperStyles = css`
67
- border: 1px solid ${token('color.border.bold', 'black')};
68
- padding: 10px;
69
- margin: 5px;
70
- flex-direction: column;
71
- width: 310px;
72
- height: 280px;
73
- overflow: auto;
74
- display: inline-block;
75
- `;
76
-
77
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
78
- export const cardFlowHeaderStyles = css`
79
- margin: ${token('space.250', '20px')} auto;
80
- padding: 10px 0;
81
- `;
82
-
83
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
84
- export const externalIdentifierWrapperStyles = css`
85
- display: flex;
86
- justify-content: space-around;
87
- margin: 0 auto;
88
-
89
- h2 {
90
- margin-bottom: 10px;
91
- }
92
- `;
93
-
94
- export const unhandledErrorCardWrapperStyles = css`
95
- padding: ${token('space.250', '20px')};
96
-
97
- > div:first-child {
98
- display: flex;
99
- margin-bottom: ${token('space.250', '20px')};
100
- }
101
-
102
- label {
103
- margin-right: ${token('space.250', '20px')};
104
- }
105
- `;
106
-
107
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
108
- export const inlineCardVideoWrapperItemStyles = css`
109
- padding: 10px;
110
- border: 1px solid ${token('color.border.bold', 'black')};
111
- margin: 10px;
112
- `;
113
-
114
- export const mediaViewerExampleColumnStyles = css`
115
- flex: 1;
116
-
117
- > div {
118
- }
119
- `;
120
-
121
- export const mediaViewerExampleWrapperStyles = css`
122
- display: flex;
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.6",
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.7.0",
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.0.0",
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.0.0",
50
+ "@atlaskit/primitives": "^4.1.0",
51
51
  "@atlaskit/spinner": "^16.0.0",
52
52
  "@atlaskit/theme": "^12.6.0",
53
- "@atlaskit/tokens": "^1.39.0",
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",