@instructure/quiz-core 20.6.0 → 20.6.1-rc.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/es/banks/api/banks.js +8 -1
- package/es/banks/components/SharingModal/RootAccountSharing.js +94 -0
- package/es/banks/components/SharingModal/ShareList/index.js +24 -2
- package/es/banks/components/SharingModal/presenter.js +13 -0
- package/es/building/components/resources/ItemFeedbackModal/index.js +1 -2
- package/es/building/components/resources/ItemFeedbackModal/presenter.js +2 -15
- package/es/building/components/resources/quiz/instructions/Edit/presenter.js +3 -6
- package/es/building/components/resources/quiz/instructions/Instructions/presenter.js +1 -2
- package/es/common/components/resources/item/ItemEdit/presenter.js +1 -14
- package/es/common/util/interactionTypePropsHelper.js +1 -1
- package/es/index.js +0 -2
- package/lib/banks/api/banks.js +8 -1
- package/lib/banks/components/SharingModal/RootAccountSharing.js +121 -0
- package/lib/banks/components/SharingModal/ShareList/index.js +25 -2
- package/lib/banks/components/SharingModal/presenter.js +13 -0
- package/lib/building/components/resources/ItemFeedbackModal/index.js +0 -1
- package/lib/building/components/resources/ItemFeedbackModal/presenter.js +1 -15
- package/lib/building/components/resources/quiz/instructions/Edit/presenter.js +4 -7
- package/lib/building/components/resources/quiz/instructions/Instructions/presenter.js +1 -2
- package/lib/common/components/resources/item/ItemEdit/presenter.js +1 -15
- package/lib/common/util/interactionTypePropsHelper.js +2 -2
- package/lib/index.js +80 -98
- package/package.json +10 -10
- package/es/common/components/RichContentInput/RceImageImportModal/index.js +0 -15
- package/es/common/components/RichContentInput/RceImageImportModal/presenter.js +0 -93
- package/es/common/components/RichContentInput/index.js +0 -21
- package/es/common/components/RichContentInput/presenter.js +0 -82
- package/lib/common/components/RichContentInput/RceImageImportModal/index.js +0 -28
- package/lib/common/components/RichContentInput/RceImageImportModal/presenter.js +0 -115
- package/lib/common/components/RichContentInput/index.js +0 -33
- package/lib/common/components/RichContentInput/presenter.js +0 -102
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.6.
|
|
3
|
+
"version": "20.6.1-rc.1+4db36c45e",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@instructure/emotion": "^8.51.0",
|
|
45
45
|
"@instructure/grading-utils": "^1.0.0",
|
|
46
46
|
"@instructure/outcomes-ui": "^3.1.0",
|
|
47
|
-
"@instructure/quiz-common": "
|
|
48
|
-
"@instructure/quiz-i18n": "
|
|
49
|
-
"@instructure/quiz-interactions": "
|
|
50
|
-
"@instructure/quiz-number-input": "
|
|
51
|
-
"@instructure/quiz-rce": "
|
|
47
|
+
"@instructure/quiz-common": "20.6.1-rc.1+4db36c45e",
|
|
48
|
+
"@instructure/quiz-i18n": "20.6.1-rc.1+4db36c45e",
|
|
49
|
+
"@instructure/quiz-interactions": "20.6.1-rc.1+4db36c45e",
|
|
50
|
+
"@instructure/quiz-number-input": "20.6.1-rc.1+4db36c45e",
|
|
51
|
+
"@instructure/quiz-rce": "20.6.1-rc.1+4db36c45e",
|
|
52
52
|
"@instructure/ui-a11y-content": "^8.51.0",
|
|
53
53
|
"@instructure/ui-alerts": "^8.51.0",
|
|
54
54
|
"@instructure/ui-avatar": "^8.51.0",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"file-saver": "~2.0.5",
|
|
113
113
|
"humps": "^2.0.0",
|
|
114
114
|
"immutable": "^3.8.1",
|
|
115
|
-
"instructure-validations": "
|
|
115
|
+
"instructure-validations": "20.6.1-rc.1+4db36c45e",
|
|
116
116
|
"ipaddr.js": "^1.5.4",
|
|
117
117
|
"isomorphic-fetch": "^2.2.0",
|
|
118
118
|
"isuuid": "^0.1.0",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"uuid": "^3.2.1"
|
|
144
144
|
},
|
|
145
145
|
"devDependencies": {
|
|
146
|
-
"@instructure/quiz-scripts": "
|
|
146
|
+
"@instructure/quiz-scripts": "20.6.0",
|
|
147
147
|
"@instructure/ui-axe-check": "^8.51.0",
|
|
148
148
|
"@instructure/ui-babel-preset": "^7.22.1",
|
|
149
149
|
"@instructure/ui-karma-config": "^7.22.1",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"intl": "^1.2.4",
|
|
164
164
|
"jquery": "^2.2.3",
|
|
165
165
|
"most-subject": "^5.3.0",
|
|
166
|
-
"quiz-presets": "
|
|
166
|
+
"quiz-presets": "20.6.1-rc.1+4db36c45e",
|
|
167
167
|
"react": "^16.8.6",
|
|
168
168
|
"react-addons-test-utils": "^15.6.2",
|
|
169
169
|
"react-dom": "^16.8.6",
|
|
@@ -179,5 +179,5 @@
|
|
|
179
179
|
"publishConfig": {
|
|
180
180
|
"access": "public"
|
|
181
181
|
},
|
|
182
|
-
"gitHead": "
|
|
182
|
+
"gitHead": "4db36c45ec394e78e3e707866e8ca1c13fbbe3a3"
|
|
183
183
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { bindActionCreators } from 'redux';
|
|
2
|
-
import { connect } from "../../../react-redux.js";
|
|
3
|
-
import { uploadStatus as setUploadStatus } from "../../../actions/upload.js";
|
|
4
|
-
import { interactionFileUpload } from "../../../../building/api/quizzes.js";
|
|
5
|
-
import { RceImageImportModal as RceImageImportModalPresenter } from "./presenter.js";
|
|
6
|
-
|
|
7
|
-
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
8
|
-
return {
|
|
9
|
-
setUploadStatus: bindActionCreators(setUploadStatus, dispatch),
|
|
10
|
-
interactionFileUpload: bindActionCreators(interactionFileUpload, dispatch)
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export var RceImageImportModal = connect(null, mapDispatchToProps)(RceImageImportModalPresenter);
|
|
15
|
-
export default RceImageImportModal;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import t from '@instructure/quiz-i18n/es/format-message';
|
|
8
|
-
import { FILE_UPLOAD_SUCCESS } from '@instructure/quiz-common';
|
|
9
|
-
import ImportModal from "../../ImportModal/index.js";
|
|
10
|
-
export var RceImageImportModal = /*#__PURE__*/function (_Component) {
|
|
11
|
-
_inherits(RceImageImportModal, _Component);
|
|
12
|
-
|
|
13
|
-
var _super = _createSuper(RceImageImportModal);
|
|
14
|
-
|
|
15
|
-
function RceImageImportModal() {
|
|
16
|
-
var _this;
|
|
17
|
-
|
|
18
|
-
_classCallCheck(this, RceImageImportModal);
|
|
19
|
-
|
|
20
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
|
-
args[_key] = arguments[_key];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
25
|
-
|
|
26
|
-
_this.successWrapper = function (successAction, fileType, altText) {
|
|
27
|
-
return function (url) {
|
|
28
|
-
_this.props.setUploadStatus(FILE_UPLOAD_SUCCESS);
|
|
29
|
-
|
|
30
|
-
successAction(url, fileType, altText);
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
_this.fileUpload = function (successAction) {
|
|
35
|
-
return function (file, errorAction, altText) {
|
|
36
|
-
_this.props.interactionFileUpload(_this.props.parentType, _this.props.parentId, file, _this.successWrapper(successAction, file.type, altText), errorAction, _this.props.uploadPath);
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
_this.storeImportModalRef = function (node) {
|
|
41
|
-
_this.importModal = node;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
return _this;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
_createClass(RceImageImportModal, [{
|
|
48
|
-
key: "render",
|
|
49
|
-
value: function render() {
|
|
50
|
-
return /*#__PURE__*/React.createElement(ImportModal, {
|
|
51
|
-
acceptFileType: [{
|
|
52
|
-
fileType: 'image/*',
|
|
53
|
-
title: t('Image')
|
|
54
|
-
}, {
|
|
55
|
-
fileType: '.mp3, .wav, .ogg',
|
|
56
|
-
title: t('Audio')
|
|
57
|
-
}, {
|
|
58
|
-
fileType: '.mp4, .webm, .ogg',
|
|
59
|
-
title: t('Video')
|
|
60
|
-
}],
|
|
61
|
-
closeOverride: this.props.closeOverride,
|
|
62
|
-
disableConfirm: true,
|
|
63
|
-
failureMessage: t('Failed to upload your file.'),
|
|
64
|
-
fileUpload: this.fileUpload(this.props.onSuccess),
|
|
65
|
-
importMessage: t('Select a file to embed.'),
|
|
66
|
-
importModalId: this.props.importModalId,
|
|
67
|
-
onClose: this.props.onClose,
|
|
68
|
-
onContinue: Function.prototype,
|
|
69
|
-
ref: this.storeImportModalRef
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}]);
|
|
73
|
-
|
|
74
|
-
RceImageImportModal.displayName = "RceImageImportModal";
|
|
75
|
-
return RceImageImportModal;
|
|
76
|
-
}(Component);
|
|
77
|
-
RceImageImportModal.propTypes = {
|
|
78
|
-
closeOverride: PropTypes.func,
|
|
79
|
-
importModalId: PropTypes.string.isRequired,
|
|
80
|
-
interactionFileUpload: PropTypes.func.isRequired,
|
|
81
|
-
onClose: PropTypes.func,
|
|
82
|
-
onSuccess: PropTypes.func.isRequired,
|
|
83
|
-
parentType: PropTypes.string.isRequired,
|
|
84
|
-
parentId: PropTypes.string.isRequired,
|
|
85
|
-
setUploadStatus: PropTypes.func.isRequired,
|
|
86
|
-
uploadPath: PropTypes.string
|
|
87
|
-
};
|
|
88
|
-
RceImageImportModal.defaultProps = {
|
|
89
|
-
closeOverride: null,
|
|
90
|
-
onClose: function onClose() {},
|
|
91
|
-
uploadPath: null
|
|
92
|
-
};
|
|
93
|
-
export default RceImageImportModal;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { connect } from "../../react-redux.js";
|
|
2
|
-
import { openModal } from "../../actions/modal.js";
|
|
3
|
-
import { generateImportModalId } from "../../../common/components/ImportModal/index.js";
|
|
4
|
-
import { RichContentInput as RichContentInputPresenter } from "./presenter.js";
|
|
5
|
-
|
|
6
|
-
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
7
|
-
return {
|
|
8
|
-
openImportModal: function openImportModal(importModalId) {
|
|
9
|
-
dispatch(openModal(generateImportModalId(importModalId)));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) {
|
|
15
|
-
return Object.assign({}, stateProps, dispatchProps, ownProps);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export var RichContentInput = connect(null, mapDispatchToProps, mergeProps, {
|
|
19
|
-
withRef: true
|
|
20
|
-
})(RichContentInputPresenter);
|
|
21
|
-
export default RichContentInput;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* TODO can we please merge this into quiz-rce and make something coherent out of this
|
|
8
|
-
*/
|
|
9
|
-
import React, { Component } from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
import { RichContentInput as ActualRichContentInput } from '@instructure/quiz-rce';
|
|
12
|
-
import RceImageImportModal from "./RceImageImportModal/index.js";
|
|
13
|
-
export var RichContentInput = /*#__PURE__*/function (_Component) {
|
|
14
|
-
_inherits(RichContentInput, _Component);
|
|
15
|
-
|
|
16
|
-
var _super = _createSuper(RichContentInput);
|
|
17
|
-
|
|
18
|
-
function RichContentInput() {
|
|
19
|
-
var _this;
|
|
20
|
-
|
|
21
|
-
_classCallCheck(this, RichContentInput);
|
|
22
|
-
|
|
23
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24
|
-
args[_key] = arguments[_key];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
28
|
-
|
|
29
|
-
_this.focus = function () {
|
|
30
|
-
_this.rce.focus();
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
_this.renderImportModal = function (importModalId, onSuccess, onClose) {
|
|
34
|
-
return /*#__PURE__*/React.createElement(RceImageImportModal, {
|
|
35
|
-
closeOverride: _this.props.importModalCloseOverride,
|
|
36
|
-
importModalId: importModalId,
|
|
37
|
-
onClose: onClose,
|
|
38
|
-
onSuccess: onSuccess,
|
|
39
|
-
parentType: _this.props.parentType,
|
|
40
|
-
parentId: _this.props.parentId,
|
|
41
|
-
uploadPath: _this.props.uploadPath
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
_this.handleRceRef = function (node) {
|
|
46
|
-
_this.rce = node;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return _this;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
_createClass(RichContentInput, [{
|
|
53
|
-
key: "render",
|
|
54
|
-
value: function render() {
|
|
55
|
-
return /*#__PURE__*/React.createElement(ActualRichContentInput, Object.assign({
|
|
56
|
-
ref: this.handleRceRef
|
|
57
|
-
}, this.props, {
|
|
58
|
-
renderImportModal: this.renderImportModal,
|
|
59
|
-
openImportModal: this.props.openImportModal
|
|
60
|
-
}));
|
|
61
|
-
}
|
|
62
|
-
}]);
|
|
63
|
-
|
|
64
|
-
RichContentInput.displayName = "RichContentInput";
|
|
65
|
-
return RichContentInput;
|
|
66
|
-
}(Component);
|
|
67
|
-
RichContentInput.propTypes = {
|
|
68
|
-
// also allows (not listed) all props for ActualRichContentInput
|
|
69
|
-
importModalCloseOverride: PropTypes.func,
|
|
70
|
-
label: PropTypes.string.isRequired,
|
|
71
|
-
openImportModal: PropTypes.func.isRequired,
|
|
72
|
-
parentType: PropTypes.string,
|
|
73
|
-
parentId: PropTypes.string,
|
|
74
|
-
uploadPath: PropTypes.string
|
|
75
|
-
};
|
|
76
|
-
RichContentInput.defaultProps = {
|
|
77
|
-
importModalCloseOverride: null,
|
|
78
|
-
parentType: '',
|
|
79
|
-
parentId: '',
|
|
80
|
-
uploadPath: null
|
|
81
|
-
};
|
|
82
|
-
export default RichContentInput;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.RceImageImportModal = void 0;
|
|
7
|
-
|
|
8
|
-
var _redux = require("redux");
|
|
9
|
-
|
|
10
|
-
var _reactRedux = require("../../../react-redux.js");
|
|
11
|
-
|
|
12
|
-
var _upload = require("../../../actions/upload.js");
|
|
13
|
-
|
|
14
|
-
var _quizzes = require("../../../../building/api/quizzes.js");
|
|
15
|
-
|
|
16
|
-
var _presenter = require("./presenter.js");
|
|
17
|
-
|
|
18
|
-
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
19
|
-
return {
|
|
20
|
-
setUploadStatus: (0, _redux.bindActionCreators)(_upload.uploadStatus, dispatch),
|
|
21
|
-
interactionFileUpload: (0, _redux.bindActionCreators)(_quizzes.interactionFileUpload, dispatch)
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
var RceImageImportModal = (0, _reactRedux.connect)(null, mapDispatchToProps)(_presenter.RceImageImportModal);
|
|
26
|
-
exports.RceImageImportModal = RceImageImportModal;
|
|
27
|
-
var _default = RceImageImportModal;
|
|
28
|
-
exports.default = _default;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.default = exports.RceImageImportModal = void 0;
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
|
-
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
25
|
-
|
|
26
|
-
var _quizCommon = require("@instructure/quiz-common");
|
|
27
|
-
|
|
28
|
-
var _index = _interopRequireDefault(require("../../ImportModal/index.js"));
|
|
29
|
-
|
|
30
|
-
var RceImageImportModal = /*#__PURE__*/function (_Component) {
|
|
31
|
-
(0, _inherits2.default)(RceImageImportModal, _Component);
|
|
32
|
-
|
|
33
|
-
var _super = (0, _createSuper2.default)(RceImageImportModal);
|
|
34
|
-
|
|
35
|
-
function RceImageImportModal() {
|
|
36
|
-
var _this;
|
|
37
|
-
|
|
38
|
-
(0, _classCallCheck2.default)(this, RceImageImportModal);
|
|
39
|
-
|
|
40
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41
|
-
args[_key] = arguments[_key];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
45
|
-
|
|
46
|
-
_this.successWrapper = function (successAction, fileType, altText) {
|
|
47
|
-
return function (url) {
|
|
48
|
-
_this.props.setUploadStatus(_quizCommon.FILE_UPLOAD_SUCCESS);
|
|
49
|
-
|
|
50
|
-
successAction(url, fileType, altText);
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
_this.fileUpload = function (successAction) {
|
|
55
|
-
return function (file, errorAction, altText) {
|
|
56
|
-
_this.props.interactionFileUpload(_this.props.parentType, _this.props.parentId, file, _this.successWrapper(successAction, file.type, altText), errorAction, _this.props.uploadPath);
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
_this.storeImportModalRef = function (node) {
|
|
61
|
-
_this.importModal = node;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
return _this;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
(0, _createClass2.default)(RceImageImportModal, [{
|
|
68
|
-
key: "render",
|
|
69
|
-
value: function render() {
|
|
70
|
-
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
71
|
-
acceptFileType: [{
|
|
72
|
-
fileType: 'image/*',
|
|
73
|
-
title: (0, _formatMessage.default)('Image')
|
|
74
|
-
}, {
|
|
75
|
-
fileType: '.mp3, .wav, .ogg',
|
|
76
|
-
title: (0, _formatMessage.default)('Audio')
|
|
77
|
-
}, {
|
|
78
|
-
fileType: '.mp4, .webm, .ogg',
|
|
79
|
-
title: (0, _formatMessage.default)('Video')
|
|
80
|
-
}],
|
|
81
|
-
closeOverride: this.props.closeOverride,
|
|
82
|
-
disableConfirm: true,
|
|
83
|
-
failureMessage: (0, _formatMessage.default)('Failed to upload your file.'),
|
|
84
|
-
fileUpload: this.fileUpload(this.props.onSuccess),
|
|
85
|
-
importMessage: (0, _formatMessage.default)('Select a file to embed.'),
|
|
86
|
-
importModalId: this.props.importModalId,
|
|
87
|
-
onClose: this.props.onClose,
|
|
88
|
-
onContinue: Function.prototype,
|
|
89
|
-
ref: this.storeImportModalRef
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}]);
|
|
93
|
-
RceImageImportModal.displayName = "RceImageImportModal";
|
|
94
|
-
return RceImageImportModal;
|
|
95
|
-
}(_react.Component);
|
|
96
|
-
|
|
97
|
-
exports.RceImageImportModal = RceImageImportModal;
|
|
98
|
-
RceImageImportModal.propTypes = {
|
|
99
|
-
closeOverride: _propTypes.default.func,
|
|
100
|
-
importModalId: _propTypes.default.string.isRequired,
|
|
101
|
-
interactionFileUpload: _propTypes.default.func.isRequired,
|
|
102
|
-
onClose: _propTypes.default.func,
|
|
103
|
-
onSuccess: _propTypes.default.func.isRequired,
|
|
104
|
-
parentType: _propTypes.default.string.isRequired,
|
|
105
|
-
parentId: _propTypes.default.string.isRequired,
|
|
106
|
-
setUploadStatus: _propTypes.default.func.isRequired,
|
|
107
|
-
uploadPath: _propTypes.default.string
|
|
108
|
-
};
|
|
109
|
-
RceImageImportModal.defaultProps = {
|
|
110
|
-
closeOverride: null,
|
|
111
|
-
onClose: function onClose() {},
|
|
112
|
-
uploadPath: null
|
|
113
|
-
};
|
|
114
|
-
var _default = RceImageImportModal;
|
|
115
|
-
exports.default = _default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.RichContentInput = void 0;
|
|
7
|
-
|
|
8
|
-
var _reactRedux = require("../../react-redux.js");
|
|
9
|
-
|
|
10
|
-
var _modal = require("../../actions/modal.js");
|
|
11
|
-
|
|
12
|
-
var _index = require("../../../common/components/ImportModal/index.js");
|
|
13
|
-
|
|
14
|
-
var _presenter = require("./presenter.js");
|
|
15
|
-
|
|
16
|
-
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
17
|
-
return {
|
|
18
|
-
openImportModal: function openImportModal(importModalId) {
|
|
19
|
-
dispatch((0, _modal.openModal)((0, _index.generateImportModalId)(importModalId)));
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) {
|
|
25
|
-
return Object.assign({}, stateProps, dispatchProps, ownProps);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var RichContentInput = (0, _reactRedux.connect)(null, mapDispatchToProps, mergeProps, {
|
|
29
|
-
withRef: true
|
|
30
|
-
})(_presenter.RichContentInput);
|
|
31
|
-
exports.RichContentInput = RichContentInput;
|
|
32
|
-
var _default = RichContentInput;
|
|
33
|
-
exports.default = _default;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.default = exports.RichContentInput = void 0;
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
|
-
var _quizRce = require("@instructure/quiz-rce");
|
|
25
|
-
|
|
26
|
-
var _index = _interopRequireDefault(require("./RceImageImportModal/index.js"));
|
|
27
|
-
|
|
28
|
-
/*
|
|
29
|
-
* TODO can we please merge this into quiz-rce and make something coherent out of this
|
|
30
|
-
*/
|
|
31
|
-
var RichContentInput = /*#__PURE__*/function (_Component) {
|
|
32
|
-
(0, _inherits2.default)(RichContentInput, _Component);
|
|
33
|
-
|
|
34
|
-
var _super = (0, _createSuper2.default)(RichContentInput);
|
|
35
|
-
|
|
36
|
-
function RichContentInput() {
|
|
37
|
-
var _this;
|
|
38
|
-
|
|
39
|
-
(0, _classCallCheck2.default)(this, RichContentInput);
|
|
40
|
-
|
|
41
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
42
|
-
args[_key] = arguments[_key];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
46
|
-
|
|
47
|
-
_this.focus = function () {
|
|
48
|
-
_this.rce.focus();
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
_this.renderImportModal = function (importModalId, onSuccess, onClose) {
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
53
|
-
closeOverride: _this.props.importModalCloseOverride,
|
|
54
|
-
importModalId: importModalId,
|
|
55
|
-
onClose: onClose,
|
|
56
|
-
onSuccess: onSuccess,
|
|
57
|
-
parentType: _this.props.parentType,
|
|
58
|
-
parentId: _this.props.parentId,
|
|
59
|
-
uploadPath: _this.props.uploadPath
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
_this.handleRceRef = function (node) {
|
|
64
|
-
_this.rce = node;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return _this;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
(0, _createClass2.default)(RichContentInput, [{
|
|
71
|
-
key: "render",
|
|
72
|
-
value: function render() {
|
|
73
|
-
return /*#__PURE__*/_react.default.createElement(_quizRce.RichContentInput, Object.assign({
|
|
74
|
-
ref: this.handleRceRef
|
|
75
|
-
}, this.props, {
|
|
76
|
-
renderImportModal: this.renderImportModal,
|
|
77
|
-
openImportModal: this.props.openImportModal
|
|
78
|
-
}));
|
|
79
|
-
}
|
|
80
|
-
}]);
|
|
81
|
-
RichContentInput.displayName = "RichContentInput";
|
|
82
|
-
return RichContentInput;
|
|
83
|
-
}(_react.Component);
|
|
84
|
-
|
|
85
|
-
exports.RichContentInput = RichContentInput;
|
|
86
|
-
RichContentInput.propTypes = {
|
|
87
|
-
// also allows (not listed) all props for ActualRichContentInput
|
|
88
|
-
importModalCloseOverride: _propTypes.default.func,
|
|
89
|
-
label: _propTypes.default.string.isRequired,
|
|
90
|
-
openImportModal: _propTypes.default.func.isRequired,
|
|
91
|
-
parentType: _propTypes.default.string,
|
|
92
|
-
parentId: _propTypes.default.string,
|
|
93
|
-
uploadPath: _propTypes.default.string
|
|
94
|
-
};
|
|
95
|
-
RichContentInput.defaultProps = {
|
|
96
|
-
importModalCloseOverride: null,
|
|
97
|
-
parentType: '',
|
|
98
|
-
parentId: '',
|
|
99
|
-
uploadPath: null
|
|
100
|
-
};
|
|
101
|
-
var _default = RichContentInput;
|
|
102
|
-
exports.default = _default;
|