@instructure/quiz-core 20.9.0 → 20.9.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/building/components/layout/Sidebar/SidebarItem/presenter.js +16 -22
- package/es/building/components/layout/Sidebar/SidebarItem/styles.js +11 -0
- package/es/building/components/layout/Sidebar/SidebarItem/theme.js +4 -2
- package/es/building/components/layout/Sidebar/Stimulus/presenter.js +17 -23
- package/es/building/components/layout/Sidebar/Stimulus/styles.js +11 -0
- package/es/building/components/layout/Sidebar/Stimulus/theme.js +4 -2
- package/es/building/components/layout/Sidebar/presenter.js +42 -38
- package/es/building/components/layout/Sidebar/styles.js +28 -0
- package/es/building/components/layout/Sidebar/theme.js +4 -2
- package/es/building/components/layout/header/BuildingButtons/presenter.js +33 -39
- package/es/building/components/layout/header/BuildingButtons/styles.js +21 -0
- package/es/building/components/layout/header/BuildingButtons/theme.js +4 -2
- package/es/building/components/resources/ActionButtons/presenter.js +29 -27
- package/es/building/components/resources/ActionButtons/styles.js +33 -0
- package/es/building/components/resources/ActionButtons/theme.js +4 -2
- package/es/building/components/resources/AddToBankOptions/index.js +11 -15
- package/es/building/components/resources/AddToBankOptions/styles.js +11 -0
- package/es/building/components/resources/AddToBankOptions/theme.js +4 -2
- package/es/building/components/resources/DeleteStimulusModal/presenter.js +38 -44
- package/es/building/components/resources/DeleteStimulusModal/styles.js +22 -0
- package/es/building/components/resources/DeleteStimulusModal/theme.js +4 -2
- package/es/building/components/resources/ItemFeedbackModal/presenter.js +23 -28
- package/es/building/components/resources/ItemFeedbackModal/styles.js +14 -0
- package/es/building/components/resources/ItemFeedbackModal/theme.js +4 -2
- package/es/common/components/layout/header/Timer/presenter.js +30 -37
- package/es/common/components/layout/header/Timer/styles.js +27 -0
- package/es/common/components/layout/header/Timer/theme.js +4 -2
- package/es/common/components/layout/sidebar/PositionSummary/index.js +17 -25
- package/es/common/components/layout/sidebar/PositionSummary/styles.js +28 -0
- package/es/common/components/layout/sidebar/PositionSummary/theme.js +4 -2
- package/es/common/components/layout/sidebar/Sidebar/index.js +88 -94
- package/es/common/components/layout/sidebar/Sidebar/styles.js +117 -0
- package/es/common/components/layout/sidebar/Sidebar/theme.js +4 -8
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +52 -52
- package/es/common/components/layout/sidebar/SidebarItem/styles.js +59 -0
- package/es/common/components/layout/sidebar/SidebarItem/theme.js +4 -2
- package/es/common/components/layout/sidebar/Stimulus/presenter.js +39 -36
- package/es/common/components/layout/sidebar/Stimulus/styles.js +33 -0
- package/es/common/components/layout/sidebar/Stimulus/theme.js +4 -2
- package/es/common/components/shared/InteractionTypes/presenter.js +27 -33
- package/es/common/components/shared/InteractionTypes/styles.js +17 -0
- package/es/common/components/shared/InteractionTypes/theme.js +4 -2
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/index.js +40 -30
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/styles.js +41 -0
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/theme.js +4 -2
- package/es/common/components/shared/file_selector/FileSelector.js +11 -14
- package/es/common/components/shared/file_selector/styles.js +12 -0
- package/es/common/components/shared/file_selector/theme.js +4 -2
- package/lib/building/components/layout/Sidebar/SidebarItem/presenter.js +15 -23
- package/lib/building/components/layout/Sidebar/SidebarItem/styles.js +19 -0
- package/lib/building/components/layout/Sidebar/SidebarItem/theme.js +6 -3
- package/lib/building/components/layout/Sidebar/Stimulus/presenter.js +16 -24
- package/lib/building/components/layout/Sidebar/Stimulus/styles.js +19 -0
- package/lib/building/components/layout/Sidebar/Stimulus/theme.js +6 -3
- package/lib/building/components/layout/Sidebar/presenter.js +40 -41
- package/lib/building/components/layout/Sidebar/styles.js +38 -0
- package/lib/building/components/layout/Sidebar/theme.js +6 -3
- package/lib/building/components/layout/header/BuildingButtons/presenter.js +32 -40
- package/lib/building/components/layout/header/BuildingButtons/styles.js +29 -0
- package/lib/building/components/layout/header/BuildingButtons/theme.js +6 -3
- package/lib/building/components/resources/ActionButtons/presenter.js +28 -30
- package/lib/building/components/resources/ActionButtons/styles.js +44 -0
- package/lib/building/components/resources/ActionButtons/theme.js +6 -3
- package/lib/building/components/resources/AddToBankOptions/index.js +10 -16
- package/lib/building/components/resources/AddToBankOptions/styles.js +19 -0
- package/lib/building/components/resources/AddToBankOptions/theme.js +6 -3
- package/lib/building/components/resources/DeleteStimulusModal/presenter.js +37 -46
- package/lib/building/components/resources/DeleteStimulusModal/styles.js +30 -0
- package/lib/building/components/resources/DeleteStimulusModal/theme.js +6 -3
- package/lib/building/components/resources/ItemFeedbackModal/presenter.js +19 -27
- package/lib/building/components/resources/ItemFeedbackModal/styles.js +22 -0
- package/lib/building/components/resources/ItemFeedbackModal/theme.js +6 -3
- package/lib/common/components/layout/header/Timer/presenter.js +29 -39
- package/lib/common/components/layout/header/Timer/styles.js +35 -0
- package/lib/common/components/layout/header/Timer/theme.js +6 -3
- package/lib/common/components/layout/sidebar/PositionSummary/index.js +16 -26
- package/lib/common/components/layout/sidebar/PositionSummary/styles.js +36 -0
- package/lib/common/components/layout/sidebar/PositionSummary/theme.js +6 -3
- package/lib/common/components/layout/sidebar/Sidebar/index.js +85 -97
- package/lib/common/components/layout/sidebar/Sidebar/styles.js +128 -0
- package/lib/common/components/layout/sidebar/Sidebar/theme.js +5 -9
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +51 -55
- package/lib/common/components/layout/sidebar/SidebarItem/styles.js +69 -0
- package/lib/common/components/layout/sidebar/SidebarItem/theme.js +6 -3
- package/lib/common/components/layout/sidebar/Stimulus/presenter.js +38 -37
- package/lib/common/components/layout/sidebar/Stimulus/styles.js +41 -0
- package/lib/common/components/layout/sidebar/Stimulus/theme.js +6 -3
- package/lib/common/components/shared/InteractionTypes/presenter.js +26 -36
- package/lib/common/components/shared/InteractionTypes/styles.js +25 -0
- package/lib/common/components/shared/InteractionTypes/theme.js +6 -3
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/index.js +40 -33
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/styles.js +51 -0
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/theme.js +6 -3
- package/lib/common/components/shared/file_selector/FileSelector.js +10 -15
- package/lib/common/components/shared/file_selector/styles.js +20 -0
- package/lib/common/components/shared/file_selector/theme.js +6 -3
- package/package.json +10 -10
|
@@ -5,7 +5,8 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import partial from 'lodash/partial';
|
|
11
12
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
@@ -13,27 +14,18 @@ import { IconClockLine, IconClockSolid, IconArrowOpenStartLine } from '@instruct
|
|
|
13
14
|
import { Button } from '@instructure/ui-buttons';
|
|
14
15
|
import { TopNavBar } from '@instructure/ui-top-nav-bar';
|
|
15
16
|
import { View } from '@instructure/ui-view';
|
|
16
|
-
import {
|
|
17
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
17
18
|
import FormattedDuration from "../../../shared/FormattedDuration/index.js";
|
|
18
19
|
import { formatTime } from "../../../../util/formatTimespan.js";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
template: function template(theme) {
|
|
22
|
-
return "\n\n.fBhoO_dAhe{flex-direction:row;font-size:".concat(theme.timerFontSize || 'inherit', ";justify-content:center;line-height:1rem}\n\n.fBhoO_dAhe,.fBhoO_Swlx{align-items:center;display:flex}\n\n.fBhoO_Swlx{flex-direction:column-reverse}\n\n.fBhoO_dkDW{padding:").concat(theme.timerRightPadding || 'inherit', "}\n\n.fBhoO_bYJj{font-size:").concat(theme.timeRemainingLabelFontSize || 'inherit', ";text-align:center;width:100%}\n\n[dir=ltr] .fBhoO_bYJj,[dir=rtl] .fBhoO_bYJj{text-align:center}");
|
|
23
|
-
},
|
|
24
|
-
'timer': 'fBhoO_dAhe',
|
|
25
|
-
'timerLeft': 'fBhoO_Swlx',
|
|
26
|
-
'timerRight': 'fBhoO_dkDW',
|
|
27
|
-
'timeRemainingLabel': 'fBhoO_bYJj'
|
|
28
|
-
};
|
|
29
|
-
import theme from "./theme.js";
|
|
20
|
+
import generateStyle from "./styles.js";
|
|
21
|
+
import generateComponentTheme from "./theme.js";
|
|
30
22
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
31
23
|
|
|
32
|
-
var _ref =
|
|
24
|
+
var _ref = jsx(IconClockLine, null);
|
|
33
25
|
|
|
34
|
-
var _ref2 =
|
|
26
|
+
var _ref2 = jsx(IconClockSolid, null);
|
|
35
27
|
|
|
36
|
-
export var Timer = (_dec =
|
|
28
|
+
export var Timer = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
37
29
|
_inherits(Timer, _Component);
|
|
38
30
|
|
|
39
31
|
var _super = _createSuper(Timer);
|
|
@@ -119,13 +111,13 @@ export var Timer = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
119
111
|
}, {
|
|
120
112
|
key: "renderHelpScreenreaderText",
|
|
121
113
|
value: function renderHelpScreenreaderText() {
|
|
122
|
-
return
|
|
114
|
+
return jsx(ScreenReaderContent, null, t('During the quiz, press Alt+Shift+T to have the remaining time read'));
|
|
123
115
|
}
|
|
124
116
|
}, {
|
|
125
117
|
key: "renderMinimizedTimer",
|
|
126
118
|
value: function renderMinimizedTimer() {
|
|
127
119
|
if (this.props.iceTopNavBarEnabled) {
|
|
128
|
-
return
|
|
120
|
+
return jsx(TopNavBar.Item, {
|
|
129
121
|
id: "TimerButton",
|
|
130
122
|
onClick: partial(this.props.updateTimerMinimized, false),
|
|
131
123
|
variant: "icon",
|
|
@@ -136,20 +128,20 @@ export var Timer = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
136
128
|
}, t('Show Timer'));
|
|
137
129
|
}
|
|
138
130
|
|
|
139
|
-
return
|
|
140
|
-
|
|
141
|
-
}, this.renderHelpScreenreaderText(),
|
|
131
|
+
return jsx("div", {
|
|
132
|
+
css: this.props.styles.timer
|
|
133
|
+
}, this.renderHelpScreenreaderText(), jsx(Button, {
|
|
142
134
|
"aria-expanded": "false",
|
|
143
135
|
ref: this.showTimerRef,
|
|
144
136
|
renderIcon: IconClockLine,
|
|
145
137
|
onClick: partial(this.props.updateTimerMinimized, false)
|
|
146
|
-
},
|
|
138
|
+
}, jsx(ScreenReaderContent, null, t('Show Timer'))));
|
|
147
139
|
}
|
|
148
140
|
}, {
|
|
149
141
|
key: "renderMaximizedTimer",
|
|
150
142
|
value: function renderMaximizedTimer() {
|
|
151
143
|
if (this.props.iceTopNavBarEnabled) {
|
|
152
|
-
return
|
|
144
|
+
return jsx(TopNavBar.Item, {
|
|
153
145
|
id: "TimerButton",
|
|
154
146
|
onClick: partial(this.props.updateTimerMinimized, true),
|
|
155
147
|
variant: "forceIconWithLabel",
|
|
@@ -157,29 +149,29 @@ export var Timer = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
157
149
|
tooltip: t('Hide Timer'),
|
|
158
150
|
"aria-expanded": "true",
|
|
159
151
|
itemRef: this.hideTimerRef
|
|
160
|
-
},
|
|
152
|
+
}, jsx(FormattedDuration, {
|
|
161
153
|
seconds: this.props.timeLeftInSeconds
|
|
162
154
|
}));
|
|
163
155
|
}
|
|
164
156
|
|
|
165
|
-
return
|
|
166
|
-
|
|
167
|
-
}, this.renderHelpScreenreaderText(),
|
|
157
|
+
return jsx("div", {
|
|
158
|
+
css: this.props.styles.timer
|
|
159
|
+
}, this.renderHelpScreenreaderText(), jsx(View, {
|
|
168
160
|
as: "div"
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
}, t('Time Remaining')),
|
|
161
|
+
}, jsx("div", {
|
|
162
|
+
css: this.props.styles.timerLeft
|
|
163
|
+
}, jsx("div", {
|
|
164
|
+
css: this.props.styles.timeRemainingLabel
|
|
165
|
+
}, t('Time Remaining')), jsx(FormattedDuration, {
|
|
174
166
|
seconds: this.props.timeLeftInSeconds
|
|
175
|
-
}))),
|
|
176
|
-
|
|
177
|
-
},
|
|
167
|
+
}))), jsx("div", {
|
|
168
|
+
css: this.props.styles.timerRight
|
|
169
|
+
}, jsx(Button, {
|
|
178
170
|
"aria-expanded": "true",
|
|
179
171
|
ref: this.hideTimerRef,
|
|
180
172
|
renderIcon: IconArrowOpenStartLine,
|
|
181
173
|
onClick: partial(this.props.updateTimerMinimized, true)
|
|
182
|
-
},
|
|
174
|
+
}, jsx(ScreenReaderContent, null, t('Hide Timer')))));
|
|
183
175
|
}
|
|
184
176
|
}, {
|
|
185
177
|
key: "render",
|
|
@@ -204,7 +196,8 @@ export var Timer = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
204
196
|
timerRunning: PropTypes.bool,
|
|
205
197
|
updateTimerMinimized: PropTypes.func.isRequired,
|
|
206
198
|
iceTopNavBarEnabled: PropTypes.bool,
|
|
207
|
-
setTimerEnabled: PropTypes.func
|
|
199
|
+
setTimerEnabled: PropTypes.func,
|
|
200
|
+
styles: PropTypes.object
|
|
208
201
|
}, _class2.defaultProps = {
|
|
209
202
|
timerRunning: false,
|
|
210
203
|
timeLeftInSeconds: 0,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
timer: {
|
|
4
|
+
lineHeight: '1rem',
|
|
5
|
+
fontSize: componentTheme.timerFontSize,
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
justifyContent: 'center'
|
|
10
|
+
},
|
|
11
|
+
timerLeft: {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexDirection: 'column-reverse',
|
|
14
|
+
alignItems: 'center'
|
|
15
|
+
},
|
|
16
|
+
timerRight: {
|
|
17
|
+
padding: componentTheme.timerRightPadding
|
|
18
|
+
},
|
|
19
|
+
timeRemainingLabel: {
|
|
20
|
+
fontSize: componentTheme.timeRemainingLabelFontSize,
|
|
21
|
+
width: '100%',
|
|
22
|
+
textAlign: 'center'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
borders = _ref.borders,
|
|
4
4
|
colors = _ref.colors,
|
|
@@ -15,4 +15,6 @@ export default function generator(_ref) {
|
|
|
15
15
|
timerRightPadding: spacing.xxSmall,
|
|
16
16
|
timeRemainingLabelFontSize: typography.fontSizeXSmall
|
|
17
17
|
};
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default generateComponentTheme;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
@@ -5,24 +6,14 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
6
|
|
|
6
7
|
var _dec, _class, _class2, _temp;
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
import { Component } from 'react';
|
|
9
11
|
import PropTypes from 'prop-types';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
componentId: 'CixOW',
|
|
14
|
-
template: function template(theme) {
|
|
15
|
-
return "\n\n.CixOW_bZNM{display:flex;flex-flow:column}\n\n.CixOW_dlMM{padding-bottom:".concat(theme.firstNumberSummaryPadding || 'inherit', "}\n\n.CixOW_dWEq{padding-top:").concat(theme.secondNumberSummaryPadding || 'inherit', "}\n\n.CixOW_fJqn{color:").concat(theme.numberSummaryColor || 'inherit', ";font-size:").concat(theme.numberSummaryFontSize || 'inherit', ";font-weight:").concat(theme.numberSummaryFontWeight || 'inherit', ";margin:auto}\n\n.CixOW_EKnN{border-color:").concat(theme.verticalDotsBorderColor || 'inherit', ";border-left:dotted ").concat(theme.verticalDotsBorderWidth || 'inherit', ";height:1.5rem;margin:auto}");
|
|
16
|
-
},
|
|
17
|
-
'column': 'CixOW_bZNM',
|
|
18
|
-
'firstNumberSummary': 'CixOW_dlMM',
|
|
19
|
-
'secondNumberSummary': 'CixOW_dWEq',
|
|
20
|
-
'numberSummary': 'CixOW_fJqn',
|
|
21
|
-
'verticalDots': 'CixOW_EKnN'
|
|
22
|
-
};
|
|
23
|
-
import theme from "./theme.js";
|
|
12
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
13
|
+
import generateStyle from "./styles.js";
|
|
14
|
+
import generateComponentTheme from "./theme.js";
|
|
24
15
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
25
|
-
export var PositionSummary = (_dec =
|
|
16
|
+
export var PositionSummary = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
26
17
|
_inherits(PositionSummary, _Component);
|
|
27
18
|
|
|
28
19
|
var _super = _createSuper(PositionSummary);
|
|
@@ -36,16 +27,16 @@ export var PositionSummary = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
36
27
|
_createClass(PositionSummary, [{
|
|
37
28
|
key: "render",
|
|
38
29
|
value: function render() {
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
30
|
+
return jsx("div", {
|
|
31
|
+
css: this.props.styles.column
|
|
32
|
+
}, jsx("div", {
|
|
33
|
+
css: _objectSpread(_objectSpread({}, this.props.styles.numberSummary), this.props.styles.firstNumberSummary)
|
|
43
34
|
}, t('{first, number}', {
|
|
44
35
|
first: this.props.firstPosition
|
|
45
|
-
})),
|
|
46
|
-
|
|
47
|
-
}),
|
|
48
|
-
|
|
36
|
+
})), jsx("div", {
|
|
37
|
+
css: this.props.styles.verticalDots
|
|
38
|
+
}), jsx("div", {
|
|
39
|
+
css: _objectSpread(_objectSpread({}, this.props.styles.numberSummary), this.props.styles.secondNumberSummary)
|
|
49
40
|
}, t('{last, number}', {
|
|
50
41
|
last: this.props.lastPosition
|
|
51
42
|
})));
|
|
@@ -56,6 +47,7 @@ export var PositionSummary = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
56
47
|
return PositionSummary;
|
|
57
48
|
}(Component), _class2.propTypes = {
|
|
58
49
|
firstPosition: PropTypes.number.isRequired,
|
|
59
|
-
lastPosition: PropTypes.number.isRequired
|
|
50
|
+
lastPosition: PropTypes.number.isRequired,
|
|
51
|
+
styles: PropTypes.object
|
|
60
52
|
}, _temp)) || _class);
|
|
61
53
|
export default PositionSummary;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
column: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexFlow: 'column'
|
|
6
|
+
},
|
|
7
|
+
firstNumberSummary: {
|
|
8
|
+
paddingBottom: "".concat(componentTheme.firstNumberSummaryPadding)
|
|
9
|
+
},
|
|
10
|
+
secondNumberSummary: {
|
|
11
|
+
paddingTop: "".concat(componentTheme.secondNumberSummaryPadding)
|
|
12
|
+
},
|
|
13
|
+
numberSummary: {
|
|
14
|
+
color: componentTheme.numberSummaryColor,
|
|
15
|
+
fontSize: componentTheme.numberSummaryFontSize,
|
|
16
|
+
fontWeight: componentTheme.numberSummaryFontWeight,
|
|
17
|
+
margin: 'auto'
|
|
18
|
+
},
|
|
19
|
+
verticalDots: {
|
|
20
|
+
margin: 'auto',
|
|
21
|
+
height: '1.5rem',
|
|
22
|
+
borderLeft: "dotted ".concat(componentTheme.verticalDotsBorderWidth),
|
|
23
|
+
borderColor: componentTheme.verticalDotsBorderColor
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var colors = _ref.colors,
|
|
3
3
|
spacing = _ref.spacing,
|
|
4
4
|
borders = _ref.borders,
|
|
@@ -12,4 +12,6 @@ export default function generator(_ref) {
|
|
|
12
12
|
verticalDotsBorderWidth: borders.widthSmall,
|
|
13
13
|
verticalDotsBorderColor: colors.licorice
|
|
14
14
|
};
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default generateComponentTheme;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
@@ -6,19 +6,20 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
6
|
|
|
7
7
|
var _dec, _class, _class2, _temp;
|
|
8
8
|
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
|
|
9
11
|
/* eslint "jsx-a11y/click-events-have-key-events": "warn" */
|
|
10
|
-
import
|
|
12
|
+
import { Component } from 'react';
|
|
11
13
|
import PropTypes from 'prop-types';
|
|
12
14
|
import { List } from 'immutable';
|
|
13
15
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
14
|
-
import classNames from 'classnames';
|
|
15
16
|
import { IconMoveStartLine, IconMoveEndLine, IconPinSolid, IconQuizInstructionsLine, IconQuizTitleLine } from '@instructure/ui-icons';
|
|
16
17
|
import { AccessibleContent, ScreenReaderContent, PresentationContent } from '@instructure/ui-a11y-content';
|
|
17
18
|
import { IconButton } from '@instructure/ui-buttons';
|
|
18
19
|
import { Link } from '@instructure/ui-link';
|
|
19
20
|
import { Text } from '@instructure/ui-text';
|
|
20
21
|
import { View } from '@instructure/ui-view';
|
|
21
|
-
import {
|
|
22
|
+
import { withStyle, jsx, Global } from '@instructure/emotion';
|
|
22
23
|
import { Heading } from '@instructure/ui-heading';
|
|
23
24
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
24
25
|
import { INSTRUCTIONS_SCROLL_KEY, RESULTS_SCROLL_KEY, SIDEBAR_NAV_ID, TITLE_SCROLL_KEY } from '@instructure/quiz-common';
|
|
@@ -26,43 +27,24 @@ import { onPhone } from "../../../../util/windowChecks.js";
|
|
|
26
27
|
import CustomPropTypes from "../../../../util/CustomPropTypes.js";
|
|
27
28
|
import noop from "../../../../util/noop.js";
|
|
28
29
|
import Pin from "./Pin.js";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
'sidebar': 'bPuQe_bObp',
|
|
35
|
-
'sidebarWrapper': 'bPuQe_crKy',
|
|
36
|
-
'sidebarContent': 'bPuQe_eYGv',
|
|
37
|
-
'actionableInfo': 'bPuQe_eeTU',
|
|
38
|
-
'description': 'bPuQe_difO',
|
|
39
|
-
'headerSpacing': 'bPuQe_cjDf',
|
|
40
|
-
'headerBottomBorder': 'bPuQe_fuFE',
|
|
41
|
-
'iconWrapper': 'bPuQe_cvRx',
|
|
42
|
-
'pinnedSection': 'bPuQe_fwEb',
|
|
43
|
-
'questionNavigatorPadding': 'bPuQe_ftzv',
|
|
44
|
-
'sidebarIsOpen': 'bPuQe_eNNp',
|
|
45
|
-
'sidebarClosed': 'bPuQe_eQGE',
|
|
46
|
-
'buttonWrapper': 'bPuQe_nqth',
|
|
47
|
-
'commonContainer': 'bPuQe_eYHq'
|
|
48
|
-
};
|
|
49
|
-
import theme from "./theme.js";
|
|
50
|
-
|
|
51
|
-
var _ref = /*#__PURE__*/React.createElement(IconQuizTitleLine, {
|
|
30
|
+
import generateStyle from "./styles.js";
|
|
31
|
+
import generateComponentTheme from "./theme.js";
|
|
32
|
+
|
|
33
|
+
var _ref = jsx(IconQuizTitleLine, {
|
|
52
34
|
color: "primary"
|
|
53
35
|
});
|
|
54
36
|
|
|
55
|
-
var _ref2 =
|
|
37
|
+
var _ref2 = jsx(IconQuizInstructionsLine, {
|
|
56
38
|
color: "primary"
|
|
57
39
|
});
|
|
58
40
|
|
|
59
|
-
var _ref3 =
|
|
41
|
+
var _ref3 = jsx(IconQuizInstructionsLine, {
|
|
60
42
|
color: "primary"
|
|
61
43
|
});
|
|
62
44
|
|
|
63
|
-
var _ref4 =
|
|
45
|
+
var _ref4 = jsx(IconPinSolid, null);
|
|
64
46
|
|
|
65
|
-
export var Sidebar = (_dec =
|
|
47
|
+
export var Sidebar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
66
48
|
_inherits(Sidebar, _Component);
|
|
67
49
|
|
|
68
50
|
var _super = _createSuper(Sidebar);
|
|
@@ -123,6 +105,16 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
123
105
|
}
|
|
124
106
|
|
|
125
107
|
_createClass(Sidebar, [{
|
|
108
|
+
key: "componentDidMount",
|
|
109
|
+
value: function componentDidMount() {
|
|
110
|
+
this.props.makeStyles();
|
|
111
|
+
}
|
|
112
|
+
}, {
|
|
113
|
+
key: "componentDidUpdate",
|
|
114
|
+
value: function componentDidUpdate() {
|
|
115
|
+
this.props.makeStyles();
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
126
118
|
key: "handleTransitionEnd",
|
|
127
119
|
value: function handleTransitionEnd() {
|
|
128
120
|
// when the sidebar finishes its transition, fire a "windowResized" event
|
|
@@ -141,16 +133,16 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
141
133
|
return;
|
|
142
134
|
}
|
|
143
135
|
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
},
|
|
136
|
+
return jsx("div", {
|
|
137
|
+
css: this.props.styles.sidebar.actionableInfo
|
|
138
|
+
}, jsx(Link, {
|
|
147
139
|
href: "#",
|
|
148
140
|
margin: "small",
|
|
149
141
|
forceButtonRole: false,
|
|
150
142
|
onClick: this.scrollToTitle,
|
|
151
143
|
renderIcon: _ref
|
|
152
|
-
},
|
|
153
|
-
|
|
144
|
+
}, jsx(ScreenReaderContent, null, t('Navigate to title'))), jsx(PresentationContent, null, jsx("span", {
|
|
145
|
+
css: this.props.styles.sidebar.description,
|
|
154
146
|
onClick: this.scrollToTitle,
|
|
155
147
|
tabIndex: "-1"
|
|
156
148
|
}, this.props.title || t('Title'))));
|
|
@@ -162,17 +154,17 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
162
154
|
return;
|
|
163
155
|
}
|
|
164
156
|
|
|
165
|
-
return
|
|
166
|
-
|
|
167
|
-
},
|
|
157
|
+
return jsx("div", {
|
|
158
|
+
css: this.props.styles.sidebar.actionableInfo
|
|
159
|
+
}, jsx(Link, {
|
|
168
160
|
href: "#",
|
|
169
161
|
margin: "small",
|
|
170
162
|
forceButtonRole: false,
|
|
171
163
|
onClick: this.scrollToInfo,
|
|
172
164
|
renderIcon: _ref2,
|
|
173
165
|
"data-automation": "sidebar-instructions-button"
|
|
174
|
-
},
|
|
175
|
-
|
|
166
|
+
}, jsx(ScreenReaderContent, null, t('Navigate to instructions'))), jsx(PresentationContent, null, jsx("span", {
|
|
167
|
+
css: this.props.styles.sidebar.description,
|
|
176
168
|
"data-automation": "sidebar-instructions-text",
|
|
177
169
|
onClick: this.scrollToInfo,
|
|
178
170
|
tabIndex: "-1"
|
|
@@ -185,17 +177,17 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
185
177
|
return;
|
|
186
178
|
}
|
|
187
179
|
|
|
188
|
-
return
|
|
189
|
-
|
|
190
|
-
},
|
|
180
|
+
return jsx("div", {
|
|
181
|
+
css: this.props.styles.sidebar.actionableInfo
|
|
182
|
+
}, jsx(Link, {
|
|
191
183
|
href: "#",
|
|
192
184
|
margin: "small",
|
|
193
185
|
forceButtonRole: false,
|
|
194
186
|
onClick: this.scrollToResults,
|
|
195
187
|
renderIcon: _ref3,
|
|
196
188
|
"data-automation": "sidebar-results-button"
|
|
197
|
-
},
|
|
198
|
-
|
|
189
|
+
}, jsx(ScreenReaderContent, null, t('Navigate to results'))), jsx(PresentationContent, null, jsx("span", {
|
|
190
|
+
css: this.props.styles.sidebar.description,
|
|
199
191
|
"data-automation": "sidebar-results-text",
|
|
200
192
|
onClick: this.scrollToResults,
|
|
201
193
|
tabIndex: "-1"
|
|
@@ -204,20 +196,20 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
204
196
|
}, {
|
|
205
197
|
key: "renderSidebarHeader",
|
|
206
198
|
value: function renderSidebarHeader() {
|
|
207
|
-
var
|
|
199
|
+
var _this$props = this.props,
|
|
200
|
+
sidebarOpen = _this$props.sidebarOpen,
|
|
201
|
+
styles = _this$props.styles;
|
|
208
202
|
var SidebarIcon = sidebarOpen ? IconMoveStartLine : IconMoveEndLine;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
},
|
|
214
|
-
className: closedClasses
|
|
215
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
203
|
+
return jsx("div", {
|
|
204
|
+
css: _objectSpread(_objectSpread({}, styles.headerSpacing), styles.headerBottomBorder)
|
|
205
|
+
}, jsx("div", {
|
|
206
|
+
css: styles.questionNavigatorPadding
|
|
207
|
+
}, jsx(Heading, {
|
|
216
208
|
level: "h5",
|
|
217
209
|
as: "h2"
|
|
218
|
-
}, t('Question Navigator'))),
|
|
219
|
-
|
|
220
|
-
},
|
|
210
|
+
}, t('Question Navigator'))), jsx("div", {
|
|
211
|
+
css: styles.iconWrapper
|
|
212
|
+
}, jsx(IconButton, {
|
|
221
213
|
onClick: this.toggleSidebar,
|
|
222
214
|
size: "small",
|
|
223
215
|
margin: "none",
|
|
@@ -231,15 +223,15 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
231
223
|
}, {
|
|
232
224
|
key: "renderTotalPointsPossible",
|
|
233
225
|
value: function renderTotalPointsPossible() {
|
|
234
|
-
var _this$
|
|
235
|
-
sidebarOpen = _this$
|
|
236
|
-
totalPointsPossible = _this$
|
|
226
|
+
var _this$props2 = this.props,
|
|
227
|
+
sidebarOpen = _this$props2.sidebarOpen,
|
|
228
|
+
totalPointsPossible = _this$props2.totalPointsPossible;
|
|
237
229
|
|
|
238
230
|
if (typeof totalPointsPossible !== 'number') {
|
|
239
231
|
return null;
|
|
240
232
|
}
|
|
241
233
|
|
|
242
|
-
var pointsText =
|
|
234
|
+
var pointsText = jsx(Text, {
|
|
243
235
|
key: "pointsText",
|
|
244
236
|
size: "small",
|
|
245
237
|
weight: "bold"
|
|
@@ -249,7 +241,7 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
249
241
|
var responsiveText = pointsText;
|
|
250
242
|
|
|
251
243
|
if (sidebarOpen) {
|
|
252
|
-
responsiveText =
|
|
244
|
+
responsiveText = jsx(Text, {
|
|
253
245
|
size: "small"
|
|
254
246
|
}, t.rich('Total question points = <points/>', {
|
|
255
247
|
points: function points() {
|
|
@@ -258,11 +250,11 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
258
250
|
}));
|
|
259
251
|
}
|
|
260
252
|
|
|
261
|
-
return
|
|
253
|
+
return jsx(View, {
|
|
262
254
|
borderWidth: "0 0 small 0",
|
|
263
255
|
padding: "small x-small",
|
|
264
256
|
textAlign: sidebarOpen ? 'start' : 'center'
|
|
265
|
-
},
|
|
257
|
+
}, jsx(AccessibleContent, {
|
|
266
258
|
alt: t('Total question points = {totalPointsPossible}', {
|
|
267
259
|
totalPointsPossible: totalPointsPossible
|
|
268
260
|
})
|
|
@@ -271,38 +263,37 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
271
263
|
}, {
|
|
272
264
|
key: "renderPinned",
|
|
273
265
|
value: function renderPinned() {
|
|
274
|
-
var _this$
|
|
275
|
-
sidebarOpen = _this$
|
|
276
|
-
taking = _this$
|
|
277
|
-
pinnedItems = _this$
|
|
278
|
-
scrollToItem = _this$
|
|
266
|
+
var _this$props3 = this.props,
|
|
267
|
+
sidebarOpen = _this$props3.sidebarOpen,
|
|
268
|
+
taking = _this$props3.taking,
|
|
269
|
+
pinnedItems = _this$props3.pinnedItems,
|
|
270
|
+
scrollToItem = _this$props3.scrollToItem,
|
|
271
|
+
styles = _this$props3.styles;
|
|
279
272
|
|
|
280
273
|
if (!taking) {
|
|
281
274
|
return;
|
|
282
275
|
}
|
|
283
276
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
},
|
|
289
|
-
|
|
290
|
-
},
|
|
291
|
-
className: closedClasses
|
|
292
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
277
|
+
return jsx("div", {
|
|
278
|
+
css: _objectSpread(_objectSpread({}, styles.pinnedSection), styles.headerBottomBorder)
|
|
279
|
+
}, jsx("div", {
|
|
280
|
+
css: styles.headerSpacing
|
|
281
|
+
}, jsx("div", {
|
|
282
|
+
css: styles.buttonWrapper
|
|
283
|
+
}, jsx(Heading, {
|
|
293
284
|
level: "h5",
|
|
294
285
|
as: "h2"
|
|
295
|
-
}, t('Pinned Questions'))),
|
|
296
|
-
|
|
286
|
+
}, t('Pinned Questions'))), jsx("div", {
|
|
287
|
+
css: styles.iconWrapper,
|
|
297
288
|
"aria-hidden": sidebarOpen
|
|
298
|
-
},
|
|
289
|
+
}, jsx(Text, {
|
|
299
290
|
size: "x-small",
|
|
300
291
|
"aria-label": t('Pinned Questions'),
|
|
301
292
|
role: "img"
|
|
302
|
-
}, _ref4))),
|
|
303
|
-
|
|
293
|
+
}, _ref4))), jsx("div", {
|
|
294
|
+
css: styles.buttonWrapper
|
|
304
295
|
}, pinnedItems.map(function (pin) {
|
|
305
|
-
return
|
|
296
|
+
return jsx(Pin, {
|
|
306
297
|
key: pin.sessionItemId,
|
|
307
298
|
scrollToItem: scrollToItem,
|
|
308
299
|
position: pin.position,
|
|
@@ -313,17 +304,18 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
313
304
|
}, {
|
|
314
305
|
key: "render",
|
|
315
306
|
value: function render() {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
className: styles.commonContainer,
|
|
307
|
+
return jsx(View, null, jsx("div", {
|
|
308
|
+
css: this.props.styles.commonContainer,
|
|
319
309
|
id: "sidebar-wrapper",
|
|
320
310
|
tabIndex: "-1"
|
|
321
|
-
},
|
|
322
|
-
|
|
311
|
+
}, jsx("div", {
|
|
312
|
+
css: this.props.styles.sidebar,
|
|
323
313
|
onTransitionEnd: this.handleTransitionEnd,
|
|
324
314
|
"data-automation": this.props.sidebarOpen ? 'sdk-sidebar-open' : 'sdk-sidebar-closed'
|
|
325
|
-
},
|
|
326
|
-
|
|
315
|
+
}, jsx(Global, {
|
|
316
|
+
styles: this.props.styles.globalStyles
|
|
317
|
+
}), jsx("div", {
|
|
318
|
+
css: this.props.styles.sidebarWrapper,
|
|
327
319
|
ref: this.refWrapper,
|
|
328
320
|
role: this.props.role,
|
|
329
321
|
onBlur: this.handleBlur // for some reason, without a click handler here, a random item will
|
|
@@ -331,8 +323,8 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
331
323
|
,
|
|
332
324
|
onClick: noop,
|
|
333
325
|
id: SIDEBAR_NAV_ID
|
|
334
|
-
}, this.renderSidebarHeader(), this.renderTotalPointsPossible(), this.renderPinned(), this.renderTitle(), this.renderInstructions(), this.renderResults(),
|
|
335
|
-
|
|
326
|
+
}, this.renderSidebarHeader(), this.renderTotalPointsPossible(), this.renderPinned(), this.renderTitle(), this.renderInstructions(), this.renderResults(), jsx("div", {
|
|
327
|
+
css: this.props.styles.sidebarContent
|
|
336
328
|
}, this.props.children)))));
|
|
337
329
|
}
|
|
338
330
|
}]);
|
|
@@ -354,7 +346,9 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
354
346
|
toggleSidebar: PropTypes.func.isRequired,
|
|
355
347
|
screenreaderNotification: PropTypes.func.isRequired,
|
|
356
348
|
totalPointsPossible: PropTypes.number,
|
|
357
|
-
shouldCloseOnBlur: PropTypes.bool
|
|
349
|
+
shouldCloseOnBlur: PropTypes.bool,
|
|
350
|
+
makeStyles: PropTypes.func,
|
|
351
|
+
styles: PropTypes.object
|
|
358
352
|
}, _class2.defaultProps = {
|
|
359
353
|
grading: false,
|
|
360
354
|
taking: false,
|