@atlaskit/media-card 77.10.5 → 77.10.7

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 (86) hide show
  1. package/CHANGELOG.md +12 -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/iconMessage/iconMessageWrapper.js +35 -6
  13. package/dist/cjs/card/ui/imageRenderer/imageRenderer.js +2 -2
  14. package/dist/cjs/card/ui/tickBox/styles.js +2 -16
  15. package/dist/cjs/card/ui/tickBox/tickBoxWrapper.js +25 -1
  16. package/dist/cjs/card/ui/unhandledErrorCard/index.js +1 -1
  17. package/dist/cjs/card/v2/cardV2.js +1 -1
  18. package/dist/cjs/card/v2/cardV2Loader.js +2 -2
  19. package/dist/cjs/card/v2/cardViewV2.js +2 -2
  20. package/dist/cjs/card/v2/cardviews/index.js +2 -2
  21. package/dist/cjs/card/v2/externalImageCard.js +2 -2
  22. package/dist/cjs/card/v2/fileCard.js +2 -2
  23. package/dist/cjs/card/v2/inlinePlayerLazyV2.js +2 -2
  24. package/dist/cjs/card/v2/inlinePlayerV2.js +2 -2
  25. package/dist/cjs/errors.js +1 -1
  26. package/dist/cjs/inline/loader.js +4 -4
  27. package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
  28. package/dist/cjs/inline/mediaInlineCard.js +2 -2
  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/iconMessage/iconMessageWrapper.js +36 -6
  39. package/dist/es2019/card/ui/tickBox/styles.js +2 -28
  40. package/dist/es2019/card/ui/tickBox/tickBoxWrapper.js +23 -1
  41. package/dist/es2019/card/v2/cardV2.js +1 -1
  42. package/dist/es2019/inline/loader.js +1 -1
  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/iconMessage/iconMessageWrapper.js +36 -6
  55. package/dist/esm/card/ui/tickBox/styles.js +2 -15
  56. package/dist/esm/card/ui/tickBox/tickBoxWrapper.js +26 -1
  57. package/dist/esm/card/ui/unhandledErrorCard/index.js +1 -1
  58. package/dist/esm/card/v2/cardV2.js +1 -1
  59. package/dist/esm/errors.js +1 -1
  60. package/dist/esm/inline/loader.js +2 -2
  61. package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
  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/card/ui/tickBox/styles.d.ts +0 -5
  70. package/dist/types/inline/loader.d.ts +3 -3
  71. package/dist/types/inline/mediaInlineAnalyticsErrorBoundary.d.ts +3 -3
  72. package/dist/types/utils/viewportDetector.d.ts +4 -4
  73. package/dist/types-ts4.5/card/media-card-analytics-error-boundary.d.ts +3 -3
  74. package/dist/types-ts4.5/card/ui/tickBox/styles.d.ts +0 -5
  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-ts4.5/utils/viewportDetector.d.ts +4 -4
  78. package/example-helpers/cardViewWrapper.tsx +30 -15
  79. package/example-helpers/index.tsx +6 -6
  80. package/example-helpers/styles.ts +119 -136
  81. package/package.json +5 -4
  82. package/dist/cjs/card/ui/iconMessage/styles.js +0 -22
  83. package/dist/es2019/card/ui/iconMessage/styles.js +0 -30
  84. package/dist/esm/card/ui/iconMessage/styles.js +0 -15
  85. package/dist/types/card/ui/iconMessage/styles.d.ts +0 -5
  86. package/dist/types-ts4.5/card/ui/iconMessage/styles.d.ts +0 -5
@@ -4,6 +4,7 @@ import { printFunctionCall, printScript } from '../printScript';
4
4
  // Any changes to this file must be tested directly in product before merging.
5
5
  // The scripts printed here might differ from what we observe in our internal tests
6
6
  // due to minimification, for example.
7
+
7
8
  export var GLOBAL_MEDIA_CARD_SSR = 'mediaCardSsr';
8
9
  export var GLOBAL_MEDIA_NAMESPACE = '__MEDIA_INTERNAL';
9
10
  export function getMediaGlobalScope() {
@@ -5,7 +5,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
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 React from 'react';
10
10
  import { Component } from 'react';
11
11
  import { ErrorIcon } from './errorIcon';
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
6
  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); }; }
7
- 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; } }
7
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
8
  import React from 'react';
9
9
  import { Component } from 'react';
10
10
  import { getDimensionsWithDefault } from './getDimensionsWithDefault';
@@ -5,7 +5,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
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
  /**@jsx jsx */
10
10
  import { jsx } from '@emotion/react';
11
11
  import { Component } from 'react';
@@ -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.5";
10
+ var packageVersion = "77.10.7";
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,7 +1,2 @@
1
1
  export declare const tickBoxClassName = "media-card-tickbox";
2
2
  export declare const tickboxFixedStyles: string;
3
- export declare const getSelectedStyles: (selected?: boolean) => string;
4
- export declare const wrapperStyles: {
5
- (selected?: boolean): import("@emotion/react").SerializedStyles;
6
- displayName: string;
7
- };
@@ -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,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,7 +1,2 @@
1
1
  export declare const tickBoxClassName = "media-card-tickbox";
2
2
  export declare const tickboxFixedStyles: string;
3
- export declare const getSelectedStyles: (selected?: boolean) => string;
4
- export declare const wrapperStyles: {
5
- (selected?: boolean): import("@emotion/react").SerializedStyles;
6
- displayName: string;
7
- };
@@ -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,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.5",
3
+ "version": "77.10.7",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
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",
@@ -47,9 +47,10 @@
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.1.0",
50
51
  "@atlaskit/spinner": "^16.0.0",
51
52
  "@atlaskit/theme": "^12.6.0",
52
- "@atlaskit/tokens": "^1.39.0",
53
+ "@atlaskit/tokens": "^1.41.0",
53
54
  "@atlaskit/tooltip": "^18.1.0",
54
55
  "@atlaskit/ufo": "^0.2.0",
55
56
  "@babel/runtime": "^7.0.0",
@@ -114,4 +115,4 @@
114
115
  }
115
116
  },
116
117
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
117
- }
118
+ }
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.iconMessageWrapperStyles = void 0;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
- var _react = require("@emotion/react");
10
- var _colors = require("@atlaskit/theme/colors");
11
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
12
- var breatheAnimation = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% { opacity: 1}\n 50% { opacity: 0.3 }\n 100% { opacity: 1; }"])));
13
- var animatedStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n animation-name: ", ";\n animation-duration: 3.5s;\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n"])), breatheAnimation);
14
- var getStylesBasedOnProps = function getStylesBasedOnProps(_ref) {
15
- var animated = _ref.animated,
16
- reducedFont = _ref.reducedFont;
17
- return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n overflow: hidden;\n opacity: 1;\n font-weight: 450;\n ", "\n color: ", ";\n text-align: center;\n ", "\n margin-bottom: -1em;\n padding: 3px 10px;\n"])), reducedFont ? 'font-size: 0.7em;' : '', "var(--ds-text-subtlest, ".concat(_colors.N300, ")"), animated ? animatedStyles : '');
18
- };
19
- var iconMessageWrapperStyles = exports.iconMessageWrapperStyles = function iconMessageWrapperStyles(props) {
20
- return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), getStylesBasedOnProps(props));
21
- };
22
- iconMessageWrapperStyles.displayName = 'IconMessageWrapper';