@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,8 +2,6 @@
|
|
|
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
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -31,24 +29,17 @@ var _index = _interopRequireDefault(require("../../../../../common/components/sh
|
|
|
31
29
|
|
|
32
30
|
var _quizCommon = require("@instructure/quiz-common");
|
|
33
31
|
|
|
34
|
-
var
|
|
32
|
+
var _emotion = require("@instructure/emotion");
|
|
35
33
|
|
|
36
34
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
37
35
|
|
|
36
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
37
|
+
|
|
38
38
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
39
39
|
|
|
40
40
|
var _dec, _class, _class2, _temp;
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
componentId: 'exAHi',
|
|
44
|
-
template: function template(theme) {
|
|
45
|
-
return "\n\n.exAHi_cKjJ{color:".concat(theme.quizSavingColor || 'inherit', ";margin:").concat(theme.quizSavingMargin || 'inherit', "}\n\n.exAHi_dxna{align-items:center;display:flex;height:100%;margin-right:").concat(theme.buttonsHolderMargin || 'inherit', "}\n\n.exAHi_cLWx{font-size:").concat(theme.menuIconFontSize || 'inherit', ";margin-right:").concat(theme.menuIconMargin || 'inherit', ";vertical-align:middle}");
|
|
46
|
-
},
|
|
47
|
-
'quizSaving': 'exAHi_cKjJ',
|
|
48
|
-
'buttonsHolder': 'exAHi_dxna',
|
|
49
|
-
'menuIcon': 'exAHi_cLWx'
|
|
50
|
-
};
|
|
51
|
-
var BuildingButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
42
|
+
var BuildingButtons = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
52
43
|
(0, _inherits2.default)(BuildingButtons, _Component);
|
|
53
44
|
|
|
54
45
|
var _super = (0, _createSuper2.default)(BuildingButtons);
|
|
@@ -107,8 +98,8 @@ var BuildingButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
107
98
|
key: "renderSavingMessage",
|
|
108
99
|
value: function renderSavingMessage() {
|
|
109
100
|
if (this.props.quizSaving) {
|
|
110
|
-
return
|
|
111
|
-
|
|
101
|
+
return (0, _emotion.jsx)("div", {
|
|
102
|
+
css: this.props.styles.quizSaving
|
|
112
103
|
}, (0, _formatMessage.default)('Saving...'));
|
|
113
104
|
}
|
|
114
105
|
}
|
|
@@ -124,43 +115,43 @@ var BuildingButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
124
115
|
var menuItems = [];
|
|
125
116
|
|
|
126
117
|
if (this.props.speedgraderLink) {
|
|
127
|
-
menuItems.push(
|
|
118
|
+
menuItems.push((0, _emotion.jsx)(_uiMenu.Menu.Item, {
|
|
128
119
|
key: "speedgrader",
|
|
129
120
|
onSelect: this.openSpeedgraderLink
|
|
130
|
-
},
|
|
131
|
-
|
|
121
|
+
}, (0, _emotion.jsx)(_uiIcons.IconSpeedGraderLine, {
|
|
122
|
+
css: this.props.styles.menuIcon
|
|
132
123
|
}), (0, _formatMessage.default)('Speedgrader')));
|
|
133
124
|
}
|
|
134
125
|
|
|
135
|
-
menuItems.push(
|
|
126
|
+
menuItems.push((0, _emotion.jsx)(_uiMenu.Menu.Item, {
|
|
136
127
|
key: "import",
|
|
137
128
|
disabled: !this.props.canImport,
|
|
138
129
|
onSelect: this.props.openModal,
|
|
139
130
|
"data-automation": "sdk-import-content-menuitem"
|
|
140
|
-
},
|
|
141
|
-
|
|
131
|
+
}, (0, _emotion.jsx)(_uiIcons.IconImportLine, {
|
|
132
|
+
css: this.props.styles.menuIcon,
|
|
142
133
|
"data-automation": "sdk-import-content-icon"
|
|
143
134
|
}), (0, _formatMessage.default)('Import Content')));
|
|
144
135
|
|
|
145
136
|
if (this.props.contentExportEnabled) {
|
|
146
|
-
menuItems.push(
|
|
137
|
+
menuItems.push((0, _emotion.jsx)(_uiMenu.Menu.Item, {
|
|
147
138
|
key: "export",
|
|
148
139
|
disabled: !this.props.canExport,
|
|
149
140
|
onSelect: this.startQuizExportJob,
|
|
150
141
|
"data-automation": "sdk-export-content-menuitem"
|
|
151
|
-
},
|
|
152
|
-
|
|
142
|
+
}, (0, _emotion.jsx)(_uiIcons.IconExportLine, {
|
|
143
|
+
css: this.props.styles.menuIcon,
|
|
153
144
|
"data-automation": "sdk-export-content-icon"
|
|
154
145
|
}), (0, _formatMessage.default)('Export Content')));
|
|
155
146
|
}
|
|
156
147
|
|
|
157
148
|
if (this.props.enableItemBanking) {
|
|
158
|
-
menuItems.push(
|
|
149
|
+
menuItems.push((0, _emotion.jsx)(_uiMenu.Menu.Item, {
|
|
159
150
|
key: "banks",
|
|
160
151
|
onSelect: this.props.navigateToBanks,
|
|
161
152
|
"data-automation": "sdk-manage-item-banks-menuitem"
|
|
162
|
-
},
|
|
163
|
-
|
|
153
|
+
}, (0, _emotion.jsx)(_uiIcons.IconBankLine, {
|
|
154
|
+
css: this.props.styles.menuIcon,
|
|
164
155
|
"data-automation": "sdk-manage-item-banks-icon"
|
|
165
156
|
}), (0, _formatMessage.default)('Manage Item Banks')));
|
|
166
157
|
}
|
|
@@ -169,26 +160,26 @@ var BuildingButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
169
160
|
{
|
|
170
161
|
/* eslint-disable react/jsx-no-bind */
|
|
171
162
|
}
|
|
172
|
-
menuItems.push(
|
|
163
|
+
menuItems.push((0, _emotion.jsx)(_uiMenu.Menu.Item, {
|
|
173
164
|
key: "printKey",
|
|
174
165
|
disabled: !this.props.hasQuestions || this.props.isEditing,
|
|
175
166
|
onSelect: function onSelect() {
|
|
176
167
|
return handlePrint(_quizCommon.PRINT_CURRENT_PAGE);
|
|
177
168
|
},
|
|
178
169
|
"data-automation": "sdk-print-key-menuitem"
|
|
179
|
-
},
|
|
180
|
-
|
|
170
|
+
}, (0, _emotion.jsx)(_uiIcons.IconPrinterLine, {
|
|
171
|
+
css: this.props.styles.menuIcon,
|
|
181
172
|
"data-automation": "sdk-print-icon"
|
|
182
173
|
}), (0, _formatMessage.default)('Print Key (With Answers)')));
|
|
183
|
-
menuItems.push(
|
|
174
|
+
menuItems.push((0, _emotion.jsx)(_uiMenu.Menu.Item, {
|
|
184
175
|
key: "printBlank",
|
|
185
176
|
disabled: !this.props.hasQuestions || this.props.isEditing,
|
|
186
177
|
onSelect: function onSelect() {
|
|
187
178
|
return handlePrint(_quizCommon.PRINT_BLANK);
|
|
188
179
|
},
|
|
189
180
|
"data-automation": "sdk-print-blank-menuitem"
|
|
190
|
-
},
|
|
191
|
-
|
|
181
|
+
}, (0, _emotion.jsx)(_uiIcons.IconPrinterLine, {
|
|
182
|
+
css: this.props.styles.menuIcon,
|
|
192
183
|
"data-automation": "sdk-print-blank-icon"
|
|
193
184
|
}), (0, _formatMessage.default)('Print Blank Quiz')));
|
|
194
185
|
{
|
|
@@ -197,8 +188,8 @@ var BuildingButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
197
188
|
}
|
|
198
189
|
|
|
199
190
|
if (menuItems.length < 1) return;
|
|
200
|
-
return
|
|
201
|
-
trigger:
|
|
191
|
+
return (0, _emotion.jsx)(_uiMenu.Menu, {
|
|
192
|
+
trigger: (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
202
193
|
renderIcon: _uiIcons.IconMoreSolid,
|
|
203
194
|
withBackground: false,
|
|
204
195
|
withBorder: false,
|
|
@@ -212,9 +203,9 @@ var BuildingButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
212
203
|
value: function render() {
|
|
213
204
|
var _this2 = this;
|
|
214
205
|
|
|
215
|
-
return
|
|
216
|
-
|
|
217
|
-
}, this.renderSavingMessage(),
|
|
206
|
+
return (0, _emotion.jsx)("div", {
|
|
207
|
+
css: this.props.styles.buttonsHolder
|
|
208
|
+
}, this.renderSavingMessage(), (0, _emotion.jsx)(_index.default, {
|
|
218
209
|
render: function render(handlePrint) {
|
|
219
210
|
return _this2.renderMenu(handlePrint);
|
|
220
211
|
},
|
|
@@ -245,7 +236,8 @@ var BuildingButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
245
236
|
setBanksTrayButtonRef: _propTypes.default.func.isRequired,
|
|
246
237
|
speedgraderLink: _propTypes.default.string,
|
|
247
238
|
startExport: _propTypes.default.func.isRequired,
|
|
248
|
-
contextUuid: _propTypes.default.string
|
|
239
|
+
contextUuid: _propTypes.default.string,
|
|
240
|
+
styles: _propTypes.default.object
|
|
249
241
|
}, _class2.defaultProps = {
|
|
250
242
|
activeQuizId: null,
|
|
251
243
|
addInfo: function addInfo() {},
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
return {
|
|
10
|
+
quizSaving: {
|
|
11
|
+
color: componentTheme.quizSavingColor,
|
|
12
|
+
margin: componentTheme.quizSavingMargin
|
|
13
|
+
},
|
|
14
|
+
buttonsHolder: {
|
|
15
|
+
height: '100%',
|
|
16
|
+
marginRight: componentTheme.buttonsHolderMargin,
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center'
|
|
19
|
+
},
|
|
20
|
+
menuIcon: {
|
|
21
|
+
verticalAlign: 'middle',
|
|
22
|
+
marginRight: componentTheme.menuIconMargin,
|
|
23
|
+
fontSize: componentTheme.menuIconFontSize
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var _default = generateStyle;
|
|
29
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var colors = _ref.colors,
|
|
10
10
|
spacing = _ref.spacing,
|
|
11
11
|
typography = _ref.typography;
|
|
@@ -16,4 +16,7 @@ function generator(_ref) {
|
|
|
16
16
|
menuIconMargin: spacing.xSmall,
|
|
17
17
|
menuIconFontSize: typography.fontSizeLarge
|
|
18
18
|
};
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var _default = generateComponentTheme;
|
|
22
|
+
exports.default = _default;
|
|
@@ -2,15 +2,11 @@
|
|
|
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.ActionButtons = void 0;
|
|
11
9
|
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
11
|
|
|
16
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -19,19 +15,17 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
19
15
|
|
|
20
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
17
|
|
|
22
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
23
19
|
|
|
24
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
21
|
|
|
26
22
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
27
23
|
|
|
28
|
-
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
29
|
-
|
|
30
24
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
31
25
|
|
|
32
26
|
var _uiIcons = require("@instructure/ui-icons");
|
|
33
27
|
|
|
34
|
-
var
|
|
28
|
+
var _emotion = require("@instructure/emotion");
|
|
35
29
|
|
|
36
30
|
var _index = _interopRequireDefault(require("../../../../common/components/shared/drag_and_drop/DragHandle/index.js"));
|
|
37
31
|
|
|
@@ -41,21 +35,14 @@ var _noop = _interopRequireDefault(require("../../../../common/util/noop.js"));
|
|
|
41
35
|
|
|
42
36
|
var _quizCommon = require("@instructure/quiz-common");
|
|
43
37
|
|
|
38
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
39
|
+
|
|
44
40
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
45
41
|
|
|
46
42
|
var _dec, _class, _class2, _temp;
|
|
47
43
|
|
|
48
|
-
var styles = {
|
|
49
|
-
componentId: 'gEXZO',
|
|
50
|
-
template: function template(theme) {
|
|
51
|
-
return "\n\n.gEXZO_exDh{color:".concat(theme.buttonsColor || 'inherit', ";display:inline-flex;flex:0 0 auto;font-size:1.1rem;padding:0 ").concat(theme.buttonsPadding || 'inherit', ";text-align:right;z-index:").concat(theme.buttonsZIndex || 'inherit', "}\n\n[dir=ltr] .gEXZO_exDh,[dir=rtl] .gEXZO_exDh{text-align:right}\n\n.gEXZO_fwKS.gEXZO_bBLs,body.tox-fullscreen .gEXZO_exDh{display:none}\n\n@media print{.gEXZO_exDh{display:none}}");
|
|
52
|
-
},
|
|
53
|
-
'buttons': 'gEXZO_exDh',
|
|
54
|
-
'edit': 'gEXZO_fwKS',
|
|
55
|
-
'hide': 'gEXZO_bBLs'
|
|
56
|
-
};
|
|
57
44
|
var ScrollTargetButton = (0, _makeScrollable.default)(_uiButtons.IconButton);
|
|
58
|
-
var ActionButtons = (_dec = (0,
|
|
45
|
+
var ActionButtons = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
59
46
|
(0, _inherits2.default)(ActionButtons, _Component);
|
|
60
47
|
|
|
61
48
|
var _super = (0, _createSuper2.default)(ActionButtons);
|
|
@@ -100,6 +87,11 @@ var ActionButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
100
87
|
value: function shouldFocusOnMount() {
|
|
101
88
|
return this.props.shouldFocusOnMount && !this.props.editingAddContentPopover;
|
|
102
89
|
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "componentDidUpdate",
|
|
92
|
+
value: function componentDidUpdate() {
|
|
93
|
+
this.props.makeStyles();
|
|
94
|
+
}
|
|
103
95
|
}, {
|
|
104
96
|
key: "componentDidMount",
|
|
105
97
|
value: function componentDidMount() {
|
|
@@ -111,20 +103,24 @@ var ActionButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
111
103
|
_this2.editButton && _this2.editButton.getWrappedInstance().setFocus();
|
|
112
104
|
}, 50);
|
|
113
105
|
}
|
|
106
|
+
|
|
107
|
+
this.props.makeStyles();
|
|
114
108
|
}
|
|
115
109
|
}, {
|
|
116
110
|
key: "render",
|
|
117
111
|
value: function render() {
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
112
|
+
var hideClass = !this.props.shouldRenderEdit ? 'hide' : '';
|
|
113
|
+
return (0, _emotion.jsx)("div", {
|
|
114
|
+
className: "buttons",
|
|
122
115
|
tabIndex: "-1",
|
|
123
116
|
onFocus: this.onButtonFocus,
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
},
|
|
117
|
+
css: this.props.styles.buttons
|
|
118
|
+
}, (0, _emotion.jsx)(_emotion.Global, {
|
|
119
|
+
styles: this.props.styles.globalStyles
|
|
120
|
+
}), (0, _emotion.jsx)("div", {
|
|
121
|
+
className: hideClass,
|
|
122
|
+
css: this.props.styles.edit
|
|
123
|
+
}, (0, _emotion.jsx)(ScrollTargetButton, {
|
|
128
124
|
as: "div",
|
|
129
125
|
onClick: this.switchOnEditing,
|
|
130
126
|
scrollKey: this.props.scrollKey,
|
|
@@ -136,7 +132,7 @@ var ActionButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
136
132
|
shouldFocusOnMount: this.shouldFocusOnMount(),
|
|
137
133
|
screenReaderLabel: this.props.quizEntry.generateScreenReaderText(this.props.displayPosition, _quizCommon.EDIT),
|
|
138
134
|
ref: this.setEditRef
|
|
139
|
-
})), this.props.questionCopyEnabled && this.props.onCopy &&
|
|
135
|
+
})), this.props.questionCopyEnabled && this.props.onCopy && (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
140
136
|
as: "div",
|
|
141
137
|
onClick: this.props.onCopy,
|
|
142
138
|
disabled: this.props.shouldDisableCopy,
|
|
@@ -146,12 +142,12 @@ var ActionButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
146
142
|
size: "small",
|
|
147
143
|
"data-automation": "sdk-copy-question-button",
|
|
148
144
|
screenReaderLabel: this.props.quizEntry.generateScreenReaderText(this.props.displayPosition, _quizCommon.COPY)
|
|
149
|
-
}), this.connectDragSource(
|
|
145
|
+
}), this.connectDragSource((0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_index.default, {
|
|
150
146
|
displayPosition: this.props.displayPosition,
|
|
151
147
|
quizEntry: this.props.quizEntry,
|
|
152
148
|
quizEntries: this.props.quizEntries,
|
|
153
149
|
disabled: this.props.shouldDisableDragHandle
|
|
154
|
-
}))), this.props.shouldRenderDelete &&
|
|
150
|
+
}))), this.props.shouldRenderDelete && (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
155
151
|
as: "div",
|
|
156
152
|
onClick: this.props.onDelete,
|
|
157
153
|
disabled: this.props.shouldDisableDeleteButton,
|
|
@@ -182,7 +178,9 @@ var ActionButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
182
178
|
shouldRenderEdit: _propTypes.default.bool,
|
|
183
179
|
shouldRenderDelete: _propTypes.default.bool,
|
|
184
180
|
switchOnEditing: _propTypes.default.func,
|
|
185
|
-
shouldFocusOnMount: _propTypes.default.bool
|
|
181
|
+
shouldFocusOnMount: _propTypes.default.bool,
|
|
182
|
+
styles: _propTypes.default.object,
|
|
183
|
+
makeStyles: _propTypes.default.func
|
|
186
184
|
}, _class2.defaultProps = {
|
|
187
185
|
onCopy: null,
|
|
188
186
|
scrollKey: void 0,
|
|
@@ -0,0 +1,44 @@
|
|
|
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
15
|
+
var mq = '@media print';
|
|
16
|
+
return {
|
|
17
|
+
buttons: (0, _defineProperty2.default)({
|
|
18
|
+
flex: '0 0 auto',
|
|
19
|
+
display: 'inline-flex',
|
|
20
|
+
textAlign: 'right',
|
|
21
|
+
zIndex: componentTheme.buttonsZIndex,
|
|
22
|
+
color: componentTheme.buttonsColor,
|
|
23
|
+
fontSize: '1.1rem',
|
|
24
|
+
padding: "0 ".concat(componentTheme.buttonsPadding)
|
|
25
|
+
}, mq, {
|
|
26
|
+
display: 'none'
|
|
27
|
+
}),
|
|
28
|
+
|
|
29
|
+
/* Hide buttons when the RCE editor is in fullscreen mode */
|
|
30
|
+
edit: (0, _objectSpread2.default)({
|
|
31
|
+
display: 'inline'
|
|
32
|
+
}, !props.shouldRenderEdit && {
|
|
33
|
+
display: 'none'
|
|
34
|
+
}),
|
|
35
|
+
globalStyles: {
|
|
36
|
+
'body.tox-fullscreen .buttons': {
|
|
37
|
+
display: 'none'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var _default = generateStyle;
|
|
44
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing,
|
|
10
10
|
colors = _ref.colors;
|
|
11
11
|
return {
|
|
@@ -13,4 +13,7 @@ function generator(_ref) {
|
|
|
13
13
|
buttonsColor: colors.oxford,
|
|
14
14
|
buttonsPadding: spacing.xSmall
|
|
15
15
|
};
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var _default = generateComponentTheme;
|
|
19
|
+
exports.default = _default;
|
|
@@ -2,8 +2,6 @@
|
|
|
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
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -25,24 +23,19 @@ var _uiView = require("@instructure/ui-view");
|
|
|
25
23
|
|
|
26
24
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
27
25
|
|
|
28
|
-
var
|
|
26
|
+
var _emotion = require("@instructure/emotion");
|
|
29
27
|
|
|
30
28
|
var _quizCommon = require("@instructure/quiz-common");
|
|
31
29
|
|
|
30
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
31
|
+
|
|
32
32
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
33
33
|
|
|
34
34
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
35
35
|
|
|
36
36
|
var _dec, _class, _class2, _temp;
|
|
37
37
|
|
|
38
|
-
var
|
|
39
|
-
componentId: 'bsvMb',
|
|
40
|
-
template: function template(theme) {
|
|
41
|
-
return "\n\n.bsvMb_dNGs{background-color:".concat(theme.addToBankBackgroundColor || 'inherit', ";border:1px dashed ").concat(theme.addToBankBorderColor || 'inherit', ";text-align:center}\n\n[dir=ltr] .bsvMb_dNGs,[dir=rtl] .bsvMb_dNGs{text-align:center}");
|
|
42
|
-
},
|
|
43
|
-
'addToBank': 'bsvMb_dNGs'
|
|
44
|
-
};
|
|
45
|
-
var AddToBankOptions = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
38
|
+
var AddToBankOptions = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
46
39
|
(0, _inherits2.default)(AddToBankOptions, _Component);
|
|
47
40
|
|
|
48
41
|
var _super = (0, _createSuper2.default)(AddToBankOptions);
|
|
@@ -87,10 +80,10 @@ var AddToBankOptions = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
87
80
|
(0, _createClass2.default)(AddToBankOptions, [{
|
|
88
81
|
key: "render",
|
|
89
82
|
value: function render() {
|
|
90
|
-
return
|
|
83
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_uiView.View, {
|
|
91
84
|
as: "div",
|
|
92
|
-
|
|
93
|
-
},
|
|
85
|
+
css: this.props.styles.addToBank
|
|
86
|
+
}, (0, _emotion.jsx)(_uiButtons.CondensedButton, {
|
|
94
87
|
color: "primary",
|
|
95
88
|
ref: this.storeAddToBankLinkRef,
|
|
96
89
|
onClick: this.openAddToBankModal,
|
|
@@ -108,7 +101,8 @@ var AddToBankOptions = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
108
101
|
isValid: _propTypes.default.bool.isRequired,
|
|
109
102
|
openModal: _propTypes.default.func.isRequired,
|
|
110
103
|
screenreaderNotification: _propTypes.default.func.isRequired,
|
|
111
|
-
showError: _propTypes.default.func.isRequired
|
|
104
|
+
showError: _propTypes.default.func.isRequired,
|
|
105
|
+
styles: _propTypes.default.object
|
|
112
106
|
}, _temp)) || _class);
|
|
113
107
|
exports.AddToBankOptions = AddToBankOptions;
|
|
114
108
|
var _default = AddToBankOptions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
return {
|
|
10
|
+
addToBank: {
|
|
11
|
+
backgroundColor: componentTheme.addToBankBackgroundColor,
|
|
12
|
+
border: "1px dashed ".concat(componentTheme.addToBankBorderColor),
|
|
13
|
+
textAlign: 'center'
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var _default = generateStyle;
|
|
19
|
+
exports.default = _default;
|
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing,
|
|
10
10
|
colors = _ref.colors;
|
|
11
11
|
return {
|
|
12
12
|
addToBankBackgroundColor: colors.porcelain,
|
|
13
13
|
addToBankBorderColor: colors.oxford
|
|
14
14
|
};
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var _default = generateComponentTheme;
|
|
18
|
+
exports.default = _default;
|