@instructure/quiz-core 17.27.1-rc.0 → 17.28.1-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [17.28.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.27.0...v17.28.0) (2022-03-09)
7
+
8
+
9
+ ### Features
10
+
11
+ * **quizzes-ui:** Reintroduce TinyMCE v5 to load based on a feature flag ([7bc7fb3](https://gerrit.instructure.com/quizzes-ui/commits/7bc7fb3bf3cd25f2bde5313dfcc60e63d4569937))
12
+
13
+
14
+
15
+
16
+
6
17
  # [17.27.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.26.0...v17.27.0) (2022-03-08)
7
18
 
8
19
 
@@ -12,6 +12,7 @@ import { Button, CloseButton } from '@instructure/ui-buttons';
12
12
  import { Heading } from '@instructure/ui-heading';
13
13
  import { themeable } from '@instructure/ui-themeable';
14
14
  import { RichContentRenderer } from '@instructure/quiz-rce';
15
+ import { isNewRCEEnabled } from "../../../../common/util/rceChecker.js";
15
16
  import RichContentInput from "../../../../common/components/RichContentInput/index.js";
16
17
  import t from '@instructure/quiz-i18n/es/format-message';
17
18
  import { Modal, ModalHeader, ModalBody, ModalFooter, ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_FEEDBACK, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
@@ -103,7 +104,8 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
103
104
  onChange: this.onFeedbackChange,
104
105
  parentType: this.props.parentType,
105
106
  parentId: this.props.parentId,
106
- importModalCloseOverride: this.returnToFeedback
107
+ importModalCloseOverride: this.returnToFeedback,
108
+ useNewRce: isNewRCEEnabled()
107
109
  }));
108
110
  }
109
111
  }, {
@@ -11,6 +11,7 @@ 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
13
  import RichContentInput from "../../../../../../common/components/RichContentInput/index.js";
14
+ import { isNewRCEEnabled } from "../../../../../../common/util/rceChecker.js";
14
15
  import wrapWithOutsideClick from "../../../../../../common/components/shared/functionality/componentWithOutsideClick.js";
15
16
  import CustomPropTypes from "../../../../../../common/util/CustomPropTypes.js";
16
17
  import elementsForSelectors from "../../../../../../common/util/ElementsForSelectors.js";
@@ -88,7 +89,8 @@ var QuizInstructionsEdit = (_dec = themeable(theme, styles), _dec(_class = (_tem
88
89
  onKeyUp: this.props.onInputChange,
89
90
  onChange: this.props.onInputChange,
90
91
  parentType: PARENT_TYPE_QUIZ,
91
- parentId: this.props.quizId
92
+ parentId: this.props.quizId,
93
+ useNewRce: isNewRCEEnabled()
92
94
  }), /*#__PURE__*/React.createElement("div", {
93
95
  className: styles.footer
94
96
  }, /*#__PURE__*/React.createElement(Button, {
@@ -36,7 +36,8 @@ export function mapStateToProps(state, props) {
36
36
  partialDeepScoringEnabled: featureOn('partial_deep_scoring'),
37
37
  partialScoringEnabled: featureOn('partial_scoring'),
38
38
  quizId: getActiveQuizId(state),
39
- showCalculator: featureOn('calculator_per_question')
39
+ showCalculator: featureOn('calculator_per_question'),
40
+ useNewRce: featureOn('use_new_rce')
40
41
  };
41
42
  }
42
43
 
@@ -179,6 +179,7 @@ ItemEdit.propTypes = {
179
179
  setUploadStatus: PropTypes.func.isRequired,
180
180
  initialFocusId: PropTypes.string,
181
181
  showCalculator: PropTypes.bool,
182
+ useNewRce: PropTypes.bool,
182
183
  clearValidationErrorsFromApi: PropTypes.func.isRequired,
183
184
  validationErrorsFromApi: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.shape({
184
185
  type: PropTypes.string,
@@ -196,6 +197,7 @@ ItemEdit.defaultProps = {
196
197
  partialScoringEnabled: false,
197
198
  initialFocusId: null,
198
199
  showCalculator: false,
200
+ useNewRce: false,
199
201
  validationErrorsFromApi: {}
200
202
  };
201
203
  export default ItemEdit;
@@ -18,7 +18,8 @@ function mapStateToProps(state, props) {
18
18
  oneQuestionAtATime: isActiveQuizWorkingInstanceOneQuestionAtATime(state),
19
19
  partialDeepScoringEnabled: featureOn('partial_deep_scoring'),
20
20
  partialScoringEnabled: featureOn('partial_scoring'),
21
- quizId: getActiveQuizId(state)
21
+ quizId: getActiveQuizId(state),
22
+ useNewRce: featureOn('use_new_rce')
22
23
  };
23
24
  }
24
25
 
@@ -76,11 +76,13 @@ ItemOverride.propTypes = {
76
76
  partialScoringEnabled: PropTypes.bool,
77
77
  quizId: PropTypes.string.isRequired,
78
78
  screenreaderNotification: PropTypes.func.isRequired,
79
- setOneQuestionAtATime: PropTypes.func.isRequired
79
+ setOneQuestionAtATime: PropTypes.func.isRequired,
80
+ useNewRce: PropTypes.bool
80
81
  };
81
82
  ItemOverride.defaultProps = {
82
83
  errorsAreShowing: false,
83
84
  partialScoringEnabled: false,
84
- partialDeepScoringEnabled: false
85
+ partialDeepScoringEnabled: false,
86
+ useNewRce: false
85
87
  };
86
88
  export default ItemOverride;
@@ -16,6 +16,7 @@ import { themeable } from '@instructure/ui-themeable';
16
16
  import { Heading } from '@instructure/ui-heading';
17
17
  import RichContentInput from "../../../RichContentInput/index.js";
18
18
  import { toErrors } from "../../../../util/instUIMessages.js";
19
+ import { isNewRCEEnabled } from "../../../../util/rceChecker.js";
19
20
  import Errors from "../../../shared/errors/Errors.js";
20
21
  import { SimpleSelect } from '@instructure/ui-simple-select';
21
22
  import { IconUpdownLine } from '@instructure/ui-icons';
@@ -174,7 +175,8 @@ export var StimulusEditInfo = (_dec = themeable(theme, styles), _dec(_class = (_
174
175
  defaultContent: stimulus.get('body'),
175
176
  onKeyUp: this.onBodyChange,
176
177
  onBlur: this.onBodyChange,
177
- uploadPath: this.fileUploadUrl()
178
+ uploadPath: this.fileUploadUrl(),
179
+ useNewRce: isNewRCEEnabled()
178
180
  }), /*#__PURE__*/React.createElement(Errors, {
179
181
  errorList: this.errorsList('body')
180
182
  })), /*#__PURE__*/React.createElement("div", {
@@ -66,7 +66,8 @@ export var propsForInteractionEdit = function propsForInteractionEdit(props, add
66
66
  setOneQuestionAtATime: setOneQuestionAtATime,
67
67
  stemErrors: props.workingItem.errorsFor('itemBody').toJS(),
68
68
  initialFocusId: props.initialFocusId,
69
- calculatorType: item.calculatorType
69
+ calculatorType: item.calculatorType,
70
+ useNewRce: props.useNewRce
70
71
  };
71
72
  };
72
73
  export var propsForInteractionShow = function propsForInteractionShow(item) {
@@ -0,0 +1,6 @@
1
+ import { featureOn } from "./featureCheck.js";
2
+ var newRCEFeatureName = 'use_new_rce';
3
+ export function isNewRCEEnabled() {
4
+ return featureOn(newRCEFeatureName);
5
+ }
6
+ export default isNewRCEEnabled;
package/es/index.js CHANGED
@@ -89,7 +89,8 @@ export { formatTime } from "./common/util/formatTimespan.js";
89
89
  export { connect } from "./common/react-redux.js";
90
90
  export { breakdownSeconds, HOUR_IN_SECONDS } from "./common/components/shared/FormattedDuration/index.js";
91
91
  export { sessionStore } from "./common/util/sessionStore.js";
92
- export { printWithCss, ensureImagesLoaded } from "./common/util/printUtils.js"; // APIs
92
+ export { printWithCss, ensureImagesLoaded } from "./common/util/printUtils.js";
93
+ export { isNewRCEEnabled } from "./common/util/rceChecker.js"; // APIs
93
94
 
94
95
  export { createQuizEntryRegrade } from "./grading/api/quizEntryRegrades.js";
95
96
  export { getQuizEntry } from "./building/api/quizEntries.js";
@@ -31,6 +31,8 @@ var _uiThemeable = require("@instructure/ui-themeable");
31
31
 
32
32
  var _quizRce = require("@instructure/quiz-rce");
33
33
 
34
+ var _rceChecker = require("../../../../common/util/rceChecker.js");
35
+
34
36
  var _index = _interopRequireDefault(require("../../../../common/components/RichContentInput/index.js"));
35
37
 
36
38
  var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
@@ -128,7 +130,8 @@ var ItemFeedbackModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
128
130
  onChange: this.onFeedbackChange,
129
131
  parentType: this.props.parentType,
130
132
  parentId: this.props.parentId,
131
- importModalCloseOverride: this.returnToFeedback
133
+ importModalCloseOverride: this.returnToFeedback,
134
+ useNewRce: (0, _rceChecker.isNewRCEEnabled)()
132
135
  }));
133
136
  }
134
137
  }, {
@@ -29,6 +29,8 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
29
29
 
30
30
  var _index = _interopRequireDefault(require("../../../../../../common/components/RichContentInput/index.js"));
31
31
 
32
+ var _rceChecker = require("../../../../../../common/util/rceChecker.js");
33
+
32
34
  var _componentWithOutsideClick = _interopRequireDefault(require("../../../../../../common/components/shared/functionality/componentWithOutsideClick.js"));
33
35
 
34
36
  var _CustomPropTypes = _interopRequireDefault(require("../../../../../../common/util/CustomPropTypes.js"));
@@ -113,7 +115,8 @@ var QuizInstructionsEdit = (_dec = (0, _uiThemeable.themeable)(_theme.default, s
113
115
  onKeyUp: this.props.onInputChange,
114
116
  onChange: this.props.onInputChange,
115
117
  parentType: _quizCommon.PARENT_TYPE_QUIZ,
116
- parentId: this.props.quizId
118
+ parentId: this.props.quizId,
119
+ useNewRce: (0, _rceChecker.isNewRCEEnabled)()
117
120
  }), /*#__PURE__*/_react.default.createElement("div", {
118
121
  className: styles.footer
119
122
  }, /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
@@ -64,7 +64,8 @@ function mapStateToProps(state, props) {
64
64
  partialDeepScoringEnabled: (0, _featureCheck.featureOn)('partial_deep_scoring'),
65
65
  partialScoringEnabled: (0, _featureCheck.featureOn)('partial_scoring'),
66
66
  quizId: (0, _quizzes2.getActiveQuizId)(state),
67
- showCalculator: (0, _featureCheck.featureOn)('calculator_per_question')
67
+ showCalculator: (0, _featureCheck.featureOn)('calculator_per_question'),
68
+ useNewRce: (0, _featureCheck.featureOn)('use_new_rce')
68
69
  };
69
70
  }
70
71
 
@@ -210,6 +210,7 @@ ItemEdit.propTypes = {
210
210
  setUploadStatus: _propTypes.default.func.isRequired,
211
211
  initialFocusId: _propTypes.default.string,
212
212
  showCalculator: _propTypes.default.bool,
213
+ useNewRce: _propTypes.default.bool,
213
214
  clearValidationErrorsFromApi: _propTypes.default.func.isRequired,
214
215
  validationErrorsFromApi: _propTypes.default.objectOf(_propTypes.default.arrayOf(_propTypes.default.shape({
215
216
  type: _propTypes.default.string,
@@ -227,6 +228,7 @@ ItemEdit.defaultProps = {
227
228
  partialScoringEnabled: false,
228
229
  initialFocusId: null,
229
230
  showCalculator: false,
231
+ useNewRce: false,
230
232
  validationErrorsFromApi: {}
231
233
  };
232
234
  var _default = ItemEdit;
@@ -38,7 +38,8 @@ function mapStateToProps(state, props) {
38
38
  oneQuestionAtATime: (0, _quizzes2.isActiveQuizWorkingInstanceOneQuestionAtATime)(state),
39
39
  partialDeepScoringEnabled: (0, _featureCheck.featureOn)('partial_deep_scoring'),
40
40
  partialScoringEnabled: (0, _featureCheck.featureOn)('partial_scoring'),
41
- quizId: (0, _quizzes2.getActiveQuizId)(state)
41
+ quizId: (0, _quizzes2.getActiveQuizId)(state),
42
+ useNewRce: (0, _featureCheck.featureOn)('use_new_rce')
42
43
  };
43
44
  }
44
45
 
@@ -99,12 +99,14 @@ ItemOverride.propTypes = {
99
99
  partialScoringEnabled: _propTypes.default.bool,
100
100
  quizId: _propTypes.default.string.isRequired,
101
101
  screenreaderNotification: _propTypes.default.func.isRequired,
102
- setOneQuestionAtATime: _propTypes.default.func.isRequired
102
+ setOneQuestionAtATime: _propTypes.default.func.isRequired,
103
+ useNewRce: _propTypes.default.bool
103
104
  };
104
105
  ItemOverride.defaultProps = {
105
106
  errorsAreShowing: false,
106
107
  partialScoringEnabled: false,
107
- partialDeepScoringEnabled: false
108
+ partialDeepScoringEnabled: false,
109
+ useNewRce: false
108
110
  };
109
111
  var _default = ItemOverride;
110
112
  exports.default = _default;
@@ -39,6 +39,8 @@ var _index = _interopRequireDefault(require("../../../RichContentInput/index.js"
39
39
 
40
40
  var _instUIMessages = require("../../../../util/instUIMessages.js");
41
41
 
42
+ var _rceChecker = require("../../../../util/rceChecker.js");
43
+
42
44
  var _Errors = _interopRequireDefault(require("../../../shared/errors/Errors.js"));
43
45
 
44
46
  var _uiSimpleSelect = require("@instructure/ui-simple-select");
@@ -206,7 +208,8 @@ var StimulusEditInfo = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
206
208
  defaultContent: stimulus.get('body'),
207
209
  onKeyUp: this.onBodyChange,
208
210
  onBlur: this.onBodyChange,
209
- uploadPath: this.fileUploadUrl()
211
+ uploadPath: this.fileUploadUrl(),
212
+ useNewRce: (0, _rceChecker.isNewRCEEnabled)()
210
213
  }), /*#__PURE__*/_react.default.createElement(_Errors.default, {
211
214
  errorList: this.errorsList('body')
212
215
  })), /*#__PURE__*/_react.default.createElement("div", {
@@ -77,7 +77,8 @@ var propsForInteractionEdit = function propsForInteractionEdit(props, additional
77
77
  setOneQuestionAtATime: setOneQuestionAtATime,
78
78
  stemErrors: props.workingItem.errorsFor('itemBody').toJS(),
79
79
  initialFocusId: props.initialFocusId,
80
- calculatorType: item.calculatorType
80
+ calculatorType: item.calculatorType,
81
+ useNewRce: props.useNewRce
81
82
  };
82
83
  };
83
84
 
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isNewRCEEnabled = isNewRCEEnabled;
7
+ exports.default = void 0;
8
+
9
+ var _featureCheck = require("./featureCheck.js");
10
+
11
+ var newRCEFeatureName = 'use_new_rce';
12
+
13
+ function isNewRCEEnabled() {
14
+ return (0, _featureCheck.featureOn)(newRCEFeatureName);
15
+ }
16
+
17
+ var _default = isNewRCEEnabled;
18
+ exports.default = _default;
package/lib/index.js CHANGED
@@ -103,6 +103,7 @@ var _exportNames = {
103
103
  sessionStore: true,
104
104
  printWithCss: true,
105
105
  ensureImagesLoaded: true,
106
+ isNewRCEEnabled: true,
106
107
  createQuizEntryRegrade: true,
107
108
  getQuizEntry: true,
108
109
  moveQuizEntry: true,
@@ -773,6 +774,12 @@ Object.defineProperty(exports, "ensureImagesLoaded", {
773
774
  return _printUtils.ensureImagesLoaded;
774
775
  }
775
776
  });
777
+ Object.defineProperty(exports, "isNewRCEEnabled", {
778
+ enumerable: true,
779
+ get: function get() {
780
+ return _rceChecker.isNewRCEEnabled;
781
+ }
782
+ });
776
783
  Object.defineProperty(exports, "createQuizEntryRegrade", {
777
784
  enumerable: true,
778
785
  get: function get() {
@@ -1453,6 +1460,8 @@ var _sessionStore = require("./common/util/sessionStore.js");
1453
1460
 
1454
1461
  var _printUtils = require("./common/util/printUtils.js");
1455
1462
 
1463
+ var _rceChecker = require("./common/util/rceChecker.js");
1464
+
1456
1465
  var _quizEntryRegrades = require("./grading/api/quizEntryRegrades.js");
1457
1466
 
1458
1467
  var _quizEntries = require("./building/api/quizEntries.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.27.1-rc.0+7e90f0bf2",
3
+ "version": "17.28.1-rc.0+1a117b107",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -41,11 +41,11 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@instructure/outcomes-ui": "^2.1.2",
44
- "@instructure/quiz-common": "17.27.1-rc.0+7e90f0bf2",
45
- "@instructure/quiz-i18n": "17.27.1-rc.0+7e90f0bf2",
46
- "@instructure/quiz-interactions": "17.27.1-rc.0+7e90f0bf2",
47
- "@instructure/quiz-number-input": "17.27.1-rc.0+7e90f0bf2",
48
- "@instructure/quiz-rce": "17.27.1-rc.0+7e90f0bf2",
44
+ "@instructure/quiz-common": "17.28.1-rc.0+1a117b107",
45
+ "@instructure/quiz-i18n": "17.28.1-rc.0+1a117b107",
46
+ "@instructure/quiz-interactions": "17.28.1-rc.0+1a117b107",
47
+ "@instructure/quiz-number-input": "17.28.1-rc.0+1a117b107",
48
+ "@instructure/quiz-rce": "17.28.1-rc.0+1a117b107",
49
49
  "@instructure/ui-a11y-content": "^7.11.0",
50
50
  "@instructure/ui-alerts": "^7.11.0",
51
51
  "@instructure/ui-avatar": "^7.11.0",
@@ -106,7 +106,7 @@
106
106
  "eventemitter3": "^3.1.0",
107
107
  "humps": "^2.0.0",
108
108
  "immutable": "^3.8.1",
109
- "instructure-validations": "17.27.1-rc.0+7e90f0bf2",
109
+ "instructure-validations": "17.28.1-rc.0+1a117b107",
110
110
  "ipaddr.js": "^1.5.4",
111
111
  "isomorphic-fetch": "^2.2.0",
112
112
  "isuuid": "^0.1.0",
@@ -137,7 +137,7 @@
137
137
  "uuid": "^3.2.1"
138
138
  },
139
139
  "devDependencies": {
140
- "@instructure/quiz-scripts": "17.27.1-rc.0+7e90f0bf2",
140
+ "@instructure/quiz-scripts": "17.28.1-rc.0+1a117b107",
141
141
  "@instructure/ui-axe-check": "^7.11.0",
142
142
  "@instructure/ui-babel-preset": "^7.11.0",
143
143
  "@instructure/ui-karma-config": "^7.11.0",
@@ -156,7 +156,7 @@
156
156
  "intl": "^1.2.4",
157
157
  "jquery": "^2.2.3",
158
158
  "most-subject": "^5.3.0",
159
- "quiz-presets": "17.27.1-rc.0+7e90f0bf2",
159
+ "quiz-presets": "17.28.1-rc.0+1a117b107",
160
160
  "react": "^16.8.6",
161
161
  "react-addons-test-utils": "^15.6.2",
162
162
  "react-dom": "^16.8.6",
@@ -172,5 +172,5 @@
172
172
  "publishConfig": {
173
173
  "access": "public"
174
174
  },
175
- "gitHead": "7e90f0bf2874da693ec833a5fbb66a56e899551a"
175
+ "gitHead": "1a117b1073c0a0065672ce1cffa15e15fa9f38f3"
176
176
  }