@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
|
@@ -5,23 +5,18 @@ 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 ImmutablePropTypes from 'react-immutable-proptypes';
|
|
11
|
-
import {
|
|
12
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
12
13
|
import { chooseDragConnection, usingIE } from "../../../../../common/components/shared/drag_and_drop/dragAndDropUtils.js";
|
|
13
14
|
import DragHandle from "../../../../../common/components/shared/drag_and_drop/DragHandle/index.js";
|
|
14
15
|
import DragAndDropZone from "../../../../../common/components/shared/drag_and_drop/DragAndDropZone/index.js";
|
|
15
16
|
import CommonSidebarItem from "../../../../../common/components/layout/sidebar/SidebarItem/index.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return "\n\n.beYOg_cpvQ{transform:translateZ(0)}";
|
|
20
|
-
},
|
|
21
|
-
'sidebarItemWrapper': 'beYOg_cpvQ'
|
|
22
|
-
};
|
|
23
|
-
import theme from "./theme.js";
|
|
24
|
-
export var BuildingSidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
17
|
+
import generateStyle from "./styles.js";
|
|
18
|
+
import generateComponentTheme from "./theme.js";
|
|
19
|
+
export var BuildingSidebarItem = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
25
20
|
_inherits(BuildingSidebarItem, _Component);
|
|
26
21
|
|
|
27
22
|
var _super = _createSuper(BuildingSidebarItem);
|
|
@@ -45,10 +40,8 @@ export var BuildingSidebarItem = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
45
40
|
sidebarOpen = _this$props.sidebarOpen;
|
|
46
41
|
|
|
47
42
|
if (sidebarOpen) {
|
|
48
|
-
var dragHandle =
|
|
49
|
-
|
|
50
|
-
// This wrapper div is necessary for drag and drop
|
|
51
|
-
React.createElement("div", null, /*#__PURE__*/React.createElement(DragHandle, {
|
|
43
|
+
var dragHandle = // This wrapper div is necessary for drag and drop
|
|
44
|
+
jsx("div", null, jsx(DragHandle, {
|
|
52
45
|
onSidebar: true,
|
|
53
46
|
displayPosition: this.props.displayPosition,
|
|
54
47
|
quizEntry: this.props.quizEntry,
|
|
@@ -81,11 +74,11 @@ export var BuildingSidebarItem = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
81
74
|
draggingOver: draggingOver,
|
|
82
75
|
draggingAboveHalf: draggingAboveHalf
|
|
83
76
|
};
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
},
|
|
77
|
+
return jsx("div", null, jsx("div", {
|
|
78
|
+
css: this.props.styles.sidebarItemWrapper
|
|
79
|
+
}, jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
87
80
|
location: "above"
|
|
88
|
-
})),
|
|
81
|
+
})), jsx(CommonSidebarItem, {
|
|
89
82
|
itemId: this.props.itemId,
|
|
90
83
|
itemBody: this.props.itemBody,
|
|
91
84
|
itemName: this.props.itemName,
|
|
@@ -94,9 +87,9 @@ export var BuildingSidebarItem = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
94
87
|
pointsPossible: this.props.pointsPossible,
|
|
95
88
|
quizEntry: this.props.quizEntry,
|
|
96
89
|
sidebarOpen: this.props.sidebarOpen
|
|
97
|
-
}, this.renderDragHandle()),
|
|
90
|
+
}, this.renderDragHandle()), jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
98
91
|
location: "below"
|
|
99
|
-
})));
|
|
92
|
+
}))));
|
|
100
93
|
}
|
|
101
94
|
}, {
|
|
102
95
|
key: "render",
|
|
@@ -139,7 +132,8 @@ export var BuildingSidebarItem = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
139
132
|
sidebarOpen: PropTypes.bool.isRequired,
|
|
140
133
|
// Passed in by connect
|
|
141
134
|
draggingOver: PropTypes.bool.isRequired,
|
|
142
|
-
draggingAboveHalf: PropTypes.bool.isRequired
|
|
135
|
+
draggingAboveHalf: PropTypes.bool.isRequired,
|
|
136
|
+
styles: PropTypes.object
|
|
143
137
|
}, _class2.defaultProps = {
|
|
144
138
|
disableDraggingOverride: false,
|
|
145
139
|
inStimulus: false,
|
|
@@ -5,23 +5,18 @@ 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 ImmutablePropTypes from 'react-immutable-proptypes';
|
|
11
|
-
import {
|
|
12
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
12
13
|
import { chooseDragConnection, usingIE } from "../../../../../common/components/shared/drag_and_drop/dragAndDropUtils.js";
|
|
13
14
|
import DragHandle from "../../../../../common/components/shared/drag_and_drop/DragHandle/index.js";
|
|
14
15
|
import DragAndDropZone from "../../../../../common/components/shared/drag_and_drop/DragAndDropZone/index.js";
|
|
15
16
|
import CommonStimulus from "../../../../../common/components/layout/sidebar/Stimulus/index.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return "\n\n.fyovm_drae{transform:translateZ(0)}";
|
|
20
|
-
},
|
|
21
|
-
'sidebarStimulusWrapper': 'fyovm_drae'
|
|
22
|
-
};
|
|
23
|
-
import theme from "./theme.js";
|
|
24
|
-
export var BuildingStimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
17
|
+
import generateStyle from "./styles.js";
|
|
18
|
+
import generateComponentTheme from "./theme.js";
|
|
19
|
+
export var BuildingStimulus = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
25
20
|
_inherits(BuildingStimulus, _Component);
|
|
26
21
|
|
|
27
22
|
var _super = _createSuper(BuildingStimulus);
|
|
@@ -48,10 +43,8 @@ export var BuildingStimulus = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
48
43
|
sidebarOpen = _this$props2.sidebarOpen;
|
|
49
44
|
|
|
50
45
|
if (sidebarOpen) {
|
|
51
|
-
var dragHandle =
|
|
52
|
-
|
|
53
|
-
// This wrapper div is necessary for drag and drop
|
|
54
|
-
React.createElement("div", null, /*#__PURE__*/React.createElement(DragHandle, {
|
|
46
|
+
var dragHandle = // This wrapper div is necessary for drag and drop
|
|
47
|
+
jsx("div", null, jsx(DragHandle, {
|
|
55
48
|
disabled: this.shouldDisableDragHandle(),
|
|
56
49
|
displayPosition: this.props.displayPosition,
|
|
57
50
|
onSidebar: true,
|
|
@@ -72,7 +65,7 @@ export var BuildingStimulus = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
72
65
|
}, {
|
|
73
66
|
key: "renderStimulus",
|
|
74
67
|
value: function renderStimulus() {
|
|
75
|
-
return
|
|
68
|
+
return jsx(CommonStimulus, {
|
|
76
69
|
displayPosition: this.props.displayPosition,
|
|
77
70
|
draggingOver: this.props.draggingOver,
|
|
78
71
|
draggingAboveHalf: this.props.draggingAboveHalf,
|
|
@@ -96,15 +89,15 @@ export var BuildingStimulus = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
96
89
|
draggingAboveHalf: this.props.draggingAboveHalf,
|
|
97
90
|
dropIntoEmptyStimulus: this.props.dropIntoEmptyStimulus
|
|
98
91
|
};
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
},
|
|
92
|
+
return jsx("div", null, jsx("div", {
|
|
93
|
+
css: this.props.styles.sidebarStimulusWrapper
|
|
94
|
+
}, jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
102
95
|
location: "above"
|
|
103
|
-
})), this.renderStimulus(),
|
|
96
|
+
})), this.renderStimulus(), jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
104
97
|
location: "in"
|
|
105
|
-
})),
|
|
98
|
+
})), jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
106
99
|
location: "below"
|
|
107
|
-
})));
|
|
100
|
+
}))));
|
|
108
101
|
}
|
|
109
102
|
}, {
|
|
110
103
|
key: "render",
|
|
@@ -147,7 +140,8 @@ export var BuildingStimulus = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
147
140
|
// Passed in by connect
|
|
148
141
|
draggingAboveHalf: PropTypes.bool.isRequired,
|
|
149
142
|
draggingOver: PropTypes.bool.isRequired,
|
|
150
|
-
dropIntoEmptyStimulus: PropTypes.bool
|
|
143
|
+
dropIntoEmptyStimulus: PropTypes.bool,
|
|
144
|
+
styles: PropTypes.object
|
|
151
145
|
}, _class2.defaultProps = {
|
|
152
146
|
draggingAboveHalf: false,
|
|
153
147
|
dropIntoEmptyStimulus: false,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
@@ -6,33 +5,23 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
5
|
|
|
7
6
|
var _dec, _class, _class2, _temp;
|
|
8
7
|
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
|
|
9
10
|
/* eslint "array-callback-return": "warn" */
|
|
10
|
-
import
|
|
11
|
+
import { Component } from 'react';
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
12
|
-
import classnames from 'classnames';
|
|
13
13
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
14
|
-
import {
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
15
15
|
import SidebarItem from "./SidebarItem/index.js";
|
|
16
16
|
import Stimulus from "./Stimulus/index.js";
|
|
17
17
|
import Sidebar from "../../../../common/components/layout/sidebar/Sidebar/index.js";
|
|
18
18
|
import generateDisplayPositions from "../../../../common/util/generateDisplayPositions.js";
|
|
19
19
|
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
template: function template(theme) {
|
|
23
|
-
return "\n\n.bAyez_eUtI{padding:".concat(theme.bottomPadding || 'inherit', "}\n\n.bAyez_bBLs,.bAyez_fYKY .bAyez_blUq,.bAyez_eNNp .bAyez_eyTz{display:none}");
|
|
24
|
-
},
|
|
25
|
-
'bottomPadding': 'bAyez_eUtI',
|
|
26
|
-
'hide': 'bAyez_bBLs',
|
|
27
|
-
'sidebarIsClosed': 'bAyez_fYKY',
|
|
28
|
-
'openItems': 'bAyez_blUq',
|
|
29
|
-
'sidebarIsOpen': 'bAyez_eNNp',
|
|
30
|
-
'closedItems': 'bAyez_eyTz'
|
|
31
|
-
};
|
|
32
|
-
import theme from "./theme.js";
|
|
20
|
+
import generateStyle from "./styles.js";
|
|
21
|
+
import generateComponentTheme from "./theme.js";
|
|
33
22
|
import { SIDEBAR_ITEM_REF } from '@instructure/quiz-common';
|
|
34
23
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
35
|
-
export var BuildingSidebar = (_dec =
|
|
24
|
+
export var BuildingSidebar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
36
25
|
_inherits(BuildingSidebar, _Component);
|
|
37
26
|
|
|
38
27
|
var _super = _createSuper(BuildingSidebar);
|
|
@@ -57,7 +46,7 @@ export var BuildingSidebar = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
57
46
|
_this.renderItem = function () {
|
|
58
47
|
var isOver = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _this.props.isOver;
|
|
59
48
|
return function (quizEntry, displayPosition, sidebarIsOpen) {
|
|
60
|
-
return
|
|
49
|
+
return jsx(SidebarItem, {
|
|
61
50
|
key: _this.setKey(quizEntry.id),
|
|
62
51
|
ref: _this.setRef(quizEntry.id),
|
|
63
52
|
inStimulus: quizEntry.isInStimulus,
|
|
@@ -95,6 +84,16 @@ export var BuildingSidebar = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
95
84
|
}
|
|
96
85
|
|
|
97
86
|
_createClass(BuildingSidebar, [{
|
|
87
|
+
key: "componentDidMount",
|
|
88
|
+
value: function componentDidMount() {
|
|
89
|
+
this.props.makeStyles();
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
key: "componentDidUpdate",
|
|
93
|
+
value: function componentDidUpdate() {
|
|
94
|
+
this.props.makeStyles();
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
98
97
|
key: "getItemBody",
|
|
99
98
|
value: function getItemBody(quizEntry) {
|
|
100
99
|
switch (quizEntry.entryType) {
|
|
@@ -149,7 +148,7 @@ export var BuildingSidebar = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
149
148
|
}, {
|
|
150
149
|
key: "renderStimulus",
|
|
151
150
|
value: function renderStimulus(quizEntry, displayPosition, sidebarIsOpen) {
|
|
152
|
-
return
|
|
151
|
+
return jsx(Stimulus, {
|
|
153
152
|
key: this.setKey(quizEntry.id),
|
|
154
153
|
ref: this.setRef(quizEntry.id),
|
|
155
154
|
displayPosition: displayPosition,
|
|
@@ -190,33 +189,36 @@ export var BuildingSidebar = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
190
189
|
}, {
|
|
191
190
|
key: "render",
|
|
192
191
|
value: function render() {
|
|
193
|
-
var
|
|
194
|
-
|
|
195
|
-
var dndClasses = classnames(styles.bottomPadding, _defineProperty({}, styles.hide, !this.props.isOver));
|
|
196
|
-
var sidebarClasses = classnames((_classnames2 = {}, _defineProperty(_classnames2, styles.sidebarIsOpen, this.props.sidebarOpen), _defineProperty(_classnames2, styles.sidebarIsClosed, !this.props.sidebarOpen), _classnames2));
|
|
192
|
+
var openClass = !this.props.sidebarOpen ? 'sidebarIsClosed' : 'sidebarIsOpen';
|
|
193
|
+
var isOverClass = !this.props.isOver ? 'hide' : '';
|
|
197
194
|
return this.props.connectDropTarget(
|
|
198
|
-
/*#__PURE__*/
|
|
199
|
-
|
|
200
195
|
/* React DnD requires a native element node like our div below */
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
196
|
+
jsx("div", {
|
|
197
|
+
style: {
|
|
198
|
+
display: 'flex'
|
|
199
|
+
}
|
|
200
|
+
}, jsx("div", {
|
|
201
|
+
className: openClass
|
|
202
|
+
}, jsx(Sidebar, {
|
|
204
203
|
role: this.props.role,
|
|
205
204
|
scrollToItem: this.scrollToItem,
|
|
206
205
|
sidebarOpen: this.props.sidebarOpen,
|
|
207
206
|
toggleSidebar: this.props.toggleSidebar,
|
|
208
207
|
screenreaderNotification: this.props.screenreaderNotification,
|
|
209
208
|
totalPointsPossible: this.props.totalPointsPossible
|
|
210
|
-
},
|
|
209
|
+
}, jsx("div", {
|
|
211
210
|
ref: this.storeStartQuizEntriesRef
|
|
212
|
-
}),
|
|
213
|
-
className:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
211
|
+
}), jsx("div", {
|
|
212
|
+
className: "closedItems",
|
|
213
|
+
css: this.props.styles.closedItems
|
|
214
|
+
}, this.renderSidebarItems(false)), jsx("div", {
|
|
215
|
+
className: "openItems",
|
|
216
|
+
css: this.props.styles.openItems
|
|
217
|
+
}, this.renderSidebarItems(true)), jsx("div", {
|
|
217
218
|
ref: this.storeEndQuizEntriesRef,
|
|
218
|
-
className:
|
|
219
|
-
|
|
219
|
+
className: isOverClass,
|
|
220
|
+
css: this.props.styles.bottomPadding
|
|
221
|
+
})))));
|
|
220
222
|
}
|
|
221
223
|
}]);
|
|
222
224
|
|
|
@@ -231,7 +233,9 @@ export var BuildingSidebar = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
231
233
|
sidebarOpen: PropTypes.bool.isRequired,
|
|
232
234
|
toggleSidebar: PropTypes.func.isRequired,
|
|
233
235
|
screenreaderNotification: PropTypes.func.isRequired,
|
|
234
|
-
totalPointsPossible: PropTypes.number.isRequired
|
|
236
|
+
totalPointsPossible: PropTypes.number.isRequired,
|
|
237
|
+
styles: PropTypes.object,
|
|
238
|
+
makeStyles: PropTypes.func
|
|
235
239
|
}, _class2.defaultProps = {
|
|
236
240
|
isOver: false,
|
|
237
241
|
role: 'navigation'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
4
|
+
return {
|
|
5
|
+
/* this class is to allow space for dragging an item
|
|
6
|
+
below a stimulus at the bottom of a long quiz */
|
|
7
|
+
bottomPadding: _objectSpread({
|
|
8
|
+
padding: componentTheme.bottomPadding
|
|
9
|
+
}, !props.isOver && {
|
|
10
|
+
display: 'none'
|
|
11
|
+
}),
|
|
12
|
+
hide: {
|
|
13
|
+
display: 'none'
|
|
14
|
+
},
|
|
15
|
+
closedItems: _objectSpread({
|
|
16
|
+
display: 'block'
|
|
17
|
+
}, props.sidebarOpen && {
|
|
18
|
+
display: 'none'
|
|
19
|
+
}),
|
|
20
|
+
openItems: _objectSpread({
|
|
21
|
+
display: 'block'
|
|
22
|
+
}, !props.sidebarOpen && {
|
|
23
|
+
display: 'none'
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default generateStyle;
|
|
@@ -5,26 +5,19 @@ 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 { IconButton } from '@instructure/ui-buttons';
|
|
11
12
|
import { Menu } from '@instructure/ui-menu';
|
|
12
13
|
import { IconExportLine, IconMoreSolid, IconImportLine, IconBankLine, IconPrinterLine, IconSpeedGraderLine } from '@instructure/ui-icons';
|
|
13
14
|
import PrintTrigger from "../../../../../common/components/shared/PrintTrigger/index.js";
|
|
14
15
|
import { PRINT_CURRENT_PAGE, PRINT_BLANK } from '@instructure/quiz-common';
|
|
15
|
-
import {
|
|
16
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
16
17
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
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}");
|
|
21
|
-
},
|
|
22
|
-
'quizSaving': 'exAHi_cKjJ',
|
|
23
|
-
'buttonsHolder': 'exAHi_dxna',
|
|
24
|
-
'menuIcon': 'exAHi_cLWx'
|
|
25
|
-
};
|
|
26
|
-
import theme from "./theme.js";
|
|
27
|
-
export var BuildingButtons = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
18
|
+
import generateStyle from "./styles.js";
|
|
19
|
+
import generateComponentTheme from "./theme.js";
|
|
20
|
+
export var BuildingButtons = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
28
21
|
_inherits(BuildingButtons, _Component);
|
|
29
22
|
|
|
30
23
|
var _super = _createSuper(BuildingButtons);
|
|
@@ -83,8 +76,8 @@ export var BuildingButtons = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
83
76
|
key: "renderSavingMessage",
|
|
84
77
|
value: function renderSavingMessage() {
|
|
85
78
|
if (this.props.quizSaving) {
|
|
86
|
-
return
|
|
87
|
-
|
|
79
|
+
return jsx("div", {
|
|
80
|
+
css: this.props.styles.quizSaving
|
|
88
81
|
}, t('Saving...'));
|
|
89
82
|
}
|
|
90
83
|
}
|
|
@@ -100,43 +93,43 @@ export var BuildingButtons = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
100
93
|
var menuItems = [];
|
|
101
94
|
|
|
102
95
|
if (this.props.speedgraderLink) {
|
|
103
|
-
menuItems.push(
|
|
96
|
+
menuItems.push(jsx(Menu.Item, {
|
|
104
97
|
key: "speedgrader",
|
|
105
98
|
onSelect: this.openSpeedgraderLink
|
|
106
|
-
},
|
|
107
|
-
|
|
99
|
+
}, jsx(IconSpeedGraderLine, {
|
|
100
|
+
css: this.props.styles.menuIcon
|
|
108
101
|
}), t('Speedgrader')));
|
|
109
102
|
}
|
|
110
103
|
|
|
111
|
-
menuItems.push(
|
|
104
|
+
menuItems.push(jsx(Menu.Item, {
|
|
112
105
|
key: "import",
|
|
113
106
|
disabled: !this.props.canImport,
|
|
114
107
|
onSelect: this.props.openModal,
|
|
115
108
|
"data-automation": "sdk-import-content-menuitem"
|
|
116
|
-
},
|
|
117
|
-
|
|
109
|
+
}, jsx(IconImportLine, {
|
|
110
|
+
css: this.props.styles.menuIcon,
|
|
118
111
|
"data-automation": "sdk-import-content-icon"
|
|
119
112
|
}), t('Import Content')));
|
|
120
113
|
|
|
121
114
|
if (this.props.contentExportEnabled) {
|
|
122
|
-
menuItems.push(
|
|
115
|
+
menuItems.push(jsx(Menu.Item, {
|
|
123
116
|
key: "export",
|
|
124
117
|
disabled: !this.props.canExport,
|
|
125
118
|
onSelect: this.startQuizExportJob,
|
|
126
119
|
"data-automation": "sdk-export-content-menuitem"
|
|
127
|
-
},
|
|
128
|
-
|
|
120
|
+
}, jsx(IconExportLine, {
|
|
121
|
+
css: this.props.styles.menuIcon,
|
|
129
122
|
"data-automation": "sdk-export-content-icon"
|
|
130
123
|
}), t('Export Content')));
|
|
131
124
|
}
|
|
132
125
|
|
|
133
126
|
if (this.props.enableItemBanking) {
|
|
134
|
-
menuItems.push(
|
|
127
|
+
menuItems.push(jsx(Menu.Item, {
|
|
135
128
|
key: "banks",
|
|
136
129
|
onSelect: this.props.navigateToBanks,
|
|
137
130
|
"data-automation": "sdk-manage-item-banks-menuitem"
|
|
138
|
-
},
|
|
139
|
-
|
|
131
|
+
}, jsx(IconBankLine, {
|
|
132
|
+
css: this.props.styles.menuIcon,
|
|
140
133
|
"data-automation": "sdk-manage-item-banks-icon"
|
|
141
134
|
}), t('Manage Item Banks')));
|
|
142
135
|
}
|
|
@@ -145,26 +138,26 @@ export var BuildingButtons = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
145
138
|
{
|
|
146
139
|
/* eslint-disable react/jsx-no-bind */
|
|
147
140
|
}
|
|
148
|
-
menuItems.push(
|
|
141
|
+
menuItems.push(jsx(Menu.Item, {
|
|
149
142
|
key: "printKey",
|
|
150
143
|
disabled: !this.props.hasQuestions || this.props.isEditing,
|
|
151
144
|
onSelect: function onSelect() {
|
|
152
145
|
return handlePrint(PRINT_CURRENT_PAGE);
|
|
153
146
|
},
|
|
154
147
|
"data-automation": "sdk-print-key-menuitem"
|
|
155
|
-
},
|
|
156
|
-
|
|
148
|
+
}, jsx(IconPrinterLine, {
|
|
149
|
+
css: this.props.styles.menuIcon,
|
|
157
150
|
"data-automation": "sdk-print-icon"
|
|
158
151
|
}), t('Print Key (With Answers)')));
|
|
159
|
-
menuItems.push(
|
|
152
|
+
menuItems.push(jsx(Menu.Item, {
|
|
160
153
|
key: "printBlank",
|
|
161
154
|
disabled: !this.props.hasQuestions || this.props.isEditing,
|
|
162
155
|
onSelect: function onSelect() {
|
|
163
156
|
return handlePrint(PRINT_BLANK);
|
|
164
157
|
},
|
|
165
158
|
"data-automation": "sdk-print-blank-menuitem"
|
|
166
|
-
},
|
|
167
|
-
|
|
159
|
+
}, jsx(IconPrinterLine, {
|
|
160
|
+
css: this.props.styles.menuIcon,
|
|
168
161
|
"data-automation": "sdk-print-blank-icon"
|
|
169
162
|
}), t('Print Blank Quiz')));
|
|
170
163
|
{
|
|
@@ -173,8 +166,8 @@ export var BuildingButtons = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
173
166
|
}
|
|
174
167
|
|
|
175
168
|
if (menuItems.length < 1) return;
|
|
176
|
-
return
|
|
177
|
-
trigger:
|
|
169
|
+
return jsx(Menu, {
|
|
170
|
+
trigger: jsx(IconButton, {
|
|
178
171
|
renderIcon: IconMoreSolid,
|
|
179
172
|
withBackground: false,
|
|
180
173
|
withBorder: false,
|
|
@@ -188,9 +181,9 @@ export var BuildingButtons = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
188
181
|
value: function render() {
|
|
189
182
|
var _this2 = this;
|
|
190
183
|
|
|
191
|
-
return
|
|
192
|
-
|
|
193
|
-
}, this.renderSavingMessage(),
|
|
184
|
+
return jsx("div", {
|
|
185
|
+
css: this.props.styles.buttonsHolder
|
|
186
|
+
}, this.renderSavingMessage(), jsx(PrintTrigger, {
|
|
194
187
|
render: function render(handlePrint) {
|
|
195
188
|
return _this2.renderMenu(handlePrint);
|
|
196
189
|
},
|
|
@@ -222,7 +215,8 @@ export var BuildingButtons = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
222
215
|
setBanksTrayButtonRef: PropTypes.func.isRequired,
|
|
223
216
|
speedgraderLink: PropTypes.string,
|
|
224
217
|
startExport: PropTypes.func.isRequired,
|
|
225
|
-
contextUuid: PropTypes.string
|
|
218
|
+
contextUuid: PropTypes.string,
|
|
219
|
+
styles: PropTypes.object
|
|
226
220
|
}, _class2.defaultProps = {
|
|
227
221
|
activeQuizId: null,
|
|
228
222
|
addInfo: function addInfo() {},
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
quizSaving: {
|
|
4
|
+
color: componentTheme.quizSavingColor,
|
|
5
|
+
margin: componentTheme.quizSavingMargin
|
|
6
|
+
},
|
|
7
|
+
buttonsHolder: {
|
|
8
|
+
height: '100%',
|
|
9
|
+
marginRight: componentTheme.buttonsHolderMargin,
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center'
|
|
12
|
+
},
|
|
13
|
+
menuIcon: {
|
|
14
|
+
verticalAlign: 'middle',
|
|
15
|
+
marginRight: componentTheme.menuIconMargin,
|
|
16
|
+
fontSize: componentTheme.menuIconFontSize
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
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
|
typography = _ref.typography;
|
|
@@ -9,4 +9,6 @@ export default function generator(_ref) {
|
|
|
9
9
|
menuIconMargin: spacing.xSmall,
|
|
10
10
|
menuIconFontSize: typography.fontSizeLarge
|
|
11
11
|
};
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default generateComponentTheme;
|