@atlaskit/media-card 79.15.9 → 79.16.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.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/fileCard.js +4 -2
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionButton-compiled.js +4 -1
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/fileCard.js +4 -2
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/actionsBar/cardActions/cardActionButton-compiled.js +4 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/fileCard.js +4 -2
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/actionsBar/cardActions/cardActionButton-compiled.js +4 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/fileCard.d.ts +4 -2
- package/dist/types/types.d.ts +3 -1
- package/dist/types-ts4.5/card/fileCard.d.ts +4 -2
- package/dist/types-ts4.5/types.d.ts +3 -1
- package/example-helpers/svg-helpers/uploader.ts +6 -4
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 79.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6e25e8bbb01c3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e25e8bbb01c3) -
|
|
8
|
+
[ux] Adds mediaViewerExtensions prop to media-viewer/src/header and threads it through parents.
|
|
9
|
+
Allows callers to pass in additional buttons to the image / video preview'
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 79.15.9
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -20,7 +20,7 @@ var _label = _interopRequireDefault(require("@atlaskit/react-ufo/label"));
|
|
|
20
20
|
var _excluded = ["identifier"];
|
|
21
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
22
|
var packageName = "@atlaskit/media-card";
|
|
23
|
-
var packageVersion = "
|
|
23
|
+
var packageVersion = "79.15.9";
|
|
24
24
|
var CardBase = exports.CardBase = function CardBase(_ref) {
|
|
25
25
|
var identifier = _ref.identifier,
|
|
26
26
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -93,7 +93,8 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
93
93
|
viewerOptions = _ref.viewerOptions,
|
|
94
94
|
includeHashForDuplicateFiles = _ref.includeHashForDuplicateFiles,
|
|
95
95
|
ssrItemDetails = _ref.ssrItemDetails,
|
|
96
|
-
onError = _ref.onError
|
|
96
|
+
onError = _ref.onError,
|
|
97
|
+
mediaViewerExtensions = _ref.mediaViewerExtensions;
|
|
97
98
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
98
99
|
formatMessage = _useIntl.formatMessage;
|
|
99
100
|
var _useState = (0, _react.useState)(false),
|
|
@@ -786,6 +787,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
786
787
|
},
|
|
787
788
|
contextId: contextId,
|
|
788
789
|
featureFlags: featureFlags,
|
|
789
|
-
viewerOptions: viewerOptions
|
|
790
|
+
viewerOptions: viewerOptions,
|
|
791
|
+
extensions: mediaViewerExtensions
|
|
790
792
|
}) : null, getSsrScriptProps && /*#__PURE__*/_react.default.createElement("script", getSsrScriptProps()));
|
|
791
793
|
};
|
|
@@ -87,7 +87,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
87
87
|
}(_react.default.Component);
|
|
88
88
|
(0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
89
89
|
var packageName = "@atlaskit/media-card";
|
|
90
|
-
var packageVersion = "
|
|
90
|
+
var packageVersion = "79.15.9";
|
|
91
91
|
|
|
92
92
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
93
93
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
@@ -13,6 +13,7 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
19
|
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; }
|
|
@@ -24,7 +25,9 @@ var variantStyleMap = {
|
|
|
24
25
|
var cardActionButtonStyles = null;
|
|
25
26
|
var CardActionButton = exports.CardActionButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
26
27
|
var _props$variant;
|
|
27
|
-
return /*#__PURE__*/React.createElement("button", (0, _extends2.default)({}, props, {
|
|
28
|
+
return /*#__PURE__*/React.createElement("button", (0, _extends2.default)({}, props, (0, _platformFeatureFlags.fg)('platform_media_card_action_button_type_fix') ? {
|
|
29
|
+
type: 'button'
|
|
30
|
+
} : {}, {
|
|
28
31
|
id: "cardActionButton",
|
|
29
32
|
"data-testid": "media-card-primary-action",
|
|
30
33
|
"aria-label": props.label,
|
|
@@ -116,7 +116,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
116
116
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
117
117
|
var analyticsContext = {
|
|
118
118
|
packageVersion: "@atlaskit/media-card",
|
|
119
|
-
packageName: "
|
|
119
|
+
packageName: "79.15.9",
|
|
120
120
|
componentName: 'mediaInlineCard',
|
|
121
121
|
component: 'mediaInlineCard'
|
|
122
122
|
};
|
|
@@ -19,7 +19,7 @@ var _globalScope = require("./globalScope/globalScope");
|
|
|
19
19
|
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; }
|
|
20
20
|
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; }
|
|
21
21
|
var packageName = "@atlaskit/media-card";
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "79.15.9";
|
|
23
23
|
var SAMPLE_RATE = 0.05;
|
|
24
24
|
|
|
25
25
|
/**
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -9,7 +9,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
|
|
|
9
9
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
10
|
import UFOLabel from '@atlaskit/react-ufo/label';
|
|
11
11
|
const packageName = "@atlaskit/media-card";
|
|
12
|
-
const packageVersion = "
|
|
12
|
+
const packageVersion = "79.15.9";
|
|
13
13
|
export const CardBase = ({
|
|
14
14
|
identifier,
|
|
15
15
|
...otherProps
|
|
@@ -74,7 +74,8 @@ export const FileCard = ({
|
|
|
74
74
|
viewerOptions,
|
|
75
75
|
includeHashForDuplicateFiles,
|
|
76
76
|
ssrItemDetails,
|
|
77
|
-
onError
|
|
77
|
+
onError,
|
|
78
|
+
mediaViewerExtensions
|
|
78
79
|
}) => {
|
|
79
80
|
const {
|
|
80
81
|
formatMessage
|
|
@@ -704,6 +705,7 @@ export const FileCard = ({
|
|
|
704
705
|
},
|
|
705
706
|
contextId: contextId,
|
|
706
707
|
featureFlags: featureFlags,
|
|
707
|
-
viewerOptions: viewerOptions
|
|
708
|
+
viewerOptions: viewerOptions,
|
|
709
|
+
extensions: mediaViewerExtensions
|
|
708
710
|
}) : null, getSsrScriptProps && /*#__PURE__*/React.createElement("script", getSsrScriptProps()));
|
|
709
711
|
};
|
|
@@ -66,7 +66,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
|
|
|
66
66
|
}
|
|
67
67
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
68
68
|
const packageName = "@atlaskit/media-card";
|
|
69
|
-
const packageVersion = "
|
|
69
|
+
const packageVersion = "79.15.9";
|
|
70
70
|
|
|
71
71
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
72
72
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
@@ -6,6 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { N500 } from '@atlaskit/theme/colors';
|
|
10
11
|
const variantStyleMap = {
|
|
11
12
|
filled: "_bfhk1pja _irr3tl7t",
|
|
@@ -14,7 +15,9 @@ const variantStyleMap = {
|
|
|
14
15
|
const cardActionButtonStyles = null;
|
|
15
16
|
export const CardActionButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
16
17
|
var _props$variant;
|
|
17
|
-
return /*#__PURE__*/React.createElement("button", _extends({}, props, {
|
|
18
|
+
return /*#__PURE__*/React.createElement("button", _extends({}, props, fg('platform_media_card_action_button_type_fix') ? {
|
|
19
|
+
type: 'button'
|
|
20
|
+
} : {}, {
|
|
18
21
|
id: "cardActionButton",
|
|
19
22
|
"data-testid": "media-card-primary-action",
|
|
20
23
|
"aria-label": props.label,
|
|
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
|
|
|
37
37
|
} = this.state;
|
|
38
38
|
const analyticsContext = {
|
|
39
39
|
packageVersion: "@atlaskit/media-card",
|
|
40
|
-
packageName: "
|
|
40
|
+
packageName: "79.15.9",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -9,7 +9,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
|
9
9
|
import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
10
10
|
import { getMediaGlobalScope } from './globalScope/globalScope';
|
|
11
11
|
const packageName = "@atlaskit/media-card";
|
|
12
|
-
const packageVersion = "
|
|
12
|
+
const packageVersion = "79.15.9";
|
|
13
13
|
const SAMPLE_RATE = 0.05;
|
|
14
14
|
|
|
15
15
|
/**
|
package/dist/esm/card/card.js
CHANGED
|
@@ -11,7 +11,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
|
|
|
11
11
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
12
|
import UFOLabel from '@atlaskit/react-ufo/label';
|
|
13
13
|
var packageName = "@atlaskit/media-card";
|
|
14
|
-
var packageVersion = "
|
|
14
|
+
var packageVersion = "79.15.9";
|
|
15
15
|
export var CardBase = function CardBase(_ref) {
|
|
16
16
|
var identifier = _ref.identifier,
|
|
17
17
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -85,7 +85,8 @@ export var FileCard = function FileCard(_ref) {
|
|
|
85
85
|
viewerOptions = _ref.viewerOptions,
|
|
86
86
|
includeHashForDuplicateFiles = _ref.includeHashForDuplicateFiles,
|
|
87
87
|
ssrItemDetails = _ref.ssrItemDetails,
|
|
88
|
-
onError = _ref.onError
|
|
88
|
+
onError = _ref.onError,
|
|
89
|
+
mediaViewerExtensions = _ref.mediaViewerExtensions;
|
|
89
90
|
var _useIntl = useIntl(),
|
|
90
91
|
formatMessage = _useIntl.formatMessage;
|
|
91
92
|
var _useState = useState(false),
|
|
@@ -778,6 +779,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
778
779
|
},
|
|
779
780
|
contextId: contextId,
|
|
780
781
|
featureFlags: featureFlags,
|
|
781
|
-
viewerOptions: viewerOptions
|
|
782
|
+
viewerOptions: viewerOptions,
|
|
783
|
+
extensions: mediaViewerExtensions
|
|
782
784
|
}) : null, getSsrScriptProps && /*#__PURE__*/React.createElement("script", getSsrScriptProps()));
|
|
783
785
|
};
|
|
@@ -80,7 +80,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
80
80
|
}(React.Component);
|
|
81
81
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
82
82
|
var packageName = "@atlaskit/media-card";
|
|
83
|
-
var packageVersion = "
|
|
83
|
+
var packageVersion = "79.15.9";
|
|
84
84
|
|
|
85
85
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
86
86
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
@@ -9,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
import { forwardRef } from 'react';
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
11
|
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { N500 } from '@atlaskit/theme/colors';
|
|
13
14
|
var variantStyleMap = {
|
|
14
15
|
filled: "_bfhk1pja _irr3tl7t",
|
|
@@ -17,7 +18,9 @@ var variantStyleMap = {
|
|
|
17
18
|
var cardActionButtonStyles = null;
|
|
18
19
|
export var CardActionButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
19
20
|
var _props$variant;
|
|
20
|
-
return /*#__PURE__*/React.createElement("button", _extends({}, props, {
|
|
21
|
+
return /*#__PURE__*/React.createElement("button", _extends({}, props, fg('platform_media_card_action_button_type_fix') ? {
|
|
22
|
+
type: 'button'
|
|
23
|
+
} : {}, {
|
|
21
24
|
id: "cardActionButton",
|
|
22
25
|
"data-testid": "media-card-primary-action",
|
|
23
26
|
"aria-label": props.label,
|
|
@@ -101,7 +101,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
101
101
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
102
102
|
var analyticsContext = {
|
|
103
103
|
packageVersion: "@atlaskit/media-card",
|
|
104
|
-
packageName: "
|
|
104
|
+
packageName: "79.15.9",
|
|
105
105
|
componentName: 'mediaInlineCard',
|
|
106
106
|
component: 'mediaInlineCard'
|
|
107
107
|
};
|
|
@@ -13,7 +13,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
|
13
13
|
import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
14
14
|
import { getMediaGlobalScope } from './globalScope/globalScope';
|
|
15
15
|
var packageName = "@atlaskit/media-card";
|
|
16
|
-
var packageVersion = "
|
|
16
|
+
var packageVersion = "79.15.9";
|
|
17
17
|
var SAMPLE_RATE = 0.05;
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type FileIdentifier, type Identifier, type ImageResizeMode } from '@atlaskit/media-client';
|
|
2
2
|
import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '@atlaskit/media-common';
|
|
3
|
-
import { type ViewerOptionsProps } from '@atlaskit/media-viewer';
|
|
3
|
+
import { type ViewerOptionsProps, type MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { type MediaCardErrorPrimaryReason } from '../errors';
|
|
6
6
|
import { type CardAppearance, type CardDimensions, type CardEventProps, type TitleBoxIcon } from '../types';
|
|
@@ -59,5 +59,7 @@ export interface FileCardProps extends CardEventProps {
|
|
|
59
59
|
readonly ssrItemDetails?: SsrItemDetails;
|
|
60
60
|
/** General Error handling include status errors and display errors*/
|
|
61
61
|
readonly onError?: (reason: MediaFilePreviewErrorPrimaryReason | MediaCardErrorPrimaryReason) => void;
|
|
62
|
+
/** Extensions for the media viewer (e.g. comment button in header). */
|
|
63
|
+
readonly mediaViewerExtensions?: MediaViewerExtensions;
|
|
62
64
|
}
|
|
63
|
-
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, }: FileCardProps) => React.JSX.Element;
|
|
65
|
+
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
8
8
|
import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '@atlaskit/media-common';
|
|
9
9
|
import { type CardAction } from './card/actions';
|
|
10
10
|
import { type MediaCardError, type MediaCardErrorPrimaryReason } from './errors';
|
|
11
|
-
import { type ViewerOptionsProps } from '@atlaskit/media-viewer';
|
|
11
|
+
import { type ViewerOptionsProps, type MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
12
12
|
import type { MediaFilePreviewErrorPrimaryReason } from '@atlaskit/media-file-preview';
|
|
13
13
|
export type CardStatus = 'uploading' | 'loading' | 'processing' | 'loading-preview' | 'complete' | 'error' | 'failed-processing';
|
|
14
14
|
export type FilePreviewStatus = {
|
|
@@ -111,6 +111,8 @@ export interface CardProps extends SharedCardProps, CardEventProps {
|
|
|
111
111
|
readonly mediaSettings?: MediaSettings;
|
|
112
112
|
/** General Error handling include status errors and display errors*/
|
|
113
113
|
readonly onError?: (reason: MediaFilePreviewErrorPrimaryReason | MediaCardErrorPrimaryReason) => void;
|
|
114
|
+
/** Extensions for the media viewer (e.g. comment button in header). */
|
|
115
|
+
readonly mediaViewerExtensions?: MediaViewerExtensions;
|
|
114
116
|
}
|
|
115
117
|
export interface CardState {
|
|
116
118
|
status: CardStatus;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type FileIdentifier, type Identifier, type ImageResizeMode } from '@atlaskit/media-client';
|
|
2
2
|
import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '@atlaskit/media-common';
|
|
3
|
-
import { type ViewerOptionsProps } from '@atlaskit/media-viewer';
|
|
3
|
+
import { type ViewerOptionsProps, type MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { type MediaCardErrorPrimaryReason } from '../errors';
|
|
6
6
|
import { type CardAppearance, type CardDimensions, type CardEventProps, type TitleBoxIcon } from '../types';
|
|
@@ -59,5 +59,7 @@ export interface FileCardProps extends CardEventProps {
|
|
|
59
59
|
readonly ssrItemDetails?: SsrItemDetails;
|
|
60
60
|
/** General Error handling include status errors and display errors*/
|
|
61
61
|
readonly onError?: (reason: MediaFilePreviewErrorPrimaryReason | MediaCardErrorPrimaryReason) => void;
|
|
62
|
+
/** Extensions for the media viewer (e.g. comment button in header). */
|
|
63
|
+
readonly mediaViewerExtensions?: MediaViewerExtensions;
|
|
62
64
|
}
|
|
63
|
-
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, }: FileCardProps) => React.JSX.Element;
|
|
65
|
+
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
|
|
@@ -8,7 +8,7 @@ import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
8
8
|
import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '@atlaskit/media-common';
|
|
9
9
|
import { type CardAction } from './card/actions';
|
|
10
10
|
import { type MediaCardError, type MediaCardErrorPrimaryReason } from './errors';
|
|
11
|
-
import { type ViewerOptionsProps } from '@atlaskit/media-viewer';
|
|
11
|
+
import { type ViewerOptionsProps, type MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
12
12
|
import type { MediaFilePreviewErrorPrimaryReason } from '@atlaskit/media-file-preview';
|
|
13
13
|
export type CardStatus = 'uploading' | 'loading' | 'processing' | 'loading-preview' | 'complete' | 'error' | 'failed-processing';
|
|
14
14
|
export type FilePreviewStatus = {
|
|
@@ -111,6 +111,8 @@ export interface CardProps extends SharedCardProps, CardEventProps {
|
|
|
111
111
|
readonly mediaSettings?: MediaSettings;
|
|
112
112
|
/** General Error handling include status errors and display errors*/
|
|
113
113
|
readonly onError?: (reason: MediaFilePreviewErrorPrimaryReason | MediaCardErrorPrimaryReason) => void;
|
|
114
|
+
/** Extensions for the media viewer (e.g. comment button in header). */
|
|
115
|
+
readonly mediaViewerExtensions?: MediaViewerExtensions;
|
|
114
116
|
}
|
|
115
117
|
export interface CardState {
|
|
116
118
|
status: CardStatus;
|
|
@@ -3,10 +3,12 @@ import { type SyntheticEvent, useState } from 'react';
|
|
|
3
3
|
import { type FileIdentifier } from '@atlaskit/media-client';
|
|
4
4
|
import { useMediaClient } from '@atlaskit/media-client-react';
|
|
5
5
|
|
|
6
|
-
export const useSvgUploader = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export const useSvgUploader = (
|
|
7
|
+
collectionName?: string,
|
|
8
|
+
): {
|
|
9
|
+
status: string;
|
|
10
|
+
identifier: FileIdentifier | undefined;
|
|
11
|
+
uploadFn: (event: SyntheticEvent<HTMLInputElement>) => Promise<void>;
|
|
10
12
|
} => {
|
|
11
13
|
const mediaClient = useMediaClient();
|
|
12
14
|
const [identifier, setIdentifier] = useState<FileIdentifier>();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "79.
|
|
3
|
+
"version": "79.16.0",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,9 +40,10 @@
|
|
|
40
40
|
"@atlaskit/media-client-react": "^5.0.0",
|
|
41
41
|
"@atlaskit/media-common": "^13.0.0",
|
|
42
42
|
"@atlaskit/media-file-preview": "^0.16.0",
|
|
43
|
+
"@atlaskit/media-state": "^2.0.0",
|
|
43
44
|
"@atlaskit/media-svg": "^2.2.0",
|
|
44
45
|
"@atlaskit/media-ui": "^28.7.0",
|
|
45
|
-
"@atlaskit/media-viewer": "^52.
|
|
46
|
+
"@atlaskit/media-viewer": "^52.9.0",
|
|
46
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
48
|
"@atlaskit/primitives": "^18.0.0",
|
|
48
49
|
"@atlaskit/react-ufo": "^5.4.0",
|
|
@@ -75,7 +76,6 @@
|
|
|
75
76
|
"@atlaskit/inline-message": "^15.6.0",
|
|
76
77
|
"@atlaskit/media-core": "^37.0.0",
|
|
77
78
|
"@atlaskit/media-picker": "^70.1.0",
|
|
78
|
-
"@atlaskit/media-state": "^2.0.0",
|
|
79
79
|
"@atlaskit/media-test-data": "^3.2.0",
|
|
80
80
|
"@atlaskit/media-test-helpers": "^40.0.0",
|
|
81
81
|
"@atlaskit/radio": "^8.4.0",
|
|
@@ -149,6 +149,9 @@
|
|
|
149
149
|
},
|
|
150
150
|
"dfo_attachments_late_render_fix": {
|
|
151
151
|
"type": "boolean"
|
|
152
|
+
},
|
|
153
|
+
"platform_media_card_action_button_type_fix": {
|
|
154
|
+
"type": "boolean"
|
|
152
155
|
}
|
|
153
156
|
},
|
|
154
157
|
"techstack": {
|