@instructure/quiz-core 20.38.0 → 21.0.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 (67) hide show
  1. package/es/banks/components/BankEntry/presenter.js +2 -2
  2. package/es/banks/components/BanksList/presenter.js +1 -1
  3. package/es/banks/components/CreateBankModal/presenter.js +22 -24
  4. package/es/banks/components/EditBankModal/presenter.js +24 -22
  5. package/es/banks/components/SharingModal/presenter.js +2 -6
  6. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +2 -2
  7. package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +2 -2
  8. package/es/common/components/ConfirmationModal/presenter.js +10 -7
  9. package/es/common/components/PrintFontSizeModal/presenter.js +2 -2
  10. package/es/common/components/SDKApp/index.js +4 -4
  11. package/es/common/components/layout/navbar/SecondaryNavBarButton/index.js +13 -32
  12. package/es/common/components/layout/navbar/index.js +0 -3
  13. package/es/common/components/resources/entry/EntrySave/presenter.js +2 -2
  14. package/es/common/components/resources/item/ItemEdit/presenter.js +0 -5
  15. package/es/common/components/resources/quiz/AddContent/Popover/presenter.js +0 -4
  16. package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
  17. package/es/common/components/resources/stimulus/Stimulus/presenter.js +11 -5
  18. package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +17 -9
  19. package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +2 -1
  20. package/es/common/components/resources/stimulus/StimulusShowInfo/index.js +7 -5
  21. package/es/common/components/shared/PaginatedCollection/presenter.js +2 -2
  22. package/es/common/components/shared/PrintTrigger/presenter.js +0 -5
  23. package/es/common/components/shared/TimeUnitsInput/index.js +2 -2
  24. package/es/common/components/shared/functionality/makeEditable.js +2 -2
  25. package/es/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +2 -2
  26. package/es/reporting/components/resources/OutcomeAnalysis/presenter.js +1 -11
  27. package/es/reporting/components/resources/QuizAndItemAnalysis/presenter.js +2 -2
  28. package/lib/banks/components/BankEntry/presenter.js +2 -2
  29. package/lib/banks/components/BanksList/presenter.js +1 -1
  30. package/lib/banks/components/CreateBankModal/presenter.js +23 -24
  31. package/lib/banks/components/EditBankModal/presenter.js +25 -22
  32. package/lib/banks/components/SharingModal/presenter.js +2 -6
  33. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +2 -2
  34. package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +2 -2
  35. package/lib/common/components/ConfirmationModal/presenter.js +10 -7
  36. package/lib/common/components/PrintFontSizeModal/presenter.js +2 -2
  37. package/lib/common/components/SDKApp/index.js +4 -4
  38. package/lib/common/components/layout/navbar/SecondaryNavBarButton/index.js +13 -32
  39. package/lib/common/components/layout/navbar/index.js +0 -3
  40. package/lib/common/components/resources/entry/EntrySave/presenter.js +2 -2
  41. package/lib/common/components/resources/item/ItemEdit/presenter.js +0 -5
  42. package/lib/common/components/resources/quiz/AddContent/Popover/presenter.js +0 -4
  43. package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
  44. package/lib/common/components/resources/stimulus/Stimulus/presenter.js +11 -5
  45. package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +17 -9
  46. package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +2 -1
  47. package/lib/common/components/resources/stimulus/StimulusShowInfo/index.js +7 -5
  48. package/lib/common/components/shared/PaginatedCollection/presenter.js +2 -2
  49. package/lib/common/components/shared/PrintTrigger/presenter.js +0 -5
  50. package/lib/common/components/shared/TimeUnitsInput/index.js +2 -2
  51. package/lib/common/components/shared/functionality/makeEditable.js +2 -2
  52. package/lib/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +2 -2
  53. package/lib/reporting/components/resources/OutcomeAnalysis/presenter.js +1 -11
  54. package/lib/reporting/components/resources/QuizAndItemAnalysis/presenter.js +2 -2
  55. package/package.json +78 -78
  56. package/es/banks/components/CreateBankModal/styles.js +0 -15
  57. package/es/banks/components/CreateBankModal/theme.js +0 -10
  58. package/es/banks/components/EditBankModal/styles.js +0 -12
  59. package/es/banks/components/EditBankModal/theme.js +0 -9
  60. package/es/common/components/layout/navbar/SecondaryNavBarButton/styles.js +0 -9
  61. package/es/common/components/layout/navbar/SecondaryNavBarButton/theme.js +0 -10
  62. package/lib/banks/components/CreateBankModal/styles.js +0 -22
  63. package/lib/banks/components/CreateBankModal/theme.js +0 -17
  64. package/lib/banks/components/EditBankModal/styles.js +0 -19
  65. package/lib/banks/components/EditBankModal/theme.js +0 -16
  66. package/lib/common/components/layout/navbar/SecondaryNavBarButton/styles.js +0 -16
  67. package/lib/common/components/layout/navbar/SecondaryNavBarButton/theme.js +0 -17
@@ -212,8 +212,8 @@ export var BankEntry = (_dec = withStyleOverrides(generateStyle, generateCompone
212
212
  this.props.setShouldClone(false);
213
213
  }
214
214
  }, {
215
- key: "componentWillMount",
216
- value: function componentWillMount() {
215
+ key: "UNSAFE_componentWillMount",
216
+ value: function UNSAFE_componentWillMount() {
217
217
  this.props.setShouldClone(false);
218
218
  }
219
219
  }, {
@@ -446,7 +446,7 @@ export var BanksList = (_dec = withStyleOverrides(generateStyle, generateCompone
446
446
  }, jsx(Table.Row, null, this.renderTableSortHeader('name', t('Name')), this.renderTableSortHeader('updated_at', t('Updated')), jsx(Table.ColHeader, {
447
447
  id: "header-num-questions",
448
448
  width: "1"
449
- }, t('Questions')), this.renderTableSortHeader('last_used', t('Last Used')), this.renderTableSortHeader('created_at', t('Created')), !this.props.isCompact && jsx(Table.ColHeader, {
449
+ }, t('Questions')), this.renderTableSortHeader('last_used', t('Last Used')), this.renderTableSortHeader('created_at', t('Created')), jsx(Table.ColHeader, {
450
450
  id: "header-option-links",
451
451
  width: "1"
452
452
  }, jsx(ScreenReaderContent, null, t('Bank option links'))))), jsx(Table.Body, null, (this.props.banks.toArray() || []).map(function (bank) {
@@ -2,9 +2,9 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- var _dec, _class, _CreateBankModal;
5
+ var _CreateBankModal;
6
6
  /** @jsx jsx */
7
- import { Component } from 'react';
7
+ import React, { Component } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { Button, CloseButton } from '@instructure/ui-buttons';
10
10
  import { Checkbox } from '@instructure/ui-checkbox';
@@ -14,19 +14,14 @@ import { jsx } from '@instructure/emotion';
14
14
  import t from '@instructure/quiz-i18n/es/format-message';
15
15
  import Bank from "../../../common/records/Bank.js";
16
16
  import { toErrors } from "../../../common/util/instUIMessages.js";
17
- import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN, withStyleOverrides } from '@instructure/quiz-common';
18
- import generateStyle from "./styles.js";
19
- import generateComponentTheme from "./theme.js";
20
- export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_CreateBankModal = /*#__PURE__*/function (_Component) {
17
+ import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
18
+ export var CreateBankModal = /*#__PURE__*/function (_Component) {
21
19
  _inherits(CreateBankModal, _Component);
22
20
  var _super = _createSuper(CreateBankModal);
23
- function CreateBankModal() {
21
+ function CreateBankModal(props) {
24
22
  var _this;
25
23
  _classCallCheck(this, CreateBankModal);
26
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27
- args[_key] = arguments[_key];
28
- }
29
- _this = _super.call.apply(_super, [this].concat(args));
24
+ _this = _super.call(this, props);
30
25
  _this.state = {
31
26
  shareWithCourse: false
32
27
  };
@@ -38,7 +33,8 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
38
33
  _this.props.onCreateBank();
39
34
  _this.closeAction();
40
35
  } else {
41
- _this.props.screenreaderNotification(t('Bank name cannot be blank.'));
36
+ var _this$bankNameInput$c;
37
+ (_this$bankNameInput$c = _this.bankNameInput.current) === null || _this$bankNameInput$c === void 0 ? void 0 : _this$bankNameInput$c.focus();
42
38
  }
43
39
  };
44
40
  _this.closeAction = function () {
@@ -68,6 +64,7 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
68
64
  shareWithCourse: event.target.checked
69
65
  });
70
66
  };
67
+ _this.bankNameInput = /*#__PURE__*/React.createRef();
71
68
  return _this;
72
69
  }
73
70
  _createClass(CreateBankModal, [{
@@ -92,17 +89,14 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
92
89
  }, {
93
90
  key: "renderContent",
94
91
  value: function renderContent() {
95
- return jsx("div", {
96
- css: this.props.styles.bankNameInput
97
- }, jsx(TextInput, {
92
+ return jsx("div", null, jsx(TextInput, {
98
93
  messages: this.getErrors(),
99
94
  onChange: this.onNameChange,
100
- renderLabel: jsx("div", {
101
- css: this.props.styles.bankNameLabel
102
- }, t('Bank Name')),
95
+ renderLabel: t('Bank Name'),
96
+ isRequired: true,
103
97
  type: "text",
104
- placeholder: t('Enter a name...'),
105
- "data-automation": "sdk-create-bank-name-textinput"
98
+ "data-automation": "sdk-create-bank-name-textinput",
99
+ ref: this.bankNameInput
106
100
  }), this.renderCheckbox());
107
101
  }
108
102
  }, {
@@ -134,7 +128,6 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
134
128
  label: t('Item Bank'),
135
129
  "data-automation": "sdk-create-bank-modal"
136
130
  }, jsx(ModalHeader, null, jsx(Heading, {
137
- level: "reset",
138
131
  as: "h2"
139
132
  }, t('New Item Bank')), jsx(CloseButton, {
140
133
  onClick: this.closeAction,
@@ -146,7 +139,11 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
146
139
  }]);
147
140
  CreateBankModal.displayName = "CreateBankModal";
148
141
  return CreateBankModal;
149
- }(Component), _CreateBankModal.displayName = 'CreateBankModal', _CreateBankModal.componentId = "Quizzes".concat(_CreateBankModal.displayName), _CreateBankModal.propTypes = {
142
+ }(Component);
143
+ _CreateBankModal = CreateBankModal;
144
+ CreateBankModal.displayName = 'CreateBankModal';
145
+ CreateBankModal.componentId = "Quizzes".concat(_CreateBankModal.displayName);
146
+ CreateBankModal.propTypes = {
150
147
  modalOpen: PropTypes.bool.isRequired,
151
148
  modalTrigger: PropTypes.instanceOf(Component),
152
149
  temporaryBank: PropTypes.instanceOf(Bank).isRequired,
@@ -169,11 +166,12 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
169
166
  root_account_name: PropTypes.string
170
167
  }),
171
168
  styles: PropTypes.object
172
- }, _CreateBankModal.defaultProps = {
169
+ };
170
+ CreateBankModal.defaultProps = {
173
171
  displayError: false,
174
172
  modalTrigger: null,
175
173
  showShareBankOnCreate: false,
176
174
  itemBanksScope: {},
177
175
  onCreateBank: function onCreateBank() {}
178
- }, _CreateBankModal)) || _class);
176
+ };
179
177
  export default CreateBankModal;
@@ -2,34 +2,32 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- var _dec, _class, _EditBankModal;
5
+ var _EditBankModal;
6
6
  /** @jsx jsx */
7
- import { Component } from 'react';
7
+ import React, { Component } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { Button, CloseButton } from '@instructure/ui-buttons';
10
10
  import { Heading } from '@instructure/ui-heading';
11
11
  import { jsx } from '@instructure/emotion';
12
12
  import t from '@instructure/quiz-i18n/es/format-message';
13
13
  import { toErrors } from "../../../common/util/instUIMessages.js";
14
- import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN, withStyleOverrides } from '@instructure/quiz-common';
14
+ import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
15
15
  import Bank from "../../../common/records/Bank.js";
16
- import generateStyle from "./styles.js";
17
- import generateComponentTheme from "./theme.js";
18
- export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_EditBankModal = /*#__PURE__*/function (_Component) {
16
+ export var EditBankModal = /*#__PURE__*/function (_Component) {
19
17
  _inherits(EditBankModal, _Component);
20
18
  var _super = _createSuper(EditBankModal);
21
- function EditBankModal() {
19
+ function EditBankModal(props) {
22
20
  var _this;
23
21
  _classCallCheck(this, EditBankModal);
24
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
25
- args[_key] = arguments[_key];
26
- }
27
- _this = _super.call.apply(_super, [this].concat(args));
22
+ _this = _super.call(this, props);
28
23
  _this.continueAction = function () {
29
24
  _this.props.showError(_this.props.errorKey);
30
25
  if (_this.props.workingBank.isValid()) {
31
26
  _this.props.updateBank(_this.props.workingBank);
32
27
  _this.closeAction();
28
+ } else {
29
+ var _this$bankNameInput$c;
30
+ (_this$bankNameInput$c = _this.bankNameInput.current) === null || _this$bankNameInput$c === void 0 ? void 0 : _this$bankNameInput$c.focus();
33
31
  }
34
32
  };
35
33
  _this.closeAction = function () {
@@ -51,6 +49,7 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
51
49
  return toErrors(_this.props.workingBank.errorsFor('title').toJS());
52
50
  }
53
51
  };
52
+ _this.bankNameInput = /*#__PURE__*/React.createRef();
54
53
  return _this;
55
54
  }
56
55
  _createClass(EditBankModal, [{
@@ -75,17 +74,16 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
75
74
  }, {
76
75
  key: "renderContent",
77
76
  value: function renderContent() {
78
- return jsx("div", {
79
- css: this.props.styles.bankNameInput
80
- }, jsx(TextInput, {
77
+ return jsx(TextInput, {
81
78
  value: this.props.workingBank.title,
82
79
  messages: this.getErrors(),
83
80
  onChange: this.onNameChange,
84
- renderLabel: jsx("div", null, t('Bank Name')),
81
+ renderLabel: t('Bank Name'),
85
82
  type: "text",
86
- placeholder: t('Enter a name...'),
87
- "data-automation": "sdk-edit-bank-name-textinput"
88
- }));
83
+ isRequired: true,
84
+ "data-automation": "sdk-edit-bank-name-textinput",
85
+ ref: this.bankNameInput
86
+ });
89
87
  }
90
88
  }, {
91
89
  key: "render",
@@ -97,7 +95,6 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
97
95
  label: t('Item Bank'),
98
96
  "data-automation": "sdk-edit-bank-modal"
99
97
  }, jsx(ModalHeader, null, jsx(Heading, {
100
- level: "reset",
101
98
  as: "h2"
102
99
  }, t('Edit Item Bank')), jsx(CloseButton, {
103
100
  onClick: this.closeAction,
@@ -109,7 +106,11 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
109
106
  }]);
110
107
  EditBankModal.displayName = "EditBankModal";
111
108
  return EditBankModal;
112
- }(Component), _EditBankModal.displayName = 'EditBankModal', _EditBankModal.componentId = "Quizzes".concat(_EditBankModal.displayName), _EditBankModal.propTypes = {
109
+ }(Component);
110
+ _EditBankModal = EditBankModal;
111
+ EditBankModal.displayName = 'EditBankModal';
112
+ EditBankModal.componentId = "Quizzes".concat(_EditBankModal.displayName);
113
+ EditBankModal.propTypes = {
113
114
  modalOpen: PropTypes.bool.isRequired,
114
115
  modalTrigger: PropTypes.instanceOf(Component),
115
116
  workingBank: PropTypes.instanceOf(Bank).isRequired,
@@ -122,8 +123,9 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
122
123
  hideError: PropTypes.func.isRequired,
123
124
  closeModal: PropTypes.func.isRequired,
124
125
  styles: PropTypes.object
125
- }, _EditBankModal.defaultProps = {
126
+ };
127
+ EditBankModal.defaultProps = {
126
128
  displayError: false,
127
129
  modalTrigger: null
128
- }, _EditBankModal)) || _class);
130
+ };
129
131
  export default EditBankModal;
@@ -22,7 +22,6 @@ import { Grid } from '@instructure/ui-grid';
22
22
  import { Tabs } from '@instructure/ui-tabs';
23
23
  import { Text } from '@instructure/ui-text';
24
24
  import { jsx } from '@instructure/emotion';
25
- import elementsForSelectors from "../../../common/util/ElementsForSelectors.js";
26
25
  import CustomPropTypes from "../../../common/util/CustomPropTypes.js";
27
26
  import ShareList from "./ShareList/index.js";
28
27
  import AsyncSearch from "../AsyncSearch/index.js";
@@ -54,9 +53,6 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
54
53
  };
55
54
  _this.shareListRef = null;
56
55
  _this.shareButtonRef = null;
57
- _this.applicationElement = function () {
58
- return elementsForSelectors(_this.props.appContainer);
59
- };
60
56
  // =============
61
57
  // LIFECYCLE
62
58
  // =============
@@ -333,8 +329,8 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
333
329
  });
334
330
  }
335
331
  }, {
336
- key: "componentWillReceiveProps",
337
- value: function componentWillReceiveProps(nextProps) {
332
+ key: "UNSAFE_componentWillReceiveProps",
333
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
338
334
  this.setState({
339
335
  accountPermission: nextProps.bank.accountPermission,
340
336
  shares: nextProps.sharedBanks
@@ -87,8 +87,8 @@ export var QuizEntryEditFooter = (_dec = withStyleOverrides(generateStyle, gener
87
87
  return _this;
88
88
  }
89
89
  _createClass(QuizEntryEditFooter, [{
90
- key: "componentWillReceiveProps",
91
- value: function componentWillReceiveProps(nextProps) {
90
+ key: "UNSAFE_componentWillReceiveProps",
91
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
92
92
  var points = this.getPoints(nextProps);
93
93
  this.setState({
94
94
  points: points,
@@ -276,8 +276,8 @@ var QuizEntryEdit = (_dec = withStyleOverrides(generateStyle, generateComponentT
276
276
  this.props.onEditQuizEntryToggle(this.props.quizEntry.id);
277
277
  }
278
278
  }, {
279
- key: "componentWillMount",
280
- value: function componentWillMount() {
279
+ key: "UNSAFE_componentWillMount",
280
+ value: function UNSAFE_componentWillMount() {
281
281
  this.props.setUi(SHOULD_CLONE_ITEM, false);
282
282
  }
283
283
  }, {
@@ -57,19 +57,20 @@ export var ConfirmationModal = /*#__PURE__*/function (_Component) {
57
57
  continueText = _this$props2.continueText,
58
58
  size = _this$props2.size,
59
59
  shouldReturnFocus = _this$props2.shouldReturnFocus,
60
- continueVariant = _this$props2.continueVariant;
60
+ continueVariant = _this$props2.continueVariant,
61
+ automationPrefix = _this$props2.automationPrefix;
61
62
  return /*#__PURE__*/React.createElement(ImportantModal, {
62
63
  open: this.props.modalOpen,
63
64
  size: size || 'small',
64
65
  label: title || t('Confirm'),
65
66
  onDismiss: this.cancelAction,
66
- "data-automation": "sdk-confirmation-modal",
67
+ "data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal") : 'sdk-confirmation-modal',
67
68
  shouldReturnFocus: shouldReturnFocus,
68
69
  onClose: this.doAction
69
70
  }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(Heading, {
70
71
  level: "reset",
71
72
  as: "h2",
72
- "data-automation": "sdk-confirmation-modal-heading"
73
+ "data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-heading") : 'sdk-confirmation-modal-heading'
73
74
  }, title || t('Confirm')), /*#__PURE__*/React.createElement(CloseButton, {
74
75
  onClick: this.cancelAction,
75
76
  placement: "end",
@@ -80,12 +81,12 @@ export var ConfirmationModal = /*#__PURE__*/function (_Component) {
80
81
  }, text || t('Are you sure?'))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
81
82
  onClick: this.cancelAction,
82
83
  margin: XSMALL_SIDE_MARGIN,
83
- "data-automation": "sdk-confirmation-modal-cancel"
84
+ "data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-cancel") : 'sdk-confirmation-modal-cancel'
84
85
  }, cancelText || t('Cancel')), /*#__PURE__*/React.createElement(Button, {
85
86
  color: continueVariant || 'primary',
86
87
  onClick: this.continueAction,
87
88
  margin: XSMALL_SIDE_MARGIN,
88
- "data-automation": "sdk-confirmation-modal-confirm"
89
+ "data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-confirm") : 'sdk-confirmation-modal-confirm'
89
90
  }, continueText || t('Confirm'))));
90
91
  }
91
92
  }]);
@@ -103,7 +104,8 @@ ConfirmationModal.propTypes = {
103
104
  size: PropTypes.string,
104
105
  shouldReturnFocus: PropTypes.bool,
105
106
  onContinue: PropTypes.func,
106
- onCancel: PropTypes.func
107
+ onCancel: PropTypes.func,
108
+ automationPrefix: PropTypes.string
107
109
  };
108
110
  ConfirmationModal.defaultProps = {
109
111
  title: null,
@@ -114,6 +116,7 @@ ConfirmationModal.defaultProps = {
114
116
  size: null,
115
117
  shouldReturnFocus: true,
116
118
  onContinue: null,
117
- onCancel: null
119
+ onCancel: null,
120
+ automationPrefix: null
118
121
  };
119
122
  export default ConfirmationModal;
@@ -85,8 +85,8 @@ export var PrintFontSizeModal = (_dec = withStyleOverrides(generateStyle, genera
85
85
  });
86
86
  }
87
87
  }, {
88
- key: "componentWillReceiveProps",
89
- value: function componentWillReceiveProps(nextProps) {
88
+ key: "UNSAFE_componentWillReceiveProps",
89
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
90
90
  this.setState({
91
91
  selectedFontSize: nextProps.persistedPrintFontSize || this.state.selectedFontSize,
92
92
  rememberTextSizeSetting: !!this.props.persistedPrintFontSize || this.state.rememberTextSizeSetting
@@ -65,8 +65,8 @@ export var SDKApp = (_dec = withStyleOverrides(generateStyle, null), _dec(_class
65
65
  return set('appContainer', selectors);
66
66
  }
67
67
  }, {
68
- key: "componentWillMount",
69
- value: function componentWillMount() {
68
+ key: "UNSAFE_componentWillMount",
69
+ value: function UNSAFE_componentWillMount() {
70
70
  var _this$props$rceConfig;
71
71
  this.store.dispatch([setAPIEndpoint(this.props.apiEndpoint), setCanvasOrigin((_this$props$rceConfig = this.props.rceConfig) === null || _this$props$rceConfig === void 0 ? void 0 : _this$props$rceConfig.canvasOrigin), this.setAppContainer(this.props.appContainer), setUserToken(this.props.userToken), setOutcomesEndpoint(this.props.outcomesEndpoint), setOutcomesToken(this.props.outcomesToken), setContextUuid(this.props.contextUuid), setExternalAccountUuid(this.props.externalAccountUuid)]);
72
72
  if (this.props.itemBankSharingEnabled) {
@@ -84,8 +84,8 @@ export var SDKApp = (_dec = withStyleOverrides(generateStyle, null), _dec(_class
84
84
  !this.props.disableAlertLiveRegion && renderAlerts(this.store);
85
85
  }
86
86
  }, {
87
- key: "componentWillReceiveProps",
88
- value: function componentWillReceiveProps(newProps) {
87
+ key: "UNSAFE_componentWillReceiveProps",
88
+ value: function UNSAFE_componentWillReceiveProps(newProps) {
89
89
  var _newProps$rceConfig, _this$props$rceConfig2;
90
90
  if (newProps.apiEndpoint !== this.props.apiEndpoint) {
91
91
  this.store.dispatch(setAPIEndpoint(newProps.apiEndpoint));
@@ -2,17 +2,14 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- var _dec, _class, _SecondaryNavBarButton;
5
+ var _SecondaryNavBarButton;
6
6
  /** @jsx jsx */
7
7
  import { Component } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { TopNavBar } from '@instructure/ui-top-nav-bar';
10
- import { InstUISettingsProvider, jsx } from '@instructure/emotion';
10
+ import { jsx } from '@instructure/emotion';
11
11
  import { omitProps } from '@instructure/ui-react-utils';
12
- import generateStyle from "./styles.js";
13
- import generateComponentTheme from "./theme.js";
14
- import { withStyleOverrides } from '@instructure/quiz-common';
15
- export var SecondaryNavBarButton = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_SecondaryNavBarButton = /*#__PURE__*/function (_Component) {
12
+ export var SecondaryNavBarButton = /*#__PURE__*/function (_Component) {
16
13
  _inherits(SecondaryNavBarButton, _Component);
17
14
  var _super = _createSuper(SecondaryNavBarButton);
18
15
  function SecondaryNavBarButton() {
@@ -20,37 +17,21 @@ export var SecondaryNavBarButton = (_dec = withStyleOverrides(generateStyle, gen
20
17
  return _super.apply(this, arguments);
21
18
  }
22
19
  _createClass(SecondaryNavBarButton, [{
23
- key: "componentDidMount",
24
- value: function componentDidMount() {
25
- this.props.makeStyles();
26
- }
27
- }, {
28
- key: "componentDidUpdate",
29
- value: function componentDidUpdate() {
30
- this.props.makeStyles();
31
- }
32
- }, {
33
20
  key: "render",
34
21
  value: function render() {
35
- return jsx(InstUISettingsProvider, {
36
- theme: {
37
- componentOverrides: {
38
- BaseButton: {
39
- primaryColor: this.props.styles.textColor,
40
- primaryBackground: this.props.styles.backgroundColor,
41
- primaryHoverBackground: this.props.styles.backgroundHoverColor,
42
- primaryBorderColor: this.props.styles.borderColor
43
- }
44
- }
45
- }
46
- }, jsx(TopNavBar.Item, omitProps(this.props, this.constructor.propTypes), this.props.children));
22
+ return jsx(TopNavBar.Item, Object.assign({
23
+ color: "secondary"
24
+ }, omitProps(this.props, this.constructor.propTypes)), this.props.children);
47
25
  }
48
26
  }]);
49
27
  SecondaryNavBarButton.displayName = "SecondaryNavBarButton";
50
28
  return SecondaryNavBarButton;
51
- }(Component), _SecondaryNavBarButton.displayName = 'TopNavBarItem', _SecondaryNavBarButton.componentId = "Quizzes".concat(_SecondaryNavBarButton.displayName), _SecondaryNavBarButton.propTypes = {
29
+ }(Component);
30
+ _SecondaryNavBarButton = SecondaryNavBarButton;
31
+ SecondaryNavBarButton.displayName = 'TopNavBarItem';
32
+ SecondaryNavBarButton.componentId = "Quizzes".concat(_SecondaryNavBarButton.displayName);
33
+ SecondaryNavBarButton.propTypes = {
52
34
  children: PropTypes.string.isRequired,
53
- styles: PropTypes.object,
54
- makeStyles: PropTypes.func
55
- }, _SecondaryNavBarButton)) || _class);
35
+ styles: PropTypes.object
36
+ };
56
37
  export default SecondaryNavBarButton;
@@ -93,9 +93,6 @@ export var NavBar = (_dec = withStyleOverrides(generateStyle, generateComponentT
93
93
  desktopBottomBorderInverse: false
94
94
  } : {}),
95
95
  navLabel: t('Quizzes navigation bar'),
96
- desktopConfig: {
97
- hideActionsUserSeparator: true
98
- },
99
96
  smallViewportConfig: {
100
97
  dropdownMenuToggleButtonLabel: t('Toggle Menu'),
101
98
  dropdownMenuLabel: t('Main Menu')
@@ -85,8 +85,8 @@ export var EntrySave = /*#__PURE__*/function (_Component) {
85
85
  return _this;
86
86
  }
87
87
  _createClass(EntrySave, [{
88
- key: "componentWillMount",
89
- value: function componentWillMount() {
88
+ key: "UNSAFE_componentWillMount",
89
+ value: function UNSAFE_componentWillMount() {
90
90
  this.props.switchOnEditing(this.props.initialFocusId);
91
91
  }
92
92
  }, {
@@ -13,7 +13,6 @@ import componentForItem from "../../../../util/componentForItem.js";
13
13
  import { liveRegion, COMPONENT_EDIT, FormFieldGroup } from '@instructure/quiz-common';
14
14
  import t from '@instructure/quiz-i18n/es/format-message';
15
15
  import { propsForInteractionEdit } from "../../../../util/interactionTypePropsHelper.js";
16
- import elementsForSelectors from "../../../../../common/util/ElementsForSelectors.js";
17
16
  import { toErrors } from "../../../../util/instUIMessages.js";
18
17
  export var ItemEdit = /*#__PURE__*/function (_Component) {
19
18
  _inherits(ItemEdit, _Component);
@@ -32,9 +31,6 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
32
31
  }
33
32
  return null;
34
33
  };
35
- _this.applicationElement = function () {
36
- return elementsForSelectors(_this.props.appContainer);
37
- };
38
34
  _this.onModalOpen = function () {
39
35
  _this.props.occludeQuizEntries(true);
40
36
  };
@@ -97,7 +93,6 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
97
93
  component: /*#__PURE__*/React.createElement(OutcomeAlignments, Object.assign({
98
94
  artifactType: "quizEntry",
99
95
  artifactId: itemId,
100
- applicationElement: this.applicationElement,
101
96
  alignmentSetId: outcomeAlignmentSetGuid,
102
97
  contextUuid: this.props.contextUuid
103
98
  }, launchContexts.length > 0 && {
@@ -9,7 +9,6 @@ import PropTypes from 'prop-types';
9
9
  import { Popover } from '@instructure/ui-popover';
10
10
  import { jsx } from '@instructure/emotion';
11
11
  import CustomPropTypes from "../../../../../util/CustomPropTypes.js";
12
- import elementsForSelectors from "../../../../../util/ElementsForSelectors.js";
13
12
  import { onPhone, onTablet } from "../../../../../util/windowChecks.js";
14
13
  import AddContentButton from "../Button/index.js";
15
14
  import AddContentBody from "../Body/index.js";
@@ -26,9 +25,6 @@ export var AddContentPopover = (_dec = withStyleOverrides(generateStyle, generat
26
25
  args[_key] = arguments[_key];
27
26
  }
28
27
  _this = _super.call.apply(_super, [this].concat(args));
29
- _this.applicationElement = function () {
30
- return elementsForSelectors(_this.props.appContainer);
31
- };
32
28
  _this.showContent = function () {
33
29
  _this.props.switchOnEditing();
34
30
  };
@@ -108,7 +108,7 @@ export var SessionItemResult = (_dec = withStyleOverrides(generateStyle, generat
108
108
  size: "small",
109
109
  margin: "small"
110
110
  }, jsx(Text, {
111
- color: "warning"
111
+ color: "alert"
112
112
  }, t("Regrade score { possible, plural,\n one {{points, number} / # point}\n other {{points, number} / # points}\n }", {
113
113
  points: this.props.sessionItemResult.regradeInfo.get('newScore') || 0,
114
114
  possible: this.props.sessionItemResult.regradeInfo.get('newPointsPossible')
@@ -67,6 +67,11 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
67
67
  lockBlueprintContentEnabled = _this$props2.lockBlueprintContentEnabled;
68
68
  return lockBlueprintContentEnabled && isContentLockedByBlueprint;
69
69
  }
70
+ }, {
71
+ key: "isPassage",
72
+ value: function isPassage() {
73
+ return this.props.stimulus.passage;
74
+ }
70
75
  }, {
71
76
  key: "renderChildQuizEntries",
72
77
  value: function renderChildQuizEntries() {
@@ -94,9 +99,10 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
94
99
  key: "renderStimulusPanel",
95
100
  value: function renderStimulusPanel() {
96
101
  var StimulusComponent = this.props.isEditing ? StimulusEdit : StimulusShow;
102
+ var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
97
103
  var connectDragPreview = this.props.connectDragPreview;
98
104
  return connectDragPreview(jsx("div", {
99
- "data-automation": "sdk-stimulus-LeftPanelShow"
105
+ "data-automation": "sdk-".concat(automationPrefix, "-LeftPanelShow")
100
106
  }, jsx(StimulusComponent, {
101
107
  bankEntryWarningWrapperProps: this.props.bankEntryWarningWrapperProps,
102
108
  connectDragSource: this.props.connectDragSource,
@@ -121,18 +127,18 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
121
127
  }, {
122
128
  key: "renderPanels",
123
129
  value: function renderPanels(propsForDnDZone) {
124
- var isPassage = this.props.stimulus.passage;
130
+ var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
125
131
  return jsx("div", {
126
132
  css: this.props.styles.stimulus,
127
133
  ref: this.props.dndRef,
128
- "data-automation": "sdk-stimulus"
134
+ "data-automation": "sdk-".concat(automationPrefix)
129
135
  }, jsx("div", {
130
136
  css: this.props.styles.leftPanel
131
137
  }, this.renderStimulusPanel()), jsx("div", {
132
138
  css: this.props.styles.itemPanel
133
- }, jsx("div", null), this.renderChildQuizEntries(), !isPassage && jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
139
+ }, jsx("div", null), this.renderChildQuizEntries(), !this.isPassage() && jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
134
140
  location: "in"
135
- })), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && !isPassage && jsx(AddContentPopover, {
141
+ })), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && !this.isPassage() && jsx(AddContentPopover, {
136
142
  allowStimulusCreation: false,
137
143
  stimulusId: this.props.stimulus.id,
138
144
  parentEntryId: this.props.quizEntry.id,