@atlaskit/media-viewer 49.2.7 → 49.4.0

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 +23 -0
  2. package/dist/cjs/analytics/events/operational/download.js +59 -0
  3. package/dist/cjs/analytics/index.js +1 -1
  4. package/dist/cjs/analytics/ufoExperiences.js +1 -1
  5. package/dist/cjs/components/media-viewer.js +4 -2
  6. package/dist/cjs/download.js +60 -27
  7. package/dist/cjs/header.js +4 -2
  8. package/dist/cjs/item-viewer.js +32 -17
  9. package/dist/cjs/list.js +11 -3
  10. package/dist/cjs/media-viewer.js +4 -2
  11. package/dist/cjs/viewerOptions.js +5 -0
  12. package/dist/cjs/viewers/archiveSidebar/archive.js +52 -8
  13. package/dist/cjs/viewers/base-viewer.js +4 -2
  14. package/dist/cjs/viewers/customViewer/customViewer.js +55 -0
  15. package/dist/es2019/analytics/events/operational/download.js +55 -0
  16. package/dist/es2019/analytics/index.js +1 -1
  17. package/dist/es2019/analytics/ufoExperiences.js +1 -1
  18. package/dist/es2019/components/media-viewer.js +4 -2
  19. package/dist/es2019/download.js +53 -24
  20. package/dist/es2019/header.js +4 -2
  21. package/dist/es2019/item-viewer.js +30 -17
  22. package/dist/es2019/list.js +12 -4
  23. package/dist/es2019/media-viewer.js +4 -2
  24. package/dist/es2019/viewerOptions.js +1 -0
  25. package/dist/es2019/viewers/archiveSidebar/archive.js +27 -5
  26. package/dist/es2019/viewers/base-viewer.js +4 -2
  27. package/dist/es2019/viewers/customViewer/customViewer.js +37 -0
  28. package/dist/esm/analytics/events/operational/download.js +53 -0
  29. package/dist/esm/analytics/index.js +1 -1
  30. package/dist/esm/analytics/ufoExperiences.js +1 -1
  31. package/dist/esm/components/media-viewer.js +4 -2
  32. package/dist/esm/download.js +60 -25
  33. package/dist/esm/header.js +4 -2
  34. package/dist/esm/item-viewer.js +32 -17
  35. package/dist/esm/list.js +12 -4
  36. package/dist/esm/media-viewer.js +4 -2
  37. package/dist/esm/viewerOptions.js +1 -0
  38. package/dist/esm/viewers/archiveSidebar/archive.js +52 -8
  39. package/dist/esm/viewers/base-viewer.js +4 -2
  40. package/dist/esm/viewers/customViewer/customViewer.js +46 -0
  41. package/dist/types/analytics/events/index.d.ts +2 -1
  42. package/dist/types/analytics/events/operational/_mediaFile.d.ts +1 -1
  43. package/dist/types/analytics/events/operational/download.d.ts +9 -0
  44. package/dist/types/components/media-viewer.d.ts +1 -1
  45. package/dist/types/components/types.d.ts +2 -0
  46. package/dist/types/download.d.ts +7 -11
  47. package/dist/types/errors.d.ts +2 -2
  48. package/dist/types/header.d.ts +3 -2
  49. package/dist/types/index.d.ts +1 -0
  50. package/dist/types/item-viewer.d.ts +7 -2
  51. package/dist/types/list.d.ts +3 -1
  52. package/dist/types/media-viewer.d.ts +2 -0
  53. package/dist/types/viewerOptions.d.ts +21 -0
  54. package/dist/types/viewers/archiveSidebar/types.d.ts +4 -0
  55. package/dist/types/viewers/audio.d.ts +2 -0
  56. package/dist/types/viewers/base-viewer.d.ts +2 -0
  57. package/dist/types/viewers/codeViewer/index.d.ts +2 -0
  58. package/dist/types/viewers/customViewer/customViewer.d.ts +12 -0
  59. package/dist/types/viewers/doc/index.d.ts +2 -0
  60. package/dist/types/viewers/image/index.d.ts +1 -1
  61. package/dist/types/viewers/video.d.ts +2 -0
  62. package/dist/types-ts4.5/analytics/events/index.d.ts +2 -1
  63. package/dist/types-ts4.5/analytics/events/operational/_mediaFile.d.ts +1 -1
  64. package/dist/types-ts4.5/analytics/events/operational/download.d.ts +9 -0
  65. package/dist/types-ts4.5/components/media-viewer.d.ts +1 -1
  66. package/dist/types-ts4.5/components/types.d.ts +2 -0
  67. package/dist/types-ts4.5/download.d.ts +7 -11
  68. package/dist/types-ts4.5/errors.d.ts +2 -2
  69. package/dist/types-ts4.5/header.d.ts +3 -2
  70. package/dist/types-ts4.5/index.d.ts +1 -0
  71. package/dist/types-ts4.5/item-viewer.d.ts +7 -2
  72. package/dist/types-ts4.5/list.d.ts +3 -1
  73. package/dist/types-ts4.5/media-viewer.d.ts +2 -0
  74. package/dist/types-ts4.5/viewerOptions.d.ts +21 -0
  75. package/dist/types-ts4.5/viewers/archiveSidebar/types.d.ts +4 -0
  76. package/dist/types-ts4.5/viewers/audio.d.ts +2 -0
  77. package/dist/types-ts4.5/viewers/base-viewer.d.ts +2 -0
  78. package/dist/types-ts4.5/viewers/codeViewer/index.d.ts +2 -0
  79. package/dist/types-ts4.5/viewers/customViewer/customViewer.d.ts +12 -0
  80. package/dist/types-ts4.5/viewers/doc/index.d.ts +2 -0
  81. package/dist/types-ts4.5/viewers/image/index.d.ts +1 -1
  82. package/dist/types-ts4.5/viewers/video.d.ts +2 -0
  83. package/package.json +6 -6
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { FileState, MediaClient, NonErrorFileState } from '@atlaskit/media-client';
3
+ import { MediaViewerError } from '../../errors';
4
+ import type { CustomRendererConfig } from '../../viewerOptions';
5
+ export type Props = {
6
+ mediaClient: MediaClient;
7
+ item: NonErrorFileState;
8
+ customRendererConfig: CustomRendererConfig;
9
+ onError: (error: MediaViewerError, fileItem?: FileState) => void;
10
+ onSuccess: () => void;
11
+ };
12
+ export declare const CustomViewer: ({ mediaClient, item, customRendererConfig, onSuccess, onError, }: Props) => JSX.Element;
@@ -3,6 +3,7 @@ import { type MediaClient, type FileState } from '@atlaskit/media-client';
3
3
  import { Outcome } from '../../domain';
4
4
  import { MediaViewerError } from '../../errors';
5
5
  import { BaseViewer } from '../base-viewer';
6
+ import { type MediaTraceContext } from '@atlaskit/media-common';
6
7
  export type Props = {
7
8
  mediaClient: MediaClient;
8
9
  item: FileState;
@@ -10,6 +11,7 @@ export type Props = {
10
11
  onClose?: () => void;
11
12
  onError: (error: MediaViewerError) => void;
12
13
  onSuccess: () => void;
14
+ traceContext: MediaTraceContext;
13
15
  };
14
16
  export type State = {
15
17
  content: Outcome<string, MediaViewerError>;
@@ -13,7 +13,7 @@ export type ImageViewerProps = {
13
13
  onError: (error: MediaViewerError) => void;
14
14
  onClose?: () => void;
15
15
  contextId?: string;
16
- traceContext?: MediaTraceContext;
16
+ traceContext: MediaTraceContext;
17
17
  };
18
18
  export interface ImageViewerContent {
19
19
  objectUrl: ObjectUrl;
@@ -4,6 +4,7 @@ import { type WithShowControlMethodProp } from '@atlaskit/media-ui';
4
4
  import { Outcome } from '../domain';
5
5
  import { MediaViewerError } from '../errors';
6
6
  import { type BaseState, BaseViewer } from './base-viewer';
7
+ import { type MediaTraceContext } from '@atlaskit/media-common';
7
8
  export type Props = Readonly<{
8
9
  item: FileState;
9
10
  mediaClient: MediaClient;
@@ -11,6 +12,7 @@ export type Props = Readonly<{
11
12
  previewCount: number;
12
13
  onCanPlay: () => void;
13
14
  onError: (error: MediaViewerError) => void;
15
+ traceContext: MediaTraceContext;
14
16
  } & WithShowControlMethodProp>;
15
17
  export type State = BaseState<string> & {
16
18
  isHDActive: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-viewer",
3
- "version": "49.2.7",
3
+ "version": "49.4.0",
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/"
@@ -40,14 +40,14 @@
40
40
  "@atlaskit/form": "^10.5.0",
41
41
  "@atlaskit/icon": "^22.24.0",
42
42
  "@atlaskit/icon-file-type": "^6.7.0",
43
- "@atlaskit/media-client": "^28.0.0",
43
+ "@atlaskit/media-client": "^28.3.0",
44
44
  "@atlaskit/media-client-react": "^2.3.0",
45
45
  "@atlaskit/media-common": "^11.7.0",
46
46
  "@atlaskit/media-svg": "^0.2.0",
47
- "@atlaskit/media-ui": "^26.0.0",
47
+ "@atlaskit/media-ui": "^26.1.0",
48
48
  "@atlaskit/platform-feature-flags": "^0.3.0",
49
- "@atlaskit/primitives": "^13.0.0",
50
- "@atlaskit/side-navigation": "^3.5.0",
49
+ "@atlaskit/primitives": "^13.1.0",
50
+ "@atlaskit/side-navigation": "^3.6.0",
51
51
  "@atlaskit/spinner": "^16.3.0",
52
52
  "@atlaskit/textfield": "^6.5.0",
53
53
  "@atlaskit/theme": "^14.0.0",
@@ -79,7 +79,7 @@
79
79
  "@atlaskit/media-integration-test-helpers": "^3.1.0",
80
80
  "@atlaskit/media-state": "^1.1.0",
81
81
  "@atlaskit/media-test-data": "^2.6.0",
82
- "@atlaskit/media-test-helpers": "^34.5.0",
82
+ "@atlaskit/media-test-helpers": "^34.6.0",
83
83
  "@atlaskit/ssr": "*",
84
84
  "@atlaskit/toggle": "13.4.7",
85
85
  "@atlaskit/visual-regression": "*",