@instructure/quiz-core 20.11.3-rc.2 → 20.11.3-rc.21

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 (161) hide show
  1. package/es/banks/components/Bank/presenter.js +12 -6
  2. package/es/banks/components/HeaderMenu/presenter.js +40 -1
  3. package/es/banks/components/HeaderMenu/styles.js +3 -0
  4. package/es/banks/components/NavWrapper/presenter.js +6 -1
  5. package/es/banks/components/SharingModal/presenter.js +1 -1
  6. package/es/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
  7. package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +23 -29
  8. package/es/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +39 -0
  9. package/es/building/components/resources/quizEntry/QuizEntry/styles.js +23 -0
  10. package/es/building/components/resources/quizEntry/QuizEntry/theme.js +4 -2
  11. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +35 -43
  12. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/styles.js +30 -0
  13. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +4 -2
  14. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +25 -31
  15. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/styles.js +19 -0
  16. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +4 -2
  17. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +27 -33
  18. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +28 -0
  19. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/theme.js +4 -2
  20. package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +32 -37
  21. package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +49 -0
  22. package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +4 -2
  23. package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +23 -23
  24. package/es/building/components/resources/quizEntry/QuizEntryEdit/styles.js +21 -0
  25. package/es/building/components/resources/quizEntry/QuizEntryEdit/theme.js +4 -2
  26. package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +36 -50
  27. package/es/building/components/resources/quizEntry/QuizEntryShow/styles.js +84 -0
  28. package/es/building/components/resources/quizEntry/QuizEntryShow/theme.js +4 -2
  29. package/es/common/components/layout/navbar/SecondaryNavBarButton/index.js +1 -1
  30. package/es/common/components/layout/navbar/index.js +135 -38
  31. package/es/common/components/layout/navbar/styles.js +8 -0
  32. package/es/common/components/layout/navbar/theme.js +10 -0
  33. package/es/common/components/resources/stimulus/Stimulus/presenter.js +40 -50
  34. package/es/common/components/resources/stimulus/Stimulus/styles.js +58 -0
  35. package/es/common/components/resources/stimulus/Stimulus/theme.js +4 -2
  36. package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +37 -46
  37. package/es/common/components/resources/stimulus/StimulusEdit/styles.js +46 -0
  38. package/es/common/components/resources/stimulus/StimulusEdit/theme.js +4 -2
  39. package/es/common/components/shared/overlayEmotion/index.js +1 -1
  40. package/es/common/components/shared/return_button/ReturnButton.js +4 -1
  41. package/es/moderating/components/resources/ModerateTable/presenter.js +44 -46
  42. package/es/moderating/components/resources/ModerateTable/styles.js +23 -0
  43. package/es/moderating/components/resources/ModerateTable/theme.js +4 -2
  44. package/es/moderating/components/resources/ModerateTableRow/presenter.js +63 -68
  45. package/es/moderating/components/resources/ModerateTableRow/styles.js +25 -0
  46. package/es/moderating/components/resources/ModerateTableRow/theme.js +4 -2
  47. package/es/reporting/components/quizAnalysis/QuizAnalysisOverview.js +34 -41
  48. package/es/reporting/components/quizAnalysis/styles.js +27 -0
  49. package/es/reporting/components/quizAnalysis/theme.js +4 -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 +10 -5
  81. package/lib/banks/components/HeaderMenu/presenter.js +42 -1
  82. package/lib/banks/components/HeaderMenu/styles.js +3 -0
  83. package/lib/banks/components/NavWrapper/presenter.js +6 -1
  84. package/lib/banks/components/SharingModal/presenter.js +1 -1
  85. package/lib/building/components/resources/quizEntry/QuizEntry/index.js +3 -1
  86. package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +22 -30
  87. package/lib/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +51 -0
  88. package/lib/building/components/resources/quizEntry/QuizEntry/styles.js +33 -0
  89. package/lib/building/components/resources/quizEntry/QuizEntry/theme.js +6 -3
  90. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +34 -45
  91. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/styles.js +38 -0
  92. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +6 -3
  93. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +24 -33
  94. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/styles.js +27 -0
  95. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +6 -3
  96. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +26 -35
  97. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +38 -0
  98. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/theme.js +6 -3
  99. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +30 -38
  100. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +57 -0
  101. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +6 -3
  102. package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +20 -22
  103. package/lib/building/components/resources/quizEntry/QuizEntryEdit/styles.js +29 -0
  104. package/lib/building/components/resources/quizEntry/QuizEntryEdit/theme.js +6 -3
  105. package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +36 -53
  106. package/lib/building/components/resources/quizEntry/QuizEntryShow/styles.js +95 -0
  107. package/lib/building/components/resources/quizEntry/QuizEntryShow/theme.js +6 -3
  108. package/lib/common/components/layout/navbar/SecondaryNavBarButton/index.js +1 -1
  109. package/lib/common/components/layout/navbar/index.js +130 -39
  110. package/lib/common/components/layout/navbar/styles.js +16 -0
  111. package/lib/common/components/layout/navbar/theme.js +18 -0
  112. package/lib/common/components/resources/stimulus/Stimulus/presenter.js +38 -52
  113. package/lib/common/components/resources/stimulus/Stimulus/styles.js +70 -0
  114. package/lib/common/components/resources/stimulus/Stimulus/theme.js +6 -3
  115. package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +36 -47
  116. package/lib/common/components/resources/stimulus/StimulusEdit/styles.js +54 -0
  117. package/lib/common/components/resources/stimulus/StimulusEdit/theme.js +6 -3
  118. package/lib/common/components/shared/overlayEmotion/index.js +1 -1
  119. package/lib/common/components/shared/return_button/ReturnButton.js +4 -1
  120. package/lib/moderating/components/resources/ModerateTable/presenter.js +43 -50
  121. package/lib/moderating/components/resources/ModerateTable/styles.js +33 -0
  122. package/lib/moderating/components/resources/ModerateTable/theme.js +6 -3
  123. package/lib/moderating/components/resources/ModerateTableRow/presenter.js +61 -70
  124. package/lib/moderating/components/resources/ModerateTableRow/styles.js +33 -0
  125. package/lib/moderating/components/resources/ModerateTableRow/theme.js +6 -3
  126. package/lib/reporting/components/quizAnalysis/QuizAnalysisOverview.js +33 -43
  127. package/lib/reporting/components/quizAnalysis/styles.js +37 -0
  128. package/lib/reporting/components/quizAnalysis/theme.js +6 -3
  129. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +42 -47
  130. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +51 -0
  131. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +8 -4
  132. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +19 -28
  133. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/styles.js +27 -0
  134. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/theme.js +6 -3
  135. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +45 -52
  136. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +62 -0
  137. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/theme.js +6 -3
  138. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +2 -2
  139. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -2
  140. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +2 -2
  141. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +28 -26
  142. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +24 -0
  143. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +6 -3
  144. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +37 -55
  145. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/styles.js +149 -0
  146. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +12 -8
  147. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +81 -65
  148. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +103 -0
  149. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +10 -6
  150. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +30 -28
  151. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/styles.js +23 -0
  152. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/theme.js +6 -3
  153. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +82 -84
  154. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +85 -0
  155. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +6 -3
  156. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +43 -48
  157. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +22 -0
  158. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +6 -3
  159. package/package.json +9 -9
  160. package/es/common/components/layout/navbar/presenter.js +0 -114
  161. package/lib/common/components/layout/navbar/presenter.js +0 -136
@@ -0,0 +1,21 @@
1
+ var generateStyle = function generateStyle(componentTheme) {
2
+ return {
3
+ globalStyles: {
4
+ 'body.tox-fullscreen .quizEntryEdit': {
5
+ transform: 'none',
6
+ zIndex: '6666'
7
+ }
8
+ },
9
+ quizEntryEdit: {
10
+ fontSize: componentTheme.quizEntryEditFontSize,
11
+ position: 'relative',
12
+ transform: 'translate3d(0, 0, 0)',
13
+
14
+ /* for drag and drop preview to work */
15
+ margin: "".concat(componentTheme.quizEntryEditMargin, " 0"),
16
+ zIndex: '3333'
17
+ }
18
+ };
19
+ };
20
+
21
+ 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
  colors = _ref.colors,
4
4
  typography = _ref.typography,
@@ -7,4 +7,6 @@ export default function generator(_ref) {
7
7
  quizEntryEditFontSize: typography.fontSizeMedium,
8
8
  quizEntryEditMargin: spacing.medium
9
9
  };
10
- }
10
+ };
11
+
12
+ export default generateComponentTheme;
@@ -5,48 +5,31 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
 
6
6
  var _dec, _class, _class2, _temp;
7
7
 
8
- import React, { Component } from 'react';
8
+ /** @jsx jsx */
9
+ import { Component } from 'react';
9
10
  import PropTypes from 'prop-types';
10
11
  import ImmutablePropTypes from 'react-immutable-proptypes';
11
12
  import partial from 'lodash/partial';
12
13
  import { DragSource } from 'react-dnd';
13
14
  import { IconBankLine } from '@instructure/ui-icons';
14
15
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
15
- import { themeable } from '@instructure/ui-themeable';
16
+ import { withStyle, jsx } from '@instructure/emotion';
16
17
  import { FillBlankInteractionType } from '@instructure/quiz-interactions';
17
18
  import { TOP } from '@instructure/quiz-common';
18
19
  import t from '@instructure/quiz-i18n/es/format-message';
19
20
  import { convertFITBtoRich } from "../../../../../common/util/fitbCopyHelper.js";
20
21
  import Item from "../../../../../common/records/Item.js";
21
- import Overlay from "../../../../../common/components/shared/overlay/Overlay.js";
22
+ import OverlayEmotion from "../../../../../common/components/shared/overlayEmotion/index.js";
22
23
  import ActionButtons from "../../ActionButtons/index.js";
23
24
  import { ItemTypes, dragSource, collectDrag } from "../../../../../common/components/shared/drag_and_drop/dragAndDropUtils.js";
24
25
  import PositionBox from "../../../../../common/components/resources/positionBox/PositionBox.js";
25
26
  import DragAndDropZone from "../../../../../common/components/shared/drag_and_drop/DragAndDropZone/index.js";
26
- var styles = {
27
- componentId: 'eqZPF',
28
- template: function template(theme) {
29
- return "\n\n.eqZPF_eLmg{transform:translateZ(0)}\n\n.eqZPF_TMNr{background-color:".concat(theme.quizEntryShowBackgroundColor || 'inherit', ";padding:").concat(theme.quizEntryShowPadding || 'inherit', "}\n\n.eqZPF_fsuY{align-items:stretch;display:flex;flex-direction:row;flex-wrap:nowrap;height:").concat(theme.headerHeight || 'inherit', ";padding-right:").concat(theme.headerRightPadding || 'inherit', "}\n\n.eqZPF_bscQ{border:").concat(theme.dndBorder || 'inherit', "}\n\n.eqZPF_cKlw{align-items:center;display:inline-flex;flex:8 0 0;overflow:hidden}\n\n.eqZPF_eGWt{border-bottom:").concat(theme.phoneConnectingLinesBorderWidth || 'inherit', " dotted;border-color:").concat(theme.phoneConnectingLinesBorderColor || 'inherit', ";border-left:").concat(theme.phoneConnectingLinesBorderWidth || 'inherit', " dotted;height:2rem;margin-right:1.2rem;margin-top:-0.8rem;width:1.2rem}\n\n.eqZPF_eGWt,.eqZPF_IoDT{display:inline-flex;flex:0 0 auto}\n\n.eqZPF_IoDT{color:").concat(theme.rightHeaderColor || 'inherit', ";text-align:right;z-index:").concat(theme.rightHeaderZIndex || 'inherit', "}\n\n[dir=ltr] .eqZPF_IoDT,[dir=rtl] .eqZPF_IoDT{text-align:right}\n\n.eqZPF_IoDT button{background-color:transparent;background-color:initial}\n\n.eqZPF_eCZW,.eqZPF_cwte,.eqZPF_nvdO{color:").concat(theme.titleInteractionTypeNamePointsColor || 'inherit', ";font-size:").concat(theme.titleInteractionTypeNamePointsFontSize || 'inherit', ";margin-left:").concat(theme.titleInteractionTypeNamePointsLeftMargin || 'inherit', ";margin-right:").concat(theme.titleInteractionTypeNamePointsRightMargin || 'inherit', ";overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n\n.eqZPF_csjx{margin:").concat(theme.itemHolderMargin || 'inherit', ";overflow-wrap:anywhere}\n\n.eqZPF_fPOQ,.eqZPF_gaTA{background-color:transparent;border:none;color:inherit;font-size:").concat(theme.optionsButtonDragDropHandleFontSize || 'inherit', ";margin:").concat(theme.optionsButtonDragDropHandleMargin || 'inherit', "}\n\n.eqZPF_gaTA{cursor:pointer}\n\n@media print{.eqZPF_eLmg{break-inside:avoid}}");
30
- },
31
- 'quizEntryWrapper': 'eqZPF_eLmg',
32
- 'quizEntryShow': 'eqZPF_TMNr',
33
- 'header': 'eqZPF_fsuY',
34
- 'dndBorder': 'eqZPF_bscQ',
35
- 'leftHeader': 'eqZPF_cKlw',
36
- 'connectingLines': 'eqZPF_eGWt',
37
- 'rightHeader': 'eqZPF_IoDT',
38
- 'interactionTypeName': 'eqZPF_eCZW',
39
- 'points': 'eqZPF_cwte',
40
- 'title': 'eqZPF_nvdO',
41
- 'itemHolder': 'eqZPF_csjx',
42
- 'dragAndDropHandle': 'eqZPF_fPOQ',
43
- 'optionsButton': 'eqZPF_gaTA'
44
- };
45
- import theme from "./theme.js";
46
-
47
- var _ref = /*#__PURE__*/React.createElement(IconBankLine, null);
48
-
49
- var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
27
+ import generateStyle from "./styles.js";
28
+ import generateComponentTheme from "./theme.js";
29
+
30
+ var _ref = jsx(IconBankLine, null);
31
+
32
+ var QuizEntryShow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
50
33
  _inherits(QuizEntryShow, _Component);
51
34
 
52
35
  var _super = _createSuper(QuizEntryShow);
@@ -215,8 +198,9 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
215
198
  value: function renderPointsPossible() {
216
199
  if (this.props.entry instanceof Item) {
217
200
  var pointsPossible = this.props.quizEntry.pointsPossible;
218
- return /*#__PURE__*/React.createElement("div", {
219
- className: styles.points,
201
+ return jsx("div", {
202
+ className: "points",
203
+ css: this.props.styles.points,
220
204
  "data-automation": "sdk-points-possible-div"
221
205
  }, this.getPointsText(pointsPossible || 0));
222
206
  }
@@ -226,8 +210,8 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
226
210
  value: function renderInteractionType() {
227
211
  if (this.props.entry instanceof Item) {
228
212
  var interactionTypeName = this.props.entry.getInteractionType().name || this.props.interactionTypeName;
229
- return /*#__PURE__*/React.createElement("div", {
230
- className: styles.interactionTypeName,
213
+ return jsx("div", {
214
+ css: this.props.styles.interactionTypeName,
231
215
  "data-automation": "sdk-interaction-type-name-div"
232
216
  }, interactionTypeName);
233
217
  }
@@ -242,10 +226,10 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
242
226
  }, {
243
227
  key: "renderLeftHeader",
244
228
  value: function renderLeftHeader() {
245
- return /*#__PURE__*/React.createElement("div", {
246
- className: styles.leftHeader
247
- }, this.renderBankedContent(), this.renderInteractionType(), this.renderPointsPossible(), /*#__PURE__*/React.createElement("div", {
248
- className: styles.title,
229
+ return jsx("div", {
230
+ css: this.props.styles.leftHeader
231
+ }, this.renderBankedContent(), this.renderInteractionType(), this.renderPointsPossible(), jsx("div", {
232
+ css: this.props.styles.title,
249
233
  "data-automation": "sdk-quiz-entry-title-div"
250
234
  }, this.props.entry.title));
251
235
  }
@@ -278,26 +262,27 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
278
262
  var shouldLockQuizEntry = lockBlueprintContentEnabled && isContentLockedByBlueprint; // Overlay gets tabIndex === "-1" so that the drag handle is tabbable before
279
263
  // the Overlay get focus and opens the quizEntry in edit mode
280
264
 
281
- return /*#__PURE__*/React.createElement(Overlay, {
265
+ return jsx(OverlayEmotion, {
282
266
  onClick: this.editingOn,
283
- wrapperClassName: styles.quizEntryWrapper,
267
+ wrapperStyles: this.props.styles.quizEntryWrapper,
284
268
  tabIndex: "-1",
285
269
  hideOverlay: shouldLockQuizEntry
286
- }, /*#__PURE__*/React.createElement(DragAndDropZone, Object.assign({}, propsForDnDZone, {
270
+ }, jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
287
271
  location: "above"
288
- })), connectDragPreview( /*#__PURE__*/React.createElement("div", {
289
- className: styles.quizEntryShow,
272
+ })), jsx("div", {
273
+ ref: connectDragPreview,
274
+ css: this.props.styles.quizEntryShow,
290
275
  "data-automation": "sdk-quiz-entry-show",
291
276
  "data-automation-item-id": this.props.quizEntry.id
292
- }, /*#__PURE__*/React.createElement("div", {
293
- className: styles.header
294
- }, quizEntry.isInStimulus && stimulusOrientation === TOP && /*#__PURE__*/React.createElement("div", {
295
- className: styles.connectingLines
296
- }), /*#__PURE__*/React.createElement(PositionBox, {
277
+ }, jsx("div", {
278
+ css: this.props.styles.header
279
+ }, quizEntry.isInStimulus && stimulusOrientation === TOP && jsx("div", {
280
+ css: this.props.styles.connectingLines
281
+ }), jsx(PositionBox, {
297
282
  position: positionToDisplay,
298
283
  headingText: positionText,
299
284
  headingLevel: quizEntry.isInStimulus ? 'h3' : 'h2'
300
- }), this.renderLeftHeader(), /*#__PURE__*/React.createElement(ActionButtons, {
285
+ }), this.renderLeftHeader(), jsx(ActionButtons, {
301
286
  connectDragSource: this.props.connectDragSource,
302
287
  displayPosition: this.props.displayPosition,
303
288
  onDelete: this.removeItem,
@@ -311,11 +296,11 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
311
296
  shouldDisableCopy: shouldLockQuizEntry,
312
297
  shouldRenderEdit: !shouldLockQuizEntry,
313
298
  shouldRenderDelete: !shouldLockQuizEntry
314
- }), /*#__PURE__*/React.createElement(ScreenReaderContent, null, srMsg)), /*#__PURE__*/React.createElement("div", {
315
- className: styles.itemHolder,
299
+ }), jsx(ScreenReaderContent, null, srMsg)), jsx("div", {
300
+ css: this.props.styles.itemHolder,
316
301
  ref: this.setInert,
317
302
  "data-automation": "sdk-quiz-entry-show-item-holder"
318
- }, this.props.children))), /*#__PURE__*/React.createElement(DragAndDropZone, Object.assign({}, propsForDnDZone, {
303
+ }, this.props.children)), jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
319
304
  location: "below"
320
305
  })));
321
306
  }
@@ -355,7 +340,8 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
355
340
  switchOnEditing: PropTypes.func.isRequired,
356
341
  // from QuizEntry
357
342
  updateItemCallStatus: PropTypes.string.isRequired,
358
- withConfirm: PropTypes.func.isRequired
343
+ withConfirm: PropTypes.func.isRequired,
344
+ styles: PropTypes.object
359
345
  }, _class2.defaultProps = {
360
346
  children: null,
361
347
  draggingOver: false,
@@ -0,0 +1,84 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+
4
+ var generateStyle = function generateStyle(componentTheme) {
5
+ var mp = '@media print';
6
+ var interactionTypeStyles = {
7
+ color: componentTheme.titleInteractionTypeNamePointsColor,
8
+ fontSize: componentTheme.titleInteractionTypeNamePointsFontSize,
9
+ marginLeft: componentTheme.titleInteractionTypeNamePointsLeftMargin,
10
+ marginRight: componentTheme.titleInteractionTypeNamePointsRightMargin,
11
+ textOverflow: 'ellipsis',
12
+ overflow: 'hidden',
13
+ whiteSpace: 'nowrap'
14
+ };
15
+ var optionsButtonDragDropStyle = {
16
+ backgroundColor: 'transparent',
17
+ border: 'none',
18
+ color: 'inherit',
19
+ fontSize: componentTheme.optionsButtonDragDropHandleFontSize,
20
+ margin: componentTheme.optionsButtonDragDropHandleMargin
21
+ };
22
+ return {
23
+ quizEntryWrapper: _defineProperty({
24
+ transform: 'translate3d(0, 0, 0)'
25
+ }, mp, {
26
+ breakInside: 'avoid'
27
+ }),
28
+ quizEntryShow: {
29
+ padding: componentTheme.quizEntryShowPadding,
30
+ backgroundColor: componentTheme.quizEntryShowBackgroundColor
31
+ },
32
+ header: {
33
+ height: componentTheme.headerHeight,
34
+ display: 'flex',
35
+ flexWrap: 'nowrap',
36
+ flexDirection: 'row',
37
+ alignItems: 'stretch',
38
+ paddingRight: componentTheme.headerRightPadding
39
+ },
40
+ dndBorder: {
41
+ border: componentTheme.dndBorder
42
+ },
43
+ leftHeader: {
44
+ flex: '8 0 0',
45
+ display: 'inline-flex',
46
+ overflow: 'hidden',
47
+ alignItems: 'center'
48
+ },
49
+ connectingLines: {
50
+ flex: '0 0 auto',
51
+ display: 'inline-flex',
52
+ borderLeft: "".concat(componentTheme.phoneConnectingLinesBorderWidth, " dotted"),
53
+ borderBottom: "".concat(componentTheme.phoneConnectingLinesBorderWidth, " dotted"),
54
+ borderColor: componentTheme.phoneConnectingLinesBorderColor,
55
+ height: '2rem',
56
+ width: '1.2rem',
57
+ marginTop: '-0.8rem',
58
+ marginRight: '1.2rem'
59
+ },
60
+ rightHeader: {
61
+ flex: '0 0 auto',
62
+ display: 'inline-flex',
63
+ textAlign: 'right',
64
+ zIndex: componentTheme.rightHeaderZIndex,
65
+ color: componentTheme.rightHeaderColor,
66
+ button: {
67
+ backgroundColor: 'initial'
68
+ }
69
+ },
70
+ title: interactionTypeStyles,
71
+ interactionTypeName: interactionTypeStyles,
72
+ points: interactionTypeStyles,
73
+ itemHolder: {
74
+ overflowWrap: 'anywhere',
75
+ margin: componentTheme.itemHolderMargin
76
+ },
77
+ optionsButton: _objectSpread(_objectSpread({}, optionsButtonDragDropStyle), {}, {
78
+ cursor: 'pointer'
79
+ }),
80
+ dragAndDropHandle: optionsButtonDragDropStyle
81
+ };
82
+ };
83
+
84
+ 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
  colors = _ref.colors,
4
4
  typography = _ref.typography,
@@ -23,4 +23,6 @@ export default function generator(_ref) {
23
23
  phoneConnectingLinesBorderColor: colors.ash,
24
24
  phoneBreakPoint: "max-width: ".concat(breakpoints.medium)
25
25
  };
26
- }
26
+ };
27
+
28
+ export default generateComponentTheme;
@@ -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;
@@ -0,0 +1,8 @@
1
+ var generateStyle = function generateStyle(componentTheme) {
2
+ return {
3
+ backgroundColor: componentTheme.backgroundColor,
4
+ phoneBreakPoint: componentTheme.phoneBreakPoint
5
+ };
6
+ };
7
+
8
+ export default generateStyle;
@@ -0,0 +1,10 @@
1
+ var generateComponentTheme = function generateComponentTheme(_ref) {
2
+ var breakpoints = _ref.breakpoints,
3
+ colors = _ref.colors;
4
+ return {
5
+ backgroundColor: colors.porcelain,
6
+ phoneBreakPoint: breakpoints.medium
7
+ };
8
+ };
9
+
10
+ export default generateComponentTheme;