@atlaskit/media-ui 28.2.4 → 28.3.1
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 +18 -0
- package/dist/cjs/MediaInlineCard/ErroredView/index.compiled.css +1 -0
- package/dist/cjs/MediaInlineCard/ErroredView/index.js +16 -17
- package/dist/cjs/MediaInlineCard/Frame/index.js +3 -1
- package/dist/cjs/MediaInlineCard/Frame/styled-compiled.compiled.css +3 -0
- package/dist/cjs/MediaInlineCard/Frame/styled-compiled.js +6 -3
- package/dist/cjs/MediaInlineCard/Frame/styled-emotion.js +10 -0
- package/dist/cjs/abuseModal/abuseModal.js +4 -28
- package/dist/cjs/customMediaPlayer/analytics/events/operational/captionDeleteFailed.js +24 -0
- package/dist/cjs/customMediaPlayer/analytics/events/operational/captionDeleteSucceeded.js +16 -0
- package/dist/cjs/customMediaPlayer/analytics/events/operational/captionUploadFailed.js +24 -0
- package/dist/cjs/customMediaPlayer/analytics/events/operational/captionUploadSucceeded.js +16 -0
- package/dist/cjs/customMediaPlayer/analytics/index.js +28 -0
- package/dist/cjs/customMediaPlayer/analytics/utils/captionAttributes.js +24 -0
- package/dist/cjs/customMediaPlayer/index.js +1 -1
- package/dist/cjs/customMediaPlayer/mediaPlayer/captions/apiFeedback.js +46 -0
- package/dist/cjs/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/uploader.js +32 -52
- package/dist/cjs/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/util.js +12 -0
- package/dist/cjs/customMediaPlayer/mediaPlayer/captions/artifactUploader/captionsUploaderBrowser.js +29 -5
- package/dist/cjs/customMediaPlayer/mediaPlayer/captions/artifactUploader/index.js +3 -2
- package/dist/cjs/customMediaPlayer/mediaPlayer/captions/captionDeleteConfirmationModal.js +103 -0
- package/dist/cjs/customMediaPlayer/mediaPlayer/captionsAdminControls.js +6 -3
- package/dist/cjs/customMediaPlayer/mediaPlayer/captionsSelectControls.js +6 -2
- package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
- package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +82 -9
- package/dist/cjs/customMediaPlayer/mediaPlayer/useTextTracks.js +2 -1
- package/dist/cjs/customMediaPlayer/timeRange.js +14 -13
- package/dist/cjs/messages.js +45 -0
- package/dist/es2019/MediaInlineCard/ErroredView/index.compiled.css +1 -0
- package/dist/es2019/MediaInlineCard/ErroredView/index.js +13 -17
- package/dist/es2019/MediaInlineCard/Frame/index.js +3 -1
- package/dist/es2019/MediaInlineCard/Frame/styled-compiled.compiled.css +4 -1
- package/dist/es2019/MediaInlineCard/Frame/styled-compiled.js +4 -2
- package/dist/es2019/MediaInlineCard/Frame/styled-emotion.js +9 -1
- package/dist/es2019/abuseModal/abuseModal.js +4 -28
- package/dist/es2019/customMediaPlayer/analytics/events/operational/captionDeleteFailed.js +15 -0
- package/dist/es2019/customMediaPlayer/analytics/events/operational/captionDeleteSucceeded.js +10 -0
- package/dist/es2019/customMediaPlayer/analytics/events/operational/captionUploadFailed.js +15 -0
- package/dist/es2019/customMediaPlayer/analytics/events/operational/captionUploadSucceeded.js +10 -0
- package/dist/es2019/customMediaPlayer/analytics/index.js +4 -0
- package/dist/es2019/customMediaPlayer/analytics/utils/captionAttributes.js +16 -0
- package/dist/es2019/customMediaPlayer/index.js +1 -1
- package/dist/es2019/customMediaPlayer/mediaPlayer/captions/apiFeedback.js +40 -0
- package/dist/es2019/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/uploader.js +14 -17
- package/dist/es2019/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/util.js +6 -0
- package/dist/es2019/customMediaPlayer/mediaPlayer/captions/artifactUploader/captionsUploaderBrowser.js +23 -4
- package/dist/es2019/customMediaPlayer/mediaPlayer/captions/artifactUploader/index.js +2 -1
- package/dist/es2019/customMediaPlayer/mediaPlayer/captions/captionDeleteConfirmationModal.js +68 -0
- package/dist/es2019/customMediaPlayer/mediaPlayer/captionsAdminControls.js +4 -3
- package/dist/es2019/customMediaPlayer/mediaPlayer/captionsSelectControls.js +4 -2
- package/dist/es2019/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
- package/dist/es2019/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +75 -10
- package/dist/es2019/customMediaPlayer/mediaPlayer/useTextTracks.js +2 -1
- package/dist/es2019/customMediaPlayer/timeRange.js +14 -13
- package/dist/es2019/messages.js +45 -0
- package/dist/esm/MediaInlineCard/ErroredView/index.compiled.css +1 -0
- package/dist/esm/MediaInlineCard/ErroredView/index.js +17 -18
- package/dist/esm/MediaInlineCard/Frame/index.js +3 -1
- package/dist/esm/MediaInlineCard/Frame/styled-compiled.compiled.css +3 -0
- package/dist/esm/MediaInlineCard/Frame/styled-compiled.js +7 -4
- package/dist/esm/MediaInlineCard/Frame/styled-emotion.js +11 -1
- package/dist/esm/abuseModal/abuseModal.js +4 -28
- package/dist/esm/customMediaPlayer/analytics/events/operational/captionDeleteFailed.js +17 -0
- package/dist/esm/customMediaPlayer/analytics/events/operational/captionDeleteSucceeded.js +10 -0
- package/dist/esm/customMediaPlayer/analytics/events/operational/captionUploadFailed.js +17 -0
- package/dist/esm/customMediaPlayer/analytics/events/operational/captionUploadSucceeded.js +10 -0
- package/dist/esm/customMediaPlayer/analytics/index.js +4 -0
- package/dist/esm/customMediaPlayer/analytics/utils/captionAttributes.js +17 -0
- package/dist/esm/customMediaPlayer/index.js +1 -1
- package/dist/esm/customMediaPlayer/mediaPlayer/captions/apiFeedback.js +39 -0
- package/dist/esm/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/uploader.js +32 -52
- package/dist/esm/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/util.js +6 -0
- package/dist/esm/customMediaPlayer/mediaPlayer/captions/artifactUploader/captionsUploaderBrowser.js +28 -4
- package/dist/esm/customMediaPlayer/mediaPlayer/captions/artifactUploader/index.js +2 -1
- package/dist/esm/customMediaPlayer/mediaPlayer/captions/captionDeleteConfirmationModal.js +94 -0
- package/dist/esm/customMediaPlayer/mediaPlayer/captionsAdminControls.js +6 -3
- package/dist/esm/customMediaPlayer/mediaPlayer/captionsSelectControls.js +6 -2
- package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
- package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +83 -10
- package/dist/esm/customMediaPlayer/mediaPlayer/useTextTracks.js +2 -1
- package/dist/esm/customMediaPlayer/timeRange.js +14 -13
- package/dist/esm/messages.js +45 -0
- package/dist/types/MediaInlineCard/ErroredView/index.d.ts +1 -2
- package/dist/types/MediaInlineCard/Frame/index.d.ts +1 -0
- package/dist/types/MediaInlineCard/Frame/styled-compiled.d.ts +2 -1
- package/dist/types/customMediaPlayer/analytics/events/operational/captionDeleteFailed.d.ts +5 -0
- package/dist/types/customMediaPlayer/analytics/events/operational/captionDeleteSucceeded.d.ts +5 -0
- package/dist/types/customMediaPlayer/analytics/events/operational/captionUploadFailed.d.ts +5 -0
- package/dist/types/customMediaPlayer/analytics/events/operational/captionUploadSucceeded.d.ts +5 -0
- package/dist/types/customMediaPlayer/analytics/index.d.ts +4 -0
- package/dist/types/customMediaPlayer/analytics/utils/analytics.d.ts +5 -1
- package/dist/types/customMediaPlayer/analytics/utils/captionAttributes.d.ts +25 -0
- package/dist/types/customMediaPlayer/mediaPlayer/captions/apiFeedback.d.ts +13 -0
- package/dist/types/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/uploader.d.ts +2 -1
- package/dist/types/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/util.d.ts +1 -0
- package/dist/types/customMediaPlayer/mediaPlayer/captions/artifactUploader/captionsUploaderBrowser.d.ts +12 -2
- package/dist/types/customMediaPlayer/mediaPlayer/captions/artifactUploader/index.d.ts +2 -1
- package/dist/types/customMediaPlayer/mediaPlayer/captions/artifactUploader/types.d.ts +6 -3
- package/dist/types/customMediaPlayer/mediaPlayer/captions/captionDeleteConfirmationModal.d.ts +19 -0
- package/dist/types/customMediaPlayer/mediaPlayer/captionsAdminControls.d.ts +2 -1
- package/dist/types/customMediaPlayer/mediaPlayer/mediaPlayerBase.d.ts +1 -0
- package/dist/types/customMediaPlayer/react-video-renderer/text.d.ts +1 -0
- package/dist/types/customMediaPlayer/timeRange.d.ts +3 -3
- package/dist/types/messages.d.ts +1 -1
- package/dist/types-ts4.5/MediaInlineCard/ErroredView/index.d.ts +1 -2
- package/dist/types-ts4.5/MediaInlineCard/Frame/index.d.ts +1 -0
- package/dist/types-ts4.5/MediaInlineCard/Frame/styled-compiled.d.ts +2 -1
- package/dist/types-ts4.5/customMediaPlayer/analytics/events/operational/captionDeleteFailed.d.ts +5 -0
- package/dist/types-ts4.5/customMediaPlayer/analytics/events/operational/captionDeleteSucceeded.d.ts +5 -0
- package/dist/types-ts4.5/customMediaPlayer/analytics/events/operational/captionUploadFailed.d.ts +5 -0
- package/dist/types-ts4.5/customMediaPlayer/analytics/events/operational/captionUploadSucceeded.d.ts +5 -0
- package/dist/types-ts4.5/customMediaPlayer/analytics/index.d.ts +4 -0
- package/dist/types-ts4.5/customMediaPlayer/analytics/utils/analytics.d.ts +5 -1
- package/dist/types-ts4.5/customMediaPlayer/analytics/utils/captionAttributes.d.ts +25 -0
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/captions/apiFeedback.d.ts +13 -0
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/uploader.d.ts +2 -1
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/util.d.ts +1 -0
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/captions/artifactUploader/captionsUploaderBrowser.d.ts +12 -2
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/captions/artifactUploader/index.d.ts +2 -1
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/captions/artifactUploader/types.d.ts +6 -3
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/captions/captionDeleteConfirmationModal.d.ts +19 -0
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/captionsAdminControls.d.ts +2 -1
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/mediaPlayerBase.d.ts +1 -0
- package/dist/types-ts4.5/customMediaPlayer/react-video-renderer/text.d.ts +1 -0
- package/dist/types-ts4.5/customMediaPlayer/timeRange.d.ts +3 -3
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/package.json +13 -9
- package/dist/cjs/MediaInlineCard/styled-compiled.compiled.css +0 -1
- package/dist/cjs/MediaInlineCard/styled-compiled.js +0 -28
- package/dist/cjs/MediaInlineCard/styled-emotion.js +0 -15
- package/dist/cjs/MediaInlineCard/styled.js +0 -14
- package/dist/es2019/MediaInlineCard/styled-compiled.compiled.css +0 -1
- package/dist/es2019/MediaInlineCard/styled-compiled.js +0 -13
- package/dist/es2019/MediaInlineCard/styled-emotion.js +0 -8
- package/dist/es2019/MediaInlineCard/styled.js +0 -5
- package/dist/esm/MediaInlineCard/styled-compiled.compiled.css +0 -1
- package/dist/esm/MediaInlineCard/styled-compiled.js +0 -19
- package/dist/esm/MediaInlineCard/styled-emotion.js +0 -8
- package/dist/esm/MediaInlineCard/styled.js +0 -7
- package/dist/types/MediaInlineCard/styled-compiled.d.ts +0 -2
- package/dist/types/MediaInlineCard/styled-emotion.d.ts +0 -5
- package/dist/types/MediaInlineCard/styled.d.ts +0 -2
- package/dist/types-ts4.5/MediaInlineCard/styled-compiled.d.ts +0 -2
- package/dist/types-ts4.5/MediaInlineCard/styled-emotion.d.ts +0 -5
- package/dist/types-ts4.5/MediaInlineCard/styled.d.ts +0 -2
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
-
import Button
|
|
4
|
-
import CrossIcon from '@atlaskit/icon/core/migration/close--cross';
|
|
3
|
+
import Button from '@atlaskit/button/new';
|
|
5
4
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
6
|
-
import { Flex, Grid, xcss } from '@atlaskit/primitives';
|
|
7
5
|
import { messages } from '../messages';
|
|
8
|
-
const gridStyles = xcss({
|
|
9
|
-
width: '100%'
|
|
10
|
-
});
|
|
11
|
-
const closeContainerStyles = xcss({
|
|
12
|
-
gridArea: 'close'
|
|
13
|
-
});
|
|
14
|
-
const titleContainerStyles = xcss({
|
|
15
|
-
gridArea: 'title'
|
|
16
|
-
});
|
|
17
6
|
export const AbuseModal = injectIntl(({
|
|
18
7
|
isOpen,
|
|
19
8
|
onConfirm,
|
|
@@ -25,24 +14,11 @@ export const AbuseModal = injectIntl(({
|
|
|
25
14
|
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(Modal, {
|
|
26
15
|
onClose: onClose,
|
|
27
16
|
testId: "mediaAbuseModal"
|
|
28
|
-
}, /*#__PURE__*/React.createElement(ModalHeader,
|
|
29
|
-
|
|
30
|
-
templateAreas: ['title close'],
|
|
31
|
-
xcss: gridStyles
|
|
32
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
33
|
-
xcss: closeContainerStyles,
|
|
34
|
-
justifyContent: "end"
|
|
35
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
36
|
-
appearance: "subtle",
|
|
37
|
-
icon: CrossIcon,
|
|
38
|
-
label: "Close Modal",
|
|
39
|
-
onClick: onClose
|
|
40
|
-
})), /*#__PURE__*/React.createElement(Flex, {
|
|
41
|
-
xcss: titleContainerStyles,
|
|
42
|
-
justifyContent: "start"
|
|
17
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
18
|
+
hasCloseButton: true
|
|
43
19
|
}, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
44
20
|
appearance: "warning"
|
|
45
|
-
}, formatMessage(messages.abuse_modal_title)))
|
|
21
|
+
}, formatMessage(messages.abuse_modal_title))), /*#__PURE__*/React.createElement(ModalBody, null, formatMessage(messages.abuse_modal_body)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
46
22
|
appearance: "subtle",
|
|
47
23
|
onClick: onClose
|
|
48
24
|
}, formatMessage(messages.cancel)), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { generateBaseAttributes } from '../../utils/captionAttributes';
|
|
2
|
+
export function createCaptionDeleteFailedOperationalEvent(type, captionAttributes, fileId, traceId, error) {
|
|
3
|
+
return {
|
|
4
|
+
eventType: 'operational',
|
|
5
|
+
action: 'deleteFailed',
|
|
6
|
+
actionSubject: 'mediaPlayerCaption',
|
|
7
|
+
actionSubjectId: captionAttributes.artifactName,
|
|
8
|
+
attributes: {
|
|
9
|
+
...generateBaseAttributes(type, captionAttributes, fileId, traceId),
|
|
10
|
+
failReason: 'delete-fail',
|
|
11
|
+
error: error.name || 'unknown',
|
|
12
|
+
errorDetail: error.message || 'unknown'
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { generateBaseAttributes } from '../../utils/captionAttributes';
|
|
2
|
+
export function createCaptionDeleteSucceededOperationalEvent(type, captionAttributes, fileId, traceId) {
|
|
3
|
+
return {
|
|
4
|
+
eventType: 'operational',
|
|
5
|
+
action: 'deleteSucceeded',
|
|
6
|
+
actionSubject: 'mediaPlayerCaption',
|
|
7
|
+
actionSubjectId: captionAttributes.artifactName,
|
|
8
|
+
attributes: generateBaseAttributes(type, captionAttributes, fileId, traceId)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { generateBaseAttributes } from '../../utils/captionAttributes';
|
|
2
|
+
export function createCaptionUploadFailedOperationalEvent(type, captionAttributes, fileId, traceId, error) {
|
|
3
|
+
return {
|
|
4
|
+
eventType: 'operational',
|
|
5
|
+
action: 'uploadFailed',
|
|
6
|
+
actionSubject: 'mediaPlayerCaption',
|
|
7
|
+
actionSubjectId: fileId,
|
|
8
|
+
attributes: {
|
|
9
|
+
...generateBaseAttributes(type, captionAttributes, fileId, traceId),
|
|
10
|
+
failReason: 'upload-fail',
|
|
11
|
+
error: error.name || 'unknown',
|
|
12
|
+
errorDetail: error.message || 'unknown'
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { generateBaseAttributes } from '../../utils/captionAttributes';
|
|
2
|
+
export function createCaptionUploadSucceededOperationalEvent(type, captionAttributes, fileId, traceId) {
|
|
3
|
+
return {
|
|
4
|
+
eventType: 'operational',
|
|
5
|
+
action: 'uploadSucceeded',
|
|
6
|
+
actionSubject: 'mediaPlayerCaption',
|
|
7
|
+
actionSubjectId: fileId,
|
|
8
|
+
attributes: generateBaseAttributes(type, captionAttributes, fileId, traceId)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -4,6 +4,10 @@ export { createPlaybackSpeedChangedEvent } from './events/ui/playbackSpeedChange
|
|
|
4
4
|
export { createPlayPauseBlanketClickedEvent } from './events/ui/playPauseBlanketClicked';
|
|
5
5
|
export { createMediaShortcutPressedEvent } from './events/ui/shortcutPressed';
|
|
6
6
|
export { createTimeRangeNavigatedEvent } from './events/ui/timeRangeNavigated';
|
|
7
|
+
export { createCaptionUploadSucceededOperationalEvent } from './events/operational/captionUploadSucceeded';
|
|
8
|
+
export { createCaptionDeleteSucceededOperationalEvent } from './events/operational/captionDeleteSucceeded';
|
|
9
|
+
export { createCaptionUploadFailedOperationalEvent } from './events/operational/captionUploadFailed';
|
|
10
|
+
export { createCaptionDeleteFailedOperationalEvent } from './events/operational/captionDeleteFailed';
|
|
7
11
|
export { createFirstPlayedTrackEvent } from './events/track/playCount';
|
|
8
12
|
export { createPlayedTrackEvent } from './events/track/played';
|
|
9
13
|
export { createAndFireMediaCustomMediaPlayerEvent, fireAnalyticsEvent } from './utils/analytics';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function generateBaseAttributes(type, captionAttributes, fileId, traceId) {
|
|
2
|
+
return {
|
|
3
|
+
type,
|
|
4
|
+
captionAttributes,
|
|
5
|
+
...(fileId && {
|
|
6
|
+
fileAttributes: {
|
|
7
|
+
fileId
|
|
8
|
+
}
|
|
9
|
+
}),
|
|
10
|
+
...(traceId && {
|
|
11
|
+
traceContext: {
|
|
12
|
+
traceId
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -7,7 +7,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
7
7
|
import { withMediaAnalyticsContext } from '@atlaskit/media-common';
|
|
8
8
|
export const CustomMediaPlayerBase = props => fg('platform_media_compiled') ? /*#__PURE__*/React.createElement(CompiledCustomMediaPlayerBase, props) : /*#__PURE__*/React.createElement(EmotionCustomMediaPlayerBase, props);
|
|
9
9
|
const packageName = "@atlaskit/media-ui";
|
|
10
|
-
const packageVersion = "28.
|
|
10
|
+
const packageVersion = "28.3.1";
|
|
11
11
|
|
|
12
12
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
13
13
|
export const CustomMediaPlayer = withMediaAnalyticsContext({
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutoDismissFlag, FlagGroup } from '@atlaskit/flag';
|
|
3
|
+
import SuccessIcon from '@atlaskit/icon/core/migration/success--check-circle';
|
|
4
|
+
import ErrorIcon from '@atlaskit/icon/core/migration/error';
|
|
5
|
+
import { injectIntl } from 'react-intl-next';
|
|
6
|
+
import { messages } from '../../../messages';
|
|
7
|
+
function ApiFeedback({
|
|
8
|
+
notificationType,
|
|
9
|
+
onDismissed,
|
|
10
|
+
successDescription,
|
|
11
|
+
errorDescription,
|
|
12
|
+
intl
|
|
13
|
+
}) {
|
|
14
|
+
return /*#__PURE__*/React.createElement(FlagGroup, {
|
|
15
|
+
onDismissed: onDismissed
|
|
16
|
+
}, notificationType === 'success' ? /*#__PURE__*/React.createElement(AutoDismissFlag, {
|
|
17
|
+
id: 'success',
|
|
18
|
+
icon: /*#__PURE__*/React.createElement(SuccessIcon, {
|
|
19
|
+
label: "Success",
|
|
20
|
+
color: "var(--ds-icon-success, #22A06B)",
|
|
21
|
+
LEGACY_size: "medium",
|
|
22
|
+
spacing: "spacious"
|
|
23
|
+
}),
|
|
24
|
+
key: 'success',
|
|
25
|
+
title: intl.formatMessage(messages.success),
|
|
26
|
+
description: successDescription
|
|
27
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null), notificationType === 'error' ? /*#__PURE__*/React.createElement(AutoDismissFlag, {
|
|
28
|
+
id: 'error',
|
|
29
|
+
icon: /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
30
|
+
label: "Error",
|
|
31
|
+
color: "var(--ds-icon-danger, #C9372C)",
|
|
32
|
+
LEGACY_size: "medium",
|
|
33
|
+
spacing: "spacious"
|
|
34
|
+
}),
|
|
35
|
+
key: 'error',
|
|
36
|
+
title: intl.formatMessage(messages.error),
|
|
37
|
+
description: errorDescription
|
|
38
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null));
|
|
39
|
+
}
|
|
40
|
+
export default injectIntl(ApiFeedback);
|
package/dist/es2019/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/uploader.js
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return error;
|
|
4
|
-
}
|
|
5
|
-
return new Error(String(error));
|
|
6
|
-
};
|
|
7
|
-
const upladFile = async (mediaClient, identifier, file, locale) => {
|
|
8
|
-
const result = await mediaClient.file.uploadArtifact(identifier.id, file, {
|
|
9
|
-
type: 'caption',
|
|
10
|
-
language: locale
|
|
11
|
-
}, identifier.collectionName);
|
|
12
|
-
return result;
|
|
13
|
-
};
|
|
1
|
+
import { parseError } from './util';
|
|
2
|
+
import { getRandomTelemetryId } from '@atlaskit/media-common';
|
|
14
3
|
export const createUploadCaptionsFn = (mediaClient, identifier, onStart, onEnd, onError) => async (file, locale) => {
|
|
4
|
+
const context = {
|
|
5
|
+
traceId: getRandomTelemetryId()
|
|
6
|
+
};
|
|
15
7
|
if (file) {
|
|
16
|
-
onStart === null || onStart === void 0 ? void 0 : onStart(file);
|
|
8
|
+
onStart === null || onStart === void 0 ? void 0 : onStart(file, context);
|
|
17
9
|
try {
|
|
18
|
-
const result = await
|
|
19
|
-
|
|
10
|
+
const result = await mediaClient.file.uploadArtifact(identifier.id, file, {
|
|
11
|
+
type: 'caption',
|
|
12
|
+
language: locale
|
|
13
|
+
}, identifier.collectionName, {
|
|
14
|
+
traceId: context.traceId
|
|
15
|
+
});
|
|
16
|
+
onEnd === null || onEnd === void 0 ? void 0 : onEnd(result, context);
|
|
20
17
|
} catch (error) {
|
|
21
|
-
onError === null || onError === void 0 ? void 0 : onError(parseError(error));
|
|
18
|
+
onError === null || onError === void 0 ? void 0 : onError(parseError(error), context);
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
21
|
};
|
|
@@ -2,17 +2,30 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { useMediaClient } from '@atlaskit/media-client-react';
|
|
3
3
|
import { BrowserPicker } from './filePickers/browser';
|
|
4
4
|
import { createUploadCaptionsFn, UploadCaptionsForm } from './captions';
|
|
5
|
-
|
|
5
|
+
import ApiFeedback from '../apiFeedback';
|
|
6
|
+
import { messages } from '../../../../messages';
|
|
7
|
+
import { injectIntl } from 'react-intl-next';
|
|
8
|
+
const CaptionsUploaderBrowser = ({
|
|
6
9
|
identifier,
|
|
7
10
|
isOpen,
|
|
8
11
|
onClose,
|
|
9
12
|
onStart,
|
|
10
13
|
onEnd,
|
|
11
|
-
onError
|
|
14
|
+
onError,
|
|
15
|
+
intl
|
|
12
16
|
}) => {
|
|
13
17
|
const [isFormOpen, setIsFormOpen] = useState(false);
|
|
14
18
|
const [file, setFile] = useState();
|
|
15
19
|
const mediaClient = useMediaClient();
|
|
20
|
+
const [notificationType, setNotificationType] = useState(null);
|
|
21
|
+
const _onError = (error, context) => {
|
|
22
|
+
setNotificationType('error');
|
|
23
|
+
onError === null || onError === void 0 ? void 0 : onError(error, context);
|
|
24
|
+
};
|
|
25
|
+
const _onEnd = (metadata, context) => {
|
|
26
|
+
setNotificationType('success');
|
|
27
|
+
onEnd === null || onEnd === void 0 ? void 0 : onEnd(metadata, context);
|
|
28
|
+
};
|
|
16
29
|
const close = () => {
|
|
17
30
|
setIsFormOpen(false);
|
|
18
31
|
setFile(undefined);
|
|
@@ -34,7 +47,13 @@ export const CaptionsUploaderBrowser = ({
|
|
|
34
47
|
}), /*#__PURE__*/React.createElement(UploadCaptionsForm, {
|
|
35
48
|
isOpen: isFormOpen,
|
|
36
49
|
file: file,
|
|
37
|
-
uploadFn: createUploadCaptionsFn(mediaClient, identifier, onStart,
|
|
50
|
+
uploadFn: createUploadCaptionsFn(mediaClient, identifier, onStart, _onEnd, _onError),
|
|
38
51
|
onClose: close
|
|
52
|
+
}), /*#__PURE__*/React.createElement(ApiFeedback, {
|
|
53
|
+
notificationType: notificationType,
|
|
54
|
+
onDismissed: () => setNotificationType(null),
|
|
55
|
+
successDescription: intl.formatMessage(messages.video_captions_upload_success_description),
|
|
56
|
+
errorDescription: intl.formatMessage(messages.video_captions_upload_error_description)
|
|
39
57
|
}));
|
|
40
|
-
};
|
|
58
|
+
};
|
|
59
|
+
export default injectIntl(CaptionsUploaderBrowser);
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import CaptionsUploaderBrowser from './captionsUploaderBrowser';
|
|
2
|
+
export { CaptionsUploaderBrowser };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import Button from '@atlaskit/button/new';
|
|
3
|
+
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
4
|
+
import { useMediaClient } from '@atlaskit/media-client-react';
|
|
5
|
+
import { parseError } from './artifactUploader/captions/util';
|
|
6
|
+
import ApiFeedback from './apiFeedback';
|
|
7
|
+
import { injectIntl } from 'react-intl-next';
|
|
8
|
+
import { messages } from '../../../messages';
|
|
9
|
+
import { getRandomTelemetryId } from '@atlaskit/media-common';
|
|
10
|
+
const CaptionDeleteConfirmationModal = ({
|
|
11
|
+
identifier,
|
|
12
|
+
artifactName,
|
|
13
|
+
onClose,
|
|
14
|
+
onStart,
|
|
15
|
+
onEnd,
|
|
16
|
+
onError,
|
|
17
|
+
intl
|
|
18
|
+
}) => {
|
|
19
|
+
const mediaClient = useMediaClient();
|
|
20
|
+
const [notificationType, setNotificationType] = useState(null);
|
|
21
|
+
const _onError = (error, context) => {
|
|
22
|
+
setNotificationType('error');
|
|
23
|
+
onError === null || onError === void 0 ? void 0 : onError(error, context);
|
|
24
|
+
};
|
|
25
|
+
const _onEnd = context => {
|
|
26
|
+
setNotificationType('success');
|
|
27
|
+
onEnd === null || onEnd === void 0 ? void 0 : onEnd(context);
|
|
28
|
+
};
|
|
29
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalTransition, null, artifactName && /*#__PURE__*/React.createElement(Modal, {
|
|
30
|
+
onClose: onClose
|
|
31
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
32
|
+
hasCloseButton: true
|
|
33
|
+
}, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
34
|
+
appearance: "danger"
|
|
35
|
+
}, intl.formatMessage(messages.video_captions_delete_captions_confirmation_header))), /*#__PURE__*/React.createElement(ModalBody, null, intl.formatMessage(messages.video_captions_delete_captions_confirmation_description)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
36
|
+
appearance: "subtle",
|
|
37
|
+
onClick: onClose
|
|
38
|
+
}, intl.formatMessage(messages.cancel)), /*#__PURE__*/React.createElement(Button, {
|
|
39
|
+
appearance: "danger",
|
|
40
|
+
onClick: () => {
|
|
41
|
+
deleteCaption(mediaClient, identifier, artifactName, onStart, _onEnd, _onError);
|
|
42
|
+
onClose();
|
|
43
|
+
}
|
|
44
|
+
}, intl.formatMessage(messages.delete))))), /*#__PURE__*/React.createElement(ApiFeedback, {
|
|
45
|
+
notificationType: notificationType,
|
|
46
|
+
onDismissed: () => setNotificationType(null),
|
|
47
|
+
successDescription: intl.formatMessage(messages.video_captions_delete_success_description),
|
|
48
|
+
errorDescription: intl.formatMessage(messages.video_captions_delete_error_description)
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
export default injectIntl(CaptionDeleteConfirmationModal);
|
|
52
|
+
const deleteCaption = async (mediaClient, identifier, artifactName, onStart, onEnd, onError) => {
|
|
53
|
+
const context = {
|
|
54
|
+
traceId: getRandomTelemetryId(),
|
|
55
|
+
artifactName
|
|
56
|
+
};
|
|
57
|
+
onStart === null || onStart === void 0 ? void 0 : onStart(context);
|
|
58
|
+
try {
|
|
59
|
+
await mediaClient.file.deleteArtifact(identifier.id, {
|
|
60
|
+
artifactName
|
|
61
|
+
}, identifier.collectionName, {
|
|
62
|
+
traceId: context.traceId
|
|
63
|
+
});
|
|
64
|
+
onEnd === null || onEnd === void 0 ? void 0 : onEnd(context);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
onError === null || onError === void 0 ? void 0 : onError(parseError(error), context);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
@@ -12,7 +12,8 @@ import { formatLocale } from './captions';
|
|
|
12
12
|
export const _CaptionsAdminControls = ({
|
|
13
13
|
intl,
|
|
14
14
|
textTracks = {},
|
|
15
|
-
onUpload
|
|
15
|
+
onUpload,
|
|
16
|
+
onDelete
|
|
16
17
|
}) => {
|
|
17
18
|
var _textTracks$captions;
|
|
18
19
|
const videoSettings = intl.formatMessage(messages.video_settings);
|
|
@@ -36,8 +37,8 @@ export const _CaptionsAdminControls = ({
|
|
|
36
37
|
title: videoSettings
|
|
37
38
|
}, (_textTracks$captions = textTracks.captions) === null || _textTracks$captions === void 0 ? void 0 : _textTracks$captions.tracks.map((track, index) => /*#__PURE__*/React.createElement(DropdownItem, {
|
|
38
39
|
key: `${track.lang}-${index}`,
|
|
39
|
-
onClick: () =>
|
|
40
|
-
|
|
40
|
+
onClick: () => onDelete(track.artifactName),
|
|
41
|
+
elemAfter: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
41
42
|
spacing: "spacious",
|
|
42
43
|
label: "",
|
|
43
44
|
color: "var(--ds-icon-danger, #C9372C)"
|
|
@@ -4,7 +4,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
4
4
|
import Tooltip from '@atlaskit/tooltip';
|
|
5
5
|
import Button, { IconButton, SplitButton } from '@atlaskit/button/new';
|
|
6
6
|
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
7
|
-
import ChevronDownIcon from '@atlaskit/icon/
|
|
7
|
+
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
8
8
|
import { messages } from '../../messages';
|
|
9
9
|
import { formatLocale } from './captions';
|
|
10
10
|
export const _CaptionsSelectControls = /*#__PURE__*/memo(({
|
|
@@ -45,7 +45,9 @@ export const _CaptionsSelectControls = /*#__PURE__*/memo(({
|
|
|
45
45
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
46
46
|
ref: triggerRef
|
|
47
47
|
}, triggerProps, {
|
|
48
|
-
icon: ChevronDownIcon,
|
|
48
|
+
icon: iconProps => /*#__PURE__*/React.createElement(ChevronDownIcon, _extends({}, iconProps, {
|
|
49
|
+
size: "small"
|
|
50
|
+
})),
|
|
49
51
|
label: selectCaptions,
|
|
50
52
|
appearance: "subtle"
|
|
51
53
|
})))
|
|
@@ -5,7 +5,7 @@ import { useFileState, useMediaClient, useMediaSettings } from '@atlaskit/media-
|
|
|
5
5
|
import { MediaPlayerBase } from './mediaPlayerBase';
|
|
6
6
|
import { useTextTracks } from './useTextTracks';
|
|
7
7
|
const packageName = "@atlaskit/media-ui";
|
|
8
|
-
const packageVersion = "28.
|
|
8
|
+
const packageVersion = "28.3.1";
|
|
9
9
|
const MediaPlayerBaseWithContext = withMediaAnalyticsContext({
|
|
10
10
|
packageVersion,
|
|
11
11
|
packageName,
|
|
@@ -26,7 +26,7 @@ import { TimeRange } from '../timeRange';
|
|
|
26
26
|
import VolumeRange from '../volumeRange';
|
|
27
27
|
import { CurrentTime, VolumeWrapper, LeftControls, RightControls, VolumeToggleWrapper, MutedIndicator, VolumeTimeRangeWrapper } from '../styled';
|
|
28
28
|
import { ControlsWrapper } from '../styled-compiled';
|
|
29
|
-
import { fireAnalyticsEvent, createCustomMediaPlayerScreenEvent, createMediaButtonClickedEvent, createMediaShortcutPressedEvent, createPlayPauseBlanketClickedEvent, createTimeRangeNavigatedEvent, createPlaybackSpeedChangedEvent, createFirstPlayedTrackEvent, createPlayedTrackEvent } from '../analytics';
|
|
29
|
+
import { fireAnalyticsEvent, createCustomMediaPlayerScreenEvent, createMediaButtonClickedEvent, createMediaShortcutPressedEvent, createPlayPauseBlanketClickedEvent, createTimeRangeNavigatedEvent, createPlaybackSpeedChangedEvent, createCaptionUploadSucceededOperationalEvent, createCaptionDeleteSucceededOperationalEvent, createCaptionUploadFailedOperationalEvent, createCaptionDeleteFailedOperationalEvent, createFirstPlayedTrackEvent, createPlayedTrackEvent } from '../analytics';
|
|
30
30
|
import { formatDuration } from '../../formatDuration';
|
|
31
31
|
import { Shortcut, keyCodes } from '../../shortcut';
|
|
32
32
|
import { toggleFullscreen, getFullscreenElement } from '../fullscreen';
|
|
@@ -44,6 +44,7 @@ import VideoSkipForwardTenIcon from '@atlaskit/icon/core/video-skip-forward-ten'
|
|
|
44
44
|
import VideoSkipBackwardTenIcon from '@atlaskit/icon/core/video-skip-backward-ten';
|
|
45
45
|
import { getUserCaptionsLocale, setUserCaptionsLocale, findPreselectedTrackIndex, getUserCaptionsEnabled, setUserCaptionsEnabled } from './captions';
|
|
46
46
|
import { CaptionsUploaderBrowser } from './captions/artifactUploader';
|
|
47
|
+
import CaptionDeleteConfirmationModal from './captions/captionDeleteConfirmationModal';
|
|
47
48
|
const MEDIUM_VIDEO_MAX_WIDTH = 400;
|
|
48
49
|
const SMALL_VIDEO_MAX_WIDTH = 245;
|
|
49
50
|
const MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
|
|
@@ -88,7 +89,8 @@ class _MediaPlayerBase extends Component {
|
|
|
88
89
|
playbackSpeed: 1,
|
|
89
90
|
selectedTracksIndex: -1,
|
|
90
91
|
areCaptionsEnabled: false,
|
|
91
|
-
isArtifactUploaderOpen: false
|
|
92
|
+
isArtifactUploaderOpen: false,
|
|
93
|
+
artifactToDelete: undefined
|
|
92
94
|
});
|
|
93
95
|
_defineProperty(this, "findPreselectedTrackIndex", ({
|
|
94
96
|
textTracks,
|
|
@@ -517,6 +519,16 @@ class _MediaPlayerBase extends Component {
|
|
|
517
519
|
areCaptionsEnabled
|
|
518
520
|
});
|
|
519
521
|
});
|
|
522
|
+
_defineProperty(this, "onCaptionDelete", artifactName => {
|
|
523
|
+
// Modal is not supported in fullscreen mode (as it uses portals which are not in the same DOM tree),
|
|
524
|
+
// So we need to exit fullscreen first
|
|
525
|
+
if (this.state.isFullScreenEnabled) {
|
|
526
|
+
this.toggleFullscreen();
|
|
527
|
+
}
|
|
528
|
+
this.setState({
|
|
529
|
+
artifactToDelete: artifactName
|
|
530
|
+
});
|
|
531
|
+
});
|
|
520
532
|
_defineProperty(this, "resolveSelectedTracksIndex", () => {
|
|
521
533
|
const {
|
|
522
534
|
areCaptionsEnabled,
|
|
@@ -686,6 +698,42 @@ class _MediaPlayerBase extends Component {
|
|
|
686
698
|
}
|
|
687
699
|
fireAnalyticsEvent(analyticsEvent, createAnalyticsEvent);
|
|
688
700
|
}
|
|
701
|
+
baseAnalyticCaptionAttributes() {
|
|
702
|
+
var _textTracks$captions3, _textTracks$captions4, _textTracks$captions5, _textTracks$captions6, _textTracks$captions7;
|
|
703
|
+
const {
|
|
704
|
+
textTracks
|
|
705
|
+
} = this.props;
|
|
706
|
+
const {
|
|
707
|
+
selectedTracksIndex
|
|
708
|
+
} = this.state;
|
|
709
|
+
const captionAttributes = {
|
|
710
|
+
selectedTrackIndex: selectedTracksIndex,
|
|
711
|
+
availableCaptionTracks: (textTracks === null || textTracks === void 0 ? void 0 : (_textTracks$captions3 = textTracks.captions) === null || _textTracks$captions3 === void 0 ? void 0 : (_textTracks$captions4 = _textTracks$captions3.tracks) === null || _textTracks$captions4 === void 0 ? void 0 : _textTracks$captions4.length) || 0,
|
|
712
|
+
selectedTrackLanguage: (textTracks === null || textTracks === void 0 ? void 0 : (_textTracks$captions5 = textTracks.captions) === null || _textTracks$captions5 === void 0 ? void 0 : (_textTracks$captions6 = _textTracks$captions5.tracks) === null || _textTracks$captions6 === void 0 ? void 0 : (_textTracks$captions7 = _textTracks$captions6[selectedTracksIndex]) === null || _textTracks$captions7 === void 0 ? void 0 : _textTracks$captions7.lang) || null
|
|
713
|
+
};
|
|
714
|
+
return captionAttributes;
|
|
715
|
+
}
|
|
716
|
+
fireCaptionEvent(event) {
|
|
717
|
+
fireAnalyticsEvent(event, this.props.createAnalyticsEvent);
|
|
718
|
+
}
|
|
719
|
+
fireCaptionUploadSucceededEvent(traceId) {
|
|
720
|
+
this.fireCaptionEvent(createCaptionUploadSucceededOperationalEvent(this.props.type, this.baseAnalyticCaptionAttributes(), this.props.identifier.id, traceId));
|
|
721
|
+
}
|
|
722
|
+
fireCaptionUploadFailedEvent(traceId, error) {
|
|
723
|
+
this.fireCaptionEvent(createCaptionUploadFailedOperationalEvent(this.props.type, this.baseAnalyticCaptionAttributes(), this.props.identifier.id, traceId, error));
|
|
724
|
+
}
|
|
725
|
+
fireCaptionDeleteSucceededEvent(traceId, artifactName) {
|
|
726
|
+
this.fireCaptionEvent(createCaptionDeleteSucceededOperationalEvent(this.props.type, {
|
|
727
|
+
...this.baseAnalyticCaptionAttributes(),
|
|
728
|
+
artifactName
|
|
729
|
+
}, this.props.identifier.id, traceId));
|
|
730
|
+
}
|
|
731
|
+
fireCaptionDeleteFailedEvent(traceId, artifactName, error) {
|
|
732
|
+
this.fireCaptionEvent(createCaptionDeleteFailedOperationalEvent(this.props.type, {
|
|
733
|
+
...this.baseAnalyticCaptionAttributes(),
|
|
734
|
+
artifactName
|
|
735
|
+
}, this.props.identifier.id, traceId, error));
|
|
736
|
+
}
|
|
689
737
|
render() {
|
|
690
738
|
const {
|
|
691
739
|
type,
|
|
@@ -704,7 +752,8 @@ class _MediaPlayerBase extends Component {
|
|
|
704
752
|
} = this.props;
|
|
705
753
|
const {
|
|
706
754
|
areCaptionsEnabled,
|
|
707
|
-
isArtifactUploaderOpen
|
|
755
|
+
isArtifactUploaderOpen,
|
|
756
|
+
artifactToDelete
|
|
708
757
|
} = this.state;
|
|
709
758
|
return /*#__PURE__*/React.createElement(Box, {
|
|
710
759
|
xcss: customVideoWrapperStyles.root,
|
|
@@ -796,21 +845,37 @@ class _MediaPlayerBase extends Component {
|
|
|
796
845
|
textTracks: textTracks,
|
|
797
846
|
onUpload: () => this.setState({
|
|
798
847
|
isArtifactUploaderOpen: true
|
|
799
|
-
})
|
|
848
|
+
}),
|
|
849
|
+
onDelete: this.onCaptionDelete
|
|
800
850
|
}), /*#__PURE__*/React.createElement(CaptionsUploaderBrowser, {
|
|
801
851
|
identifier: identifier,
|
|
802
852
|
isOpen: isArtifactUploaderOpen,
|
|
803
853
|
onClose: () => this.setState({
|
|
804
854
|
isArtifactUploaderOpen: false
|
|
805
855
|
}),
|
|
806
|
-
|
|
807
|
-
|
|
856
|
+
onEnd: (metadata, context) => {
|
|
857
|
+
this.fireCaptionUploadSucceededEvent(context.traceId);
|
|
808
858
|
},
|
|
809
|
-
|
|
810
|
-
|
|
859
|
+
onError: (err, context) => {
|
|
860
|
+
this.fireCaptionUploadFailedEvent(context.traceId, err);
|
|
861
|
+
}
|
|
862
|
+
}), /*#__PURE__*/React.createElement(CaptionDeleteConfirmationModal, {
|
|
863
|
+
identifier: identifier,
|
|
864
|
+
artifactName: artifactToDelete,
|
|
865
|
+
onClose: () => this.setState({
|
|
866
|
+
artifactToDelete: ''
|
|
867
|
+
}),
|
|
868
|
+
onEnd: context => {
|
|
869
|
+
this.fireCaptionDeleteSucceededEvent(context.traceId, context.artifactName);
|
|
870
|
+
this.setState({
|
|
871
|
+
artifactToDelete: ''
|
|
872
|
+
});
|
|
811
873
|
},
|
|
812
|
-
onError: () => {
|
|
813
|
-
|
|
874
|
+
onError: (err, context) => {
|
|
875
|
+
this.fireCaptionDeleteFailedEvent(context.traceId, context.artifactName, err);
|
|
876
|
+
this.setState({
|
|
877
|
+
artifactToDelete: ''
|
|
878
|
+
});
|
|
814
879
|
}
|
|
815
880
|
}))))));
|
|
816
881
|
}));
|
|
@@ -26,7 +26,7 @@ export class TimeRangeBase extends Component {
|
|
|
26
26
|
}
|
|
27
27
|
this.wrapperElementWidth = this.wrapperElement.current.getBoundingClientRect().width;
|
|
28
28
|
});
|
|
29
|
-
_defineProperty(this, "
|
|
29
|
+
_defineProperty(this, "onPointerMove", e => {
|
|
30
30
|
const {
|
|
31
31
|
isDragging,
|
|
32
32
|
dragStartClientX
|
|
@@ -34,6 +34,7 @@ export class TimeRangeBase extends Component {
|
|
|
34
34
|
if (!isDragging) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
+
e.preventDefault();
|
|
37
38
|
e.stopPropagation();
|
|
38
39
|
const {
|
|
39
40
|
onChange,
|
|
@@ -62,13 +63,13 @@ export class TimeRangeBase extends Component {
|
|
|
62
63
|
onChange(newTimeWithBoundaries);
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
|
-
_defineProperty(this, "
|
|
66
|
+
_defineProperty(this, "onPointerUp", () => {
|
|
66
67
|
const {
|
|
67
68
|
onChanged
|
|
68
69
|
} = this.props;
|
|
69
70
|
// As soon as user finished dragging, we should clean up events.
|
|
70
|
-
document.removeEventListener('
|
|
71
|
-
document.removeEventListener('
|
|
71
|
+
document.removeEventListener('pointerup', this.onPointerUp);
|
|
72
|
+
document.removeEventListener('pointermove', this.onPointerMove);
|
|
72
73
|
if (onChanged) {
|
|
73
74
|
onChanged();
|
|
74
75
|
}
|
|
@@ -76,17 +77,17 @@ export class TimeRangeBase extends Component {
|
|
|
76
77
|
isDragging: false
|
|
77
78
|
});
|
|
78
79
|
});
|
|
79
|
-
_defineProperty(this, "
|
|
80
|
+
_defineProperty(this, "onPointerDown", e => {
|
|
80
81
|
e.preventDefault();
|
|
81
82
|
|
|
82
83
|
// We need to recalculate every time, because width can change (thanks, editor ;-)
|
|
83
84
|
this.setWrapperWidth();
|
|
84
85
|
|
|
85
|
-
// We are implementing drag and drop here. There is no reason to start listening for
|
|
86
|
-
// before that. Also if we start listening for
|
|
86
|
+
// We are implementing drag and drop here. There is no reason to start listening for pointerUp or move
|
|
87
|
+
// before that. Also if we start listening for pointerup before that we could pick up someone else's event
|
|
87
88
|
// For example editors resizing of a inline video player.
|
|
88
|
-
document.addEventListener('
|
|
89
|
-
document.addEventListener('
|
|
89
|
+
document.addEventListener('pointerup', this.onPointerUp);
|
|
90
|
+
document.addEventListener('pointermove', this.onPointerMove);
|
|
90
91
|
const {
|
|
91
92
|
duration,
|
|
92
93
|
onChange
|
|
@@ -158,8 +159,8 @@ export class TimeRangeBase extends Component {
|
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
161
|
componentWillUnmount() {
|
|
161
|
-
document.removeEventListener('
|
|
162
|
-
document.removeEventListener('
|
|
162
|
+
document.removeEventListener('pointermove', this.onPointerMove);
|
|
163
|
+
document.removeEventListener('pointerup', this.onPointerUp);
|
|
163
164
|
window.removeEventListener('resize', this.setWrapperWidth);
|
|
164
165
|
}
|
|
165
166
|
render() {
|
|
@@ -245,11 +246,11 @@ export class TimeRangeBase extends Component {
|
|
|
245
246
|
})
|
|
246
247
|
}, disableThumbTooltip ? null : currentTimeTooltip)));
|
|
247
248
|
return fg('platform_media_compiled') ? /*#__PURE__*/React.createElement(CompiledTimeRangeWrapper, {
|
|
248
|
-
|
|
249
|
+
onPointerDown: this.onPointerDown,
|
|
249
250
|
"data-testid": "time-range-wrapper"
|
|
250
251
|
}, timeline) : /*#__PURE__*/React.createElement(EmotionTimeRangeWrapper, {
|
|
251
252
|
showAsActive: isAlwaysActive,
|
|
252
|
-
|
|
253
|
+
onPointerDown: this.onPointerDown,
|
|
253
254
|
"data-testid": "time-range-wrapper"
|
|
254
255
|
}, timeline);
|
|
255
256
|
}
|