@instructure/quiz-core 20.9.0 → 20.9.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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/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/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/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/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/package.json +10 -10
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = exports.Sidebar = void 0;
|
|
11
9
|
|
|
12
|
-
var
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
11
|
|
|
14
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
13
|
|
|
@@ -19,7 +17,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
19
17
|
|
|
20
18
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
19
|
|
|
22
|
-
var _react =
|
|
20
|
+
var _react = require("react");
|
|
23
21
|
|
|
24
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
23
|
|
|
@@ -27,8 +25,6 @@ var _immutable = require("immutable");
|
|
|
27
25
|
|
|
28
26
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
29
27
|
|
|
30
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
31
|
-
|
|
32
28
|
var _uiIcons = require("@instructure/ui-icons");
|
|
33
29
|
|
|
34
30
|
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
@@ -41,7 +37,7 @@ var _uiText = require("@instructure/ui-text");
|
|
|
41
37
|
|
|
42
38
|
var _uiView = require("@instructure/ui-view");
|
|
43
39
|
|
|
44
|
-
var
|
|
40
|
+
var _emotion = require("@instructure/emotion");
|
|
45
41
|
|
|
46
42
|
var _uiHeading = require("@instructure/ui-heading");
|
|
47
43
|
|
|
@@ -57,46 +53,27 @@ var _noop = _interopRequireDefault(require("../../../../util/noop.js"));
|
|
|
57
53
|
|
|
58
54
|
var _Pin = _interopRequireDefault(require("./Pin.js"));
|
|
59
55
|
|
|
56
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
57
|
+
|
|
60
58
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
61
59
|
|
|
62
60
|
var _dec, _class, _class2, _temp;
|
|
63
61
|
|
|
64
|
-
var
|
|
65
|
-
componentId: 'bPuQe',
|
|
66
|
-
template: function template(theme) {
|
|
67
|
-
return "\n\n.bPuQe_bObp{background-color:".concat(theme.sidebarBackgroundColor || 'inherit', ";border:").concat(theme.sidebarBorderWidth || 'inherit', " solid ").concat(theme.sidebarBorderColor || 'inherit', ";box-sizing:border-box;color:").concat(theme.sidebarColor || 'inherit', ";height:100%;overflow:hidden;position:relative;transition:").concat(theme.sidebarTransitionDuration || 'inherit', " ease;width:").concat(theme.sidebarWidthClosed || 'inherit', ";z-index:").concat(theme.sidebarZIndex || 'inherit', "}\n\nbody.tox-fullscreen .bPuQe_bObp{z-index:0}\n\n.bPuQe_crKy{display:flex;flex-direction:column;height:100%}\n\n.bPuQe_eYGv{overflow-x:hidden;overflow-y:auto}\n\n.bPuQe_eeTU{border-bottom:").concat(theme.sidebarHeaderBorderWidth || 'inherit', " solid ").concat(theme.sidebarHeaderBorderColor || 'inherit', ";border-right:").concat(theme.actionableInfoBorderWidth || 'inherit', " solid ").concat(theme.sidebarBackgroundColor || 'inherit', ";text-align:center}\n\n[dir=ltr] .bPuQe_eeTU,[dir=rtl] .bPuQe_eeTU{text-align:center}\n\n.bPuQe_eeTU:hover{border-right:").concat(theme.actionableInfoBorderWidth || 'inherit', " solid ").concat(theme.actionableInfoHoverBorderColor || 'inherit', "}\n\n.bPuQe_difO{color:").concat(theme.descriptionFontColor || 'inherit', ";display:none;font-size:").concat(theme.descriptionFontSize || 'inherit', "}\n\n.bPuQe_cjDf{display:flex;flex-direction:row;flex-shrink:0;padding:").concat(theme.headerSpacingPadding || 'inherit', "}\n\n.bPuQe_cjDf h2{padding-top:0.3em}\n\n.bPuQe_fuFE{border-bottom:solid ").concat(theme.sidebarHeaderBorderWidth || 'inherit', ";border-color:").concat(theme.sidebarHeaderBorderColor || 'inherit', "}\n\n.bPuQe_cvRx{margin-left:auto}\n\n.bPuQe_fwEb{background-color:").concat(theme.pinnedSectionBackgroundColor || 'inherit', ";width:100%}\n\n.bPuQe_fwEb .bPuQe_cjDf{flex-grow:1}\n\n.bPuQe_ftzv{padding-top:").concat(theme.questionNavigatorPadding || 'inherit', "}\n\n.bPuQe_bObp.bPuQe_eNNp{opacity:1;transition:").concat(theme.sidebarTransitionDuration || 'inherit', " ease;width:").concat(theme.sidebarWidthOpen || 'inherit', "}\n\n.bPuQe_eNNp .bPuQe_difO{cursor:pointer;display:inline-block}\n\n.bPuQe_eNNp .bPuQe_eeTU,[dir=ltr] .bPuQe_eNNp .bPuQe_eeTU,[dir=rtl] .bPuQe_eNNp .bPuQe_eeTU{text-align:inherit}\n\n.bPuQe_eQGE{display:none}\n\n.bPuQe_eQGE.bPuQe_cvRx{display:block;margin:auto}\n\n.bPuQe_nqth button{font-size:").concat(theme.pinnedQuestionFontSize || 'inherit', ";padding-bottom:").concat(theme.pinnedQuestionSpacing || 'inherit', ";padding-left:").concat(theme.pinnedQuestionSpacing || 'inherit', "}\n\n.bPuQe_eYHq{height:100%}\n\n@media screen and (--phoneBreakPoint){.bPuQe_eYHq{position:relative}.bPuQe_bObp{position:absolute;width:0}.bPuQe_bObp,.bPuQe_bObp.bPuQe_eNNp{transition:").concat(theme.sidebarTransitionDuration || 'inherit', " ease}.bPuQe_bObp.bPuQe_eNNp{display:inline;max-width:100vw;width:100vw}}\n\n@media print{.bPuQe_eYHq{display:none}}");
|
|
68
|
-
},
|
|
69
|
-
'sidebar': 'bPuQe_bObp',
|
|
70
|
-
'sidebarWrapper': 'bPuQe_crKy',
|
|
71
|
-
'sidebarContent': 'bPuQe_eYGv',
|
|
72
|
-
'actionableInfo': 'bPuQe_eeTU',
|
|
73
|
-
'description': 'bPuQe_difO',
|
|
74
|
-
'headerSpacing': 'bPuQe_cjDf',
|
|
75
|
-
'headerBottomBorder': 'bPuQe_fuFE',
|
|
76
|
-
'iconWrapper': 'bPuQe_cvRx',
|
|
77
|
-
'pinnedSection': 'bPuQe_fwEb',
|
|
78
|
-
'questionNavigatorPadding': 'bPuQe_ftzv',
|
|
79
|
-
'sidebarIsOpen': 'bPuQe_eNNp',
|
|
80
|
-
'sidebarClosed': 'bPuQe_eQGE',
|
|
81
|
-
'buttonWrapper': 'bPuQe_nqth',
|
|
82
|
-
'commonContainer': 'bPuQe_eYHq'
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
var _ref = /*#__PURE__*/_react.default.createElement(_uiIcons.IconQuizTitleLine, {
|
|
62
|
+
var _ref = (0, _emotion.jsx)(_uiIcons.IconQuizTitleLine, {
|
|
86
63
|
color: "primary"
|
|
87
64
|
});
|
|
88
65
|
|
|
89
|
-
var _ref2 =
|
|
66
|
+
var _ref2 = (0, _emotion.jsx)(_uiIcons.IconQuizInstructionsLine, {
|
|
90
67
|
color: "primary"
|
|
91
68
|
});
|
|
92
69
|
|
|
93
|
-
var _ref3 =
|
|
70
|
+
var _ref3 = (0, _emotion.jsx)(_uiIcons.IconQuizInstructionsLine, {
|
|
94
71
|
color: "primary"
|
|
95
72
|
});
|
|
96
73
|
|
|
97
|
-
var _ref4 =
|
|
74
|
+
var _ref4 = (0, _emotion.jsx)(_uiIcons.IconPinSolid, null);
|
|
98
75
|
|
|
99
|
-
var Sidebar = (_dec = (0,
|
|
76
|
+
var Sidebar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
100
77
|
(0, _inherits2.default)(Sidebar, _Component);
|
|
101
78
|
|
|
102
79
|
var _super = (0, _createSuper2.default)(Sidebar);
|
|
@@ -157,6 +134,16 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
157
134
|
}
|
|
158
135
|
|
|
159
136
|
(0, _createClass2.default)(Sidebar, [{
|
|
137
|
+
key: "componentDidMount",
|
|
138
|
+
value: function componentDidMount() {
|
|
139
|
+
this.props.makeStyles();
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
key: "componentDidUpdate",
|
|
143
|
+
value: function componentDidUpdate() {
|
|
144
|
+
this.props.makeStyles();
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
160
147
|
key: "handleTransitionEnd",
|
|
161
148
|
value: function handleTransitionEnd() {
|
|
162
149
|
// when the sidebar finishes its transition, fire a "windowResized" event
|
|
@@ -175,16 +162,16 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
175
162
|
return;
|
|
176
163
|
}
|
|
177
164
|
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
},
|
|
165
|
+
return (0, _emotion.jsx)("div", {
|
|
166
|
+
css: this.props.styles.sidebar.actionableInfo
|
|
167
|
+
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
181
168
|
href: "#",
|
|
182
169
|
margin: "small",
|
|
183
170
|
forceButtonRole: false,
|
|
184
171
|
onClick: this.scrollToTitle,
|
|
185
172
|
renderIcon: _ref
|
|
186
|
-
},
|
|
187
|
-
|
|
173
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Navigate to title'))), (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, (0, _emotion.jsx)("span", {
|
|
174
|
+
css: this.props.styles.sidebar.description,
|
|
188
175
|
onClick: this.scrollToTitle,
|
|
189
176
|
tabIndex: "-1"
|
|
190
177
|
}, this.props.title || (0, _formatMessage.default)('Title'))));
|
|
@@ -196,17 +183,17 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
196
183
|
return;
|
|
197
184
|
}
|
|
198
185
|
|
|
199
|
-
return
|
|
200
|
-
|
|
201
|
-
},
|
|
186
|
+
return (0, _emotion.jsx)("div", {
|
|
187
|
+
css: this.props.styles.sidebar.actionableInfo
|
|
188
|
+
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
202
189
|
href: "#",
|
|
203
190
|
margin: "small",
|
|
204
191
|
forceButtonRole: false,
|
|
205
192
|
onClick: this.scrollToInfo,
|
|
206
193
|
renderIcon: _ref2,
|
|
207
194
|
"data-automation": "sidebar-instructions-button"
|
|
208
|
-
},
|
|
209
|
-
|
|
195
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Navigate to instructions'))), (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, (0, _emotion.jsx)("span", {
|
|
196
|
+
css: this.props.styles.sidebar.description,
|
|
210
197
|
"data-automation": "sidebar-instructions-text",
|
|
211
198
|
onClick: this.scrollToInfo,
|
|
212
199
|
tabIndex: "-1"
|
|
@@ -219,17 +206,17 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
219
206
|
return;
|
|
220
207
|
}
|
|
221
208
|
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
},
|
|
209
|
+
return (0, _emotion.jsx)("div", {
|
|
210
|
+
css: this.props.styles.sidebar.actionableInfo
|
|
211
|
+
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
225
212
|
href: "#",
|
|
226
213
|
margin: "small",
|
|
227
214
|
forceButtonRole: false,
|
|
228
215
|
onClick: this.scrollToResults,
|
|
229
216
|
renderIcon: _ref3,
|
|
230
217
|
"data-automation": "sidebar-results-button"
|
|
231
|
-
},
|
|
232
|
-
|
|
218
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Navigate to results'))), (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, (0, _emotion.jsx)("span", {
|
|
219
|
+
css: this.props.styles.sidebar.description,
|
|
233
220
|
"data-automation": "sidebar-results-text",
|
|
234
221
|
onClick: this.scrollToResults,
|
|
235
222
|
tabIndex: "-1"
|
|
@@ -238,20 +225,20 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
238
225
|
}, {
|
|
239
226
|
key: "renderSidebarHeader",
|
|
240
227
|
value: function renderSidebarHeader() {
|
|
241
|
-
var
|
|
228
|
+
var _this$props = this.props,
|
|
229
|
+
sidebarOpen = _this$props.sidebarOpen,
|
|
230
|
+
styles = _this$props.styles;
|
|
242
231
|
var SidebarIcon = sidebarOpen ? _uiIcons.IconMoveStartLine : _uiIcons.IconMoveEndLine;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
},
|
|
248
|
-
className: closedClasses
|
|
249
|
-
}, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
|
|
232
|
+
return (0, _emotion.jsx)("div", {
|
|
233
|
+
css: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles.headerSpacing), styles.headerBottomBorder)
|
|
234
|
+
}, (0, _emotion.jsx)("div", {
|
|
235
|
+
css: styles.questionNavigatorPadding
|
|
236
|
+
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
250
237
|
level: "h5",
|
|
251
238
|
as: "h2"
|
|
252
|
-
}, (0, _formatMessage.default)('Question Navigator'))),
|
|
253
|
-
|
|
254
|
-
},
|
|
239
|
+
}, (0, _formatMessage.default)('Question Navigator'))), (0, _emotion.jsx)("div", {
|
|
240
|
+
css: styles.iconWrapper
|
|
241
|
+
}, (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
255
242
|
onClick: this.toggleSidebar,
|
|
256
243
|
size: "small",
|
|
257
244
|
margin: "none",
|
|
@@ -265,26 +252,25 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
265
252
|
}, {
|
|
266
253
|
key: "renderTotalPointsPossible",
|
|
267
254
|
value: function renderTotalPointsPossible() {
|
|
268
|
-
var _this$
|
|
269
|
-
sidebarOpen = _this$
|
|
270
|
-
totalPointsPossible = _this$
|
|
255
|
+
var _this$props2 = this.props,
|
|
256
|
+
sidebarOpen = _this$props2.sidebarOpen,
|
|
257
|
+
totalPointsPossible = _this$props2.totalPointsPossible;
|
|
271
258
|
|
|
272
259
|
if (typeof totalPointsPossible !== 'number') {
|
|
273
260
|
return null;
|
|
274
261
|
}
|
|
275
262
|
|
|
276
|
-
var pointsText =
|
|
263
|
+
var pointsText = (0, _emotion.jsx)(_uiText.Text, {
|
|
277
264
|
key: "pointsText",
|
|
278
265
|
size: "small",
|
|
279
266
|
weight: "bold"
|
|
280
267
|
}, (0, _formatMessage.default)("{\n totalPointsPossible, plural,\n one {# pt}\n other {# pts}\n }", {
|
|
281
268
|
totalPointsPossible: totalPointsPossible
|
|
282
269
|
}));
|
|
283
|
-
|
|
284
270
|
var responsiveText = pointsText;
|
|
285
271
|
|
|
286
272
|
if (sidebarOpen) {
|
|
287
|
-
responsiveText =
|
|
273
|
+
responsiveText = (0, _emotion.jsx)(_uiText.Text, {
|
|
288
274
|
size: "small"
|
|
289
275
|
}, _formatMessage.default.rich('Total question points = <points/>', {
|
|
290
276
|
points: function points() {
|
|
@@ -293,11 +279,11 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
293
279
|
}));
|
|
294
280
|
}
|
|
295
281
|
|
|
296
|
-
return
|
|
282
|
+
return (0, _emotion.jsx)(_uiView.View, {
|
|
297
283
|
borderWidth: "0 0 small 0",
|
|
298
284
|
padding: "small x-small",
|
|
299
285
|
textAlign: sidebarOpen ? 'start' : 'center'
|
|
300
|
-
},
|
|
286
|
+
}, (0, _emotion.jsx)(_uiA11yContent.AccessibleContent, {
|
|
301
287
|
alt: (0, _formatMessage.default)('Total question points = {totalPointsPossible}', {
|
|
302
288
|
totalPointsPossible: totalPointsPossible
|
|
303
289
|
})
|
|
@@ -306,38 +292,37 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
306
292
|
}, {
|
|
307
293
|
key: "renderPinned",
|
|
308
294
|
value: function renderPinned() {
|
|
309
|
-
var _this$
|
|
310
|
-
sidebarOpen = _this$
|
|
311
|
-
taking = _this$
|
|
312
|
-
pinnedItems = _this$
|
|
313
|
-
scrollToItem = _this$
|
|
295
|
+
var _this$props3 = this.props,
|
|
296
|
+
sidebarOpen = _this$props3.sidebarOpen,
|
|
297
|
+
taking = _this$props3.taking,
|
|
298
|
+
pinnedItems = _this$props3.pinnedItems,
|
|
299
|
+
scrollToItem = _this$props3.scrollToItem,
|
|
300
|
+
styles = _this$props3.styles;
|
|
314
301
|
|
|
315
302
|
if (!taking) {
|
|
316
303
|
return;
|
|
317
304
|
}
|
|
318
305
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
},
|
|
324
|
-
|
|
325
|
-
},
|
|
326
|
-
className: closedClasses
|
|
327
|
-
}, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
|
|
306
|
+
return (0, _emotion.jsx)("div", {
|
|
307
|
+
css: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles.pinnedSection), styles.headerBottomBorder)
|
|
308
|
+
}, (0, _emotion.jsx)("div", {
|
|
309
|
+
css: styles.headerSpacing
|
|
310
|
+
}, (0, _emotion.jsx)("div", {
|
|
311
|
+
css: styles.buttonWrapper
|
|
312
|
+
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
328
313
|
level: "h5",
|
|
329
314
|
as: "h2"
|
|
330
|
-
}, (0, _formatMessage.default)('Pinned Questions'))),
|
|
331
|
-
|
|
315
|
+
}, (0, _formatMessage.default)('Pinned Questions'))), (0, _emotion.jsx)("div", {
|
|
316
|
+
css: styles.iconWrapper,
|
|
332
317
|
"aria-hidden": sidebarOpen
|
|
333
|
-
},
|
|
318
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
334
319
|
size: "x-small",
|
|
335
320
|
"aria-label": (0, _formatMessage.default)('Pinned Questions'),
|
|
336
321
|
role: "img"
|
|
337
|
-
}, _ref4))),
|
|
338
|
-
|
|
322
|
+
}, _ref4))), (0, _emotion.jsx)("div", {
|
|
323
|
+
css: styles.buttonWrapper
|
|
339
324
|
}, pinnedItems.map(function (pin) {
|
|
340
|
-
return
|
|
325
|
+
return (0, _emotion.jsx)(_Pin.default, {
|
|
341
326
|
key: pin.sessionItemId,
|
|
342
327
|
scrollToItem: scrollToItem,
|
|
343
328
|
position: pin.position,
|
|
@@ -348,17 +333,18 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
348
333
|
}, {
|
|
349
334
|
key: "render",
|
|
350
335
|
value: function render() {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
className: styles.commonContainer,
|
|
336
|
+
return (0, _emotion.jsx)(_uiView.View, null, (0, _emotion.jsx)("div", {
|
|
337
|
+
css: this.props.styles.commonContainer,
|
|
354
338
|
id: "sidebar-wrapper",
|
|
355
339
|
tabIndex: "-1"
|
|
356
|
-
},
|
|
357
|
-
|
|
340
|
+
}, (0, _emotion.jsx)("div", {
|
|
341
|
+
css: this.props.styles.sidebar,
|
|
358
342
|
onTransitionEnd: this.handleTransitionEnd,
|
|
359
343
|
"data-automation": this.props.sidebarOpen ? 'sdk-sidebar-open' : 'sdk-sidebar-closed'
|
|
360
|
-
},
|
|
361
|
-
|
|
344
|
+
}, (0, _emotion.jsx)(_emotion.Global, {
|
|
345
|
+
styles: this.props.styles.globalStyles
|
|
346
|
+
}), (0, _emotion.jsx)("div", {
|
|
347
|
+
css: this.props.styles.sidebarWrapper,
|
|
362
348
|
ref: this.refWrapper,
|
|
363
349
|
role: this.props.role,
|
|
364
350
|
onBlur: this.handleBlur // for some reason, without a click handler here, a random item will
|
|
@@ -366,8 +352,8 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
366
352
|
,
|
|
367
353
|
onClick: _noop.default,
|
|
368
354
|
id: _quizCommon.SIDEBAR_NAV_ID
|
|
369
|
-
}, this.renderSidebarHeader(), this.renderTotalPointsPossible(), this.renderPinned(), this.renderTitle(), this.renderInstructions(), this.renderResults(),
|
|
370
|
-
|
|
355
|
+
}, this.renderSidebarHeader(), this.renderTotalPointsPossible(), this.renderPinned(), this.renderTitle(), this.renderInstructions(), this.renderResults(), (0, _emotion.jsx)("div", {
|
|
356
|
+
css: this.props.styles.sidebarContent
|
|
371
357
|
}, this.props.children)))));
|
|
372
358
|
}
|
|
373
359
|
}]);
|
|
@@ -388,7 +374,9 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
388
374
|
toggleSidebar: _propTypes.default.func.isRequired,
|
|
389
375
|
screenreaderNotification: _propTypes.default.func.isRequired,
|
|
390
376
|
totalPointsPossible: _propTypes.default.number,
|
|
391
|
-
shouldCloseOnBlur: _propTypes.default.bool
|
|
377
|
+
shouldCloseOnBlur: _propTypes.default.bool,
|
|
378
|
+
makeStyles: _propTypes.default.func,
|
|
379
|
+
styles: _propTypes.default.object
|
|
392
380
|
}, _class2.defaultProps = {
|
|
393
381
|
grading: false,
|
|
394
382
|
taking: false,
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
|
+
|
|
14
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
15
|
+
var _commonContainer;
|
|
16
|
+
|
|
17
|
+
var mq = "@media screen and (".concat(componentTheme.phoneBreakPoint, ")");
|
|
18
|
+
var mp = '@media print';
|
|
19
|
+
return {
|
|
20
|
+
sidebar: (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _defineProperty2.default)({
|
|
21
|
+
boxSizing: 'border-box',
|
|
22
|
+
width: componentTheme.sidebarWidthClosed,
|
|
23
|
+
backgroundColor: componentTheme.sidebarBackgroundColor,
|
|
24
|
+
border: "".concat(componentTheme.sidebarBorderWidth, " solid ").concat(componentTheme.sidebarBorderColor),
|
|
25
|
+
color: componentTheme.sidebarColor,
|
|
26
|
+
height: '100%',
|
|
27
|
+
overflow: 'hidden',
|
|
28
|
+
position: 'relative',
|
|
29
|
+
zIndex: componentTheme.sidebarZIndex,
|
|
30
|
+
transition: "".concat(componentTheme.sidebarTransitionDuration, " ease")
|
|
31
|
+
}, mq, {
|
|
32
|
+
position: 'absolute',
|
|
33
|
+
width: 0
|
|
34
|
+
}), props.sidebarOpen && (0, _defineProperty2.default)({
|
|
35
|
+
width: componentTheme.sidebarWidthOpen,
|
|
36
|
+
opacity: 1
|
|
37
|
+
}, mq, {
|
|
38
|
+
width: '100vw',
|
|
39
|
+
maxWidth: '100vw'
|
|
40
|
+
})), {}, {
|
|
41
|
+
description: (0, _objectSpread3.default)({
|
|
42
|
+
color: componentTheme.descriptionFontColor,
|
|
43
|
+
display: 'none',
|
|
44
|
+
fontSize: componentTheme.descriptionFontSize
|
|
45
|
+
}, props.sidebarOpen && {
|
|
46
|
+
cursor: 'pointer',
|
|
47
|
+
display: 'inline-block'
|
|
48
|
+
}),
|
|
49
|
+
actionableInfo: (0, _objectSpread3.default)({
|
|
50
|
+
borderBottom: "".concat(componentTheme.sidebarHeaderBorderWidth, " solid ").concat(componentTheme.sidebarHeaderBorderColor),
|
|
51
|
+
borderRight: "".concat(componentTheme.actionableInfoBorderWidth, " solid ").concat(componentTheme.sidebarBackgroundColor),
|
|
52
|
+
textAlign: 'center',
|
|
53
|
+
':hover': {
|
|
54
|
+
borderRight: "".concat(componentTheme.actionableInfoBorderWidth, " solid ").concat(componentTheme.actionableInfoHoverBorderColor)
|
|
55
|
+
}
|
|
56
|
+
}, props.sidebarOpen && {
|
|
57
|
+
textAlign: 'inherit'
|
|
58
|
+
})
|
|
59
|
+
}),
|
|
60
|
+
|
|
61
|
+
/* Decrease z-index when RCE editor is in fullscreen mode */
|
|
62
|
+
globalStyles: {
|
|
63
|
+
sidebar: {
|
|
64
|
+
zIndex: 0
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
sidebarWrapper: {
|
|
68
|
+
display: 'flex',
|
|
69
|
+
flexDirection: 'column',
|
|
70
|
+
height: '100%'
|
|
71
|
+
},
|
|
72
|
+
sidebarContent: {
|
|
73
|
+
overflowY: 'auto',
|
|
74
|
+
overflowX: 'hidden'
|
|
75
|
+
},
|
|
76
|
+
headerSpacing: {
|
|
77
|
+
display: 'flex',
|
|
78
|
+
flexDirection: 'row',
|
|
79
|
+
padding: componentTheme.headerSpacingPadding,
|
|
80
|
+
flexShrink: 0,
|
|
81
|
+
h2: {
|
|
82
|
+
paddingTop: '0.3em'
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
headerBottomBorder: {
|
|
86
|
+
borderBottom: "solid ".concat(componentTheme.sidebarHeaderBorderWidth),
|
|
87
|
+
borderColor: componentTheme.sidebarHeaderBorderColor
|
|
88
|
+
},
|
|
89
|
+
iconWrapper: (0, _objectSpread3.default)({
|
|
90
|
+
marginLeft: 'auto'
|
|
91
|
+
}, !props.sidebarOpen && {
|
|
92
|
+
display: 'block',
|
|
93
|
+
margin: 'auto'
|
|
94
|
+
}),
|
|
95
|
+
pinnedSection: {
|
|
96
|
+
width: '100%',
|
|
97
|
+
backgroundColor: componentTheme.pinnedSectionBackgroundColor,
|
|
98
|
+
headerSpacing: {
|
|
99
|
+
flexGrow: 1
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
questionNavigatorPadding: (0, _objectSpread3.default)({
|
|
103
|
+
paddingTop: componentTheme.questionNavigatorPadding
|
|
104
|
+
}, !props.sidebarOpen && {
|
|
105
|
+
display: 'none'
|
|
106
|
+
}),
|
|
107
|
+
buttonWrapper: (0, _objectSpread3.default)({
|
|
108
|
+
button: {
|
|
109
|
+
paddingLeft: componentTheme.pinnedQuestionSpacing,
|
|
110
|
+
paddingBottom: componentTheme.pinnedQuestionSpacing,
|
|
111
|
+
fontSize: componentTheme.pinnedQuestionFontSize,
|
|
112
|
+
display: 'block'
|
|
113
|
+
}
|
|
114
|
+
}, !props.sidebarOpen && {
|
|
115
|
+
display: 'none'
|
|
116
|
+
}),
|
|
117
|
+
commonContainer: (_commonContainer = {
|
|
118
|
+
height: '100%'
|
|
119
|
+
}, (0, _defineProperty2.default)(_commonContainer, mq, {
|
|
120
|
+
position: 'relative'
|
|
121
|
+
}), (0, _defineProperty2.default)(_commonContainer, mp, {
|
|
122
|
+
display: 'none'
|
|
123
|
+
}), _commonContainer)
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
var _default = generateStyle;
|
|
128
|
+
exports.default = _default;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _uiColorUtils = require("@instructure/ui-color-utils");
|
|
9
9
|
|
|
10
|
-
function
|
|
10
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
11
11
|
var colors = _ref.colors,
|
|
12
12
|
spacing = _ref.spacing,
|
|
13
13
|
typography = _ref.typography,
|
|
@@ -42,11 +42,7 @@ function generator(_ref) {
|
|
|
42
42
|
focusBorderColor: colors.brand,
|
|
43
43
|
focusOutlineColor: (0, _uiColorUtils.alpha)(colors.brand, 50)
|
|
44
44
|
};
|
|
45
|
-
}
|
|
45
|
+
};
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
focusBorderColor: variables['ic-brand-primary'],
|
|
50
|
-
focusOutlineColor: (0, _uiColorUtils.alpha)(variables['ic-brand-primary'], 50)
|
|
51
|
-
};
|
|
52
|
-
};
|
|
47
|
+
var _default = generateComponentTheme;
|
|
48
|
+
exports.default = _default;
|