@instructure/canvas-rce 5.11.0 → 5.12.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 +30 -0
- package/es/canvasFileBrowser/FileBrowser.js +6 -1
- package/es/common/fileUrl.js +3 -4
- package/es/defaultTinymceConfig.js +1 -1
- package/es/elementDenylist.js +19 -0
- package/es/getThemeVars.js +4 -3
- package/es/getTranslations.js +77 -1
- package/es/rce/RCEWrapper.js +2 -6
- package/es/rce/RceHtmlEditor.js +58 -20
- package/es/rce/StatusBar.js +8 -2
- package/es/rce/contentInsertion.js +5 -2
- package/es/rce/plugins/instructure_documents/components/DocumentsPanel.js +3 -9
- package/es/rce/plugins/instructure_html_view/plugin.js +2 -2
- package/es/rce/plugins/instructure_icon_maker/components/SavedIconMakerList.js +3 -2
- package/es/rce/plugins/instructure_image/ImageList/Image.js +2 -2
- package/es/rce/plugins/instructure_image/Images/index.js +3 -10
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +3 -0
- package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +3 -1
- package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +26 -1
- package/es/rce/plugins/instructure_record/AudioOptionsTray/index.js +9 -3
- package/es/rce/plugins/instructure_record/MediaPanel/index.js +3 -9
- package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +27 -2
- package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +35 -6
- package/es/rce/plugins/shared/fileShape.js +81 -9
- package/es/rce/plugins/shared/fileTypeUtils.js +6 -0
- package/es/rcs/api.js +6 -4
- package/es/sidebar/store/configureStore.js +2 -2
- package/es/translations/locales/ab.js +26 -0
- package/es/translations/locales/cs.js +27 -0
- package/es/translations/locales/cs_CZ.js +27 -0
- package/es/translations/locales/da_DK.js +27 -0
- package/es/translations/locales/en_NZ.js +26 -0
- package/es/translations/locales/en_SE.js +26 -0
- package/es/translations/locales/en_US.js +26 -0
- package/es/translations/locales/hu_HU.js +27 -0
- package/es/translations/locales/id.js +2426 -0
- package/{lib/types/inst-ui.d.js → es/translations/locales/id_ID.js} +9 -1
- package/es/translations/locales/ko_KR.js +27 -0
- package/es/translations/locales/lt.js +26 -0
- package/es/translations/locales/lt_LT.js +26 -0
- package/es/translations/locales/mn_MN.js +26 -0
- package/es/translations/locales/nl_NL.js +27 -0
- package/es/translations/locales/ro.js +27 -0
- package/es/translations/locales/ru.js +2375 -32
- package/es/translations/locales/sv.js +2379 -30
- package/es/translations/locales/th.js +2401 -1
- package/es/translations/locales/tl_PH.js +26 -0
- package/es/translations/locales/tr.js +3 -0
- package/es/translations/locales/vi.js +2396 -8
- package/es/translations/locales/zh_TW.Big5.js +27 -0
- package/es/translations/locales/zh_TW.js +27 -0
- package/lib/canvasFileBrowser/FileBrowser.js +6 -1
- package/lib/common/fileUrl.js +3 -4
- package/lib/defaultTinymceConfig.js +1 -1
- package/lib/elementDenylist.js +19 -0
- package/lib/getThemeVars.js +4 -3
- package/lib/getTranslations.js +77 -1
- package/lib/rce/RCEWrapper.js +2 -6
- package/lib/rce/RceHtmlEditor.js +58 -20
- package/lib/rce/StatusBar.js +8 -2
- package/lib/rce/contentInsertion.js +5 -2
- package/lib/rce/plugins/instructure_documents/components/DocumentsPanel.js +3 -9
- package/lib/rce/plugins/instructure_html_view/plugin.js +2 -2
- package/lib/rce/plugins/instructure_icon_maker/components/SavedIconMakerList.js +3 -2
- package/lib/rce/plugins/instructure_image/ImageList/Image.js +2 -2
- package/lib/rce/plugins/instructure_image/Images/index.js +3 -10
- package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +3 -0
- package/lib/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +3 -1
- package/lib/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +26 -1
- package/lib/rce/plugins/instructure_record/AudioOptionsTray/index.js +9 -3
- package/lib/rce/plugins/instructure_record/MediaPanel/index.js +3 -9
- package/lib/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +27 -2
- package/lib/rce/plugins/instructure_record/VideoOptionsTray/index.js +35 -6
- package/lib/rce/plugins/shared/fileShape.js +81 -9
- package/lib/rce/plugins/shared/fileTypeUtils.js +6 -0
- package/lib/rcs/api.js +6 -4
- package/lib/sidebar/store/configureStore.js +2 -2
- package/lib/translations/locales/ab.js +26 -0
- package/lib/translations/locales/cs.js +27 -0
- package/lib/translations/locales/cs_CZ.js +27 -0
- package/lib/translations/locales/da_DK.js +27 -0
- package/lib/translations/locales/en_NZ.js +26 -0
- package/lib/translations/locales/en_SE.js +26 -0
- package/lib/translations/locales/en_US.js +26 -0
- package/lib/translations/locales/hu_HU.js +27 -0
- package/lib/translations/locales/id.js +2426 -0
- package/{es/types/inst-ui.d.js → lib/translations/locales/id_ID.js} +9 -1
- package/lib/translations/locales/ko_KR.js +27 -0
- package/lib/translations/locales/lt.js +26 -0
- package/lib/translations/locales/lt_LT.js +26 -0
- package/lib/translations/locales/mn_MN.js +26 -0
- package/lib/translations/locales/nl_NL.js +27 -0
- package/lib/translations/locales/ro.js +27 -0
- package/lib/translations/locales/ru.js +2375 -32
- package/lib/translations/locales/sv.js +2379 -30
- package/lib/translations/locales/th.js +2401 -1
- package/lib/translations/locales/tl_PH.js +26 -0
- package/lib/translations/locales/tr.js +3 -0
- package/lib/translations/locales/vi.js +2396 -8
- package/lib/translations/locales/zh_TW.Big5.js +27 -0
- package/lib/translations/locales/zh_TW.js +27 -0
- package/package.json +12 -12
- package/scripts/publish_to_npm.sh +26 -0
- package/es/common/scroll.js +0 -45
- package/es/types/ts-migration.js +0 -1
- package/lib/common/scroll.js +0 -45
- package/lib/types/ts-migration.js +0 -1
|
@@ -101,6 +101,27 @@ export default class TrayController {
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
requestSubtitlesFromIframe(cb) {
|
|
105
|
+
var _this$_audioContainer, _this$_audioContainer2;
|
|
106
|
+
|
|
107
|
+
if (!bridge.canvasOrigin) return;
|
|
108
|
+
this._subtitleListener = new AbortController();
|
|
109
|
+
window.addEventListener('message', event => {
|
|
110
|
+
var _event$data;
|
|
111
|
+
|
|
112
|
+
if ((event === null || event === void 0 ? void 0 : (_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.subject) === "media_tracks_response") {
|
|
113
|
+
var _event$data2;
|
|
114
|
+
|
|
115
|
+
cb(event === null || event === void 0 ? void 0 : (_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.payload);
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
signal: this._subtitleListener.signal
|
|
119
|
+
});
|
|
120
|
+
(_this$_audioContainer = this._audioContainer) === null || _this$_audioContainer === void 0 ? void 0 : (_this$_audioContainer2 = _this$_audioContainer.contentWindow) === null || _this$_audioContainer2 === void 0 ? void 0 : _this$_audioContainer2.postMessage({
|
|
121
|
+
subject: 'media_tracks_request'
|
|
122
|
+
}, bridge.canvasOrigin);
|
|
123
|
+
}
|
|
124
|
+
|
|
104
125
|
_renderTray(trayProps) {
|
|
105
126
|
const audioOptions = asAudioElement(this._audioContainer) || {};
|
|
106
127
|
const element = /*#__PURE__*/React.createElement(AudioOptionsTray, {
|
|
@@ -109,8 +130,11 @@ export default class TrayController {
|
|
|
109
130
|
this._isOpen = true;
|
|
110
131
|
},
|
|
111
132
|
onExited: () => {
|
|
133
|
+
var _this$_subtitleListen;
|
|
134
|
+
|
|
112
135
|
bridge.focusActiveEditor(false);
|
|
113
136
|
this._isOpen = false;
|
|
137
|
+
(_this$_subtitleListen = this._subtitleListener) === null || _this$_subtitleListen === void 0 ? void 0 : _this$_subtitleListen.abort();
|
|
114
138
|
},
|
|
115
139
|
onSave: options => {
|
|
116
140
|
this._applyAudioOptions(options);
|
|
@@ -119,7 +143,8 @@ export default class TrayController {
|
|
|
119
143
|
},
|
|
120
144
|
onDismiss: () => this._dismissTray(),
|
|
121
145
|
open: this._shouldOpen,
|
|
122
|
-
trayProps: trayProps
|
|
146
|
+
trayProps: trayProps,
|
|
147
|
+
requestSubtitlesFromIframe: cb => this.requestSubtitlesFromIframe(cb)
|
|
123
148
|
});
|
|
124
149
|
ReactDOM.render(element, this.container);
|
|
125
150
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License along
|
|
16
16
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import React, { useState } from 'react';
|
|
18
|
+
import React, { useState, useEffect } from 'react';
|
|
19
19
|
import { arrayOf, bool, func, shape, string } from 'prop-types';
|
|
20
20
|
import { Flex } from '@instructure/ui-flex';
|
|
21
21
|
import { Tray } from '@instructure/ui-tray';
|
|
@@ -39,9 +39,13 @@ export default function AudioOptionsTray(_ref) {
|
|
|
39
39
|
onDismiss,
|
|
40
40
|
onSave,
|
|
41
41
|
trayProps,
|
|
42
|
-
audioOptions
|
|
42
|
+
audioOptions,
|
|
43
|
+
requestSubtitlesFromIframe
|
|
43
44
|
} = _ref;
|
|
44
45
|
const [subtitles, setSubtitles] = useState(audioOptions.tracks || []);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (subtitles.length === 0) requestSubtitlesFromIframe(setSubtitles);
|
|
48
|
+
}, []);
|
|
45
49
|
|
|
46
50
|
const handleSave = (e, contentProps) => {
|
|
47
51
|
onSave({
|
|
@@ -128,6 +132,7 @@ AudioOptionsTray.propTypes = {
|
|
|
128
132
|
onDismiss: func,
|
|
129
133
|
onSave: func,
|
|
130
134
|
open: bool.isRequired,
|
|
135
|
+
requestSubtitlesFromIframe: func,
|
|
131
136
|
trayProps: shape({
|
|
132
137
|
host: string.isRequired,
|
|
133
138
|
jwt: string.isRequired
|
|
@@ -144,5 +149,6 @@ AudioOptionsTray.defaultProps = {
|
|
|
144
149
|
onEntered: null,
|
|
145
150
|
onExited: null,
|
|
146
151
|
onDismiss: null,
|
|
147
|
-
onSave: null
|
|
152
|
+
onSave: null,
|
|
153
|
+
requestSubtitlesFromIframe: () => {}
|
|
148
154
|
};
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
import React, { useRef } from 'react';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { func, oneOf, shape, string } from 'prop-types';
|
|
20
|
+
import { contentTrayDocumentShape } from '../../shared/fileShape';
|
|
21
21
|
import formatMessage from '../../../../format-message';
|
|
22
22
|
import { Text } from '@instructure/ui-text';
|
|
23
23
|
import { View } from '@instructure/ui-view';
|
|
@@ -114,13 +114,7 @@ MediaPanel.propTypes = {
|
|
|
114
114
|
fetchInitialMedia: func.isRequired,
|
|
115
115
|
fetchNextMedia: func.isRequired,
|
|
116
116
|
onMediaEmbed: func.isRequired,
|
|
117
|
-
media:
|
|
118
|
-
files: arrayOf(shape(mediaObjectShape)).isRequired,
|
|
119
|
-
bookmark: string,
|
|
120
|
-
hasMore: bool,
|
|
121
|
-
isLoading: bool,
|
|
122
|
-
error: string
|
|
123
|
-
})).isRequired,
|
|
117
|
+
media: contentTrayDocumentShape.isRequired,
|
|
124
118
|
sortBy: shape({
|
|
125
119
|
sort: oneOf(['date_added', 'alphabetical']).isRequired,
|
|
126
120
|
order: oneOf(['asc', 'desc']).isRequired
|
|
@@ -146,7 +146,7 @@ export default class TrayController {
|
|
|
146
146
|
// If not, we can't update the MediaObject in the canvas db.
|
|
147
147
|
|
|
148
148
|
|
|
149
|
-
if (videoOptions.media_object_id && videoOptions.media_object_id !== 'undefined') {
|
|
149
|
+
if (videoOptions.media_object_id && videoOptions.media_object_id !== 'undefined' && !videoOptions.editLocked) {
|
|
150
150
|
videoOptions.updateMediaObject(data).then(_r => {
|
|
151
151
|
if (this.$videoContainer && videoOptions.displayAs === 'embed') {
|
|
152
152
|
this.$videoContainer.contentWindow.postMessage({
|
|
@@ -177,6 +177,27 @@ export default class TrayController {
|
|
|
177
177
|
this._editor = null;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
requestSubtitlesFromIframe(cb) {
|
|
181
|
+
var _this$$videoContainer2, _this$$videoContainer3;
|
|
182
|
+
|
|
183
|
+
if (!bridge.canvasOrigin) return;
|
|
184
|
+
this._subtitleListener = new AbortController();
|
|
185
|
+
window.addEventListener('message', event => {
|
|
186
|
+
var _event$data;
|
|
187
|
+
|
|
188
|
+
if ((event === null || event === void 0 ? void 0 : (_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.subject) === "media_tracks_response") {
|
|
189
|
+
var _event$data2;
|
|
190
|
+
|
|
191
|
+
cb(event === null || event === void 0 ? void 0 : (_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.payload);
|
|
192
|
+
}
|
|
193
|
+
}, {
|
|
194
|
+
signal: this._subtitleListener.signal
|
|
195
|
+
});
|
|
196
|
+
(_this$$videoContainer2 = this.$videoContainer) === null || _this$$videoContainer2 === void 0 ? void 0 : (_this$$videoContainer3 = _this$$videoContainer2.contentWindow) === null || _this$$videoContainer3 === void 0 ? void 0 : _this$$videoContainer3.postMessage({
|
|
197
|
+
subject: 'media_tracks_request'
|
|
198
|
+
}, bridge.canvasOrigin);
|
|
199
|
+
}
|
|
200
|
+
|
|
180
201
|
_renderTray(trayProps) {
|
|
181
202
|
let vo = {};
|
|
182
203
|
|
|
@@ -198,8 +219,11 @@ export default class TrayController {
|
|
|
198
219
|
this._isOpen = true;
|
|
199
220
|
},
|
|
200
221
|
onExited: () => {
|
|
222
|
+
var _this$_subtitleListen;
|
|
223
|
+
|
|
201
224
|
bridge.focusActiveEditor(false);
|
|
202
225
|
this._isOpen = false;
|
|
226
|
+
(_this$_subtitleListen = this._subtitleListener) === null || _this$_subtitleListen === void 0 ? void 0 : _this$_subtitleListen.abort();
|
|
203
227
|
},
|
|
204
228
|
onSave: videoOptions => {
|
|
205
229
|
this._applyVideoOptions(videoOptions);
|
|
@@ -207,7 +231,8 @@ export default class TrayController {
|
|
|
207
231
|
onRequestClose: () => this._dismissTray(),
|
|
208
232
|
open: this._shouldOpen,
|
|
209
233
|
trayProps: trayProps,
|
|
210
|
-
studioOptions: isStudioEmbeddedMedia(this.$videoContainer) ? parseStudioOptions(this.$videoContainer) : null
|
|
234
|
+
studioOptions: isStudioEmbeddedMedia(this.$videoContainer) ? parseStudioOptions(this.$videoContainer) : null,
|
|
235
|
+
requestSubtitlesFromIframe: cb => this.requestSubtitlesFromIframe(cb)
|
|
211
236
|
});
|
|
212
237
|
ReactDOM.render(element, this.$container);
|
|
213
238
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License along
|
|
16
16
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import React, { useState } from 'react';
|
|
18
|
+
import React, { useState, useEffect } from 'react';
|
|
19
19
|
import { arrayOf, bool, func, number, shape, string } from 'prop-types';
|
|
20
20
|
import { Button, CloseButton, IconButton } from '@instructure/ui-buttons';
|
|
21
21
|
import { Heading } from '@instructure/ui-heading';
|
|
@@ -27,12 +27,14 @@ import { IconQuestionLine } from '@instructure/ui-icons';
|
|
|
27
27
|
import { Flex } from '@instructure/ui-flex';
|
|
28
28
|
import { FormFieldGroup } from '@instructure/ui-form-field';
|
|
29
29
|
import { View } from '@instructure/ui-view';
|
|
30
|
+
import { Spinner } from '@instructure/ui-spinner';
|
|
30
31
|
import { Tooltip } from '@instructure/ui-tooltip';
|
|
31
32
|
import { Tray } from '@instructure/ui-tray';
|
|
32
33
|
import { StoreProvider } from '../../shared/StoreContext';
|
|
33
34
|
import { ClosedCaptionPanel } from '@instructure/canvas-media';
|
|
34
35
|
import { CUSTOM, MIN_WIDTH_VIDEO, MIN_PERCENTAGE, videoSizes, labelForImageSize, scaleToSize } from '../../instructure_image/ImageEmbedOptions';
|
|
35
36
|
import Bridge from '../../../../bridge';
|
|
37
|
+
import RceApiSource from '../../../../rcs/api';
|
|
36
38
|
import formatMessage from '../../../../format-message';
|
|
37
39
|
import DimensionsInput, { useDimensionsState } from '../../shared/DimensionsInput';
|
|
38
40
|
import { getTrayHeight } from '../../shared/trayUtils';
|
|
@@ -48,6 +50,7 @@ export default function VideoOptionsTray(_ref) {
|
|
|
48
50
|
onSave,
|
|
49
51
|
open,
|
|
50
52
|
trayProps,
|
|
53
|
+
requestSubtitlesFromIframe = () => {},
|
|
51
54
|
onEntered = null,
|
|
52
55
|
onExited = null,
|
|
53
56
|
id = 'video-options-tray',
|
|
@@ -68,6 +71,8 @@ export default function VideoOptionsTray(_ref) {
|
|
|
68
71
|
const [minWidth] = useState(MIN_WIDTH_VIDEO);
|
|
69
72
|
const [minHeight] = useState(Math.round(videoHeight / videoWidth * MIN_WIDTH_VIDEO));
|
|
70
73
|
const [minPercentage] = useState(MIN_PERCENTAGE);
|
|
74
|
+
const [editLocked, setEditLocked] = useState(null);
|
|
75
|
+
const [loading, setLoading] = useState(true);
|
|
71
76
|
const isStudio = !!studioOptions;
|
|
72
77
|
const showDisplayOptions = !isStudio || studioOptions.convertibleToLink;
|
|
73
78
|
const showSizeControls = !isStudio || studioOptions.resizable;
|
|
@@ -76,6 +81,22 @@ export default function VideoOptionsTray(_ref) {
|
|
|
76
81
|
minWidth,
|
|
77
82
|
minPercentage
|
|
78
83
|
});
|
|
84
|
+
const api = new RceApiSource(trayProps);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (videoOptions.attachmentId) {
|
|
87
|
+
api.getFile(videoOptions.attachmentId, {
|
|
88
|
+
include: ['blueprint_course_status']
|
|
89
|
+
}).then(response => {
|
|
90
|
+
setEditLocked((response === null || response === void 0 ? void 0 : response.restricted_by_master_course) && (response === null || response === void 0 ? void 0 : response.is_master_course_child_content));
|
|
91
|
+
setLoading(false);
|
|
92
|
+
}).catch(error => {
|
|
93
|
+
setLoading(false);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}, [videoOptions.attachmentId]);
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (subtitles.length === 0) requestSubtitlesFromIframe(setSubtitles);
|
|
99
|
+
}, []);
|
|
79
100
|
|
|
80
101
|
function handleTitleTextChange(event) {
|
|
81
102
|
setTitleText(event.target.value);
|
|
@@ -124,7 +145,8 @@ export default function VideoOptionsTray(_ref) {
|
|
|
124
145
|
appliedWidth,
|
|
125
146
|
displayAs,
|
|
126
147
|
subtitles,
|
|
127
|
-
updateMediaObject
|
|
148
|
+
updateMediaObject,
|
|
149
|
+
editLocked
|
|
128
150
|
});
|
|
129
151
|
}
|
|
130
152
|
|
|
@@ -192,7 +214,13 @@ export default function VideoOptionsTray(_ref) {
|
|
|
192
214
|
color: "primary",
|
|
193
215
|
onClick: onRequestClose,
|
|
194
216
|
screenReaderLabel: formatMessage('Close')
|
|
195
|
-
})))), /*#__PURE__*/React.createElement(Flex.Item, {
|
|
217
|
+
})))), loading && videoOptions.attachmentId ? /*#__PURE__*/React.createElement(Flex.Item, {
|
|
218
|
+
textAlign: "center",
|
|
219
|
+
margin: "xx-large",
|
|
220
|
+
padding: "xx-large"
|
|
221
|
+
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
222
|
+
renderTitle: formatMessage("Loading")
|
|
223
|
+
})) : /*#__PURE__*/React.createElement(Flex.Item, {
|
|
196
224
|
as: "form",
|
|
197
225
|
shouldGrow: true,
|
|
198
226
|
margin: "none",
|
|
@@ -207,7 +235,7 @@ export default function VideoOptionsTray(_ref) {
|
|
|
207
235
|
shouldShrink: true
|
|
208
236
|
}, /*#__PURE__*/React.createElement(Flex, {
|
|
209
237
|
direction: "column"
|
|
210
|
-
}, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
238
|
+
}, !editLocked && /*#__PURE__*/React.createElement(Flex.Item, {
|
|
211
239
|
padding: "small"
|
|
212
240
|
}, isStudio ? /*#__PURE__*/React.createElement(Flex, {
|
|
213
241
|
direction: "column"
|
|
@@ -266,7 +294,7 @@ export default function VideoOptionsTray(_ref) {
|
|
|
266
294
|
minWidth: minWidth,
|
|
267
295
|
minPercentage: minPercentage,
|
|
268
296
|
hidePercentage: true
|
|
269
|
-
}))), !isStudio && /*#__PURE__*/React.createElement(Flex.Item, {
|
|
297
|
+
}))), !isStudio && !editLocked && /*#__PURE__*/React.createElement(Flex.Item, {
|
|
270
298
|
padding: "small"
|
|
271
299
|
}, /*#__PURE__*/React.createElement(FormFieldGroup, {
|
|
272
300
|
description: formatMessage('Closed Captions/Subtitles')
|
|
@@ -317,5 +345,6 @@ VideoOptionsTray.propTypes = {
|
|
|
317
345
|
jwt: string.isRequired
|
|
318
346
|
}),
|
|
319
347
|
id: string,
|
|
320
|
-
studioOptions: parsedStudioOptionsPropType
|
|
348
|
+
studioOptions: parsedStudioOptionsPropType,
|
|
349
|
+
requestSubtitlesFromIframe: func
|
|
321
350
|
};
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License along
|
|
16
16
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { bool, number, oneOfType, string } from 'prop-types';
|
|
18
|
+
import { arrayOf, bool, number, oneOfType, shape, string, checkPropTypes } from 'prop-types';
|
|
19
19
|
export const fileShape = {
|
|
20
20
|
content_type: string.isRequired,
|
|
21
21
|
date: string.isRequired,
|
|
22
|
-
display_name: string,
|
|
22
|
+
display_name: string.isRequired,
|
|
23
23
|
filename: string.isRequired,
|
|
24
24
|
href: string.isRequired,
|
|
25
25
|
id: oneOfType([number, string]).isRequired,
|
|
@@ -31,13 +31,13 @@ export const fileShape = {
|
|
|
31
31
|
locked_for_user: bool,
|
|
32
32
|
published: bool
|
|
33
33
|
};
|
|
34
|
-
export const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
id: oneOfType([number, string]).isRequired,
|
|
34
|
+
export const imageShape = { ...fileShape,
|
|
35
|
+
thumbnail_url: string
|
|
36
|
+
};
|
|
37
|
+
export const mediaObjectShape = { ...imageShape,
|
|
39
38
|
title: string.isRequired,
|
|
40
|
-
|
|
39
|
+
embedded_iframe_url: string,
|
|
40
|
+
media_entry_id: string
|
|
41
41
|
};
|
|
42
42
|
export const fileOrMediaObjectShape = {
|
|
43
43
|
content_type: string.isRequired,
|
|
@@ -54,4 +54,76 @@ export const fileOrMediaObjectShape = {
|
|
|
54
54
|
unlock_at: string,
|
|
55
55
|
locked_for_user: bool,
|
|
56
56
|
published: bool
|
|
57
|
-
};
|
|
57
|
+
};
|
|
58
|
+
export const documentQueryReturnShape = {
|
|
59
|
+
files: arrayOf(shape(fileShape)).isRequired,
|
|
60
|
+
bookmark: string,
|
|
61
|
+
hasMore: bool,
|
|
62
|
+
isLoading: bool,
|
|
63
|
+
error: string
|
|
64
|
+
};
|
|
65
|
+
export const imageQueryReturnShape = {
|
|
66
|
+
files: arrayOf(shape(imageShape)).isRequired,
|
|
67
|
+
bookmark: string,
|
|
68
|
+
hasMore: bool,
|
|
69
|
+
isLoading: bool,
|
|
70
|
+
error: string
|
|
71
|
+
};
|
|
72
|
+
export const mediaQueryReturnShape = {
|
|
73
|
+
files: arrayOf(shape(mediaObjectShape)).isRequired,
|
|
74
|
+
bookmark: string,
|
|
75
|
+
hasMore: bool,
|
|
76
|
+
isLoading: bool,
|
|
77
|
+
error: string
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
function createContentTrayDocumentShape(isRequired) {
|
|
81
|
+
return function validateContentTrayDocuments(props, propName, componentName) {
|
|
82
|
+
const p = props[propName];
|
|
83
|
+
|
|
84
|
+
if (!p) {
|
|
85
|
+
if (isRequired) {
|
|
86
|
+
if (!p) {
|
|
87
|
+
return new Error(`Required prop \`${propName}\` not supplied to \`${componentName}\`. Validation failed.`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return undefined;
|
|
92
|
+
} else {
|
|
93
|
+
const files = p.user || p.course || p.group || p.User || p.Course || p.Group;
|
|
94
|
+
|
|
95
|
+
if (!files) {
|
|
96
|
+
return new Error(`Invalid prop \`${propName}\` supplied to \`${componentName}\`. Missing "user"|"course"|"group" key.`);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if ('searchString' in p) {
|
|
100
|
+
if (!(typeof p.searchString === 'string')) {
|
|
101
|
+
return new Error(`Invalid prop \`${propName}\` supplied to \`${componentName}\`. "searchString" must be a string.`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (propName === 'documents') {
|
|
106
|
+
checkPropTypes({
|
|
107
|
+
docs: shape(documentQueryReturnShape)
|
|
108
|
+
}, {
|
|
109
|
+
docs: files
|
|
110
|
+
}, componentName, componentName);
|
|
111
|
+
} else if (propName === 'images') {
|
|
112
|
+
checkPropTypes({
|
|
113
|
+
images: shape(imageQueryReturnShape)
|
|
114
|
+
}, {
|
|
115
|
+
images: files
|
|
116
|
+
}, componentName, componentName);
|
|
117
|
+
} else if (propName === 'media') {
|
|
118
|
+
checkPropTypes({
|
|
119
|
+
media: shape(mediaQueryReturnShape)
|
|
120
|
+
}, {
|
|
121
|
+
media: files
|
|
122
|
+
}, componentName, componentName);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export const contentTrayDocumentShape = createContentTrayDocumentShape(false);
|
|
129
|
+
contentTrayDocumentShape.isRequired = createContentTrayDocumentShape(true);
|
|
@@ -112,6 +112,12 @@ export function mediaPlayerURLFromFile(file, canvasOrigin) {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
if (file.embedded_iframe_url) {
|
|
115
|
+
const url = new URL(file.embedded_iframe_url, canvasOrigin);
|
|
116
|
+
|
|
117
|
+
if (url.searchParams.has('type')) {
|
|
118
|
+
return `${absoluteToRelativeUrl(file.embedded_iframe_url, canvasOrigin)}`;
|
|
119
|
+
}
|
|
120
|
+
|
|
115
121
|
return `${absoluteToRelativeUrl(file.embedded_iframe_url, canvasOrigin)}?type=${type}`;
|
|
116
122
|
}
|
|
117
123
|
|
package/es/rcs/api.js
CHANGED
|
@@ -468,11 +468,13 @@ class RceApiSource {
|
|
|
468
468
|
|
|
469
469
|
const {
|
|
470
470
|
replacement_chain_context_type,
|
|
471
|
-
replacement_chain_context_id
|
|
471
|
+
replacement_chain_context_id,
|
|
472
|
+
include
|
|
472
473
|
} = options;
|
|
473
474
|
const uri = this.addParamsIfPresent(`${base}/${id}`, {
|
|
474
475
|
replacement_chain_context_type,
|
|
475
|
-
replacement_chain_context_id
|
|
476
|
+
replacement_chain_context_id,
|
|
477
|
+
include
|
|
476
478
|
});
|
|
477
479
|
return this.apiFetch(uri, headers).then(normalizeFileData);
|
|
478
480
|
} // @private
|
|
@@ -558,10 +560,10 @@ class RceApiSource {
|
|
|
558
560
|
} else {
|
|
559
561
|
return response;
|
|
560
562
|
}
|
|
561
|
-
}).then(checkStatus).then(res => res.json()).catch(throwConnectionError).catch(e => e.response.json().then(
|
|
563
|
+
}).then(checkStatus).then(res => res.json()).catch(throwConnectionError).catch(e => e.response.json().then(responseBody => {
|
|
562
564
|
console.error(e); // eslint-disable-line no-console
|
|
563
565
|
|
|
564
|
-
this.alertFunc(buildError(
|
|
566
|
+
this.alertFunc(buildError(responseBody));
|
|
565
567
|
throw e;
|
|
566
568
|
}));
|
|
567
569
|
} // @private
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
import { createStore, applyMiddleware } from 'redux';
|
|
19
19
|
import rootReducer from '../reducers';
|
|
20
20
|
import initialState from './initialState';
|
|
21
|
-
import
|
|
21
|
+
import { thunk } from 'redux-thunk';
|
|
22
22
|
import { batch, batching } from 'redux-batch-middleware';
|
|
23
23
|
export default function (props, state) {
|
|
24
|
-
const store = createStore(batching(rootReducer), state || initialState(props), applyMiddleware(
|
|
24
|
+
const store = createStore(batching(rootReducer), state || initialState(props), applyMiddleware(thunk, batch));
|
|
25
25
|
return store;
|
|
26
26
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2021 - present Instructure, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Canvas.
|
|
5
|
+
*
|
|
6
|
+
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
+
* Software Foundation, version 3 of the License.
|
|
9
|
+
*
|
|
10
|
+
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
+
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
+
* details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
+
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import formatMessage from '../../format-message';
|
|
19
|
+
const locale = {
|
|
20
|
+
"count_plural_one_item_loaded_other_items_loaded_857023b7": {
|
|
21
|
+
"message": "{ count, plural,\n one {}\n other {}\n}"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
formatMessage.addLocale({
|
|
25
|
+
ab: locale
|
|
26
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2021 - present Instructure, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Canvas.
|
|
5
|
+
*
|
|
6
|
+
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
+
* Software Foundation, version 3 of the License.
|
|
9
|
+
*
|
|
10
|
+
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
+
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
+
* details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
+
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import formatMessage from '../../format-message';
|
|
19
|
+
import '../tinymce/cs';
|
|
20
|
+
const locale = {
|
|
21
|
+
"count_plural_one_item_loaded_other_items_loaded_857023b7": {
|
|
22
|
+
"message": "{ count, plural,\n one {}\n few {}\n many {}\n other {}\n}"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
formatMessage.addLocale({
|
|
26
|
+
cs: locale
|
|
27
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2021 - present Instructure, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Canvas.
|
|
5
|
+
*
|
|
6
|
+
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
+
* Software Foundation, version 3 of the License.
|
|
9
|
+
*
|
|
10
|
+
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
+
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
+
* details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
+
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import formatMessage from '../../format-message';
|
|
19
|
+
import '../tinymce/cs';
|
|
20
|
+
const locale = {
|
|
21
|
+
"count_plural_one_item_loaded_other_items_loaded_857023b7": {
|
|
22
|
+
"message": "{ count, plural,\n one {}\n few {}\n many {}\n other {}\n}"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
formatMessage.addLocale({
|
|
26
|
+
'cs-CZ': locale
|
|
27
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2021 - present Instructure, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Canvas.
|
|
5
|
+
*
|
|
6
|
+
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
+
* Software Foundation, version 3 of the License.
|
|
9
|
+
*
|
|
10
|
+
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
+
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
+
* details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
+
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import formatMessage from '../../format-message';
|
|
19
|
+
import '../tinymce/da';
|
|
20
|
+
const locale = {
|
|
21
|
+
"count_plural_one_item_loaded_other_items_loaded_857023b7": {
|
|
22
|
+
"message": "{ count, plural,\n one {}\n other {}\n}"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
formatMessage.addLocale({
|
|
26
|
+
'da-DK': locale
|
|
27
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2021 - present Instructure, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Canvas.
|
|
5
|
+
*
|
|
6
|
+
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
+
* Software Foundation, version 3 of the License.
|
|
9
|
+
*
|
|
10
|
+
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
+
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
+
* details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
+
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import formatMessage from '../../format-message';
|
|
19
|
+
const locale = {
|
|
20
|
+
"count_plural_one_item_loaded_other_items_loaded_857023b7": {
|
|
21
|
+
"message": "{ count, plural,\n one {}\n other {}\n}"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
formatMessage.addLocale({
|
|
25
|
+
'en-NZ': locale
|
|
26
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2021 - present Instructure, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Canvas.
|
|
5
|
+
*
|
|
6
|
+
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
+
* Software Foundation, version 3 of the License.
|
|
9
|
+
*
|
|
10
|
+
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
+
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
+
* details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
+
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import formatMessage from '../../format-message';
|
|
19
|
+
const locale = {
|
|
20
|
+
"count_plural_one_item_loaded_other_items_loaded_857023b7": {
|
|
21
|
+
"message": "{ count, plural,\n one {}\n other {}\n}"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
formatMessage.addLocale({
|
|
25
|
+
'en-SE': locale
|
|
26
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2021 - present Instructure, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Canvas.
|
|
5
|
+
*
|
|
6
|
+
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
+
* Software Foundation, version 3 of the License.
|
|
9
|
+
*
|
|
10
|
+
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
+
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
+
* details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
+
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import formatMessage from '../../format-message';
|
|
19
|
+
const locale = {
|
|
20
|
+
"count_plural_one_item_loaded_other_items_loaded_857023b7": {
|
|
21
|
+
"message": "{ count, plural,\n one {}\n other {}\n}"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
formatMessage.addLocale({
|
|
25
|
+
'en-US': locale
|
|
26
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2021 - present Instructure, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Canvas.
|
|
5
|
+
*
|
|
6
|
+
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
+
* Software Foundation, version 3 of the License.
|
|
9
|
+
*
|
|
10
|
+
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
+
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
+
* details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
+
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import formatMessage from '../../format-message';
|
|
19
|
+
import '../tinymce/hu_HU';
|
|
20
|
+
const locale = {
|
|
21
|
+
"count_plural_one_item_loaded_other_items_loaded_857023b7": {
|
|
22
|
+
"message": "{ count, plural,\n one {}\n other {}\n}"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
formatMessage.addLocale({
|
|
26
|
+
'hu-HU': locale
|
|
27
|
+
});
|