@instructure/quiz-core 20.6.1-rc.0 → 20.6.1-rc.2

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.
Files changed (23) hide show
  1. package/es/building/components/resources/ItemFeedbackModal/index.js +1 -2
  2. package/es/building/components/resources/ItemFeedbackModal/presenter.js +2 -15
  3. package/es/building/components/resources/quiz/instructions/Edit/presenter.js +3 -6
  4. package/es/building/components/resources/quiz/instructions/Instructions/presenter.js +1 -2
  5. package/es/common/components/resources/item/ItemEdit/presenter.js +1 -14
  6. package/es/common/util/interactionTypePropsHelper.js +1 -1
  7. package/es/index.js +0 -2
  8. package/lib/building/components/resources/ItemFeedbackModal/index.js +0 -1
  9. package/lib/building/components/resources/ItemFeedbackModal/presenter.js +1 -15
  10. package/lib/building/components/resources/quiz/instructions/Edit/presenter.js +4 -7
  11. package/lib/building/components/resources/quiz/instructions/Instructions/presenter.js +1 -2
  12. package/lib/common/components/resources/item/ItemEdit/presenter.js +1 -15
  13. package/lib/common/util/interactionTypePropsHelper.js +2 -2
  14. package/lib/index.js +80 -98
  15. package/package.json +9 -9
  16. package/es/common/components/RichContentInput/RceImageImportModal/index.js +0 -15
  17. package/es/common/components/RichContentInput/RceImageImportModal/presenter.js +0 -93
  18. package/es/common/components/RichContentInput/index.js +0 -21
  19. package/es/common/components/RichContentInput/presenter.js +0 -82
  20. package/lib/common/components/RichContentInput/RceImageImportModal/index.js +0 -28
  21. package/lib/common/components/RichContentInput/RceImageImportModal/presenter.js +0 -115
  22. package/lib/common/components/RichContentInput/index.js +0 -33
  23. package/lib/common/components/RichContentInput/presenter.js +0 -102
@@ -1,7 +1,7 @@
1
1
  import { Map } from 'immutable';
2
2
  import { connect } from "../../../../common/react-redux.js";
3
3
  import { ItemFeedbackModal as ItemFeedbackModalPresenter } from "./presenter.js";
4
- import { closeModal, openModal } from "../../../../common/actions/modal.js";
4
+ import { closeModal } from "../../../../common/actions/modal.js";
5
5
  import { changeItemFeedback } from "../../../../common/actions/modifications.js";
6
6
  import Item from "../../../../common/records/Item.js";
7
7
  import { set } from "../../../../common/actions/ui.js";
@@ -25,7 +25,6 @@ function mapStateToProps(state, props) {
25
25
  var mapDispatchToProps = {
26
26
  closeModal: closeModal,
27
27
  changeItemFeedback: changeItemFeedback,
28
- openModal: openModal,
29
28
  setUi: set
30
29
  };
31
30
  export var ItemFeedbackModal = connect(mapStateToProps, mapDispatchToProps)(ItemFeedbackModalPresenter);
@@ -11,10 +11,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
11
11
  import { Button, CloseButton } from '@instructure/ui-buttons';
12
12
  import { Heading } from '@instructure/ui-heading';
13
13
  import { themeable } from '@instructure/ui-themeable';
14
- import { RichContentRenderer, RCE_THREE_LINES_HEIGHT } from '@instructure/quiz-rce';
15
- import { RichContentInput } from "../../../../common/components/RichContentInput/index.js";
14
+ import { RichContentRenderer, RichContentInput, RCE_THREE_LINES_HEIGHT } from '@instructure/quiz-rce';
16
15
  import t from '@instructure/quiz-i18n/es/format-message';
17
- import { Modal, ModalHeader, ModalBody, ModalFooter, ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_FEEDBACK, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
16
+ import { Modal, ModalHeader, ModalBody, ModalFooter, ITEM_FEEDBACK_MODAL_FEEDBACK, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
18
17
  var styles = {
19
18
  componentId: 'esPWW',
20
19
  template: function template(theme) {
@@ -67,12 +66,6 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
67
66
  _this.props.closeModal();
68
67
  };
69
68
 
70
- _this.returnToFeedback = function () {
71
- _this.props.openModal(ITEM_FEEDBACK_MODAL, {
72
- modalTrigger: _this.props.modalTrigger
73
- });
74
- };
75
-
76
69
  return _this;
77
70
  }
78
71
 
@@ -104,9 +97,6 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
104
97
  textareaId: key,
105
98
  defaultContent: this.props.feedback.get(key),
106
99
  onChange: this.onFeedbackWrapper(key),
107
- parentType: this.props.parentType,
108
- parentId: this.props.parentId,
109
- importModalCloseOverride: this.returnToFeedback,
110
100
  height: RCE_THREE_LINES_HEIGHT
111
101
  }));
112
102
  }
@@ -150,9 +140,6 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
150
140
  importModalOpen: PropTypes.bool.isRequired,
151
141
  item: ImmutablePropTypes.record.isRequired,
152
142
  modalOpen: PropTypes.bool.isRequired,
153
- openModal: PropTypes.func.isRequired,
154
- parentId: PropTypes.string.isRequired,
155
- parentType: PropTypes.string.isRequired,
156
143
  setUi: PropTypes.func.isRequired,
157
144
  modalTrigger: PropTypes.instanceOf(Component)
158
145
  }, _class2.defaultProps = {
@@ -10,11 +10,11 @@ import PropTypes from 'prop-types';
10
10
  import { Button } from '@instructure/ui-buttons';
11
11
  import { themeable } from '@instructure/ui-themeable';
12
12
  import t from '@instructure/quiz-i18n/es/format-message';
13
- import RichContentInput from "../../../../../../common/components/RichContentInput/index.js";
14
13
  import wrapWithOutsideClick from "../../../../../../common/components/shared/functionality/componentWithOutsideClick.js";
15
14
  import CustomPropTypes from "../../../../../../common/util/CustomPropTypes.js";
16
15
  import elementsForSelectors from "../../../../../../common/util/ElementsForSelectors.js";
17
- import { PARENT_TYPE_QUIZ, INSTRUCTIONS_EDIT_ID } from '@instructure/quiz-common';
16
+ import { INSTRUCTIONS_EDIT_ID } from '@instructure/quiz-common';
17
+ import { RichContentInput } from '@instructure/quiz-rce';
18
18
  var styles = {
19
19
  componentId: 'evnrd',
20
20
  template: function template(theme) {
@@ -67,9 +67,7 @@ var QuizInstructionsEdit = (_dec = themeable(theme, styles), _dec(_class = (_tem
67
67
  textareaClassName: styles.instructionsEditInput,
68
68
  defaultContent: this.props.inputValue,
69
69
  onKeyUp: this.props.onInputChange,
70
- onChange: this.props.onInputChange,
71
- parentType: PARENT_TYPE_QUIZ,
72
- parentId: this.props.quizId
70
+ onChange: this.props.onInputChange
73
71
  }), /*#__PURE__*/React.createElement("div", {
74
72
  className: styles.footer
75
73
  }, /*#__PURE__*/React.createElement(Button, {
@@ -89,7 +87,6 @@ var QuizInstructionsEdit = (_dec = themeable(theme, styles), _dec(_class = (_tem
89
87
  endEditing: PropTypes.func.isRequired,
90
88
  inputValue: PropTypes.string.isRequired,
91
89
  onInputChange: PropTypes.func.isRequired,
92
- quizId: PropTypes.string.isRequired,
93
90
  saveAndPreview: PropTypes.func.isRequired,
94
91
  appContainer: CustomPropTypes.selectors.isRequired
95
92
  }, _temp)) || _class);
@@ -149,8 +149,7 @@ export var QuizInstructions = (_dec = themeable(theme, styles), _dec(_class = (_
149
149
  inputValue: this.workingInstructions(),
150
150
  onInputChange: this.updateWorkingInstructions,
151
151
  ref: this.setRef('instructionsEdit'),
152
- saveAndPreview: this.saveAndPreview,
153
- quizId: this.props.quiz.id
152
+ saveAndPreview: this.saveAndPreview
154
153
  });
155
154
  }
156
155
  }, {
@@ -14,7 +14,6 @@ import componentForItem from "../../../../util/componentForItem.js";
14
14
  import { liveRegion, COMPONENT_EDIT } from '@instructure/quiz-common';
15
15
  import t from '@instructure/quiz-i18n/es/format-message';
16
16
  import { propsForInteractionEdit } from "../../../../util/interactionTypePropsHelper.js";
17
- import RceImageImportModal from "../../../../components/RichContentInput/RceImageImportModal/index.js";
18
17
  import elementsForSelectors from "../../../../../common/util/ElementsForSelectors.js";
19
18
  import { toErrors } from "../../../../util/instUIMessages.js";
20
19
  export var ItemEdit = /*#__PURE__*/function (_Component) {
@@ -63,16 +62,6 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
63
62
  }
64
63
  };
65
64
 
66
- _this.renderImportModal = function (importModalId, onSuccess, onClose) {
67
- return /*#__PURE__*/React.createElement(RceImageImportModal, {
68
- importModalId: importModalId,
69
- onClose: onClose,
70
- onSuccess: onSuccess,
71
- parentId: _this.props.parentId,
72
- parentType: _this.props.parentType
73
- });
74
- };
75
-
76
65
  return _this;
77
66
  }
78
67
 
@@ -136,8 +125,7 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
136
125
  name: "edit_item_".concat(this.props.guid) // eslint-disable-line react/jsx-no-literals
137
126
 
138
127
  }, /*#__PURE__*/React.createElement(Interaction, Object.assign({}, propsForInteraction, {
139
- itemId: this.props.guid,
140
- renderImportModal: this.renderImportModal
128
+ itemId: this.props.guid
141
129
  })));
142
130
  }
143
131
  }]);
@@ -169,7 +157,6 @@ ItemEdit.propTypes = {
169
157
  handleQuizEntryPointsChange: PropTypes.func.isRequired,
170
158
  interactionFileUpload: PropTypes.func.isRequired,
171
159
  oneQuestionAtATime: PropTypes.bool.isRequired,
172
- openImportModal: PropTypes.func.isRequired,
173
160
  parentId: PropTypes.string.isRequired,
174
161
  parentType: PropTypes.string.isRequired,
175
162
  partialDeepScoringEnabled: PropTypes.bool,
@@ -1,4 +1,4 @@
1
- import RichContentInput from "../components/RichContentInput/index.js";
1
+ import { RichContentInput } from '@instructure/quiz-rce';
2
2
  import t from '@instructure/quiz-i18n/es/format-message';
3
3
  export var propsForInteractionEdit = function propsForInteractionEdit(props, additionalOptions) {
4
4
  var item = props.workingItem.toJS();
package/es/index.js CHANGED
@@ -23,7 +23,6 @@ export { QuizzesSpinner } from "./common/components/shared/spinner/Spinner.js";
23
23
  export { PrintTrigger } from "./common/components/shared/PrintTrigger/index.js";
24
24
  export { IfFeature } from "./common/components/shared/IfFeature/index.js";
25
25
  export { UndecoratedQuizEntryEdit } from "./building/components/resources/quizEntry/QuizEntryEdit/presenter.js";
26
- export { RichContentInput } from "./common/components/RichContentInput/index.js";
27
26
  export { ResultStimulus } from "./common/components/resources/sessionItemResult/ResultStimulus/index.js";
28
27
  export { Stimulus as StimulusView } from "./common/components/layout/sidebar/Stimulus/index.js";
29
28
  export { Sidebar } from "./common/components/layout/sidebar/Sidebar/index.js";
@@ -42,7 +41,6 @@ export { CentileDistribution } from "./reporting/components/charts/Distribution/
42
41
  export { OutcomeAnalysis } from "./reporting/components/resources/OutcomeAnalysis/index.js";
43
42
  export { PositionBox } from "./common/components/resources/positionBox/PositionBox.js";
44
43
  export { Pin } from "./common/components/Pin/index.js";
45
- export { RceImageImportModal } from "./common/components/RichContentInput/RceImageImportModal/index.js";
46
44
  export { SessionItemResult as SessionItemResultView } from "./common/components/resources/sessionItemResult/SessionItemResult/index.js";
47
45
  export { Card } from "./common/components/shared/Card/index.js";
48
46
  export { CardContent } from "./common/components/shared/Card/CardContent/index.js";
@@ -43,7 +43,6 @@ function mapStateToProps(state, props) {
43
43
  var mapDispatchToProps = {
44
44
  closeModal: _modal.closeModal,
45
45
  changeItemFeedback: _modifications.changeItemFeedback,
46
- openModal: _modal.openModal,
47
46
  setUi: _ui.set
48
47
  };
49
48
  var ItemFeedbackModal = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_presenter.ItemFeedbackModal);
@@ -31,8 +31,6 @@ var _uiThemeable = require("@instructure/ui-themeable");
31
31
 
32
32
  var _quizRce = require("@instructure/quiz-rce");
33
33
 
34
- var _index = require("../../../../common/components/RichContentInput/index.js");
35
-
36
34
  var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
37
35
 
38
36
  var _quizCommon = require("@instructure/quiz-common");
@@ -92,12 +90,6 @@ var ItemFeedbackModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
92
90
  _this.props.closeModal();
93
91
  };
94
92
 
95
- _this.returnToFeedback = function () {
96
- _this.props.openModal(_quizCommon.ITEM_FEEDBACK_MODAL, {
97
- modalTrigger: _this.props.modalTrigger
98
- });
99
- };
100
-
101
93
  return _this;
102
94
  }
103
95
 
@@ -124,14 +116,11 @@ var ItemFeedbackModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
124
116
  return /*#__PURE__*/_react.default.createElement("div", null, _ref, /*#__PURE__*/_react.default.createElement("label", {
125
117
  className: styles.feedbackLabel,
126
118
  htmlFor: key
127
- }, label), /*#__PURE__*/_react.default.createElement(_index.RichContentInput, {
119
+ }, label), /*#__PURE__*/_react.default.createElement(_quizRce.RichContentInput, {
128
120
  label: "",
129
121
  textareaId: key,
130
122
  defaultContent: this.props.feedback.get(key),
131
123
  onChange: this.onFeedbackWrapper(key),
132
- parentType: this.props.parentType,
133
- parentId: this.props.parentId,
134
- importModalCloseOverride: this.returnToFeedback,
135
124
  height: _quizRce.RCE_THREE_LINES_HEIGHT
136
125
  }));
137
126
  }
@@ -174,9 +163,6 @@ var ItemFeedbackModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
174
163
  importModalOpen: _propTypes.default.bool.isRequired,
175
164
  item: _reactImmutableProptypes.default.record.isRequired,
176
165
  modalOpen: _propTypes.default.bool.isRequired,
177
- openModal: _propTypes.default.func.isRequired,
178
- parentId: _propTypes.default.string.isRequired,
179
- parentType: _propTypes.default.string.isRequired,
180
166
  setUi: _propTypes.default.func.isRequired,
181
167
  modalTrigger: _propTypes.default.instanceOf(_react.Component)
182
168
  }, _class2.defaultProps = {
@@ -27,8 +27,6 @@ var _uiThemeable = require("@instructure/ui-themeable");
27
27
 
28
28
  var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
29
29
 
30
- var _index = _interopRequireDefault(require("../../../../../../common/components/RichContentInput/index.js"));
31
-
32
30
  var _componentWithOutsideClick = _interopRequireDefault(require("../../../../../../common/components/shared/functionality/componentWithOutsideClick.js"));
33
31
 
34
32
  var _CustomPropTypes = _interopRequireDefault(require("../../../../../../common/util/CustomPropTypes.js"));
@@ -37,6 +35,8 @@ var _ElementsForSelectors = _interopRequireDefault(require("../../../../../../co
37
35
 
38
36
  var _quizCommon = require("@instructure/quiz-common");
39
37
 
38
+ var _quizRce = require("@instructure/quiz-rce");
39
+
40
40
  var _theme = _interopRequireDefault(require("./theme.js"));
41
41
 
42
42
  var _dec, _class, _class2, _temp;
@@ -84,16 +84,14 @@ var QuizInstructionsEdit = (_dec = (0, _uiThemeable.themeable)(_theme.default, s
84
84
  value: function render() {
85
85
  return /*#__PURE__*/_react.default.createElement("div", {
86
86
  className: styles.instructionsEditWrapper
87
- }, /*#__PURE__*/_react.default.createElement(_index.default, {
87
+ }, /*#__PURE__*/_react.default.createElement(_quizRce.RichContentInput, {
88
88
  label: "",
89
89
  textareaId: _quizCommon.INSTRUCTIONS_EDIT_ID,
90
90
  wrapperClassName: styles.instructionsEdit,
91
91
  textareaClassName: styles.instructionsEditInput,
92
92
  defaultContent: this.props.inputValue,
93
93
  onKeyUp: this.props.onInputChange,
94
- onChange: this.props.onInputChange,
95
- parentType: _quizCommon.PARENT_TYPE_QUIZ,
96
- parentId: this.props.quizId
94
+ onChange: this.props.onInputChange
97
95
  }), /*#__PURE__*/_react.default.createElement("div", {
98
96
  className: styles.footer
99
97
  }, /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
@@ -112,7 +110,6 @@ var QuizInstructionsEdit = (_dec = (0, _uiThemeable.themeable)(_theme.default, s
112
110
  endEditing: _propTypes.default.func.isRequired,
113
111
  inputValue: _propTypes.default.string.isRequired,
114
112
  onInputChange: _propTypes.default.func.isRequired,
115
- quizId: _propTypes.default.string.isRequired,
116
113
  saveAndPreview: _propTypes.default.func.isRequired,
117
114
  appContainer: _CustomPropTypes.default.selectors.isRequired
118
115
  }, _temp)) || _class);
@@ -173,8 +173,7 @@ var QuizInstructions = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
173
173
  inputValue: this.workingInstructions(),
174
174
  onInputChange: this.updateWorkingInstructions,
175
175
  ref: this.setRef('instructionsEdit'),
176
- saveAndPreview: this.saveAndPreview,
177
- quizId: this.props.quiz.id
176
+ saveAndPreview: this.saveAndPreview
178
177
  });
179
178
  }
180
179
  }, {
@@ -41,8 +41,6 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
41
41
 
42
42
  var _interactionTypePropsHelper = require("../../../../util/interactionTypePropsHelper.js");
43
43
 
44
- var _index = _interopRequireDefault(require("../../../../components/RichContentInput/RceImageImportModal/index.js"));
45
-
46
44
  var _ElementsForSelectors = _interopRequireDefault(require("../../../../../common/util/ElementsForSelectors.js"));
47
45
 
48
46
  var _instUIMessages = require("../../../../util/instUIMessages.js");
@@ -93,16 +91,6 @@ var ItemEdit = /*#__PURE__*/function (_Component) {
93
91
  }
94
92
  };
95
93
 
96
- _this.renderImportModal = function (importModalId, onSuccess, onClose) {
97
- return /*#__PURE__*/_react.default.createElement(_index.default, {
98
- importModalId: importModalId,
99
- onClose: onClose,
100
- onSuccess: onSuccess,
101
- parentId: _this.props.parentId,
102
- parentType: _this.props.parentType
103
- });
104
- };
105
-
106
94
  return _this;
107
95
  }
108
96
 
@@ -166,8 +154,7 @@ var ItemEdit = /*#__PURE__*/function (_Component) {
166
154
  name: "edit_item_".concat(this.props.guid) // eslint-disable-line react/jsx-no-literals
167
155
 
168
156
  }, /*#__PURE__*/_react.default.createElement(Interaction, Object.assign({}, propsForInteraction, {
169
- itemId: this.props.guid,
170
- renderImportModal: this.renderImportModal
157
+ itemId: this.props.guid
171
158
  })));
172
159
  }
173
160
  }]);
@@ -200,7 +187,6 @@ ItemEdit.propTypes = {
200
187
  handleQuizEntryPointsChange: _propTypes.default.func.isRequired,
201
188
  interactionFileUpload: _propTypes.default.func.isRequired,
202
189
  oneQuestionAtATime: _propTypes.default.bool.isRequired,
203
- openImportModal: _propTypes.default.func.isRequired,
204
190
  parentId: _propTypes.default.string.isRequired,
205
191
  parentType: _propTypes.default.string.isRequired,
206
192
  partialDeepScoringEnabled: _propTypes.default.bool,
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.propsForInteractionShow = exports.propsForInteractionEdit = void 0;
9
9
 
10
- var _index = _interopRequireDefault(require("../components/RichContentInput/index.js"));
10
+ var _quizRce = require("@instructure/quiz-rce");
11
11
 
12
12
  var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
13
13
 
@@ -73,7 +73,7 @@ var propsForInteractionEdit = function propsForInteractionEdit(props, additional
73
73
  override: props.override,
74
74
  overrideEditableForItem: props.overrideEditableForItem,
75
75
  overrideEditableForRegrading: props.overrideEditableForRegrading,
76
- richContentEditor: _index.default,
76
+ richContentEditor: _quizRce.RichContentInput,
77
77
  scoringAlgorithm: item.scoringAlgorithm,
78
78
  scoringData: item.scoringData,
79
79
  setOneQuestionAtATime: setOneQuestionAtATime,