@atlaskit/media-viewer 54.11.21 → 54.11.23
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.
- package/CHANGELOG.md +31 -0
- package/dist/cjs/DownloadButton.js +14 -5
- package/dist/cjs/DownloadItem.js +3 -1
- package/dist/cjs/ErrorViewDownloadButton.js +3 -0
- package/dist/cjs/ItemViewerBase.js +8 -7
- package/dist/cjs/ToolbarDownloadButton.js +5 -2
- package/dist/cjs/analytics/ufoExperiences.js +1 -1
- package/dist/cjs/errorMessage.compiled.css +1 -0
- package/dist/cjs/errorMessage.js +11 -7
- package/dist/cjs/errorMessageWithAnalytics.js +2 -1
- package/dist/cjs/header.js +2 -1
- package/dist/cjs/insetViewerContext.js +15 -15
- package/dist/cjs/loading.js +7 -2
- package/dist/cjs/navigation.js +7 -5
- package/dist/cjs/styleWrappers.compiled.css +5 -1
- package/dist/cjs/styleWrappers.js +53 -18
- package/dist/cjs/viewers/archiveSidebar/archive-viewer-base.js +3 -3
- package/dist/cjs/viewers/audio.js +68 -27
- package/dist/cjs/viewers/codeViewer/CodeRendererAdvanced/CodeRendererAdvanced.compiled.css +6 -1
- package/dist/cjs/viewers/codeViewer/CodeRendererAdvanced/CodeRendererAdvanced.js +37 -9
- package/dist/cjs/viewers/codeViewer/CodeRendererAdvanced/theme.js +68 -53
- package/dist/cjs/viewers/codeViewer/CodeViewRenderer-2.js +15 -1
- package/dist/cjs/viewers/codeViewer/CodeViewerFooter.compiled.css +10 -0
- package/dist/cjs/viewers/codeViewer/CodeViewerFooter.js +41 -0
- package/dist/cjs/viewers/codeViewer/CodeViewerHeaderBar.js +6 -0
- package/dist/cjs/viewers/codeViewer/codeViewerRenderer-compiled.compiled.css +3 -1
- package/dist/cjs/viewers/codeViewer/codeViewerRenderer-compiled.js +8 -1
- package/dist/cjs/viewers/doc/DocViewer.js +7 -2
- package/dist/cjs/viewers/doc/passwordInput.compiled.css +3 -1
- package/dist/cjs/viewers/doc/passwordInput.js +27 -13
- package/dist/cjs/viewers/video.js +6 -6
- package/dist/es2019/DownloadButton.js +12 -4
- package/dist/es2019/DownloadItem.js +3 -1
- package/dist/es2019/ErrorViewDownloadButton.js +3 -0
- package/dist/es2019/ItemViewerBase.js +3 -2
- package/dist/es2019/ToolbarDownloadButton.js +4 -1
- package/dist/es2019/analytics/ufoExperiences.js +1 -1
- package/dist/es2019/errorMessage.compiled.css +1 -0
- package/dist/es2019/errorMessage.js +9 -5
- package/dist/es2019/errorMessageWithAnalytics.js +2 -1
- package/dist/es2019/header.js +2 -1
- package/dist/es2019/insetViewerContext.js +11 -11
- package/dist/es2019/loading.js +7 -2
- package/dist/es2019/navigation.js +3 -1
- package/dist/es2019/styleWrappers.compiled.css +4 -0
- package/dist/es2019/styleWrappers.js +62 -27
- package/dist/es2019/viewers/archiveSidebar/archive-viewer-base.js +3 -3
- package/dist/es2019/viewers/audio.js +52 -17
- package/dist/es2019/viewers/codeViewer/CodeRendererAdvanced/CodeRendererAdvanced.compiled.css +6 -1
- package/dist/es2019/viewers/codeViewer/CodeRendererAdvanced/CodeRendererAdvanced.js +29 -9
- package/dist/es2019/viewers/codeViewer/CodeRendererAdvanced/theme.js +21 -5
- package/dist/es2019/viewers/codeViewer/CodeViewRenderer-2.js +15 -1
- package/dist/es2019/viewers/codeViewer/CodeViewerFooter.compiled.css +10 -0
- package/dist/es2019/viewers/codeViewer/CodeViewerFooter.js +33 -0
- package/dist/es2019/viewers/codeViewer/CodeViewerHeaderBar.js +6 -0
- package/dist/es2019/viewers/codeViewer/codeViewerRenderer-compiled.compiled.css +3 -1
- package/dist/es2019/viewers/codeViewer/codeViewerRenderer-compiled.js +5 -1
- package/dist/es2019/viewers/doc/DocViewer.js +7 -2
- package/dist/es2019/viewers/doc/passwordInput.compiled.css +3 -1
- package/dist/es2019/viewers/doc/passwordInput.js +19 -5
- package/dist/es2019/viewers/video.js +7 -7
- package/dist/esm/DownloadButton.js +14 -5
- package/dist/esm/DownloadItem.js +3 -1
- package/dist/esm/ErrorViewDownloadButton.js +3 -0
- package/dist/esm/ItemViewerBase.js +3 -2
- package/dist/esm/ToolbarDownloadButton.js +4 -1
- package/dist/esm/analytics/ufoExperiences.js +1 -1
- package/dist/esm/errorMessage.compiled.css +1 -0
- package/dist/esm/errorMessage.js +11 -7
- package/dist/esm/errorMessageWithAnalytics.js +2 -1
- package/dist/esm/header.js +2 -1
- package/dist/esm/insetViewerContext.js +14 -14
- package/dist/esm/loading.js +7 -2
- package/dist/esm/navigation.js +3 -1
- package/dist/esm/styleWrappers.compiled.css +5 -1
- package/dist/esm/styleWrappers.js +51 -16
- package/dist/esm/viewers/archiveSidebar/archive-viewer-base.js +3 -3
- package/dist/esm/viewers/audio.js +69 -28
- package/dist/esm/viewers/codeViewer/CodeRendererAdvanced/CodeRendererAdvanced.compiled.css +6 -1
- package/dist/esm/viewers/codeViewer/CodeRendererAdvanced/CodeRendererAdvanced.js +38 -11
- package/dist/esm/viewers/codeViewer/CodeRendererAdvanced/theme.js +67 -52
- package/dist/esm/viewers/codeViewer/CodeViewRenderer-2.js +15 -1
- package/dist/esm/viewers/codeViewer/CodeViewerFooter.compiled.css +10 -0
- package/dist/esm/viewers/codeViewer/CodeViewerFooter.js +32 -0
- package/dist/esm/viewers/codeViewer/CodeViewerHeaderBar.js +6 -0
- package/dist/esm/viewers/codeViewer/codeViewerRenderer-compiled.compiled.css +3 -1
- package/dist/esm/viewers/codeViewer/codeViewerRenderer-compiled.js +8 -1
- package/dist/esm/viewers/doc/DocViewer.js +7 -2
- package/dist/esm/viewers/doc/passwordInput.compiled.css +3 -1
- package/dist/esm/viewers/doc/passwordInput.js +19 -5
- package/dist/esm/viewers/video.js +7 -7
- package/dist/types/DownloadButton.d.ts +1 -1
- package/dist/types/DownloadButtonProps.d.ts +1 -0
- package/dist/types/DownloadItem.d.ts +1 -1
- package/dist/types/DownloadItemProps.d.ts +1 -0
- package/dist/types/errorMessage.d.ts +6 -1
- package/dist/types/insetViewerContext.d.ts +3 -3
- package/dist/types/styleWrappers.d.ts +2 -2
- package/dist/types/viewers/audio.d.ts +2 -16
- package/dist/types/viewers/codeViewer/CodeRendererAdvanced/theme.d.ts +1 -0
- package/dist/types/viewers/codeViewer/CodeViewerFooter.d.ts +7 -0
- package/dist/types/viewers/codeViewer/CodeViewerHeaderBar.d.ts +1 -1
- package/example-helpers/NativeMediaPreview.tsx +3 -1
- package/package.json +8 -8
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { SUPPORTED_LANGUAGES } from '@atlaskit/code/constants';
|
|
3
|
+
import { useIsInsetViewer, useMediaFooterControls } from '../../insetViewerContext';
|
|
4
|
+
import { CodeViewerFooter } from './CodeViewerFooter';
|
|
2
5
|
import { CodeViewRenderer as CompiledCodeViewRenderer } from './CodeViewRenderer';
|
|
3
|
-
export const CodeViewRenderer = props =>
|
|
6
|
+
export const CodeViewRenderer = props => {
|
|
7
|
+
var _SUPPORTED_LANGUAGES$;
|
|
8
|
+
const isInsetViewer = useIsInsetViewer();
|
|
9
|
+
const footerElement = useMediaFooterControls();
|
|
10
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CompiledCodeViewRenderer, props), isInsetViewer && /*#__PURE__*/React.createElement(CodeViewerFooter
|
|
11
|
+
// Plain text has no name, so the footer shows its translated "Plain text" label instead of
|
|
12
|
+
// the code package's untranslated "PlainText".
|
|
13
|
+
, {
|
|
14
|
+
languageName: props.language === 'text' ? undefined : (_SUPPORTED_LANGUAGES$ = SUPPORTED_LANGUAGES.find(candidate => candidate.alias.includes(props.language))) === null || _SUPPORTED_LANGUAGES$ === void 0 ? void 0 : _SUPPORTED_LANGUAGES$.name,
|
|
15
|
+
footerElement: footerElement
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
._2rko12b0{border-radius:var(--ds-radius-small,4px)}._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
2
|
+
._1bah1yb4{justify-content:space-between}
|
|
3
|
+
._1bsb1osq{width:100%}
|
|
4
|
+
._1e0c1txw{display:flex}
|
|
5
|
+
._4cvr1h6o{align-items:center}
|
|
6
|
+
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
7
|
+
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
8
|
+
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
9
|
+
._syazi7uo{color:var(--ds-text,#292a2e)}
|
|
10
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* CodeViewerFooter.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./CodeViewerFooter.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { createPortal } from 'react-dom';
|
|
7
|
+
import { FormattedMessage } from 'react-intl';
|
|
8
|
+
import { messages } from '@atlaskit/media-ui/messages';
|
|
9
|
+
const styles = {
|
|
10
|
+
root: "_1e0c1txw _4cvr1h6o _1bah1yb4 _1bsb1osq _syazi7uo",
|
|
11
|
+
language: "_2rko12b0 _ca0qv77o _u5f3u2gc _n3tdv77o _19bvu2gc _bfhki8nm"
|
|
12
|
+
};
|
|
13
|
+
// The line count on the left, if there is one, and the language on the right, in the inset media footer.
|
|
14
|
+
export const CodeViewerFooter = ({
|
|
15
|
+
lineCount,
|
|
16
|
+
languageName,
|
|
17
|
+
footerElement
|
|
18
|
+
}) => {
|
|
19
|
+
if (!footerElement) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
"data-testid": "media-viewer-code-footer",
|
|
24
|
+
className: ax([styles.root])
|
|
25
|
+
}, /*#__PURE__*/React.createElement("span", null, lineCount !== undefined && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.line_count, {
|
|
26
|
+
values: {
|
|
27
|
+
count: lineCount
|
|
28
|
+
}
|
|
29
|
+
}))), /*#__PURE__*/React.createElement("span", {
|
|
30
|
+
"data-testid": "media-viewer-code-footer-language",
|
|
31
|
+
className: ax([styles.language])
|
|
32
|
+
}, languageName !== null && languageName !== void 0 ? languageName : /*#__PURE__*/React.createElement(FormattedMessage, messages.plain_text))), footerElement);
|
|
33
|
+
};
|
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
import "./CodeViewerHeaderBar.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { useIsInsetViewer } from '../../insetViewerContext';
|
|
6
7
|
const codeViewerHeaderBarStyles = null;
|
|
7
8
|
export const CodeViewerHeaderBar = () => {
|
|
9
|
+
const isInsetViewer = useIsInsetViewer();
|
|
10
|
+
// The inset viewer has its own header row, so there is nothing to clear.
|
|
11
|
+
if (isInsetViewer) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
8
14
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
15
|
className: ax(["_4t3i8ved _bfhk1nox"])
|
|
10
16
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
._154iidpf{top:0}
|
|
1
|
+
._2rko1mok{border-radius:var(--ds-radius-large,8px)}._154iidpf{top:0}
|
|
2
2
|
._18m91wug{overflow-y:auto}
|
|
3
|
+
._1ltv1tcg{left:24px}
|
|
3
4
|
._1ltvidpf{left:0}
|
|
4
5
|
._1reo1wug{overflow-x:auto}
|
|
6
|
+
._1xi21tcg{right:24px}
|
|
5
7
|
._1xi2idpf{right:0}
|
|
6
8
|
._94n5idpf{bottom:0}
|
|
7
9
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
@@ -3,7 +3,10 @@ import "./codeViewerRenderer-compiled.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
|
+
import { useIsInsetViewer } from '../../insetViewerContext';
|
|
7
|
+
import { INSET_VIEWER_GUTTER_PX } from '../../styleWrappers';
|
|
6
8
|
const codeViewWrapperStyles = null;
|
|
9
|
+
const insetViewerCodeViewWrapperStyles = null;
|
|
7
10
|
|
|
8
11
|
// Based on some basic benchmarking with @atlaskit/code it was found that ~10,000 lines took around ~5secs to render, which locks the main thread.
|
|
9
12
|
// Therefore we set a hard limit on the amount of lines which we apply formatting to,
|
|
@@ -17,9 +20,10 @@ export const CodeViewWrapper = /*#__PURE__*/forwardRef(({
|
|
|
17
20
|
children,
|
|
18
21
|
'data-testid': testId
|
|
19
22
|
}, ref) => {
|
|
23
|
+
const isInsetViewer = useIsInsetViewer();
|
|
20
24
|
return /*#__PURE__*/React.createElement("div", {
|
|
21
25
|
"data-testid": testId,
|
|
22
26
|
ref: ref,
|
|
23
|
-
className: ax(["_1reo1wug _18m91wug _kqswstnw _1ltvidpf _154iidpf _1xi2idpf _94n5idpf _bfhkvuon"])
|
|
27
|
+
className: ax(["_1reo1wug _18m91wug _kqswstnw _1ltvidpf _154iidpf _1xi2idpf _94n5idpf _bfhkvuon", isInsetViewer && "_2rko1mok _1ltv1tcg _1xi21tcg"])
|
|
24
28
|
}, children);
|
|
25
29
|
});
|
|
@@ -10,6 +10,7 @@ import { DOCUMENT_SCROLL_ROOT_ID } from '@atlaskit/media-document-viewer/get-doc
|
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
11
11
|
import Spinner from '@atlaskit/spinner/spinner';
|
|
12
12
|
import { ZoomLevel } from '../../domain/zoomLevel';
|
|
13
|
+
import { useIsInsetViewer } from '../../insetViewerContext';
|
|
13
14
|
import { MediaViewerError } from '../../MediaViewerError';
|
|
14
15
|
import { ZoomControls } from '../../zoomControls';
|
|
15
16
|
import { PasswordInput } from './passwordInput';
|
|
@@ -69,6 +70,7 @@ export const DocViewer = ({
|
|
|
69
70
|
}) => {
|
|
70
71
|
var _fileState$mimeType;
|
|
71
72
|
const [state, dispatch] = useReducer(reducer, initialState);
|
|
73
|
+
const isInsetViewer = useIsInsetViewer();
|
|
72
74
|
|
|
73
75
|
// Compute enableLazyPageRendering based on Excel file detection and feature gate
|
|
74
76
|
// Excel files are found to have 60K pages, because excel can have thousand of empty rows, JST-1296681
|
|
@@ -149,8 +151,11 @@ export const DocViewer = ({
|
|
|
149
151
|
return /*#__PURE__*/React.createElement(React.Fragment, null, state.isLoading && /*#__PURE__*/React.createElement("div", {
|
|
150
152
|
className: ax(["_kqswstnw _1e0c1txw _1bah1h6o _4cvr1h6o"])
|
|
151
153
|
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
152
|
-
size: "large"
|
|
153
|
-
|
|
154
|
+
size: "large"
|
|
155
|
+
// The overlay viewer is always dark, so it inverts the spinner. The inset viewer follows the
|
|
156
|
+
// theme, so it uses the spinner's own subtle icon colour.
|
|
157
|
+
,
|
|
158
|
+
appearance: isInsetViewer ? 'inherit' : 'invert'
|
|
154
159
|
})), /*#__PURE__*/React.createElement("div", {
|
|
155
160
|
style: {
|
|
156
161
|
opacity: state.isLoading ? 0 : 1
|
|
@@ -7,5 +7,7 @@
|
|
|
7
7
|
._19pkidpf{margin-top:0}
|
|
8
8
|
._1e0c1txw{display:flex}
|
|
9
9
|
._1jyy9txx._1jyy9txx h1{color:#b6c2cf}
|
|
10
|
+
._1jyyazsu._1jyyazsu h1{color:var(--ds-text-subtle,#505258)}
|
|
10
11
|
._4cvr1h6o{align-items:center}
|
|
11
|
-
._syaz1366{color:#fd9891}
|
|
12
|
+
._syaz1366{color:#fd9891}
|
|
13
|
+
._syaz1tmw{color:var(--ds-text-danger,#ae2e24)}
|
|
@@ -14,12 +14,24 @@ import LockIcon from '@atlaskit/icon/core/lock-locked';
|
|
|
14
14
|
import ErrorIcon from '@atlaskit/icon/core/status-error';
|
|
15
15
|
import { messages } from '@atlaskit/media-ui/messages';
|
|
16
16
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
17
|
-
import {
|
|
17
|
+
import { Box } from '@atlaskit/primitives/box';
|
|
18
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
19
|
+
import { Flex } from '@atlaskit/primitives/components/flex';
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
21
|
+
import { Text } from '@atlaskit/primitives/text';
|
|
22
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
23
|
+
import { xcss } from '@atlaskit/primitives/xcss/xcss';
|
|
18
24
|
import TextField from '@atlaskit/textfield/text-field';
|
|
25
|
+
import { useIsInsetViewer } from '../../insetViewerContext';
|
|
19
26
|
const COLOR_SHADE = '#b6c2cf';
|
|
20
27
|
const ERROR_COLOR = '#FD9891';
|
|
21
28
|
const headingStyle = null;
|
|
29
|
+
const insetViewerHeadingStyle = null;
|
|
22
30
|
const errorMessageWrapperStyle = null;
|
|
31
|
+
const errorMessageColorStyle = null;
|
|
32
|
+
|
|
33
|
+
// The message itself takes its color from the Text color prop, so this is just for the icon.
|
|
34
|
+
const insetViewerErrorMessageColorStyle = null;
|
|
23
35
|
const errorMessageStyle = null;
|
|
24
36
|
const headerStyles = xcss({
|
|
25
37
|
textAlign: 'center',
|
|
@@ -43,6 +55,7 @@ export const PasswordInput = ({
|
|
|
43
55
|
const onRenderRef = useRef(onRender);
|
|
44
56
|
const [formError, setFormError] = useState(hasPasswordError);
|
|
45
57
|
const intl = useIntl();
|
|
58
|
+
const isInsetViewer = useIsInsetViewer();
|
|
46
59
|
useEffect(() => {
|
|
47
60
|
var _onRenderRef$current;
|
|
48
61
|
(_onRenderRef$current = onRenderRef.current) === null || _onRenderRef$current === void 0 ? void 0 : _onRenderRef$current.call(onRenderRef);
|
|
@@ -63,11 +76,11 @@ export const PasswordInput = ({
|
|
|
63
76
|
justifyContent: "center"
|
|
64
77
|
}, /*#__PURE__*/React.createElement(LockIcon, {
|
|
65
78
|
label: "",
|
|
66
|
-
color: COLOR_SHADE
|
|
79
|
+
color: isInsetViewer ? "var(--ds-icon-subtle, #505258)" : COLOR_SHADE
|
|
67
80
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
68
81
|
xcss: headerStyles
|
|
69
82
|
}, /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
className: ax(["_151kfhey _18ewwu06 _1jyy9txx"])
|
|
83
|
+
className: ax(["_151kfhey _18ewwu06 _1jyy9txx", isInsetViewer && "_1jyyazsu"])
|
|
71
84
|
}, /*#__PURE__*/React.createElement(Heading, {
|
|
72
85
|
as: "h1",
|
|
73
86
|
size: "medium"
|
|
@@ -91,7 +104,7 @@ export const PasswordInput = ({
|
|
|
91
104
|
}
|
|
92
105
|
})), formError && /*#__PURE__*/React.createElement("div", {
|
|
93
106
|
id: `${fieldProps.id}-error`,
|
|
94
|
-
className: ax(["_11c8wadc _19pk1b66 _1e0c1txw _4cvr1h6o _syaz1366 _125x1366"])
|
|
107
|
+
className: ax(["_11c8wadc _19pk1b66 _1e0c1txw _4cvr1h6o", isInsetViewer ? "_syaz1tmw" : "_syaz1366 _125x1366"])
|
|
95
108
|
}, /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
96
109
|
color: "currentColor",
|
|
97
110
|
label: "",
|
|
@@ -100,7 +113,8 @@ export const PasswordInput = ({
|
|
|
100
113
|
id: `${fieldProps.id}-errorMessage`,
|
|
101
114
|
className: ax(["_19pkidpf _18u01b66"])
|
|
102
115
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
103
|
-
as: "p"
|
|
116
|
+
as: "p",
|
|
117
|
+
color: isInsetViewer ? 'color.text.danger' : undefined
|
|
104
118
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.incorrect_password)))))), /*#__PURE__*/React.createElement(Box, {
|
|
105
119
|
xcss: footerStyles
|
|
106
120
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -13,7 +13,7 @@ import { buildVideoErrorDiagnostics } from '../buildVideoErrorDiagnostics';
|
|
|
13
13
|
import { Outcome } from '../domain/outcome';
|
|
14
14
|
import { withInsetViewerFooter } from '../insetViewerContext';
|
|
15
15
|
import { MediaViewerError } from '../MediaViewerError';
|
|
16
|
-
import { Video,
|
|
16
|
+
import { Video, CustomMediaPlayerWrapper, FittedVideoFrame } from '../styleWrappers';
|
|
17
17
|
import { insetFittedViewport } from '../utils/fit-viewport';
|
|
18
18
|
import { getObjectUrlFromFileState } from '../utils/getObjectUrlFromFileState';
|
|
19
19
|
import { isIE } from '../utils/isIE';
|
|
@@ -111,14 +111,14 @@ class _VideoViewer extends BaseViewer {
|
|
|
111
111
|
componentDidMount() {
|
|
112
112
|
super.componentDidMount();
|
|
113
113
|
if (this.props.isInsetViewer) {
|
|
114
|
-
var _this$props$
|
|
115
|
-
(_this$props$
|
|
114
|
+
var _this$props$setHasPla, _this$props;
|
|
115
|
+
(_this$props$setHasPla = (_this$props = this.props).setHasPlayerControls) === null || _this$props$setHasPla === void 0 ? void 0 : _this$props$setHasPla.call(_this$props, true);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
componentWillUnmount() {
|
|
119
119
|
if (this.props.isInsetViewer) {
|
|
120
|
-
var _this$props$
|
|
121
|
-
(_this$props$
|
|
120
|
+
var _this$props$setHasPla2, _this$props2;
|
|
121
|
+
(_this$props$setHasPla2 = (_this$props2 = this.props).setHasPlayerControls) === null || _this$props$setHasPla2 === void 0 ? void 0 : _this$props$setHasPla2.call(_this$props2, false);
|
|
122
122
|
}
|
|
123
123
|
super.componentWillUnmount();
|
|
124
124
|
}
|
|
@@ -147,7 +147,7 @@ class _VideoViewer extends BaseViewer {
|
|
|
147
147
|
src: content
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
return /*#__PURE__*/React.createElement(
|
|
150
|
+
return /*#__PURE__*/React.createElement(CustomMediaPlayerWrapper, null, /*#__PURE__*/React.createElement(FittedVideoFrame, {
|
|
151
151
|
ref: this.setInsetVideoFrame
|
|
152
152
|
}, /*#__PURE__*/React.createElement(Video, {
|
|
153
153
|
autoPlay: isAutoPlay,
|
|
@@ -196,7 +196,7 @@ class _VideoViewer extends BaseViewer {
|
|
|
196
196
|
const player = /*#__PURE__*/React.createElement(InsetViewerProvider, {
|
|
197
197
|
isInsetViewer: isInsetViewer
|
|
198
198
|
}, playerElement);
|
|
199
|
-
return /*#__PURE__*/React.createElement(
|
|
199
|
+
return /*#__PURE__*/React.createElement(CustomMediaPlayerWrapper, {
|
|
200
200
|
"data-testid": "media-viewer-video-content"
|
|
201
201
|
}, isInsetViewer ? /*#__PURE__*/React.createElement(FittedVideoFrame, {
|
|
202
202
|
ref: this.setInsetVideoFrame
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["analyticspayload", "onClick", "tooltip"];
|
|
3
|
+
var _excluded = ["analyticspayload", "onClick", "tooltip", "variant"];
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
7
|
+
import Button from '@atlaskit/button/default/button';
|
|
7
8
|
import DownloadIcon from '@atlaskit/icon/core/download';
|
|
8
9
|
import MediaButton from '@atlaskit/media-ui/MediaButton';
|
|
9
10
|
import { messages } from '@atlaskit/media-ui/messages';
|
|
10
11
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
11
12
|
import { fireAnalytics } from './analytics/fireAnalytics';
|
|
12
|
-
import { useIsInsetViewer } from './insetViewerContext';
|
|
13
13
|
import { noop } from './noop';
|
|
14
14
|
import { ViewerIconButton } from './viewer-icon-button';
|
|
15
15
|
export function DownloadButton(_ref) {
|
|
@@ -17,23 +17,32 @@ export function DownloadButton(_ref) {
|
|
|
17
17
|
_ref$onClick = _ref.onClick,
|
|
18
18
|
providedOnClick = _ref$onClick === void 0 ? noop : _ref$onClick,
|
|
19
19
|
tooltip = _ref.tooltip,
|
|
20
|
+
_ref$variant = _ref.variant,
|
|
21
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
20
22
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
23
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
22
24
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
23
25
|
var _useIntl = useIntl(),
|
|
24
26
|
formatMessage = _useIntl.formatMessage;
|
|
25
|
-
var isInsetViewer = useIsInsetViewer();
|
|
26
27
|
var onClick = useCallback(function (event, analyticsEvent) {
|
|
27
28
|
fireAnalytics(analyticspayload, createAnalyticsEvent);
|
|
28
29
|
providedOnClick(event, analyticsEvent);
|
|
29
30
|
}, [analyticspayload, providedOnClick, createAnalyticsEvent]);
|
|
30
|
-
var downloadButton =
|
|
31
|
+
var downloadButton = variant === 'insetIcon' ? /*#__PURE__*/React.createElement(ViewerIconButton, {
|
|
31
32
|
testId: rest.testId,
|
|
32
33
|
isDisabled: rest.isDisabled,
|
|
33
34
|
icon: DownloadIcon,
|
|
34
35
|
label: formatMessage(messages.download),
|
|
35
36
|
onClick: onClick
|
|
36
|
-
}) :
|
|
37
|
+
}) : variant === 'insetText' ?
|
|
38
|
+
/*#__PURE__*/
|
|
39
|
+
// The themed button used elsewhere in the inset viewer for non-icons
|
|
40
|
+
React.createElement(Button, {
|
|
41
|
+
appearance: "primary",
|
|
42
|
+
testId: rest.testId,
|
|
43
|
+
isDisabled: rest.isDisabled,
|
|
44
|
+
onClick: onClick
|
|
45
|
+
}, rest.children) : /*#__PURE__*/React.createElement(MediaButton, _extends({}, rest, {
|
|
37
46
|
onClick: onClick
|
|
38
47
|
}));
|
|
39
48
|
return tooltip ? /*#__PURE__*/React.createElement(Tooltip, {
|
package/dist/esm/DownloadItem.js
CHANGED
|
@@ -15,6 +15,7 @@ export var DownloadItem = function DownloadItem(_ref) {
|
|
|
15
15
|
analyticspayload = _ref.analyticspayload,
|
|
16
16
|
traceContext = _ref.traceContext,
|
|
17
17
|
iconBefore = _ref.iconBefore,
|
|
18
|
+
variant = _ref.variant,
|
|
18
19
|
children = _ref.children,
|
|
19
20
|
fallbackMediaName = _ref.fallbackMediaName;
|
|
20
21
|
var _useState = useState(false),
|
|
@@ -52,6 +53,7 @@ export var DownloadItem = function DownloadItem(_ref) {
|
|
|
52
53
|
itemDownloader();
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
|
-
iconBefore: iconBefore
|
|
56
|
+
iconBefore: iconBefore,
|
|
57
|
+
variant: variant
|
|
56
58
|
}, children));
|
|
57
59
|
};
|
|
@@ -3,6 +3,7 @@ import { FormattedMessage } from 'react-intl';
|
|
|
3
3
|
import { messages } from '@atlaskit/media-ui/messages';
|
|
4
4
|
import { createFailedPreviewDownloadButtonClickedEvent } from './analytics/events/ui/failedPreviewDownloadButtonClicked';
|
|
5
5
|
import { DownloadItem } from './DownloadItem';
|
|
6
|
+
import { useIsInsetViewer } from './insetViewerContext';
|
|
6
7
|
import { DownloadButtonWrapper } from './styleWrappers';
|
|
7
8
|
export var ErrorViewDownloadButton = function ErrorViewDownloadButton(_ref) {
|
|
8
9
|
var fileState = _ref.fileState,
|
|
@@ -10,12 +11,14 @@ export var ErrorViewDownloadButton = function ErrorViewDownloadButton(_ref) {
|
|
|
10
11
|
error = _ref.error,
|
|
11
12
|
traceContext = _ref.traceContext,
|
|
12
13
|
collectionName = _ref.collectionName;
|
|
14
|
+
var isInsetViewer = useIsInsetViewer();
|
|
13
15
|
var downloadEvent = createFailedPreviewDownloadButtonClickedEvent(fileState, error);
|
|
14
16
|
var testId = 'media-viewer-error-download-button';
|
|
15
17
|
return /*#__PURE__*/React.createElement(DownloadButtonWrapper, null, /*#__PURE__*/React.createElement(DownloadItem, {
|
|
16
18
|
testId: testId,
|
|
17
19
|
analyticspayload: downloadEvent,
|
|
18
20
|
appearance: "primary",
|
|
21
|
+
variant: isInsetViewer ? 'insetText' : 'default',
|
|
19
22
|
fileState: fileState,
|
|
20
23
|
mediaClient: mediaClient,
|
|
21
24
|
collectionName: collectionName,
|
|
@@ -3,13 +3,14 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import React, { Suspense, useCallback, useEffect, useState, useRef } from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl';
|
|
5
5
|
import Loadable from 'react-loadable';
|
|
6
|
-
import {
|
|
6
|
+
import { isFileIdentifier, toCommonMediaClientError } from '@atlaskit/media-client';
|
|
7
7
|
import { useFileState } from '@atlaskit/media-client-react/use-file-state';
|
|
8
8
|
import { useMediaClient } from '@atlaskit/media-client-react/use-media-client';
|
|
9
|
+
import { isExternalImageIdentifier } from '@atlaskit/media-client/is-external-image-identifier';
|
|
9
10
|
import { isCodeViewerItem } from '@atlaskit/media-ui/isCodeViewerItem';
|
|
10
11
|
import { messages } from '@atlaskit/media-ui/messages';
|
|
11
12
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
|
-
import { Text } from '@atlaskit/primitives/compiled';
|
|
13
|
+
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
13
14
|
import { createCommencedEvent } from './analytics/events/operational/commenced';
|
|
14
15
|
import { createLoadSucceededEvent } from './analytics/events/operational/loadSucceeded';
|
|
15
16
|
import { fireAnalytics } from './analytics/fireAnalytics';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { isExternalImageIdentifier } from '@atlaskit/media-client';
|
|
2
|
+
import { isExternalImageIdentifier } from '@atlaskit/media-client/is-external-image-identifier';
|
|
3
3
|
import { createDownloadButtonClickedEvent } from './analytics/events/ui/downloadButtonClicked';
|
|
4
4
|
import { downloadIcon } from './downloadIcon';
|
|
5
5
|
import { DownloadItem } from './DownloadItem';
|
|
6
|
+
import { useIsInsetViewer } from './insetViewerContext';
|
|
6
7
|
export var ToolbarDownloadButton = function ToolbarDownloadButton(_ref) {
|
|
7
8
|
var state = _ref.state,
|
|
8
9
|
mediaClient = _ref.mediaClient,
|
|
9
10
|
identifier = _ref.identifier,
|
|
10
11
|
traceContext = _ref.traceContext,
|
|
11
12
|
fallbackMediaName = _ref.fallbackMediaName;
|
|
13
|
+
var isInsetViewer = useIsInsetViewer();
|
|
12
14
|
// TODO [MS-1731]: make it work for external files as well
|
|
13
15
|
if (isExternalImageIdentifier(identifier)) {
|
|
14
16
|
return null;
|
|
@@ -23,6 +25,7 @@ export var ToolbarDownloadButton = function ToolbarDownloadButton(_ref) {
|
|
|
23
25
|
collectionName: identifier.collectionName,
|
|
24
26
|
traceContext: traceContext,
|
|
25
27
|
iconBefore: downloadIcon,
|
|
28
|
+
variant: isInsetViewer ? 'insetIcon' : 'default',
|
|
26
29
|
fallbackMediaName: fallbackMediaName
|
|
27
30
|
});
|
|
28
31
|
};
|
|
@@ -7,7 +7,7 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
|
7
7
|
import { UFOExperience } from '@atlaskit/ufo/experience';
|
|
8
8
|
import { ExperiencePerformanceTypes, ExperienceTypes } from '@atlaskit/ufo/experience-types';
|
|
9
9
|
var packageName = "@atlaskit/media-viewer";
|
|
10
|
-
var packageVersion = "54.11.
|
|
10
|
+
var packageVersion = "54.11.22";
|
|
11
11
|
var ufoExperience;
|
|
12
12
|
var getExperience = function getExperience() {
|
|
13
13
|
if (!ufoExperience) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
package/dist/esm/errorMessage.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
/* errorMessage.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
import "./errorMessage.compiled.css";
|
|
9
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
10
|
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; }
|
|
8
11
|
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) { _defineProperty(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; }
|
|
9
12
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
@@ -21,6 +24,9 @@ import { errorLoadingFile } from './error-images';
|
|
|
21
24
|
import { getErrorMessageFromError } from './getErrorMessageFromError';
|
|
22
25
|
import { getPrimaryErrorReason } from './getPrimaryErrorReason';
|
|
23
26
|
import { ErrorMessageWrapper, ErrorImage } from './styleWrappers';
|
|
27
|
+
var styles = {
|
|
28
|
+
insetViewerLine: "_syazazsu"
|
|
29
|
+
};
|
|
24
30
|
var errorLoadingFileImage = function errorLoadingFileImage(formatMessage) {
|
|
25
31
|
return /*#__PURE__*/React.createElement(ErrorImage, {
|
|
26
32
|
src: errorLoadingFile,
|
|
@@ -103,17 +109,15 @@ export var ErrorMessage = /*#__PURE__*/function (_React$Component) {
|
|
|
103
109
|
}, {
|
|
104
110
|
key: "render",
|
|
105
111
|
value: function render() {
|
|
112
|
+
var _this = this;
|
|
106
113
|
var errorInfo = this.getErrorInfo();
|
|
107
114
|
return /*#__PURE__*/React.createElement(ErrorMessageWrapper, {
|
|
108
115
|
"data-testid": "media-viewer-error"
|
|
109
116
|
}, /*#__PURE__*/React.createElement("div", null, errorInfo.icon, errorInfo.messages.map(function (formatMessage, i) {
|
|
110
|
-
return (
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
key: "p".concat(i)
|
|
115
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, formatMessage))
|
|
116
|
-
);
|
|
117
|
+
return /*#__PURE__*/React.createElement("p", {
|
|
118
|
+
key: "p".concat(i),
|
|
119
|
+
className: ax([_this.props.isInsetViewer && styles.insetViewerLine])
|
|
120
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, formatMessage));
|
|
117
121
|
})), this.props.children);
|
|
118
122
|
}
|
|
119
123
|
}], [{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { injectIntl } from 'react-intl';
|
|
2
2
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
3
3
|
import { ErrorMessage } from './errorMessage';
|
|
4
|
+
import { withInsetViewer } from './insetViewerContext';
|
|
4
5
|
|
|
5
6
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
6
|
-
var ErroMsg = withAnalyticsEvents()(injectIntl(ErrorMessage));
|
|
7
|
+
var ErroMsg = withAnalyticsEvents()(withInsetViewer(injectIntl(ErrorMessage)));
|
|
7
8
|
export default ErroMsg;
|
package/dist/esm/header.js
CHANGED
|
@@ -2,9 +2,10 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
import CrossIcon from '@atlaskit/icon/core/cross';
|
|
5
|
-
import {
|
|
5
|
+
import { isErrorFileState, toCommonMediaClientError } from '@atlaskit/media-client';
|
|
6
6
|
import { useFileState } from '@atlaskit/media-client-react/use-file-state';
|
|
7
7
|
import { useMediaClient } from '@atlaskit/media-client-react/use-media-client';
|
|
8
|
+
import { isExternalImageIdentifier } from '@atlaskit/media-client/is-external-image-identifier';
|
|
8
9
|
import { isZipMimeType } from '@atlaskit/media-common/isZipMimeType';
|
|
9
10
|
import { hideControlsClassName } from '@atlaskit/media-ui/classNames';
|
|
10
11
|
import { getExtension } from '@atlaskit/media-ui/getExtension';
|
|
@@ -8,8 +8,8 @@ var MediaFooterControlsContext = /*#__PURE__*/createContext(null);
|
|
|
8
8
|
var SetMediaFooterControlsContext = /*#__PURE__*/createContext(function () {});
|
|
9
9
|
|
|
10
10
|
// Whether a viewer has registered video controls in the footer, which gives the footer extra room.
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var HasMediaFooterPlayerControlsContext = /*#__PURE__*/createContext(false);
|
|
12
|
+
var SetHasMediaFooterPlayerControlsContext = /*#__PURE__*/createContext(function () {});
|
|
13
13
|
export var InsetViewerProvider = function InsetViewerProvider(_ref) {
|
|
14
14
|
var _ref$isInsetViewer = _ref.isInsetViewer,
|
|
15
15
|
isInsetViewer = _ref$isInsetViewer === void 0 ? false : _ref$isInsetViewer,
|
|
@@ -20,18 +20,18 @@ export var InsetViewerProvider = function InsetViewerProvider(_ref) {
|
|
|
20
20
|
setMediaFooterControls = _useState2[1];
|
|
21
21
|
var _useState3 = useState(false),
|
|
22
22
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
hasPlayerControls = _useState4[0],
|
|
24
|
+
setHasPlayerControls = _useState4[1];
|
|
25
25
|
return /*#__PURE__*/React.createElement(InsetViewerContext.Provider, {
|
|
26
26
|
value: isInsetViewer
|
|
27
27
|
}, /*#__PURE__*/React.createElement(SetMediaFooterControlsContext.Provider, {
|
|
28
28
|
value: setMediaFooterControls
|
|
29
29
|
}, /*#__PURE__*/React.createElement(MediaFooterControlsContext.Provider, {
|
|
30
30
|
value: mediaFooterControls
|
|
31
|
-
}, /*#__PURE__*/React.createElement(
|
|
32
|
-
value:
|
|
33
|
-
}, /*#__PURE__*/React.createElement(
|
|
34
|
-
value:
|
|
31
|
+
}, /*#__PURE__*/React.createElement(SetHasMediaFooterPlayerControlsContext.Provider, {
|
|
32
|
+
value: setHasPlayerControls
|
|
33
|
+
}, /*#__PURE__*/React.createElement(HasMediaFooterPlayerControlsContext.Provider, {
|
|
34
|
+
value: hasPlayerControls
|
|
35
35
|
}, children)))));
|
|
36
36
|
};
|
|
37
37
|
export var useIsInsetViewer = function useIsInsetViewer() {
|
|
@@ -43,11 +43,11 @@ export var useMediaFooterControls = function useMediaFooterControls() {
|
|
|
43
43
|
export var useSetMediaFooterControls = function useSetMediaFooterControls() {
|
|
44
44
|
return useContext(SetMediaFooterControlsContext);
|
|
45
45
|
};
|
|
46
|
-
export var
|
|
47
|
-
return useContext(
|
|
46
|
+
export var useHasMediaFooterPlayerControls = function useHasMediaFooterPlayerControls() {
|
|
47
|
+
return useContext(HasMediaFooterPlayerControlsContext);
|
|
48
48
|
};
|
|
49
|
-
export var
|
|
50
|
-
return useContext(
|
|
49
|
+
export var useSetHasMediaFooterPlayerControls = function useSetHasMediaFooterPlayerControls() {
|
|
50
|
+
return useContext(SetHasMediaFooterPlayerControlsContext);
|
|
51
51
|
};
|
|
52
52
|
export var withInsetViewer = function withInsetViewer(WrappedComponent) {
|
|
53
53
|
var WithInsetViewer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -64,12 +64,12 @@ export var withInsetViewerFooter = function withInsetViewerFooter(WrappedCompone
|
|
|
64
64
|
var WithInsetViewerFooter = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
65
65
|
var isInsetViewer = useIsInsetViewer();
|
|
66
66
|
var mediaFooterControls = useMediaFooterControls();
|
|
67
|
-
var
|
|
67
|
+
var setHasPlayerControls = useSetHasMediaFooterPlayerControls();
|
|
68
68
|
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
|
|
69
69
|
ref: ref,
|
|
70
70
|
isInsetViewer: isInsetViewer,
|
|
71
71
|
mediaFooterControls: mediaFooterControls,
|
|
72
|
-
|
|
72
|
+
setHasPlayerControls: setHasPlayerControls
|
|
73
73
|
}));
|
|
74
74
|
});
|
|
75
75
|
WithInsetViewerFooter.displayName = "WithInsetViewerFooter(".concat(WrappedComponent.displayName || WrappedComponent.name || 'Component', ")");
|
package/dist/esm/loading.js
CHANGED
|
@@ -3,12 +3,17 @@ import React from 'react';
|
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { messages } from '@atlaskit/media-ui/messages';
|
|
5
5
|
import AkSpinner from '@atlaskit/spinner/spinner';
|
|
6
|
+
import { useIsInsetViewer } from './insetViewerContext';
|
|
6
7
|
export var Spinner = function Spinner(_ref) {
|
|
7
8
|
_objectDestructuringEmpty(_ref);
|
|
8
9
|
var intl = useIntl();
|
|
10
|
+
var isInsetViewer = useIsInsetViewer();
|
|
9
11
|
return /*#__PURE__*/React.createElement(AkSpinner, {
|
|
10
|
-
label: intl.formatMessage(messages.loading_file)
|
|
11
|
-
|
|
12
|
+
label: intl.formatMessage(messages.loading_file)
|
|
13
|
+
// The overlay viewer is always dark, so it inverts the spinner. The inset viewer follows the
|
|
14
|
+
// theme, so it uses the spinner's own subtle icon colour.
|
|
15
|
+
,
|
|
16
|
+
appearance: isInsetViewer ? 'inherit' : 'invert',
|
|
12
17
|
size: "large"
|
|
13
18
|
});
|
|
14
19
|
};
|
package/dist/esm/navigation.js
CHANGED
|
@@ -19,7 +19,9 @@ import { hideControlsClassName } from '@atlaskit/media-ui/classNames';
|
|
|
19
19
|
import { Shortcut } from '@atlaskit/media-ui/shortcut';
|
|
20
20
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
21
21
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
22
|
-
import { Pressable
|
|
22
|
+
import { Pressable } from '@atlaskit/primitives/pressable';
|
|
23
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
24
|
+
import { xcss } from '@atlaskit/primitives/xcss/xcss';
|
|
23
25
|
import { createNavigatedEvent } from './analytics/events/ui/createNavigatedEvent';
|
|
24
26
|
import { fireAnalytics } from './analytics/fireAnalytics';
|
|
25
27
|
import { withInsetViewer } from './insetViewerContext';
|