@atlaskit/media-viewer 46.5.0 → 47.0.2

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 (108) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/analytics/index.js +7 -16
  3. package/dist/cjs/analytics/ufoExperiences.js +6 -6
  4. package/dist/cjs/content.js +3 -3
  5. package/dist/cjs/download.js +2 -2
  6. package/dist/cjs/errorMessage.js +3 -3
  7. package/dist/cjs/header.js +6 -6
  8. package/dist/cjs/list.js +2 -2
  9. package/dist/cjs/media-viewer.js +3 -3
  10. package/dist/cjs/navigation.js +3 -3
  11. package/dist/cjs/styleWrappers.js +458 -0
  12. package/dist/cjs/styles.js +125 -0
  13. package/dist/cjs/version.json +1 -1
  14. package/dist/cjs/viewers/archiveSidebar/archive-sidebar-folder-entry.js +10 -7
  15. package/dist/cjs/viewers/archiveSidebar/archive-sidebar-header.js +5 -3
  16. package/dist/cjs/viewers/archiveSidebar/archive-sidebar-renderer.js +3 -3
  17. package/dist/cjs/viewers/archiveSidebar/archive-sidebar.js +5 -5
  18. package/dist/cjs/viewers/archiveSidebar/archive.js +16 -14
  19. package/dist/cjs/viewers/archiveSidebar/styleWrappers.js +123 -0
  20. package/dist/cjs/viewers/archiveSidebar/styles.js +58 -0
  21. package/dist/cjs/viewers/audio.js +10 -8
  22. package/dist/cjs/viewers/codeViewer/codeViewerRenderer.js +33 -12
  23. package/dist/cjs/viewers/codeViewer/index.js +2 -2
  24. package/dist/cjs/viewers/codeViewer/styles.js +21 -0
  25. package/dist/cjs/viewers/doc/index.js +2 -2
  26. package/dist/cjs/viewers/doc/pdfRenderer.js +8 -8
  27. package/dist/cjs/viewers/image/interactive-img.js +11 -9
  28. package/dist/cjs/viewers/video.js +3 -3
  29. package/dist/cjs/zoomControls.js +4 -4
  30. package/dist/es2019/analytics/index.js +4 -2
  31. package/dist/es2019/analytics/ufoExperiences.js +2 -1
  32. package/dist/es2019/content.js +1 -1
  33. package/dist/es2019/download.js +1 -1
  34. package/dist/es2019/errorMessage.js +1 -1
  35. package/dist/es2019/header.js +1 -1
  36. package/dist/es2019/list.js +1 -1
  37. package/dist/es2019/media-viewer.js +1 -1
  38. package/dist/es2019/navigation.js +1 -1
  39. package/dist/es2019/styleWrappers.js +298 -0
  40. package/dist/es2019/{styled.js → styles.js} +56 -65
  41. package/dist/es2019/version.json +1 -1
  42. package/dist/es2019/viewers/archiveSidebar/archive-sidebar-folder-entry.js +4 -2
  43. package/dist/es2019/viewers/archiveSidebar/archive-sidebar-header.js +2 -1
  44. package/dist/es2019/viewers/archiveSidebar/archive-sidebar-renderer.js +2 -2
  45. package/dist/es2019/viewers/archiveSidebar/archive-sidebar.js +1 -1
  46. package/dist/es2019/viewers/archiveSidebar/archive.js +3 -2
  47. package/dist/es2019/viewers/archiveSidebar/styleWrappers.js +90 -0
  48. package/dist/es2019/viewers/archiveSidebar/{styled.js → styles.js} +13 -13
  49. package/dist/es2019/viewers/audio.js +3 -2
  50. package/dist/es2019/viewers/codeViewer/codeViewerRenderer.js +26 -8
  51. package/dist/es2019/viewers/codeViewer/{styled.js → styles.js} +3 -3
  52. package/dist/es2019/viewers/doc/pdfRenderer.js +13 -11
  53. package/dist/es2019/viewers/image/interactive-img.js +6 -4
  54. package/dist/es2019/viewers/video.js +1 -1
  55. package/dist/es2019/zoomControls.js +1 -1
  56. package/dist/esm/analytics/index.js +4 -2
  57. package/dist/esm/analytics/ufoExperiences.js +2 -1
  58. package/dist/esm/components/media-viewer-loader.js +1 -1
  59. package/dist/esm/content.js +1 -1
  60. package/dist/esm/download.js +1 -1
  61. package/dist/esm/errorMessage.js +1 -1
  62. package/dist/esm/header.js +1 -1
  63. package/dist/esm/list.js +1 -1
  64. package/dist/esm/media-viewer.js +1 -1
  65. package/dist/esm/navigation.js +1 -1
  66. package/dist/esm/styleWrappers.js +338 -0
  67. package/dist/esm/styles.js +64 -0
  68. package/dist/esm/utils/getObjectUrlFromFileState.js +1 -1
  69. package/dist/esm/utils/index.js +1 -1
  70. package/dist/esm/version.json +1 -1
  71. package/dist/esm/viewers/archiveSidebar/archive-sidebar-folder-entry.js +5 -3
  72. package/dist/esm/viewers/archiveSidebar/archive-sidebar-header.js +2 -1
  73. package/dist/esm/viewers/archiveSidebar/archive-sidebar-renderer.js +3 -3
  74. package/dist/esm/viewers/archiveSidebar/archive-sidebar.js +3 -2
  75. package/dist/esm/viewers/archiveSidebar/archive.js +4 -3
  76. package/dist/esm/viewers/archiveSidebar/archiveViewerLoader.js +1 -1
  77. package/dist/esm/viewers/archiveSidebar/styleWrappers.js +79 -0
  78. package/dist/esm/viewers/archiveSidebar/styles.js +32 -0
  79. package/dist/esm/viewers/audio.js +4 -3
  80. package/dist/esm/viewers/codeViewer/codeViewerRenderer.js +27 -11
  81. package/dist/esm/viewers/codeViewer/index.js +1 -1
  82. package/dist/esm/viewers/codeViewer/styles.js +10 -0
  83. package/dist/esm/viewers/doc/index.js +1 -1
  84. package/dist/esm/viewers/doc/pdfRenderer.js +10 -9
  85. package/dist/esm/viewers/image/index.js +1 -1
  86. package/dist/esm/viewers/image/interactive-img.js +6 -4
  87. package/dist/esm/viewers/video.js +2 -2
  88. package/dist/esm/zoomControls.js +1 -1
  89. package/dist/types/analytics/index.d.ts +3 -1
  90. package/dist/types/styleWrappers.d.ts +114 -0
  91. package/dist/types/styles.d.ts +57 -0
  92. package/dist/types/viewers/archiveSidebar/styleWrappers.d.ts +24 -0
  93. package/dist/types/viewers/archiveSidebar/styles.d.ts +23 -0
  94. package/dist/types/viewers/codeViewer/codeViewerRenderer.d.ts +10 -3
  95. package/dist/types/viewers/codeViewer/styles.d.ts +2 -0
  96. package/example-helpers/MainWrapper.tsx +32 -4
  97. package/example-helpers/{styled.ts → styles.ts} +6 -6
  98. package/package.json +7 -7
  99. package/report.api.md +80 -0
  100. package/dist/cjs/styled.js +0 -209
  101. package/dist/cjs/viewers/archiveSidebar/styled.js +0 -88
  102. package/dist/cjs/viewers/codeViewer/styled.js +0 -24
  103. package/dist/esm/styled.js +0 -76
  104. package/dist/esm/viewers/archiveSidebar/styled.js +0 -32
  105. package/dist/esm/viewers/codeViewer/styled.js +0 -10
  106. package/dist/types/styled.d.ts +0 -61
  107. package/dist/types/viewers/archiveSidebar/styled.d.ts +0 -24
  108. package/dist/types/viewers/codeViewer/styled.d.ts +0 -3
@@ -18,7 +18,7 @@ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
18
18
  import HDIcon from '@atlaskit/icon/glyph/vid-hd-circle';
19
19
  import Spinner from '@atlaskit/spinner';
20
20
  import { B75, B200, DN400, DN60, N0 } from '@atlaskit/theme/colors';
21
- import { BaselineExtend, HDIconGroupWrapper, HDIconWrapper, ImageWrapper, Img } from '../../styled';
21
+ import { BaselineExtend, HDIconGroupWrapper, HDIconWrapper, ImageWrapper, Img } from '../../styleWrappers';
22
22
  import { ZoomLevel } from '../../domain/zoomLevel';
23
23
  import { closeOnDirectClick } from '../../utils/closeOnDirectClick';
24
24
  import { ZoomControls } from '../../zoomControls';
@@ -307,8 +307,9 @@ export var InteractiveImgComponent = /*#__PURE__*/function (_React$Component) {
307
307
  return /*#__PURE__*/React.createElement(ImageWrapper, {
308
308
  "data-testid": "media-viewer-image-content",
309
309
  onClick: this.onImageClicked,
310
- innerRef: this.saveWrapperRef,
311
- style: wrapperStyleOverride
310
+ ref: this.saveWrapperRef,
311
+ style: wrapperStyleOverride,
312
+ className: "media-viewer-image-content"
312
313
  }, /*#__PURE__*/React.createElement(Img, {
313
314
  "data-testid": "media-viewer-image",
314
315
  canDrag: canDrag,
@@ -318,7 +319,8 @@ export var InteractiveImgComponent = /*#__PURE__*/function (_React$Component) {
318
319
  onLoad: this.onImgLoad,
319
320
  onError: onError,
320
321
  onMouseDown: this.startDragging,
321
- shouldPixelate: zoomLevel.value > 1
322
+ shouldPixelate: zoomLevel.value > 1,
323
+ className: "media-viewer-image"
322
324
  }), /*#__PURE__*/React.createElement(BaselineExtend, null), /*#__PURE__*/React.createElement(ZoomControls, {
323
325
  zoomLevel: zoomLevel,
324
326
  onChange: this.onZoomChange
@@ -1,4 +1,3 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
3
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
6
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  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); }; }
12
12
 
@@ -17,7 +17,7 @@ import { getArtifactUrl, globalMediaEventEmitter } from '@atlaskit/media-client'
17
17
  import { CustomMediaPlayer } from '@atlaskit/media-ui';
18
18
  import { Outcome } from '../domain';
19
19
  import { MediaViewerError } from '../errors';
20
- import { Video, CustomVideoPlayerWrapper } from '../styled';
20
+ import { Video, CustomVideoPlayerWrapper } from '../styleWrappers';
21
21
  import { isIE } from '../utils/isIE';
22
22
  import { BaseViewer } from './base-viewer';
23
23
  import { getObjectUrlFromFileState } from '../utils/getObjectUrlFromFileState';
@@ -15,7 +15,7 @@ import { Component } from 'react';
15
15
  import { hideControlsClassName, MediaButton } from '@atlaskit/media-ui';
16
16
  import ZoomOutIcon from '@atlaskit/icon/glyph/media-services/zoom-out';
17
17
  import ZoomInIcon from '@atlaskit/icon/glyph/media-services/zoom-in';
18
- import { ZoomWrapper, ZoomControlsWrapper, ZoomLevelIndicator } from './styled';
18
+ import { ZoomWrapper, ZoomControlsWrapper, ZoomLevelIndicator } from './styleWrappers';
19
19
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
20
20
  import { fireAnalytics } from './analytics/';
21
21
  import { createZoomInButtonClickEvent } from './analytics/events/ui/zoomInButtonClicked';
@@ -2,9 +2,10 @@ import { FileState, RequestMetadata } from '@atlaskit/media-client';
2
2
  import { FileAttributes, WithFileAttributes, FailureAttributes } from '@atlaskit/media-common';
3
3
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
4
4
  import { PrimaryErrorReason } from '../errors';
5
- import { name as packageName, version as packageVersion } from '../version.json';
6
5
  import { MediaViewerEventPayload } from './events';
7
6
  declare const componentName = "mediaViewer";
7
+ declare const packageName: string;
8
+ declare const packageVersion: string;
8
9
  export { packageName, packageVersion, componentName, componentName as component, };
9
10
  export declare const relevantFlags: {
10
11
  newCardExperience: boolean;
@@ -14,6 +15,7 @@ export declare const relevantFlags: {
14
15
  mediaInline: boolean;
15
16
  folderUploads: boolean;
16
17
  mediaUploadApiV2: boolean;
18
+ memoryCacheLogging: boolean;
17
19
  };
18
20
  export declare const LOGGED_FEATURE_FLAGS: (keyof import("@atlaskit/media-common").MediaFeatureFlags)[];
19
21
  export declare const LOGGED_FEATURE_FLAG_KEYS: string[];
@@ -0,0 +1,114 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { CSSProperties, MouseEvent, ReactNode } from 'react';
4
+ import { MediaType } from '@atlaskit/media-client';
5
+ declare type Children = {
6
+ children: ReactNode;
7
+ };
8
+ declare type ClassName = {
9
+ className: string;
10
+ };
11
+ declare type DataTestID = {
12
+ 'data-testid'?: string | undefined;
13
+ };
14
+ declare type BlanketProps = DataTestID & Children & ClassName;
15
+ export declare const Blanket: ({ "data-testid": datatestId, className, children, }: BlanketProps) => jsx.JSX.Element;
16
+ export declare const HeaderWrapper: {
17
+ ({ className, children, }: ClassName & Children): jsx.JSX.Element;
18
+ displayName: string;
19
+ };
20
+ export declare const ListWrapper: {
21
+ ({ children }: Children): jsx.JSX.Element;
22
+ displayName: string;
23
+ };
24
+ export declare const ArrowsWrapper: ({ children }: Children) => jsx.JSX.Element;
25
+ export declare const CloseButtonWrapper: ({ className, children, }: ClassName & Children) => jsx.JSX.Element;
26
+ declare type ContentWrapperProps = {
27
+ isSidebarVisible: boolean | undefined;
28
+ } & Children;
29
+ export declare const ContentWrapper: ({ isSidebarVisible, children, }: ContentWrapperProps) => jsx.JSX.Element;
30
+ export declare const ZoomWrapper: ({ className, children }: ClassName & Children) => jsx.JSX.Element;
31
+ export declare const ZoomControlsWrapper: ({ children }: Children) => jsx.JSX.Element;
32
+ export declare const ZoomLevelIndicator: ({ children }: Children) => jsx.JSX.Element;
33
+ export declare const HDIconGroupWrapper: ({ className, children, }: ClassName & Children) => jsx.JSX.Element;
34
+ export declare const HDIconWrapper: ({ children }: Children) => jsx.JSX.Element;
35
+ declare type ErrorMessageWrapperProps = DataTestID & Children;
36
+ export declare const ErrorMessageWrapper: ({ "data-testid": datatestId, children, }: ErrorMessageWrapperProps) => jsx.JSX.Element;
37
+ declare type ErrorImageProps = {
38
+ alt: string | undefined;
39
+ src: string;
40
+ };
41
+ export declare const ErrorImage: ({ src, alt }: ErrorImageProps) => jsx.JSX.Element;
42
+ declare type VideoProps = {
43
+ controls: boolean;
44
+ src: string;
45
+ autoPlay: boolean;
46
+ };
47
+ export declare const Video: ({ autoPlay, controls, src }: VideoProps) => jsx.JSX.Element;
48
+ export declare const PDFWrapper: import("react").ForwardRefExoticComponent<DataTestID & Children & import("react").RefAttributes<unknown>>;
49
+ export declare const Arrow: ({ className, children }: ClassName & Children) => jsx.JSX.Element;
50
+ export declare const LeftWrapper: ({ children }: Children) => jsx.JSX.Element;
51
+ export declare const RightWrapper: ({ children }: Children) => jsx.JSX.Element;
52
+ export declare type HeaderProps = {
53
+ isArchiveSideBarVisible: boolean;
54
+ };
55
+ export declare const Header: ({ children, isArchiveSideBarVisible, className, }: Children & HeaderProps & ClassName) => jsx.JSX.Element;
56
+ export declare const LeftHeader: ({ children }: Children) => jsx.JSX.Element;
57
+ export declare type ImageWrapperProps = {
58
+ onClick: (event: MouseEvent<HTMLDivElement>) => void;
59
+ style: CSSProperties;
60
+ } & Children & DataTestID;
61
+ export declare const ImageWrapper: import("react").ForwardRefExoticComponent<{
62
+ onClick: (event: MouseEvent<HTMLDivElement>) => void;
63
+ style: CSSProperties;
64
+ } & Children & DataTestID & ClassName & import("react").RefAttributes<unknown>>;
65
+ export declare const BaselineExtend: () => jsx.JSX.Element;
66
+ export declare type ImgProps = {
67
+ canDrag: boolean;
68
+ isDragging: boolean;
69
+ shouldPixelate: boolean;
70
+ src: string;
71
+ style: CSSProperties;
72
+ onLoad: (ev: React.SyntheticEvent<HTMLImageElement>) => void;
73
+ onMouseDown: (ev: MouseEvent<{}>) => void;
74
+ onError: (() => void) | undefined;
75
+ } & DataTestID & ClassName;
76
+ export declare const Img: ({ canDrag, isDragging, shouldPixelate, "data-testid": datatestId, src, style, onLoad, onError, onMouseDown, className, }: ImgProps) => jsx.JSX.Element;
77
+ export declare const MedatadataTextWrapper: ({ children }: Children) => jsx.JSX.Element;
78
+ export declare const MetadataWrapper: ({ children }: Children) => jsx.JSX.Element;
79
+ declare type MetadataFileNameProps = DataTestID & Children;
80
+ export declare const MetadataFileName: ({ "data-testid": datatestId, children, }: MetadataFileNameProps) => jsx.JSX.Element;
81
+ declare type MetadataSubTextProps = DataTestID & Children;
82
+ export declare const MetadataSubText: ({ "data-testid": datatestId, children, }: MetadataSubTextProps) => jsx.JSX.Element;
83
+ export declare const MetadataIconWrapper: ({ children }: Children) => jsx.JSX.Element;
84
+ export interface IconWrapperProps {
85
+ type: MediaType;
86
+ }
87
+ export declare const RightHeader: ({ children }: Children) => jsx.JSX.Element;
88
+ export declare const CustomAudioPlayerWrapper: ({ children }: Children) => jsx.JSX.Element;
89
+ declare type AudioPlayerProps = DataTestID & Children;
90
+ export declare const AudioPlayer: {
91
+ ({ "data-testid": datatestId, children, }: AudioPlayerProps): jsx.JSX.Element;
92
+ displayName: string;
93
+ };
94
+ declare type AudioProps = {
95
+ autoPlay: boolean;
96
+ controls: boolean;
97
+ src: string | undefined;
98
+ preload: string;
99
+ };
100
+ export declare const Audio: import("react").ForwardRefExoticComponent<AudioProps & import("react").RefAttributes<unknown>>;
101
+ declare type AudioCoverProps = {
102
+ alt: string | undefined;
103
+ src: string;
104
+ };
105
+ export declare const AudioCover: ({ src, alt }: AudioCoverProps) => jsx.JSX.Element;
106
+ export declare const DefaultCoverWrapper: ({ children }: Children) => jsx.JSX.Element;
107
+ export declare const DownloadButtonWrapper: ({ children }: Children) => jsx.JSX.Element;
108
+ declare type CustomVideoPlayerWrapperProps = DataTestID & Children;
109
+ export declare const CustomVideoPlayerWrapper: ({ "data-testid": datatestId, children, }: CustomVideoPlayerWrapperProps) => jsx.JSX.Element;
110
+ declare type SidebarWrapperProps = DataTestID & Children;
111
+ export declare const SidebarWrapper: ({ "data-testid": datatestId, children, }: SidebarWrapperProps) => jsx.JSX.Element;
112
+ export declare const SpinnerWrapper: ({ children }: Children) => jsx.JSX.Element;
113
+ export declare const FormattedMessageWrapper: ({ children }: Children) => jsx.JSX.Element;
114
+ export {};
@@ -0,0 +1,57 @@
1
+ import { MediaType } from '@atlaskit/media-client';
2
+ export declare const blanketColor = "#1B2638";
3
+ export declare const blanketStyles: import("@emotion/react").SerializedStyles;
4
+ export declare const headerWrapperStyles: import("@emotion/react").SerializedStyles;
5
+ export interface ContentWrapperProps {
6
+ showControls: boolean;
7
+ }
8
+ export declare const listWrapperStyles: import("@emotion/react").SerializedStyles;
9
+ export declare const arrowsWrapperStyles: import("@emotion/react").SerializedStyles;
10
+ export declare const closeButtonWrapperStyles: import("@emotion/react").SerializedStyles;
11
+ export declare const contentWrapperStyles: ({ isSidebarVisible, }: {
12
+ isSidebarVisible?: boolean | undefined;
13
+ }) => import("@emotion/react").SerializedStyles;
14
+ export declare const zoomWrapperStyles: import("@emotion/react").SerializedStyles;
15
+ export declare const zoomControlsWrapperStyles: import("@emotion/react").SerializedStyles;
16
+ export declare const zoomLevelIndicatorStyles: import("@emotion/react").SerializedStyles;
17
+ export declare const hdIconGroupWrapperStyles: import("@emotion/react").SerializedStyles;
18
+ export declare const hdIconWrapperStyles: import("@emotion/react").SerializedStyles;
19
+ export declare const errorMessageWrapperStyles: import("@emotion/react").SerializedStyles;
20
+ export declare const errorImageStyles: import("@emotion/react").SerializedStyles;
21
+ export declare const videoStyles: import("@emotion/react").SerializedStyles;
22
+ export declare const pdfWrapperStyles: import("@emotion/react").SerializedStyles;
23
+ export declare const arrowStyles: import("@emotion/react").SerializedStyles;
24
+ export declare const leftWrapperStyles: import("@emotion/react").SerializedStyles;
25
+ export declare const rightWrapperStyles: import("@emotion/react").SerializedStyles;
26
+ export declare type HeaderProps = {
27
+ isArchiveSideBarVisible: boolean;
28
+ };
29
+ export declare const headerStyles: ({ isArchiveSideBarVisible }: HeaderProps) => import("@emotion/react").SerializedStyles;
30
+ export declare const leftHeaderStyles: import("@emotion/react").SerializedStyles;
31
+ export declare const imageWrapperStyles: import("@emotion/react").SerializedStyles;
32
+ export declare const baselineExtendStyles: import("@emotion/react").SerializedStyles;
33
+ export declare type ImgProps = {
34
+ cursor: string;
35
+ shouldPixelate: boolean;
36
+ };
37
+ export declare const imgStyles: ({ cursor, shouldPixelate }: ImgProps) => import("@emotion/react").SerializedStyles;
38
+ export declare const medatadataTextWrapperStyles: import("@emotion/react").SerializedStyles;
39
+ export declare const metadataWrapperStyles: import("@emotion/react").SerializedStyles;
40
+ export declare const metadataFileNameStyles: import("@emotion/react").SerializedStyles;
41
+ export declare const metadataSubTextStyles: import("@emotion/react").SerializedStyles;
42
+ export declare const metadataIconWrapperStyles: import("@emotion/react").SerializedStyles;
43
+ export interface IconWrapperProps {
44
+ type: MediaType;
45
+ }
46
+ export declare const rightHeaderStyles: import("@emotion/react").SerializedStyles;
47
+ export declare const customAudioPlayerWrapperStyles: import("@emotion/react").SerializedStyles;
48
+ export declare const audioPlayerStyles: import("@emotion/react").SerializedStyles;
49
+ export declare const audioStyles: import("@emotion/react").SerializedStyles;
50
+ export declare const audioCoverStyles: import("@emotion/react").SerializedStyles;
51
+ export declare const defaultCoverWrapperStyles: import("@emotion/react").SerializedStyles;
52
+ export declare const downloadButtonWrapperStyles: import("@emotion/react").SerializedStyles;
53
+ export declare const customVideoPlayerWrapperStyles: import("@emotion/react").SerializedStyles;
54
+ export declare const sidebarWrapperStyles: import("@emotion/react").SerializedStyles;
55
+ export declare const spinnerWrapperStyles: import("@emotion/react").SerializedStyles;
56
+ export declare const errorReasonTipStyles: import("@emotion/react").SerializedStyles;
57
+ export declare const formattedMessageWrapperStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,24 @@
1
+ /** @jsx jsx */
2
+ import { ReactNode, MouseEvent, Key } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ declare type Children = {
5
+ children?: ReactNode;
6
+ };
7
+ declare type OnClick = {
8
+ onClick: (event: MouseEvent<HTMLDivElement>) => void;
9
+ };
10
+ export declare const ArchiveItemViewerWrapper: ({ children }: Children) => jsx.JSX.Element;
11
+ export declare const ArchiveSideBar: ({ children }: Children) => jsx.JSX.Element;
12
+ export declare const ArchiveSidebarFolderWrapper: ({ children }: Children) => jsx.JSX.Element;
13
+ export declare const ArchiveDownloadButtonWrapper: ({ children, onClick, }: Children & OnClick) => jsx.JSX.Element;
14
+ export declare const SidebarItemWrapper: ({ children }: Children) => jsx.JSX.Element;
15
+ export declare const ArchiveSidebarFileEntryWrapper: ({ children, index, }: {
16
+ index: Key;
17
+ } & Children) => jsx.JSX.Element;
18
+ export declare const ArchiveLayout: ({ children }: Children) => jsx.JSX.Element;
19
+ export declare const ArchiveViewerWrapper: ({ children }: Children) => jsx.JSX.Element;
20
+ export declare const Separator: () => jsx.JSX.Element;
21
+ export declare const SidebarHeaderWrapper: ({ children }: Children) => jsx.JSX.Element;
22
+ export declare const SidebarHeaderIcon: ({ children }: Children) => jsx.JSX.Element;
23
+ export declare const SidebarHeaderEntry: ({ children }: Children) => jsx.JSX.Element;
24
+ export {};
@@ -0,0 +1,23 @@
1
+ export declare const ArchiveSideBarWidth = 300;
2
+ export declare const archiveItemViewerWrapperStyles: import("@emotion/react").SerializedStyles;
3
+ export declare const archiveSideBarStyles: import("@emotion/react").SerializedStyles;
4
+ export declare const archiveSidebarFolderWrapperStyles: import("@emotion/react").SerializedStyles;
5
+ export declare const archiveDownloadButtonWrapperStyles: import("@emotion/react").SerializedStyles;
6
+ export declare const sidebarItemWrapperStyles: import("@emotion/react").SerializedStyles;
7
+ export declare const archiveSidebarFileEntryWrapperStyles: import("@emotion/react").SerializedStyles;
8
+ export declare const archiveLayoutStyles: import("@emotion/react").SerializedStyles;
9
+ export declare const archiveViewerWrapperStyles: import("@emotion/react").SerializedStyles;
10
+ export declare const separatorStyles: import("@emotion/react").SerializedStyles;
11
+ export declare const sidebarHeaderWrapperStyles: import("@emotion/react").SerializedStyles;
12
+ export declare const sidebarHeaderIconStyles: import("@emotion/react").SerializedStyles;
13
+ export declare const sidebarHeaderEntryStyles: import("@emotion/react").SerializedStyles;
14
+ /** TODO Replace background colors of item with theme from @atlaskit/tokens once ready*/
15
+ export declare const itemStyle: {
16
+ backgroundColor: string;
17
+ fill: string;
18
+ color: string;
19
+ ':hover': {
20
+ backgroundColor: string;
21
+ color: string;
22
+ };
23
+ };
@@ -1,8 +1,15 @@
1
- import React from 'react';
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { ReactNode, Component } from 'react';
2
4
  import { FileState } from '@atlaskit/media-client';
3
5
  import { Outcome } from '../../domain';
4
6
  import type { SupportedLanguages } from '@atlaskit/code/types';
5
7
  import { MediaViewerError } from '../../errors';
8
+ export declare const CodeViewWrapper: ({ children, "data-testid": testId, }: {
9
+ children: ReactNode;
10
+ 'data-testid': string | undefined;
11
+ }) => jsx.JSX.Element;
12
+ export declare const CodeViewerHeaderBar: () => jsx.JSX.Element;
6
13
  export declare type Props = {
7
14
  item: FileState;
8
15
  src: string;
@@ -15,10 +22,10 @@ export declare type Props = {
15
22
  export declare type State = {
16
23
  doc: Outcome<any, MediaViewerError>;
17
24
  };
18
- export declare class CodeViewRenderer extends React.Component<Props, State> {
25
+ export declare class CodeViewRenderer extends Component<Props, State> {
19
26
  state: State;
20
27
  componentDidMount(): void;
21
28
  componentWillUnmount(): void;
22
29
  private init;
23
- render(): JSX.Element;
30
+ render(): jsx.JSX.Element;
24
31
  }
@@ -0,0 +1,2 @@
1
+ export declare const codeViewWrapperStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const codeViewerHeaderBarStyles: import("@emotion/react").SerializedStyles;
@@ -1,13 +1,41 @@
1
- import React, { ReactNode } from 'react';
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { ReactNode, FC } from 'react';
2
4
  import { enableMediaUfoLogger } from '@atlaskit/media-test-helpers';
3
5
  import { payloadPublisher } from '@atlassian/ufo';
4
- import { Container } from './styled';
6
+ import {
7
+ containerStyles,
8
+ groupStyles,
9
+ buttonListStyles,
10
+ mVSidebarHeaderStyles,
11
+ mVSidebarStyles,
12
+ } from './styles';
5
13
 
6
14
  type Props = {
7
15
  children: ReactNode;
16
+ shouldApplyStyles?: Boolean;
8
17
  };
9
18
 
10
- export const MainWrapper: React.FC<Props> = ({ children }) => {
19
+ export const MainWrapper: FC<Props> = ({
20
+ children,
21
+ shouldApplyStyles = true,
22
+ }) => {
11
23
  enableMediaUfoLogger(payloadPublisher);
12
- return <Container>{children}</Container>;
24
+ return <div css={shouldApplyStyles && containerStyles}>{children}</div>;
25
+ };
26
+
27
+ export const Group: FC<Props> = ({ children }) => {
28
+ return <div css={groupStyles}>{children}</div>;
29
+ };
30
+
31
+ export const ButtonList: FC<Props> = ({ children }) => {
32
+ return <ul css={buttonListStyles}>{children}</ul>;
33
+ };
34
+
35
+ export const MVSidebarHeader: FC<Props> = ({ children }) => {
36
+ return <div css={mVSidebarHeaderStyles}>{children}</div>;
37
+ };
38
+
39
+ export const MVSidebar: FC<Props> = ({ children }) => {
40
+ return <div css={mVSidebarStyles}>{children}</div>;
13
41
  };
@@ -1,21 +1,21 @@
1
- import styled from 'styled-components';
1
+ import { css } from '@emotion/react';
2
2
 
3
- export const Container = styled.div`
3
+ export const containerStyles = css`
4
4
  display: flex;
5
5
  flex-direction: row;
6
6
  flex-wrap: wrap;
7
7
  `;
8
- export const Group = styled.div`
8
+ export const groupStyles = css`
9
9
  width: 250px;
10
10
  padding: 20px;
11
11
  `;
12
12
 
13
- export const ButtonList = styled.ul`
13
+ export const buttonListStyles = css`
14
14
  padding-left: 0;
15
15
  list-style: none;
16
16
  `;
17
17
 
18
- export const MVSidebar = styled.div`
18
+ export const mVSidebarStyles = css`
19
19
  height: calc(100vh - 64px);
20
20
  padding: 32px;
21
21
  overflow: auto;
@@ -31,7 +31,7 @@ export const MVSidebar = styled.div`
31
31
  }
32
32
  `;
33
33
 
34
- export const MVSidebarHeader = styled.div`
34
+ export const mVSidebarHeaderStyles = css`
35
35
  display: flex;
36
36
  width: 100%;
37
37
  justify-content: space-between;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-viewer",
3
- "version": "46.5.0",
3
+ "version": "47.0.2",
4
4
  "description": "MediaViewer is Atlassian's powerful solution for viewing files on the web. It's both powerful and extendable yet easy-to-integrate",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,8 +32,8 @@
32
32
  "@atlaskit/code": "^14.3.0",
33
33
  "@atlaskit/icon": "^21.10.0",
34
34
  "@atlaskit/icon-file-type": "^6.3.0",
35
- "@atlaskit/media-client": "^17.0.0",
36
- "@atlaskit/media-common": "^2.15.0",
35
+ "@atlaskit/media-client": "^17.1.0",
36
+ "@atlaskit/media-common": "^2.16.0",
37
37
  "@atlaskit/media-ui": "^22.1.0",
38
38
  "@atlaskit/side-navigation": "^1.2.3",
39
39
  "@atlaskit/spinner": "^15.0.0",
@@ -49,14 +49,14 @@
49
49
  "unzipit": "^1.3.0"
50
50
  },
51
51
  "peerDependencies": {
52
+ "@emotion/react": "^11.7.1",
52
53
  "react": "^16.8.0",
53
- "react-intl-next": "npm:react-intl@^5.18.1",
54
- "styled-components": "^3.2.6"
54
+ "react-intl-next": "npm:react-intl@^5.18.1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@atlaskit/button": "^16.3.0",
58
58
  "@atlaskit/docs": "*",
59
- "@atlaskit/media-card": "^73.8.0",
59
+ "@atlaskit/media-card": "^74.1.0",
60
60
  "@atlaskit/media-core": "^33.0.0",
61
61
  "@atlaskit/media-integration-test-helpers": "^2.6.0",
62
62
  "@atlaskit/media-test-helpers": "^30.0.0",
@@ -76,7 +76,7 @@
76
76
  "react-dom": "^16.8.0",
77
77
  "react-intl-next": "npm:react-intl@^5.18.1",
78
78
  "rxjs": "^5.5.0",
79
- "typescript": "4.2.4",
79
+ "typescript": "4.3.5",
80
80
  "wait-for-expect": "^1.2.0"
81
81
  },
82
82
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
package/report.api.md ADDED
@@ -0,0 +1,80 @@
1
+ ## API Report File for "@atlaskit/media-viewer"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+ import { Identifier } from '@atlaskit/media-client';
7
+ import { MediaClient } from '@atlaskit/media-client';
8
+ import { MediaFeatureFlags } from '@atlaskit/media-common';
9
+ import { default as React_2 } from 'react';
10
+ import { ReactNode } from 'react';
11
+ import { WithMediaClientConfigProps } from '@atlaskit/media-client';
12
+
13
+ declare interface AsyncMediaViewerState {
14
+ MediaViewer?: MediaViewerWithMediaClientConfigComponent;
15
+ MediaViewerErrorBoundary?: MediaViewerErrorBoundaryComponent;
16
+ }
17
+
18
+ export declare class MediaViewer extends React_2.PureComponent<
19
+ MediaViewerWithMediaClientConfigProps & AsyncMediaViewerState,
20
+ AsyncMediaViewerState
21
+ > {
22
+ static displayName: string;
23
+ static MediaViewer?: MediaViewerWithMediaClientConfigComponent;
24
+ static MediaViewerErrorBoundary?: MediaViewerErrorBoundaryComponent;
25
+ state: AsyncMediaViewerState;
26
+ UNSAFE_componentWillMount(): Promise<void>;
27
+ render(): JSX.Element;
28
+ }
29
+
30
+ declare type MediaViewerAnalyticsErrorBoundaryProps = {
31
+ data?: {
32
+ [k: string]: any;
33
+ };
34
+ };
35
+
36
+ export declare interface MediaViewerDataSource {
37
+ list?: Array<Identifier>;
38
+ collectionName?: string;
39
+ }
40
+
41
+ declare type MediaViewerErrorBoundaryComponent = React_2.ComponentType<
42
+ MediaViewerAnalyticsErrorBoundaryProps
43
+ >;
44
+
45
+ export declare interface MediaViewerExtensions {
46
+ sidebar?: {
47
+ icon: ReactNode;
48
+ renderer: (
49
+ selectedIdentifier: Identifier,
50
+ actions: MediaViewerExtensionsActions,
51
+ ) => ReactNode;
52
+ };
53
+ }
54
+
55
+ export declare interface MediaViewerExtensionsActions {
56
+ close: () => void;
57
+ }
58
+
59
+ export declare interface MediaViewerProps {
60
+ readonly mediaClient: MediaClient;
61
+ readonly selectedItem: Identifier;
62
+ readonly dataSource: MediaViewerDataSource;
63
+ readonly collectionName: string;
64
+ readonly pageSize?: number;
65
+ readonly onClose?: () => void;
66
+ readonly featureFlags?: MediaFeatureFlags;
67
+ readonly extensions?: MediaViewerExtensions;
68
+ readonly contextId?: string;
69
+ }
70
+
71
+ declare type MediaViewerWithMediaClientConfigComponent = React_2.ComponentType<
72
+ MediaViewerWithMediaClientConfigProps
73
+ >;
74
+
75
+ declare type MediaViewerWithMediaClientConfigProps = WithMediaClientConfigProps<
76
+ MediaViewerProps
77
+ >;
78
+
79
+ export {};
80
+ ```