@instructure/quiz-core 20.11.3-rc.8 → 20.11.3

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 (160) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/es/banks/components/Bank/presenter.js +15 -7
  3. package/es/banks/components/BankEntry/presenter.js +5 -2
  4. package/es/banks/components/Banks/index.js +1 -1
  5. package/es/banks/components/Banks/presenter.js +0 -6
  6. package/es/banks/components/CreateBankModal/presenter.js +3 -1
  7. package/es/banks/components/HeaderMenu/presenter.js +40 -1
  8. package/es/banks/components/HeaderMenu/styles.js +3 -0
  9. package/es/banks/components/NavWrapper/presenter.js +6 -1
  10. package/es/banks/components/SharingModal/presenter.js +1 -1
  11. package/es/building/components/resources/BanksTray/presenter.js +5 -2
  12. package/es/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
  13. package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +23 -29
  14. package/es/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +39 -0
  15. package/es/building/components/resources/quizEntry/QuizEntry/styles.js +23 -0
  16. package/es/building/components/resources/quizEntry/QuizEntry/theme.js +4 -2
  17. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +35 -43
  18. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/styles.js +30 -0
  19. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +4 -2
  20. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +25 -31
  21. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/styles.js +19 -0
  22. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +4 -2
  23. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +27 -33
  24. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +28 -0
  25. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/theme.js +4 -2
  26. package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +32 -37
  27. package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +49 -0
  28. package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +4 -2
  29. package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +23 -23
  30. package/es/building/components/resources/quizEntry/QuizEntryEdit/styles.js +21 -0
  31. package/es/building/components/resources/quizEntry/QuizEntryEdit/theme.js +4 -2
  32. package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +36 -50
  33. package/es/building/components/resources/quizEntry/QuizEntryShow/styles.js +84 -0
  34. package/es/building/components/resources/quizEntry/QuizEntryShow/theme.js +4 -2
  35. package/es/common/actions/outcomes.js +7 -1
  36. package/es/common/components/SDKApp/index.js +8 -2
  37. package/es/common/components/layout/navbar/SecondaryNavBarButton/index.js +1 -1
  38. package/es/common/components/layout/navbar/index.js +135 -38
  39. package/es/common/components/resources/item/ItemEdit/index.js +5 -2
  40. package/es/common/components/resources/item/ItemEdit/presenter.js +45 -8
  41. package/es/common/components/resources/stimulus/Stimulus/presenter.js +40 -50
  42. package/es/common/components/resources/stimulus/Stimulus/styles.js +58 -0
  43. package/es/common/components/resources/stimulus/Stimulus/theme.js +4 -2
  44. package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +37 -46
  45. package/es/common/components/resources/stimulus/StimulusEdit/styles.js +46 -0
  46. package/es/common/components/resources/stimulus/StimulusEdit/theme.js +4 -2
  47. package/es/common/components/shared/overlayEmotion/index.js +1 -1
  48. package/es/common/components/shared/return_button/ReturnButton.js +4 -1
  49. package/es/common/reducers/outcomes.js +6 -2
  50. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +43 -43
  51. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +41 -0
  52. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +6 -3
  53. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +20 -26
  54. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/styles.js +19 -0
  55. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/theme.js +4 -2
  56. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +45 -47
  57. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +52 -0
  58. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/theme.js +4 -2
  59. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +2 -2
  60. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -2
  61. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +2 -2
  62. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +32 -26
  63. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +14 -0
  64. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +4 -2
  65. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +38 -53
  66. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/styles.js +141 -0
  67. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +10 -7
  68. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +80 -61
  69. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +93 -0
  70. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +8 -5
  71. package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +31 -26
  72. package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/styles.js +15 -0
  73. package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/theme.js +4 -2
  74. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +80 -79
  75. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +75 -0
  76. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +4 -2
  77. package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +47 -49
  78. package/es/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +14 -0
  79. package/es/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +4 -2
  80. package/lib/banks/components/Bank/presenter.js +13 -6
  81. package/lib/banks/components/BankEntry/presenter.js +5 -2
  82. package/lib/banks/components/Banks/index.js +1 -1
  83. package/lib/banks/components/Banks/presenter.js +0 -6
  84. package/lib/banks/components/CreateBankModal/presenter.js +3 -1
  85. package/lib/banks/components/HeaderMenu/presenter.js +42 -1
  86. package/lib/banks/components/HeaderMenu/styles.js +3 -0
  87. package/lib/banks/components/NavWrapper/presenter.js +6 -1
  88. package/lib/banks/components/SharingModal/presenter.js +1 -1
  89. package/lib/building/components/resources/BanksTray/presenter.js +5 -2
  90. package/lib/building/components/resources/quizEntry/QuizEntry/index.js +3 -1
  91. package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +22 -30
  92. package/lib/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +51 -0
  93. package/lib/building/components/resources/quizEntry/QuizEntry/styles.js +33 -0
  94. package/lib/building/components/resources/quizEntry/QuizEntry/theme.js +6 -3
  95. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +34 -45
  96. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/styles.js +38 -0
  97. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +6 -3
  98. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +24 -33
  99. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/styles.js +27 -0
  100. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +6 -3
  101. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +26 -35
  102. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +38 -0
  103. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/theme.js +6 -3
  104. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +30 -38
  105. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +57 -0
  106. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +6 -3
  107. package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +20 -22
  108. package/lib/building/components/resources/quizEntry/QuizEntryEdit/styles.js +29 -0
  109. package/lib/building/components/resources/quizEntry/QuizEntryEdit/theme.js +6 -3
  110. package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +36 -53
  111. package/lib/building/components/resources/quizEntry/QuizEntryShow/styles.js +95 -0
  112. package/lib/building/components/resources/quizEntry/QuizEntryShow/theme.js +6 -3
  113. package/lib/common/actions/outcomes.js +8 -0
  114. package/lib/common/components/SDKApp/index.js +7 -1
  115. package/lib/common/components/layout/navbar/SecondaryNavBarButton/index.js +1 -1
  116. package/lib/common/components/layout/navbar/index.js +130 -39
  117. package/lib/common/components/resources/item/ItemEdit/index.js +5 -2
  118. package/lib/common/components/resources/item/ItemEdit/presenter.js +46 -8
  119. package/lib/common/components/resources/stimulus/Stimulus/presenter.js +38 -52
  120. package/lib/common/components/resources/stimulus/Stimulus/styles.js +70 -0
  121. package/lib/common/components/resources/stimulus/Stimulus/theme.js +6 -3
  122. package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +36 -47
  123. package/lib/common/components/resources/stimulus/StimulusEdit/styles.js +54 -0
  124. package/lib/common/components/resources/stimulus/StimulusEdit/theme.js +6 -3
  125. package/lib/common/components/shared/overlayEmotion/index.js +1 -1
  126. package/lib/common/components/shared/return_button/ReturnButton.js +4 -1
  127. package/lib/common/reducers/outcomes.js +5 -1
  128. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +42 -47
  129. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +51 -0
  130. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +8 -4
  131. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +19 -28
  132. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/styles.js +27 -0
  133. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/theme.js +6 -3
  134. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +45 -52
  135. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +62 -0
  136. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/theme.js +6 -3
  137. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +2 -2
  138. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -2
  139. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +2 -2
  140. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +28 -26
  141. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +24 -0
  142. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +6 -3
  143. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +37 -55
  144. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/styles.js +149 -0
  145. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +12 -8
  146. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +81 -65
  147. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +103 -0
  148. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +10 -6
  149. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +30 -28
  150. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/styles.js +23 -0
  151. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/theme.js +6 -3
  152. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +82 -84
  153. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +85 -0
  154. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +6 -3
  155. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +43 -48
  156. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +22 -0
  157. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +6 -3
  158. package/package.json +11 -11
  159. package/es/common/components/layout/navbar/presenter.js +0 -120
  160. package/lib/common/components/layout/navbar/presenter.js +0 -140
@@ -22,7 +22,7 @@ import { getLocale } from '@instructure/quiz-common';
22
22
  import { set } from "../../actions/ui.js";
23
23
  import { addAlert } from "../../actions/alerts.js";
24
24
  import { setAPIEndpoint, setCanvasOrigin, setUserToken } from "../../actions/config.js";
25
- import { setContextUuid, setOutcomesEndpoint, setOutcomesToken } from "../../actions/outcomes.js";
25
+ import { setContextUuid, setOutcomesEndpoint, setOutcomesToken, setExternalAccountUuid } from "../../actions/outcomes.js";
26
26
  import { addFeatures, removeFeatures } from "../../actions/features.js";
27
27
  import { setGradeByQuestionEnabled } from "../../actions/grading.js";
28
28
  import { renderAlerts } from "../../util/renderAlerts.js";
@@ -81,7 +81,7 @@ export var SDKApp = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp
81
81
  value: function componentWillMount() {
82
82
  var _this$props$rceConfig;
83
83
 
84
- 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)]);
84
+ 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)]);
85
85
 
86
86
  if (this.props.itemBankSharingEnabled) {
87
87
  this.store.dispatch(addFeatures('item_bank_sharing'));
@@ -139,6 +139,10 @@ export var SDKApp = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp
139
139
  if (newProps.gradeByQuestionEnabled !== this.props.gradeByQuestionEnabled && this.props.gradeByQuestionEnabled !== null) {
140
140
  this.store.dispatch(setGradeByQuestionEnabled(newProps.gradeByQuestionEnabled));
141
141
  }
142
+
143
+ if (newProps.externalAccountUuid !== this.props.externalAccountUuid) {
144
+ this.store.dispatch(setExternalAccountUuid(newProps.externalAccountUuid));
145
+ }
142
146
  }
143
147
  }, {
144
148
  key: "render",
@@ -167,6 +171,7 @@ export var SDKApp = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp
167
171
  appContainer: CustomPropTypes.selectors.isRequired,
168
172
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
169
173
  contextUuid: PropTypes.string,
174
+ externalAccountUuid: PropTypes.string,
170
175
  gradeByQuestionEnabled: PropTypes.bool,
171
176
  itemBankSharingEnabled: PropTypes.bool,
172
177
  // ESLint seems to this the "locale" prop is unused even though it definitely is
@@ -196,6 +201,7 @@ export var SDKApp = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp
196
201
  locale: PropTypes.string
197
202
  }, _class2.defaultProps = {
198
203
  contextUuid: '',
204
+ externalAccountUuid: '',
199
205
  gradeByQuestionEnabled: null,
200
206
  itemBankSharingEnabled: false,
201
207
  locale: null,
@@ -54,7 +54,7 @@ export var SecondaryNavBarButton = (_dec = withStyle(generateStyle, generateComp
54
54
 
55
55
  SecondaryNavBarButton.displayName = "SecondaryNavBarButton";
56
56
  return SecondaryNavBarButton;
57
- }(Component), _class2.propTypes = {
57
+ }(Component), _class2.displayName = 'TopNavBarItem', _class2.propTypes = {
58
58
  children: PropTypes.string.isRequired,
59
59
  styles: PropTypes.object,
60
60
  makeStyles: PropTypes.func
@@ -1,39 +1,136 @@
1
- import { bindActionCreators } from 'redux';
2
- import partial from 'lodash/partial';
3
- import { connect } from "../../../../common/react-redux.js";
4
- import * as modalActions from "../../../../common/actions/modal.js";
5
- import { set as setUI } from "../../../../common/actions/ui.js";
6
- import { BUILD_TRAY_OPEN, BUILD_TRAY_BUTTON_REF } from '@instructure/quiz-common';
7
- import { generateImportModalId } from "../../ImportModal/index.js";
8
- import { NavBar as NavBarPresenter } from "./presenter.js";
9
- import { getActiveQuiz } from "../../../selectors/quizzes.js";
10
- import { featureOn } from "../../../util/featureCheck.js";
11
- import { startQuizExportJob } from "../../../actions/quizExport.js";
12
- import { addAlert, addInfo } from "../../../actions/alerts.js";
13
- export function mapStateToProps(state) {
14
- var quiz = getActiveQuiz(state);
15
- return {
16
- activeQuizId: quiz.id,
17
- canExport: !state.getIn(['quizExport', "activeQuiz".concat(quiz.id)]),
18
- canImport: quiz.canImport(),
19
- hasQuestions: quiz.hasQuestions(),
20
- isEditing: state.get('editing') && state.get('editing').some(function (elem) {
21
- return elem;
22
- }),
23
- printingEnabled: featureOn('printing')
24
- };
25
- }
26
-
27
- var mapDispatchToProps = function mapDispatchToProps(dispatch) {
28
- return {
29
- addAlert: bindActionCreators(addAlert, dispatch),
30
- addInfo: bindActionCreators(addInfo, dispatch),
31
- openBanksTray: bindActionCreators(setUI.bind(void 0, BUILD_TRAY_OPEN, true), dispatch),
32
- setBanksTrayButtonRef: bindActionCreators(partial(setUI, BUILD_TRAY_BUTTON_REF), dispatch),
33
- startExport: bindActionCreators(startQuizExportJob, dispatch),
34
- openModal: bindActionCreators(modalActions.openModal.bind(modalActions, generateImportModalId('qtiImport')), dispatch)
35
- };
36
- };
37
-
38
- export var NavBar = connect(mapStateToProps, mapDispatchToProps)(NavBarPresenter);
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+
7
+ var _dec, _class, _class2, _temp;
8
+
9
+ /** @jsx jsx */
10
+ import { Component } from 'react';
11
+ import PropTypes from 'prop-types';
12
+ import { TopNavBar } from '@instructure/ui-top-nav-bar';
13
+ import { IconQuizLine } from '@instructure/ui-icons';
14
+ import t from '@instructure/quiz-i18n/es/format-message';
15
+ import { withStyle, jsx } from '@instructure/emotion';
16
+ import generateStyle from "./styles.js";
17
+ import generateComponentTheme from "./theme.js";
18
+
19
+ var _ref = jsx(IconQuizLine, {
20
+ color: "primary",
21
+ size: "small"
22
+ });
23
+
24
+ export var NavBar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
25
+ _inherits(NavBar, _Component);
26
+
27
+ var _super = _createSuper(NavBar);
28
+
29
+ function NavBar() {
30
+ var _this;
31
+
32
+ _classCallCheck(this, NavBar);
33
+
34
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
35
+ args[_key] = arguments[_key];
36
+ }
37
+
38
+ _this = _super.call.apply(_super, [this].concat(args));
39
+
40
+ _this.hiddenActionItemsMenuTriggerLabel = function (hiddenChildrenCount) {
41
+ return t('{hiddenChildrenCount} more actions', {
42
+ hiddenChildrenCount: hiddenChildrenCount
43
+ });
44
+ };
45
+
46
+ _this.hiddenMenuItemsMenuTriggerLabel = function (hiddenChildrenCount) {
47
+ return t('{hiddenChildrenCount} More', {
48
+ hiddenChildrenCount: hiddenChildrenCount
49
+ });
50
+ };
51
+
52
+ _this.renderBrand = function () {
53
+ return jsx(TopNavBar.Brand, {
54
+ screenReaderLabel: t('Quizzes'),
55
+ renderIcon: _ref
56
+ });
57
+ };
58
+
59
+ _this.renderMenuItems = function () {
60
+ return jsx(TopNavBar.MenuItems, {
61
+ listLabel: t('Page navigation'),
62
+ currentPageId: window.location.pathname,
63
+ renderHiddenItemsMenuTriggerLabel: _this.hiddenMenuItemsMenuTriggerLabel
64
+ }, _this.props.menuItems.map(function (menuItem) {
65
+ return _this.renderMenuItem(menuItem);
66
+ }));
67
+ };
68
+
69
+ _this.renderMenuItem = function (menuItem) {
70
+ return jsx(TopNavBar.Item, {
71
+ id: menuItem.path,
72
+ key: menuItem.path,
73
+ onClick: function onClick() {
74
+ return _this.props.handleMenuItemChange(menuItem.path);
75
+ } // eslint-disable-line react/jsx-no-bind
76
+
77
+ }, menuItem.text);
78
+ };
79
+
80
+ _this.renderActionItems = function () {
81
+ return jsx(TopNavBar.ActionItems, {
82
+ listLabel: t('Actions'),
83
+ renderHiddenItemsMenuTriggerLabel: _this.hiddenActionItemsMenuTriggerLabel
84
+ }, _toConsumableArray(_this.props.actionItems));
85
+ };
86
+
87
+ return _this;
88
+ }
89
+
90
+ _createClass(NavBar, [{
91
+ key: "render",
92
+ value: function render() {
93
+ var _this2 = this;
94
+
95
+ return jsx(TopNavBar, {
96
+ breakpoint: this.props.styles.phoneBreakPoint,
97
+ mediaQueryMatch: "element",
98
+ inverseColor: true
99
+ }, function () {
100
+ return jsx(TopNavBar.Layout, {
101
+ themeOverride: {
102
+ desktopBackgroundInverse: _this2.props.styles.backgroundColor,
103
+ smallViewportBackgroundInverse: _this2.props.styles.backgroundColor
104
+ },
105
+ navLabel: t('Quizzes navigation bar'),
106
+ desktopConfig: {
107
+ hideActionsUserSeparator: true
108
+ },
109
+ smallViewportConfig: {
110
+ dropdownMenuToggleButtonLabel: t('Toggle Menu'),
111
+ dropdownMenuLabel: t('Main Menu')
112
+ },
113
+ renderBrand: _this2.renderBrand(),
114
+ renderMenuItems: _this2.renderMenuItems(),
115
+ renderActionItems: _this2.renderActionItems()
116
+ });
117
+ });
118
+ }
119
+ }]);
120
+
121
+ NavBar.displayName = "NavBar";
122
+ return NavBar;
123
+ }(Component), _class2.propTypes = {
124
+ menuItems: PropTypes.arrayOf(PropTypes.shape({
125
+ path: PropTypes.string.isRequired,
126
+ text: PropTypes.string.isRequired
127
+ })),
128
+ handleMenuItemChange: PropTypes.func,
129
+ actionItems: PropTypes.arrayOf(PropTypes.node),
130
+ styles: PropTypes.object
131
+ }, _class2.defaultProps = {
132
+ menuItems: [],
133
+ handleMenuItemChange: function handleMenuItemChange() {},
134
+ actionItems: []
135
+ }, _temp)) || _class);
39
136
  export default NavBar;
@@ -19,7 +19,8 @@ export function mapStateToProps(state, props) {
19
19
  var workingItem = props.entry.getWorkingInstance();
20
20
  var isValid = workingItem.isValid();
21
21
  var errorsShowing = state.get('errorsShowing', Map());
22
- var errorsAreShowing = errorsShowing.get(props.guid);
22
+ var errorsAreShowing = errorsShowing.get(props.guid); // Null must always be passed to contextUuid when working with banks
23
+
23
24
  var contextUuid = props.contextUuid === void 0 ? state.getIn(['outcomes', 'contextUuid']) : props.contextUuid;
24
25
  return {
25
26
  answerFeedbackEnabled: featureOn('answer_level_feedback'),
@@ -37,7 +38,9 @@ export function mapStateToProps(state, props) {
37
38
  partialDeepScoringEnabled: featureOn('partial_deep_scoring'),
38
39
  partialScoringEnabled: featureOn('partial_scoring'),
39
40
  quizId: getActiveQuizId(state),
40
- showCalculator: featureOn('calculator_per_question')
41
+ showCalculator: featureOn('calculator_per_question'),
42
+ scope: props.scope,
43
+ rootAccountUuid: state.getIn(['outcomes', 'externalAccountUuid'])
41
44
  };
42
45
  }
43
46
 
@@ -16,6 +16,7 @@ import t from '@instructure/quiz-i18n/es/format-message';
16
16
  import { propsForInteractionEdit } from "../../../../util/interactionTypePropsHelper.js";
17
17
  import elementsForSelectors from "../../../../../common/util/ElementsForSelectors.js";
18
18
  import { toErrors } from "../../../../util/instUIMessages.js";
19
+ import { featureOn } from "../../../../../common/util/featureCheck.js";
19
20
  export var ItemEdit = /*#__PURE__*/function (_Component) {
20
21
  _inherits(ItemEdit, _Component);
21
22
 
@@ -73,27 +74,53 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
73
74
  workingItem = _this$props.workingItem;
74
75
  var itemId = guid || workingItem.get('id');
75
76
  var outcomeAlignmentSetGuid = workingItem.get('outcomeAlignmentSetGuid');
77
+ var launchContexts = [];
78
+ var rootAccountName = this.props.scope.root_account_name;
79
+ var launchContextUuid = this.props.scope.launch_context_uuid;
80
+ var launchContextTitle = this.props.scope.title; // If editing within a quiz, there is no account launch context
81
+
82
+ if (featureOn('sub_account_bank_sharing') && rootAccountName) {
83
+ launchContexts.push({
84
+ uuid: this.props.rootAccountUuid,
85
+ name: rootAccountName
86
+ }); // Add if it is a course or sub-account launch context
87
+
88
+ if (launchContextUuid && launchContextUuid !== this.props.rootAccountUuid) {
89
+ launchContexts.push({
90
+ uuid: launchContextUuid,
91
+ name: launchContextTitle
92
+ });
93
+ }
94
+ }
95
+
76
96
  var options = [];
77
97
 
78
98
  if (this.props.outcomesEndpoint) {
79
99
  options.push({
80
100
  key: 'outcomes',
81
- title: /*#__PURE__*/React.createElement("span", null, t('Align to Outcomes'), " ", /*#__PURE__*/React.createElement(OutcomeCount, {
101
+ title: /*#__PURE__*/React.createElement("span", null, t('Align to Outcomes'), /*#__PURE__*/React.createElement(OutcomeCount, Object.assign({
82
102
  alignmentSetId: outcomeAlignmentSetGuid,
83
103
  artifactType: "quizEntry",
84
104
  artifactId: itemId,
85
- contextUuid: this.props.contextUuid,
105
+ contextUuid: this.props.contextUuid // Both components need to be aware of the launch contexts
106
+
107
+ }, launchContexts.length > 0 && {
108
+ launchContexts: launchContexts
109
+ }, {
86
110
  host: this.props.outcomesEndpoint,
87
111
  jwt: this.props.outcomesToken,
88
112
  screenreaderNotification: this.props.screenreaderNotification,
89
113
  liveRegion: liveRegion
90
- })),
91
- component: /*#__PURE__*/React.createElement(OutcomeAlignments, {
114
+ }))),
115
+ component: /*#__PURE__*/React.createElement(OutcomeAlignments, Object.assign({
92
116
  artifactType: "quizEntry",
93
117
  artifactId: itemId,
94
118
  applicationElement: this.applicationElement,
95
119
  alignmentSetId: outcomeAlignmentSetGuid,
96
- contextUuid: this.props.contextUuid,
120
+ contextUuid: this.props.contextUuid
121
+ }, launchContexts.length > 0 && {
122
+ launchContexts: launchContexts
123
+ }, {
97
124
  emptySetHeading: t('Align Institution outcomes to this question.'),
98
125
  host: this.props.outcomesEndpoint,
99
126
  jwt: this.props.outcomesToken,
@@ -102,7 +129,7 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
102
129
  onUpdate: this.onOutcomeAlignmentSetChange,
103
130
  screenreaderNotification: this.props.screenreaderNotification,
104
131
  liveRegion: liveRegion
105
- })
132
+ }))
106
133
  });
107
134
  }
108
135
 
@@ -171,7 +198,15 @@ ItemEdit.propTypes = {
171
198
  validationErrorsFromApi: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.shape({
172
199
  type: PropTypes.string,
173
200
  text: PropTypes.string
174
- })))
201
+ }))),
202
+ scope: PropTypes.shape({
203
+ type: PropTypes.string,
204
+ uuid: PropTypes.string,
205
+ title: PropTypes.string,
206
+ launch_context_uuid: PropTypes.string,
207
+ root_account_name: PropTypes.string
208
+ }),
209
+ rootAccountUuid: PropTypes.string
175
210
  };
176
211
  ItemEdit.defaultProps = {
177
212
  additionalOptions: [],
@@ -186,6 +221,8 @@ ItemEdit.defaultProps = {
186
221
  quizId: null,
187
222
  initialFocusId: null,
188
223
  showCalculator: false,
189
- validationErrorsFromApi: {}
224
+ validationErrorsFromApi: {},
225
+ scope: {},
226
+ rootAccountUuid: null
190
227
  };
191
228
  export default ItemEdit;
@@ -1,4 +1,3 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
@@ -6,37 +5,24 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
5
 
7
6
  var _dec, _class, _class2, _temp;
8
7
 
9
- import React, { Component } from 'react';
8
+ /** @jsx jsx */
9
+ import { Component } from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import { DragSource } from 'react-dnd';
12
12
  import { List, Map } from 'immutable';
13
- import classnames from 'classnames';
14
13
  import ImmutablePropTypes from 'react-immutable-proptypes';
15
- import { themeable } from '@instructure/ui-themeable';
14
+ import { withStyle, jsx } from '@instructure/emotion';
16
15
  import AddContentPopover from "../../quiz/AddContent/Popover/index.js";
17
16
  import StimulusEdit from "../StimulusEdit/index.js";
18
17
  import StimulusShow from "../StimulusShow/index.js";
19
18
  import DragAndDropZone from "../../../shared/drag_and_drop/DragAndDropZone/index.js";
20
19
  import { ItemTypes, dragSource, collectDrag } from "../../../../../common/components/shared/drag_and_drop/dragAndDropUtils.js";
21
- import wrapWithOutsideClick from "../../../shared/functionality/componentWithOutsideClick.js";
22
- import { DELETE_STIMULUS_DATA, LEFT } from '@instructure/quiz-common';
20
+ import wrapWithOutsideClickEmotion from "../../../shared/functionality/componentWithOutsideClickEmotion.js";
21
+ import { DELETE_STIMULUS_DATA } from '@instructure/quiz-common';
23
22
  import ConnectedQuizEntry from "../../../../../building/components/resources/quizEntry/QuizEntry/index.js";
24
- var styles = {
25
- componentId: 'fEUId',
26
- template: function template(theme) {
27
- return "\n\n.fEUId_dRGY{display:flex}\n\n.fEUId_cZDz{border-right:".concat(theme.leftPanelBorderWidth || 'inherit', " solid ").concat(theme.leftPanelBorderColor || 'inherit', "}\n\n.fEUId_cZDz,.fEUId_AmHx{box-sizing:border-box;max-height:105vh;overflow:auto}\n\n.fEUId_AmHx{margin-left:calc(").concat(theme.rightPanelPadding || 'inherit', "*-1);padding-left:").concat(theme.rightPanelPadding || 'inherit', "}\n\n.fEUId_duqv{display:none}\n\n.fEUId_ehcZ{transform:translateZ(0)}\n\n.fEUId_fPOQ{background-color:transparent;border:none;color:inherit;cursor:move;font-size:").concat(theme.dragAndDropHandleFontSize || 'inherit', ";height:0;margin:").concat(theme.dragAndDropHandleMargin || 'inherit', ";margin-top:0;position:relative;z-index:").concat(theme.dragAndDropHandleZIndex || 'inherit', "}\n\n.fEUId_eLmg{width:100%}\n\n.fEUId_dORw{width:50%}\n\n@media print{.fEUId_cZDz,.fEUId_AmHx{max-height:none}}");
28
- },
29
- 'stimulus': 'fEUId_dRGY',
30
- 'leftPanel': 'fEUId_cZDz',
31
- 'rightPanel': 'fEUId_AmHx',
32
- 'hidden': 'fEUId_duqv',
33
- 'stimulusWrapper': 'fEUId_ehcZ',
34
- 'dragAndDropHandle': 'fEUId_fPOQ',
35
- 'quizEntryWrapper': 'fEUId_eLmg',
36
- 'horizontallyAligned': 'fEUId_dORw'
37
- };
38
- import theme from "./theme.js";
39
- export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
23
+ import generateStyle from "./styles.js";
24
+ import generateComponentTheme from "./theme.js";
25
+ export var Stimulus = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
40
26
  _inherits(Stimulus, _Component);
41
27
 
42
28
  var _super = _createSuper(Stimulus);
@@ -68,6 +54,16 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
68
54
  }
69
55
 
70
56
  _createClass(Stimulus, [{
57
+ key: "componentDidMount",
58
+ value: function componentDidMount() {
59
+ this.props.makeStyles();
60
+ }
61
+ }, {
62
+ key: "componentDidUpdate",
63
+ value: function componentDidUpdate() {
64
+ this.props.makeStyles();
65
+ }
66
+ }, {
71
67
  key: "shouldDisableDragHandle",
72
68
  value: function shouldDisableDragHandle() {
73
69
  var _this$props = this.props,
@@ -92,12 +88,12 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
92
88
  return this.props.childEntries.toArray().map(function (childEntry, idx) {
93
89
  var displayPosition = nextDisplayPosition;
94
90
  nextDisplayPosition += childEntry.displayPositionSlots;
95
- return /*#__PURE__*/React.createElement("div", {
96
- className: styles.quizEntryWrapper,
91
+ return jsx("div", {
92
+ css: _this2.props.styles.quizEntryWrapper,
97
93
  key: childEntry.id
98
- }, /*#__PURE__*/React.createElement(ConnectedQuizEntry, Object.assign({}, _this2.props.propsForQuizEntry(childEntry, displayPosition), {
94
+ }, jsx(ConnectedQuizEntry, Object.assign({}, _this2.props.propsForQuizEntry(childEntry, displayPosition), {
99
95
  stimulusOrientation: _this2.props.stimulusOrientationEnabled ? _this2.props.stimulus.orientation : null
100
- })), !_this2.props.draggingOnBuild && !_this2.isQuizContentLocked() && /*#__PURE__*/React.createElement(AddContentPopover, {
96
+ })), !_this2.props.draggingOnBuild && !_this2.isQuizContentLocked() && jsx(AddContentPopover, {
101
97
  allowStimulusCreation: false,
102
98
  stimulusId: _this2.props.stimulus.id,
103
99
  parentEntryId: _this2.props.quizEntry.id,
@@ -112,9 +108,9 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
112
108
  value: function renderStimulusPanel() {
113
109
  var StimulusComponent = this.props.isEditing ? StimulusEdit : StimulusShow;
114
110
  var connectDragPreview = this.props.connectDragPreview;
115
- return connectDragPreview( /*#__PURE__*/React.createElement("div", {
111
+ return connectDragPreview(jsx("div", {
116
112
  "data-automation": "sdk-stimulus-LeftPanelShow"
117
- }, /*#__PURE__*/React.createElement(StimulusComponent, {
113
+ }, jsx(StimulusComponent, {
118
114
  bankEntryWarningWrapperProps: this.props.bankEntryWarningWrapperProps,
119
115
  connectDragSource: this.props.connectDragSource,
120
116
  displayPosition: this.props.displayPosition,
@@ -138,25 +134,17 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
138
134
  }, {
139
135
  key: "renderPanels",
140
136
  value: function renderPanels(propsForDnDZone) {
141
- var _classnames2;
142
-
143
- var _this$props3 = this.props,
144
- stimulus = _this$props3.stimulus,
145
- stimulusOrientationEnabled = _this$props3.stimulusOrientationEnabled;
146
- var shouldSetHorizontalOrientation = stimulus.orientation === LEFT || !stimulusOrientationEnabled;
147
- var stimulusPanelClass = classnames(styles.leftPanel, _defineProperty({}, styles.horizontallyAligned, shouldSetHorizontalOrientation));
148
- var itemsPanelClass = classnames((_classnames2 = {}, _defineProperty(_classnames2, styles.horizontallyAligned, shouldSetHorizontalOrientation), _defineProperty(_classnames2, styles.hidden, stimulus.isTemporary()), _defineProperty(_classnames2, styles.rightPanel, !stimulus.isTemporary()), _classnames2));
149
- return /*#__PURE__*/React.createElement("div", {
150
- className: classnames(_defineProperty({}, styles.stimulus, shouldSetHorizontalOrientation)),
137
+ return jsx("div", {
138
+ css: this.props.styles.stimulus,
151
139
  ref: this.props.dndRef,
152
140
  "data-automation": "sdk-stimulus"
153
- }, /*#__PURE__*/React.createElement("div", {
154
- className: stimulusPanelClass
155
- }, this.renderStimulusPanel()), /*#__PURE__*/React.createElement("div", {
156
- className: itemsPanelClass
157
- }, /*#__PURE__*/React.createElement("div", null), this.renderChildQuizEntries(), /*#__PURE__*/React.createElement(DragAndDropZone, Object.assign({}, propsForDnDZone, {
141
+ }, jsx("div", {
142
+ css: this.props.styles.leftPanel
143
+ }, this.renderStimulusPanel()), jsx("div", {
144
+ css: this.props.styles.itemPanel
145
+ }, jsx("div", null), this.renderChildQuizEntries(), jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
158
146
  location: "in"
159
- })), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && /*#__PURE__*/React.createElement(AddContentPopover, {
147
+ })), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && jsx(AddContentPopover, {
160
148
  allowStimulusCreation: false,
161
149
  stimulusId: this.props.stimulus.id,
162
150
  parentEntryId: this.props.quizEntry.id,
@@ -174,13 +162,13 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
174
162
  draggingAboveHalf: this.props.draggingAboveHalf,
175
163
  dropIntoEmptyStimulus: this.props.dropIntoEmptyStimulus
176
164
  };
177
- return /*#__PURE__*/React.createElement("div", {
165
+ return jsx("div", {
178
166
  tabIndex: "-1"
179
- }, /*#__PURE__*/React.createElement(DragAndDropZone, Object.assign({}, propsForDnDZone, {
167
+ }, jsx("div", null, jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
180
168
  location: "above"
181
- })), this.renderPanels(propsForDnDZone), /*#__PURE__*/React.createElement(DragAndDropZone, Object.assign({}, propsForDnDZone, {
169
+ })), this.renderPanels(propsForDnDZone), jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
182
170
  location: "below"
183
- })));
171
+ }))));
184
172
  }
185
173
  }]);
186
174
 
@@ -215,7 +203,9 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
215
203
  switchOffEditing: PropTypes.func.isRequired,
216
204
  onEditStimulusToggle: PropTypes.func.isRequired,
217
205
  editStimulusToggle: PropTypes.bool.isRequired,
218
- stimulusOrientationEnabled: PropTypes.bool.isRequired
206
+ stimulusOrientationEnabled: PropTypes.bool.isRequired,
207
+ makeStyles: PropTypes.func,
208
+ styles: PropTypes.object
219
209
  }, _class2.defaultProps = {
220
210
  bankEntryWarningWrapperProps: function bankEntryWarningWrapperProps() {},
221
211
  childEntries: List([]),
@@ -231,4 +221,4 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
231
221
  scrollKey: '',
232
222
  isContentLockedByBlueprint: false
233
223
  }, _temp)) || _class);
234
- export default DragSource(ItemTypes.QUIZ_ENTRY, dragSource, collectDrag)(wrapWithOutsideClick(Stimulus));
224
+ export default DragSource(ItemTypes.QUIZ_ENTRY, dragSource, collectDrag)(wrapWithOutsideClickEmotion(Stimulus));
@@ -0,0 +1,58 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import { LEFT } from '@instructure/quiz-common';
4
+
5
+ var generateStyle = function generateStyle(componentTheme, props) {
6
+ var mp = '@media print';
7
+ var shouldSetHorizontalOrientation = props.stimulus.orientation === LEFT || !props.stimulusOrientationEnabled;
8
+ return {
9
+ stimulus: _objectSpread({}, shouldSetHorizontalOrientation && {
10
+ display: 'flex'
11
+ }),
12
+ leftPanel: _objectSpread(_objectSpread({
13
+ boxSizing: 'border-box',
14
+ maxHeight: '105vh',
15
+ overflow: 'auto',
16
+ borderRight: "".concat(componentTheme.leftPanelBorderWidth, " solid ").concat(componentTheme.leftPanelBorderColor)
17
+ }, shouldSetHorizontalOrientation && {
18
+ width: '50%'
19
+ }), {}, _defineProperty({}, mp, {
20
+ maxHeight: 'none'
21
+ })),
22
+ itemPanel: _objectSpread(_objectSpread(_objectSpread({}, shouldSetHorizontalOrientation && {
23
+ width: '50%'
24
+ }), props.stimulus.isTemporary() && {
25
+ display: 'none'
26
+ }), !props.stimulus.isTemporary() && _defineProperty({
27
+ boxSizing: 'border-box',
28
+ maxHeight: '105vh',
29
+ overflow: 'auto',
30
+ paddingLeft: componentTheme.rightPanelPadding,
31
+ marginLeft: "calc(".concat(componentTheme.rightPanelPadding, " * -1)")
32
+ }, mp, {
33
+ maxHeight: 'none'
34
+ })),
35
+ stimulusWrapper: {
36
+ transform: 'translate3d(0, 0, 0)'
37
+ /* for drag and drop preview to work */
38
+
39
+ },
40
+ dragAndDropHandle: {
41
+ cursor: 'move',
42
+ height: '0',
43
+ zIndex: componentTheme.dragAndDropHandleZIndex,
44
+ backgroundColor: 'transparent',
45
+ border: 'none',
46
+ color: 'inherit',
47
+ fontSize: componentTheme.dragAndDropHandleFontSize,
48
+ margin: componentTheme.dragAndDropHandleMargin,
49
+ marginTop: '0',
50
+ position: 'relative'
51
+ },
52
+ quizEntryWrapper: {
53
+ width: '100%'
54
+ }
55
+ };
56
+ };
57
+
58
+ export default generateStyle;
@@ -1,4 +1,4 @@
1
- export default function generator(_ref) {
1
+ var generateComponentTheme = function generateComponentTheme(_ref) {
2
2
  var spacing = _ref.spacing,
3
3
  typography = _ref.typography,
4
4
  colors = _ref.colors,
@@ -12,4 +12,6 @@ export default function generator(_ref) {
12
12
  dragAndDropHandleFontSize: typography.fontSizeMedium,
13
13
  dragAndDropHandleMargin: spacing.xSmall
14
14
  };
15
- }
15
+ };
16
+
17
+ export default generateComponentTheme;