@atlaskit/media-viewer 52.8.3 → 52.8.5

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 (43) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/analytics/index.js +1 -1
  3. package/dist/cjs/analytics/ufoExperiences.js +1 -1
  4. package/dist/cjs/styleWrappers.js +1 -1
  5. package/dist/cjs/viewers/archiveSidebar/custom-button-item.js +1 -1
  6. package/dist/cjs/viewers/archiveSidebar/nativePdfViewer.js +1 -1
  7. package/dist/cjs/viewers/archiveSidebar/styleWrappers.js +1 -1
  8. package/dist/cjs/viewers/codeViewer/CodeRendererAdvanced/CodeRendererAdvanced.js +1 -1
  9. package/dist/cjs/viewers/codeViewer/codeViewerRenderer-compiled.js +1 -1
  10. package/dist/cjs/viewers/doc/doc-viewer.js +1 -1
  11. package/dist/cjs/viewers/doc/passwordInput.js +1 -1
  12. package/dist/cjs/viewers/svg/ImageWrapper-compiled.js +1 -1
  13. package/dist/es2019/analytics/index.js +1 -1
  14. package/dist/es2019/analytics/ufoExperiences.js +1 -1
  15. package/dist/es2019/styleWrappers.js +1 -1
  16. package/dist/es2019/viewers/archiveSidebar/custom-button-item.js +1 -1
  17. package/dist/es2019/viewers/archiveSidebar/nativePdfViewer.js +1 -1
  18. package/dist/es2019/viewers/archiveSidebar/styleWrappers.js +1 -1
  19. package/dist/es2019/viewers/codeViewer/CodeRendererAdvanced/CodeRendererAdvanced.js +1 -1
  20. package/dist/es2019/viewers/codeViewer/codeViewerRenderer-compiled.js +1 -1
  21. package/dist/es2019/viewers/doc/doc-viewer.js +1 -1
  22. package/dist/es2019/viewers/doc/passwordInput.js +1 -1
  23. package/dist/es2019/viewers/svg/ImageWrapper-compiled.js +1 -1
  24. package/dist/esm/analytics/index.js +1 -1
  25. package/dist/esm/analytics/ufoExperiences.js +1 -1
  26. package/dist/esm/styleWrappers.js +1 -1
  27. package/dist/esm/viewers/archiveSidebar/custom-button-item.js +1 -1
  28. package/dist/esm/viewers/archiveSidebar/nativePdfViewer.js +1 -1
  29. package/dist/esm/viewers/archiveSidebar/styleWrappers.js +1 -1
  30. package/dist/esm/viewers/codeViewer/CodeRendererAdvanced/CodeRendererAdvanced.js +1 -1
  31. package/dist/esm/viewers/codeViewer/codeViewerRenderer-compiled.js +1 -1
  32. package/dist/esm/viewers/doc/doc-viewer.js +1 -1
  33. package/dist/esm/viewers/doc/passwordInput.js +1 -1
  34. package/dist/esm/viewers/svg/ImageWrapper-compiled.js +1 -1
  35. package/example-helpers/NativeMediaPreview.tsx +1 -1
  36. package/example-helpers/centeredForm.tsx +1 -1
  37. package/example-helpers/index.ts +30 -5
  38. package/example-helpers/styles.ts +6 -6
  39. package/example-helpers/svg/delayApiResponses.ts +1 -1
  40. package/example-helpers/svg/toggle.tsx +1 -1
  41. package/example-helpers/svg/uploader.ts +6 -2
  42. package/example-helpers/svg/useSelectOptions.ts +10 -2
  43. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/media-viewer
2
2
 
3
+ ## 52.8.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 52.8.4
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 52.8.3
4
16
 
5
17
  ### Patch Changes
@@ -10,7 +10,7 @@ exports.packageVersion = exports.packageName = void 0;
10
10
  var _analytics = require("@atlaskit/media-common/analytics");
11
11
  var componentName = exports.component = exports.componentName = 'mediaViewer';
12
12
  var packageName = exports.packageName = "@atlaskit/media-viewer";
13
- var packageVersion = exports.packageVersion = "52.8.2";
13
+ var packageVersion = exports.packageVersion = "0.0.0-development";
14
14
  function getFileAttributes(fileState) {
15
15
  if (!fileState) {
16
16
  return {
@@ -13,7 +13,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
13
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
14
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
15
  var packageName = "@atlaskit/media-viewer";
16
- var packageVersion = "52.8.2";
16
+ var packageVersion = "0.0.0-development";
17
17
  var ufoExperience;
18
18
  var getExperience = function getExperience() {
19
19
  if (!ufoExperience) {
@@ -1,4 +1,4 @@
1
- /* styleWrappers.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* styleWrappers.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* custom-button-item.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* custom-button-item.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* nativePdfViewer.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* nativePdfViewer.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* styleWrappers.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* styleWrappers.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* CodeRendererAdvanced.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* CodeRendererAdvanced.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* codeViewerRenderer-compiled.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* codeViewerRenderer-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* doc-viewer.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* doc-viewer.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* passwordInput.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* passwordInput.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,7 +1,7 @@
1
1
  import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
2
2
  const componentName = 'mediaViewer';
3
3
  const packageName = "@atlaskit/media-viewer";
4
- const packageVersion = "52.8.2";
4
+ const packageVersion = "0.0.0-development";
5
5
  export { packageName, packageVersion, componentName, componentName as component };
6
6
  export function getFileAttributes(fileState) {
7
7
  if (!fileState) {
@@ -3,7 +3,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
3
3
  import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
4
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
5
  const packageName = "@atlaskit/media-viewer";
6
- const packageVersion = "52.8.2";
6
+ const packageVersion = "0.0.0-development";
7
7
  let ufoExperience;
8
8
  const getExperience = () => {
9
9
  if (!ufoExperience) {
@@ -1,4 +1,4 @@
1
- /* styleWrappers.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* styleWrappers.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./styleWrappers.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* custom-button-item.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* custom-button-item.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./custom-button-item.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* nativePdfViewer.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* nativePdfViewer.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./nativePdfViewer.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* styleWrappers.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* styleWrappers.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./styleWrappers.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* CodeRendererAdvanced.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* CodeRendererAdvanced.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./CodeRendererAdvanced.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useRef } from 'react';
@@ -1,4 +1,4 @@
1
- /* codeViewerRenderer-compiled.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* codeViewerRenderer-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import "./codeViewerRenderer-compiled.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* doc-viewer.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* doc-viewer.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./doc-viewer.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useReducer } from 'react';
@@ -1,4 +1,4 @@
1
- /* passwordInput.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* passwordInput.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./passwordInput.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./ImageWrapper-compiled.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,7 +1,7 @@
1
1
  import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
2
2
  var componentName = 'mediaViewer';
3
3
  var packageName = "@atlaskit/media-viewer";
4
- var packageVersion = "52.8.2";
4
+ var packageVersion = "0.0.0-development";
5
5
  export { packageName, packageVersion, componentName, componentName as component };
6
6
  export function getFileAttributes(fileState) {
7
7
  if (!fileState) {
@@ -6,7 +6,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
6
6
  import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
8
  var packageName = "@atlaskit/media-viewer";
9
- var packageVersion = "52.8.2";
9
+ var packageVersion = "0.0.0-development";
10
10
  var ufoExperience;
11
11
  var getExperience = function getExperience() {
12
12
  if (!ufoExperience) {
@@ -1,4 +1,4 @@
1
- /* styleWrappers.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* styleWrappers.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _extends from "@babel/runtime/helpers/extends";
4
4
  import "./styleWrappers.compiled.css";
@@ -1,4 +1,4 @@
1
- /* custom-button-item.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* custom-button-item.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _excluded = ["children", "onClick"];
@@ -1,4 +1,4 @@
1
- /* nativePdfViewer.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* nativePdfViewer.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./nativePdfViewer.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* styleWrappers.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* styleWrappers.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./styleWrappers.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* CodeRendererAdvanced.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* CodeRendererAdvanced.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./CodeRendererAdvanced.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useRef } from 'react';
@@ -1,4 +1,4 @@
1
- /* codeViewerRenderer-compiled.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* codeViewerRenderer-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -1,4 +1,4 @@
1
- /* doc-viewer.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* doc-viewer.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
@@ -1,4 +1,4 @@
1
- /* passwordInput.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* passwordInput.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import "./passwordInput.compiled.css";
@@ -1,4 +1,4 @@
1
- /* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./ImageWrapper-compiled.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -22,7 +22,7 @@ export const NativeMediaPreview = ({
22
22
  identifier,
23
23
  mediaClient,
24
24
  onClick,
25
- }: NativeMediaViewerProps) => {
25
+ }: NativeMediaViewerProps): React.JSX.Element => {
26
26
  const [url, setUrl] = useState('dataURI' in identifier ? identifier.dataURI : '');
27
27
  const [isPreviewUnavailable, setIsPreviewUnavailable] = useState(false);
28
28
 
@@ -8,7 +8,7 @@ const centeredFormStyles = xcss({
8
8
  margin: 'auto',
9
9
  });
10
10
 
11
- export const CenteredForm = ({ children }: { children: ReactNode }) => (
11
+ export const CenteredForm = ({ children }: { children: ReactNode }): React.JSX.Element => (
12
12
  <Stack alignInline="center" alignBlock="center" grow="fill" xcss={centeredFormStyles}>
13
13
  <Box>{children}</Box>
14
14
  </Stack>
@@ -175,27 +175,52 @@ export const zipWithNestedFolderItem: FileIdentifier = {
175
175
  occurrenceKey: 'testOccurrenceKey',
176
176
  };
177
177
 
178
- export const zipItemMultipleFoldersAtRoot = {
178
+ export const zipItemMultipleFoldersAtRoot: {
179
+ occurrenceKey: string;
180
+ mediaItemType: "file";
181
+ id: string;
182
+ collectionName?: string;
183
+ } = {
179
184
  ...zipItemMultipleFoldersAtRootId,
180
185
  occurrenceKey: 'testOccurenceKey',
181
186
  };
182
187
 
183
- export const zipItemLargeInnerFile = {
188
+ export const zipItemLargeInnerFile: {
189
+ occurrenceKey: string;
190
+ mediaItemType: "file";
191
+ id: string;
192
+ collectionName?: string;
193
+ } = {
184
194
  ...zipItemLargeInnerFileId,
185
195
  occurrenceKey: 'testOccurrenceKey',
186
196
  };
187
197
 
188
- export const codeItem = {
198
+ export const codeItem: {
199
+ occurrenceKey: string;
200
+ mediaItemType: "file";
201
+ id: string;
202
+ collectionName?: string;
203
+ } = {
189
204
  ...codeFileId,
190
205
  occurrenceKey: 'testOccurrenceKey',
191
206
  };
192
207
 
193
- export const emailItem = {
208
+ export const emailItem: {
209
+ occurrenceKey: string;
210
+ mediaItemType: "file";
211
+ id: string;
212
+ collectionName?: string;
213
+ } = {
194
214
  ...emailFileId,
195
215
  occurrenceKey: 'testOccurrenceKey',
196
216
  };
197
217
 
198
- export const emailFailedItem = {
218
+ export const emailFailedItem: {
219
+ occurrenceKey: string;
220
+ mediaItemType: "file";
221
+ id: string;
222
+ collectionName?: string;
223
+ } = {
199
224
  ...emailUnsupportedFileId,
200
225
  occurrenceKey: 'testOccurrenceKey',
201
226
  };
@@ -1,27 +1,27 @@
1
1
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
- import { css } from '@emotion/react';
2
+ import { css, type SerializedStyles } from '@emotion/react';
3
3
  import { token } from '@atlaskit/tokens';
4
4
 
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
6
- export const containerStyles = css({
6
+ export const containerStyles: SerializedStyles = css({
7
7
  display: 'flex',
8
8
  flexDirection: 'row',
9
9
  flexWrap: 'wrap',
10
10
  });
11
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
12
- export const groupStyles = css({
12
+ export const groupStyles: SerializedStyles = css({
13
13
  width: '250px',
14
14
  padding: token('space.250', '20px'),
15
15
  });
16
16
 
17
17
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
18
- export const buttonListStyles = css({
18
+ export const buttonListStyles: SerializedStyles = css({
19
19
  paddingLeft: 0,
20
20
  listStyle: 'none',
21
21
  });
22
22
 
23
23
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
24
- export const mVSidebarStyles = css({
24
+ export const mVSidebarStyles: SerializedStyles = css({
25
25
  height: 'calc(100vh - 64px)',
26
26
  padding: token('space.400', '32px'),
27
27
  overflow: 'auto',
@@ -38,7 +38,7 @@ export const mVSidebarStyles = css({
38
38
  });
39
39
 
40
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
41
- export const mVSidebarHeaderStyles = css({
41
+ export const mVSidebarHeaderStyles: SerializedStyles = css({
42
42
  display: 'flex',
43
43
  width: '100%',
44
44
  justifyContent: 'space-between',
@@ -6,7 +6,7 @@ type Endpoints = Partial<Record<keyof MediaApi, number>>;
6
6
  export const delayApiResponses = (
7
7
  mediaApi: MediaApi,
8
8
  { getImage, getItems, getFileBinary }: Endpoints,
9
- ) => {
9
+ ): void => {
10
10
  const baseGetImage = mediaApi.getImage;
11
11
  mediaApi.getImage = async (...params) => {
12
12
  await sleep(getImage);
@@ -32,7 +32,7 @@ export const ToggleBox = ({
32
32
  label: string;
33
33
  centered?: boolean;
34
34
  onChange: (val: boolean) => void;
35
- }) => {
35
+ }): React.JSX.Element => {
36
36
  const [id] = useState(makeid());
37
37
 
38
38
  return (
@@ -4,12 +4,16 @@ import { type FileIdentifier } from '@atlaskit/media-client';
4
4
  import { getMediaClient } from '@atlaskit/media-client-react';
5
5
  import { type MediaClientConfig } from '@atlaskit/media-client';
6
6
 
7
- export const useSvgUploader = (config: MediaClientConfig, collectionName?: string) => {
7
+ export const useSvgUploader = (config: MediaClientConfig, collectionName?: string): {
8
+ status: string;
9
+ identifier: FileIdentifier | undefined;
10
+ uploadFn: (event: SyntheticEvent<HTMLInputElement>) => Promise<void>;
11
+ } => {
8
12
  const mediaClient = getMediaClient(config);
9
13
  const [identifier, setIdentifier] = useState<FileIdentifier>();
10
14
  const [status, setStatus] = useState<string>('');
11
15
 
12
- const uploadFn = async (event: SyntheticEvent<HTMLInputElement>) => {
16
+ const uploadFn = async (event: SyntheticEvent<HTMLInputElement>): Promise<void> => {
13
17
  if (!event.currentTarget.files || !event.currentTarget.files.length) {
14
18
  return;
15
19
  }
@@ -1,7 +1,15 @@
1
- import { useState, useMemo } from 'react';
1
+ import { useState, useMemo, type Dispatch, type SetStateAction } from 'react';
2
2
  import { type FileIdentifier } from '@atlaskit/media-client';
3
3
 
4
- export const useSelectOptions = (identifiers: FileIdentifier[], fileKeys: string[]) => {
4
+ export const useSelectOptions = (identifiers: FileIdentifier[], fileKeys: string[]): {
5
+ options: {
6
+ label: string;
7
+ value: FileIdentifier;
8
+ }[]; defaultOption: {
9
+ label: string;
10
+ value: FileIdentifier;
11
+ }; identifier: FileIdentifier; setIdentifier: Dispatch<SetStateAction<FileIdentifier>>;
12
+ } => {
5
13
  const defaultOption = useMemo(
6
14
  () => ({ label: fileKeys[0], value: identifiers[0] }),
7
15
  [identifiers, fileKeys],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-viewer",
3
- "version": "52.8.3",
3
+ "version": "52.8.5",
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/"
@@ -35,11 +35,11 @@
35
35
  "@atlaskit/button": "^23.10.0",
36
36
  "@atlaskit/code": "^17.4.0",
37
37
  "@atlaskit/css": "^0.19.0",
38
- "@atlaskit/form": "^15.3.0",
38
+ "@atlaskit/form": "^15.4.0",
39
39
  "@atlaskit/heading": "^5.3.0",
40
- "@atlaskit/icon": "^32.0.0",
40
+ "@atlaskit/icon": "^33.0.0",
41
41
  "@atlaskit/icon-file-type": "^7.0.0",
42
- "@atlaskit/icon-lab": "^5.17.0",
42
+ "@atlaskit/icon-lab": "^6.0.0",
43
43
  "@atlaskit/media-client": "^36.0.0",
44
44
  "@atlaskit/media-client-react": "^5.0.0",
45
45
  "@atlaskit/media-common": "^13.0.0",
@@ -53,15 +53,15 @@
53
53
  "@atlaskit/spinner": "^19.0.0",
54
54
  "@atlaskit/textfield": "^8.2.0",
55
55
  "@atlaskit/theme": "^22.0.0",
56
- "@atlaskit/tokens": "^11.0.0",
57
- "@atlaskit/tooltip": "^20.14.0",
56
+ "@atlaskit/tokens": "^11.1.0",
57
+ "@atlaskit/tooltip": "^21.0.0",
58
58
  "@atlaskit/ufo": "^0.4.0",
59
59
  "@babel/runtime": "^7.0.0",
60
60
  "@codemirror/language": "6.10.8",
61
61
  "@codemirror/language-data": "6.5.1",
62
62
  "@codemirror/state": "6.5.1",
63
63
  "@codemirror/view": "6.36.2",
64
- "@compiled/react": "^0.18.6",
64
+ "@compiled/react": "^0.20.0",
65
65
  "@kenjiuno/msgreader": "^1.2.6",
66
66
  "@lezer/highlight": "1.2.1",
67
67
  "deep-equal": "^1.0.1",
@@ -91,7 +91,7 @@
91
91
  "@atlaskit/media-test-helpers": "^40.0.0",
92
92
  "@atlaskit/ssr": "workspace:^",
93
93
  "@atlaskit/toggle": "^15.2.0",
94
- "@atlassian/a11y-jest-testing": "^0.11.0",
94
+ "@atlassian/a11y-jest-testing": "^0.10.0",
95
95
  "@atlassian/feature-flags-test-utils": "^1.0.0",
96
96
  "@atlassian/ufo": "^0.7.0",
97
97
  "@testing-library/dom": "^10.1.0",