@instructure/quiz-core 20.9.0 → 20.9.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/building/components/layout/Sidebar/SidebarItem/presenter.js +16 -22
- package/es/building/components/layout/Sidebar/SidebarItem/styles.js +11 -0
- package/es/building/components/layout/Sidebar/SidebarItem/theme.js +4 -2
- package/es/building/components/layout/Sidebar/Stimulus/presenter.js +17 -23
- package/es/building/components/layout/Sidebar/Stimulus/styles.js +11 -0
- package/es/building/components/layout/Sidebar/Stimulus/theme.js +4 -2
- package/es/building/components/layout/Sidebar/presenter.js +42 -38
- package/es/building/components/layout/Sidebar/styles.js +28 -0
- package/es/building/components/layout/Sidebar/theme.js +4 -2
- package/es/building/components/layout/header/BuildingButtons/presenter.js +33 -39
- package/es/building/components/layout/header/BuildingButtons/styles.js +21 -0
- package/es/building/components/layout/header/BuildingButtons/theme.js +4 -2
- package/es/building/components/resources/ActionButtons/presenter.js +29 -27
- package/es/building/components/resources/ActionButtons/styles.js +33 -0
- package/es/building/components/resources/ActionButtons/theme.js +4 -2
- package/es/building/components/resources/AddToBankOptions/index.js +11 -15
- package/es/building/components/resources/AddToBankOptions/styles.js +11 -0
- package/es/building/components/resources/AddToBankOptions/theme.js +4 -2
- package/es/building/components/resources/DeleteStimulusModal/presenter.js +38 -44
- package/es/building/components/resources/DeleteStimulusModal/styles.js +22 -0
- package/es/building/components/resources/DeleteStimulusModal/theme.js +4 -2
- package/es/building/components/resources/ItemFeedbackModal/presenter.js +23 -28
- package/es/building/components/resources/ItemFeedbackModal/styles.js +14 -0
- package/es/building/components/resources/ItemFeedbackModal/theme.js +4 -2
- package/es/common/components/layout/header/Timer/presenter.js +30 -37
- package/es/common/components/layout/header/Timer/styles.js +27 -0
- package/es/common/components/layout/header/Timer/theme.js +4 -2
- package/es/common/components/layout/sidebar/PositionSummary/index.js +17 -25
- package/es/common/components/layout/sidebar/PositionSummary/styles.js +28 -0
- package/es/common/components/layout/sidebar/PositionSummary/theme.js +4 -2
- package/es/common/components/layout/sidebar/Sidebar/index.js +88 -94
- package/es/common/components/layout/sidebar/Sidebar/styles.js +117 -0
- package/es/common/components/layout/sidebar/Sidebar/theme.js +4 -8
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +52 -52
- package/es/common/components/layout/sidebar/SidebarItem/styles.js +59 -0
- package/es/common/components/layout/sidebar/SidebarItem/theme.js +4 -2
- package/es/common/components/layout/sidebar/Stimulus/presenter.js +39 -36
- package/es/common/components/layout/sidebar/Stimulus/styles.js +33 -0
- package/es/common/components/layout/sidebar/Stimulus/theme.js +4 -2
- package/es/common/components/shared/InteractionTypes/presenter.js +27 -33
- package/es/common/components/shared/InteractionTypes/styles.js +17 -0
- package/es/common/components/shared/InteractionTypes/theme.js +4 -2
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/index.js +40 -30
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/styles.js +41 -0
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/theme.js +4 -2
- package/es/common/components/shared/file_selector/FileSelector.js +11 -14
- package/es/common/components/shared/file_selector/styles.js +12 -0
- package/es/common/components/shared/file_selector/theme.js +4 -2
- package/lib/building/components/layout/Sidebar/SidebarItem/presenter.js +15 -23
- package/lib/building/components/layout/Sidebar/SidebarItem/styles.js +19 -0
- package/lib/building/components/layout/Sidebar/SidebarItem/theme.js +6 -3
- package/lib/building/components/layout/Sidebar/Stimulus/presenter.js +16 -24
- package/lib/building/components/layout/Sidebar/Stimulus/styles.js +19 -0
- package/lib/building/components/layout/Sidebar/Stimulus/theme.js +6 -3
- package/lib/building/components/layout/Sidebar/presenter.js +40 -41
- package/lib/building/components/layout/Sidebar/styles.js +38 -0
- package/lib/building/components/layout/Sidebar/theme.js +6 -3
- package/lib/building/components/layout/header/BuildingButtons/presenter.js +32 -40
- package/lib/building/components/layout/header/BuildingButtons/styles.js +29 -0
- package/lib/building/components/layout/header/BuildingButtons/theme.js +6 -3
- package/lib/building/components/resources/ActionButtons/presenter.js +28 -30
- package/lib/building/components/resources/ActionButtons/styles.js +44 -0
- package/lib/building/components/resources/ActionButtons/theme.js +6 -3
- package/lib/building/components/resources/AddToBankOptions/index.js +10 -16
- package/lib/building/components/resources/AddToBankOptions/styles.js +19 -0
- package/lib/building/components/resources/AddToBankOptions/theme.js +6 -3
- package/lib/building/components/resources/DeleteStimulusModal/presenter.js +37 -46
- package/lib/building/components/resources/DeleteStimulusModal/styles.js +30 -0
- package/lib/building/components/resources/DeleteStimulusModal/theme.js +6 -3
- package/lib/building/components/resources/ItemFeedbackModal/presenter.js +19 -27
- package/lib/building/components/resources/ItemFeedbackModal/styles.js +22 -0
- package/lib/building/components/resources/ItemFeedbackModal/theme.js +6 -3
- package/lib/common/components/layout/header/Timer/presenter.js +29 -39
- package/lib/common/components/layout/header/Timer/styles.js +35 -0
- package/lib/common/components/layout/header/Timer/theme.js +6 -3
- package/lib/common/components/layout/sidebar/PositionSummary/index.js +16 -26
- package/lib/common/components/layout/sidebar/PositionSummary/styles.js +36 -0
- package/lib/common/components/layout/sidebar/PositionSummary/theme.js +6 -3
- package/lib/common/components/layout/sidebar/Sidebar/index.js +85 -97
- package/lib/common/components/layout/sidebar/Sidebar/styles.js +128 -0
- package/lib/common/components/layout/sidebar/Sidebar/theme.js +5 -9
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +51 -55
- package/lib/common/components/layout/sidebar/SidebarItem/styles.js +69 -0
- package/lib/common/components/layout/sidebar/SidebarItem/theme.js +6 -3
- package/lib/common/components/layout/sidebar/Stimulus/presenter.js +38 -37
- package/lib/common/components/layout/sidebar/Stimulus/styles.js +41 -0
- package/lib/common/components/layout/sidebar/Stimulus/theme.js +6 -3
- package/lib/common/components/shared/InteractionTypes/presenter.js +26 -36
- package/lib/common/components/shared/InteractionTypes/styles.js +25 -0
- package/lib/common/components/shared/InteractionTypes/theme.js +6 -3
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/index.js +40 -33
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/styles.js +51 -0
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/theme.js +6 -3
- package/lib/common/components/shared/file_selector/FileSelector.js +10 -15
- package/lib/common/components/shared/file_selector/styles.js +20 -0
- package/lib/common/components/shared/file_selector/theme.js +6 -3
- package/package.json +10 -10
|
@@ -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
|
|
|
@@ -27,7 +25,7 @@ var _partial = _interopRequireDefault(require("lodash/partial"));
|
|
|
27
25
|
|
|
28
26
|
var _immutable = require("immutable");
|
|
29
27
|
|
|
30
|
-
var
|
|
28
|
+
var _emotion = require("@instructure/emotion");
|
|
31
29
|
|
|
32
30
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
33
31
|
|
|
@@ -43,20 +41,13 @@ var _interactionTypeMetadata = require("../../../util/interactionTypeMetadata.js
|
|
|
43
41
|
|
|
44
42
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
45
43
|
|
|
44
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
45
|
+
|
|
46
46
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
47
47
|
|
|
48
48
|
var _dec, _class, _class2, _temp;
|
|
49
49
|
|
|
50
|
-
var
|
|
51
|
-
componentId: 'bLlES',
|
|
52
|
-
template: function template(theme) {
|
|
53
|
-
return "\n\n.bLlES_cvRx{padding-right:0.25rem}\n\n.bLlES_dsOT{width:10rem}\n\n.bLlES_cFIX{border-top:".concat(theme.stimulusDividerBorderWidth || 'inherit', " solid ").concat(theme.stimulusDividerBorderColor || 'inherit', ";margin-bottom:").concat(theme.stimulusDividerMarginBottom || 'inherit', ";margin-top:").concat(theme.stimulusDividerMarginTop || 'inherit', "}");
|
|
54
|
-
},
|
|
55
|
-
'iconWrapper': 'bLlES_cvRx',
|
|
56
|
-
'textWrapper': 'bLlES_dsOT',
|
|
57
|
-
'stimulusDivider': 'bLlES_cFIX'
|
|
58
|
-
};
|
|
59
|
-
var InteractionTypes = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
50
|
+
var InteractionTypes = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
60
51
|
(0, _inherits2.default)(InteractionTypes, _Component);
|
|
61
52
|
|
|
62
53
|
var _super = (0, _createSuper2.default)(InteractionTypes);
|
|
@@ -92,7 +83,7 @@ var InteractionTypes = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
92
83
|
automation = "sdk-interaction-button-".concat(intType.slug);
|
|
93
84
|
}
|
|
94
85
|
|
|
95
|
-
return
|
|
86
|
+
return (0, _emotion.jsx)(_uiButtons.Button, {
|
|
96
87
|
key: intType.slug,
|
|
97
88
|
margin: "0 0 xx-small",
|
|
98
89
|
onClick: onClick,
|
|
@@ -100,20 +91,20 @@ var InteractionTypes = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
100
91
|
"data-automation": automation,
|
|
101
92
|
display: "block",
|
|
102
93
|
textAlign: "start"
|
|
103
|
-
},
|
|
94
|
+
}, (0, _emotion.jsx)(_uiGrid.Grid, {
|
|
104
95
|
colSpacing: "none",
|
|
105
96
|
vAlign: "middle"
|
|
106
|
-
},
|
|
97
|
+
}, (0, _emotion.jsx)(_uiGrid.Grid.Row, {
|
|
107
98
|
key: "iconrow"
|
|
108
|
-
},
|
|
99
|
+
}, (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
109
100
|
width: "auto"
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
},
|
|
101
|
+
}, (0, _emotion.jsx)("div", {
|
|
102
|
+
css: _this.props.styles.iconWrapper
|
|
103
|
+
}, (0, _emotion.jsx)(Icon, {
|
|
113
104
|
title: title
|
|
114
|
-
}))),
|
|
115
|
-
|
|
116
|
-
},
|
|
105
|
+
}))), (0, _emotion.jsx)(_uiGrid.Grid.Col, null, (0, _emotion.jsx)("div", {
|
|
106
|
+
css: _this.props.styles.textWrapper
|
|
107
|
+
}, (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, (0, _emotion.jsx)(_uiText.Text, {
|
|
117
108
|
color: "primary"
|
|
118
109
|
}, name)))))));
|
|
119
110
|
};
|
|
@@ -131,7 +122,7 @@ var InteractionTypes = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
131
122
|
buttons[Math.floor(i / _this.props.columns)] = [];
|
|
132
123
|
}
|
|
133
124
|
|
|
134
|
-
buttons[Math.floor(i / _this.props.columns)].push(
|
|
125
|
+
buttons[Math.floor(i / _this.props.columns)].push((0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
135
126
|
width: 12 / _this.props.columns,
|
|
136
127
|
key: intType.slug
|
|
137
128
|
}, button));
|
|
@@ -140,7 +131,7 @@ var InteractionTypes = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
140
131
|
var key = gridCols.map(function (gridCol) {
|
|
141
132
|
return gridCol.key;
|
|
142
133
|
}).join('-');
|
|
143
|
-
return
|
|
134
|
+
return (0, _emotion.jsx)(_uiGrid.Grid.Row, {
|
|
144
135
|
key: key
|
|
145
136
|
}, gridCols);
|
|
146
137
|
});
|
|
@@ -148,24 +139,22 @@ var InteractionTypes = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
148
139
|
|
|
149
140
|
_this.renderStimulusTypeButton = function () {
|
|
150
141
|
if (_this.props.allowStimulusCreation) {
|
|
151
|
-
var dividerRow =
|
|
142
|
+
var dividerRow = (0, _emotion.jsx)(_uiGrid.Grid.Row, {
|
|
152
143
|
key: "divider"
|
|
153
|
-
},
|
|
144
|
+
}, (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
154
145
|
key: "divider"
|
|
155
|
-
},
|
|
156
|
-
|
|
146
|
+
}, (0, _emotion.jsx)("div", {
|
|
147
|
+
css: _this.props.styles.stimulusDivider
|
|
157
148
|
})));
|
|
158
|
-
|
|
159
|
-
var stimulusRow = /*#__PURE__*/_react.default.createElement(_uiGrid.Grid.Row, {
|
|
149
|
+
var stimulusRow = (0, _emotion.jsx)(_uiGrid.Grid.Row, {
|
|
160
150
|
key: "stimulus"
|
|
161
|
-
},
|
|
151
|
+
}, (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
162
152
|
width: 12 / _this.props.columns,
|
|
163
153
|
key: "stimulus"
|
|
164
154
|
}, _this.renderInteractionTypeButton({
|
|
165
155
|
name: 'Stimulus',
|
|
166
156
|
slug: 'stimulus'
|
|
167
157
|
})));
|
|
168
|
-
|
|
169
158
|
return [dividerRow, stimulusRow];
|
|
170
159
|
}
|
|
171
160
|
};
|
|
@@ -176,7 +165,7 @@ var InteractionTypes = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
176
165
|
(0, _createClass2.default)(InteractionTypes, [{
|
|
177
166
|
key: "render",
|
|
178
167
|
value: function render() {
|
|
179
|
-
return
|
|
168
|
+
return (0, _emotion.jsx)(_uiGrid.Grid, {
|
|
180
169
|
rowSpacing: "none",
|
|
181
170
|
colSpacing: "small",
|
|
182
171
|
startAt: "medium"
|
|
@@ -190,7 +179,8 @@ var InteractionTypes = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
190
179
|
addItem: _propTypes.default.func.isRequired,
|
|
191
180
|
addStimulus: _propTypes.default.func.isRequired,
|
|
192
181
|
allowStimulusCreation: _propTypes.default.bool,
|
|
193
|
-
types: _reactImmutableProptypes.default.list
|
|
182
|
+
types: _reactImmutableProptypes.default.list,
|
|
183
|
+
styles: _propTypes.default.object
|
|
194
184
|
}, _class2.defaultProps = {
|
|
195
185
|
allowStimulusCreation: true,
|
|
196
186
|
types: (0, _immutable.List)()
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
iconWrapper: {
|
|
11
|
+
paddingRight: '0.25rem'
|
|
12
|
+
},
|
|
13
|
+
textWrapper: {
|
|
14
|
+
width: '10rem'
|
|
15
|
+
},
|
|
16
|
+
stimulusDivider: {
|
|
17
|
+
borderTop: "".concat(componentTheme.stimulusDividerBorderWidth, " solid ").concat(componentTheme.stimulusDividerBorderColor),
|
|
18
|
+
marginTop: componentTheme.stimulusDividerMarginTop,
|
|
19
|
+
marginBottom: componentTheme.stimulusDividerMarginBottom
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var _default = generateStyle;
|
|
25
|
+
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
|
borders = _ref.borders,
|
|
11
11
|
spacing = _ref.spacing;
|
|
@@ -15,4 +15,7 @@ function generator(_ref) {
|
|
|
15
15
|
stimulusDividerMarginTop: spacing.xSmall,
|
|
16
16
|
stimulusDividerMarginBottom: spacing.small
|
|
17
17
|
};
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var _default = generateComponentTheme;
|
|
21
|
+
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.DragAndDropZone = 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,42 +15,56 @@ 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
|
-
var
|
|
27
|
-
|
|
28
|
-
var _uiThemeable = require("@instructure/ui-themeable");
|
|
22
|
+
var _emotion = require("@instructure/emotion");
|
|
29
23
|
|
|
30
24
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
31
25
|
|
|
26
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
27
|
+
|
|
32
28
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
33
29
|
|
|
34
30
|
var _dec, _class, _class2, _temp;
|
|
35
31
|
|
|
36
|
-
var
|
|
37
|
-
componentId: 'cSfbM',
|
|
38
|
-
template: function template(theme) {
|
|
39
|
-
return "\n\n.cSfbM_ffKt{background-color:".concat(theme.DnDZoneBackgroundColor || 'inherit', ";border:").concat(theme.DnDZoneBorderWidth || 'inherit', " dashed ").concat(theme.DnDZoneBorderColor || 'inherit', ";display:flex;padding:").concat(theme.DnDZonePadding || 'inherit', "}\n\n.cSfbM_ffKt,.cSfbM_dDZW{justify-content:center;width:100%}\n\n.cSfbM_dDZW{background-color:").concat(theme.sidebarDnDZoneBackgroundColor || 'inherit', ";border:").concat(theme.sidebarDnDZoneBorderWidth || 'inherit', " dashed ").concat(theme.sidebarDnDZoneBorderColor || 'inherit', ";color:").concat(theme.sidebarDnDZoneColor || 'inherit', ";margin:").concat(theme.sidebarDnDZoneMargin || 'inherit', ";padding:").concat(theme.sidebarDnDZonePadding || 'inherit', ";text-align:center}\n\n[dir=ltr] .cSfbM_dDZW,[dir=rtl] .cSfbM_dDZW{text-align:center}\n\n.cSfbM_dDZW.cSfbM_baAw{margin-left:10%;width:90%}\n\n.cSfbM_gasz{display:flex;flex:1 0 100%;justify-content:center;width:100%}\n\n.cSfbM_bBLs{display:none;width:100%}");
|
|
40
|
-
},
|
|
41
|
-
'DnDZone': 'cSfbM_ffKt',
|
|
42
|
-
'sidebarDnDZone': 'cSfbM_dDZW',
|
|
43
|
-
'inSidebarStimulus': 'cSfbM_baAw',
|
|
44
|
-
'wrapper': 'cSfbM_gasz',
|
|
45
|
-
'hide': 'cSfbM_bBLs'
|
|
46
|
-
};
|
|
47
|
-
var DragAndDropZone = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
32
|
+
var DragAndDropZone = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
48
33
|
(0, _inherits2.default)(DragAndDropZone, _Component);
|
|
49
34
|
|
|
50
35
|
var _super = (0, _createSuper2.default)(DragAndDropZone);
|
|
51
36
|
|
|
52
37
|
function DragAndDropZone() {
|
|
38
|
+
var _this;
|
|
39
|
+
|
|
53
40
|
(0, _classCallCheck2.default)(this, DragAndDropZone);
|
|
54
|
-
|
|
41
|
+
|
|
42
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
+
args[_key] = arguments[_key];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
|
+
_this.state = {
|
|
48
|
+
toRender: false
|
|
49
|
+
};
|
|
50
|
+
return _this;
|
|
55
51
|
}
|
|
56
52
|
|
|
57
53
|
(0, _createClass2.default)(DragAndDropZone, [{
|
|
54
|
+
key: "componentDidMount",
|
|
55
|
+
value: function componentDidMount() {
|
|
56
|
+
this.props.makeStyles({
|
|
57
|
+
toRender: this.shouldRender()
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "componentDidUpdate",
|
|
62
|
+
value: function componentDidUpdate() {
|
|
63
|
+
this.props.makeStyles({
|
|
64
|
+
toRender: this.shouldRender()
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
58
68
|
key: "shouldRender",
|
|
59
69
|
value: function shouldRender() {
|
|
60
70
|
var _this$props = this.props,
|
|
@@ -89,17 +99,12 @@ var DragAndDropZone = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
89
99
|
}, {
|
|
90
100
|
key: "render",
|
|
91
101
|
value: function render() {
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
var wrapper = (0, _classnames3.default)(styles.wrapper, (0, _defineProperty2.default)({}, styles.hide, !this.shouldRender()));
|
|
99
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
100
|
-
className: wrapper
|
|
101
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
-
className: style
|
|
102
|
+
var wrapperClass = !this.shouldRender() ? 'wrapper hide' : 'wrapper';
|
|
103
|
+
return (0, _emotion.jsx)("div", {
|
|
104
|
+
className: wrapperClass,
|
|
105
|
+
css: this.props.styles.wrapper
|
|
106
|
+
}, (0, _emotion.jsx)("div", {
|
|
107
|
+
css: this.props.styles.dropZoneStyle
|
|
103
108
|
}, (0, _formatMessage.default)('Drop Question Here')));
|
|
104
109
|
}
|
|
105
110
|
}]);
|
|
@@ -112,7 +117,9 @@ var DragAndDropZone = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
112
117
|
inSidebar: _propTypes.default.bool,
|
|
113
118
|
inStimulus: _propTypes.default.bool,
|
|
114
119
|
location: _propTypes.default.oneOf(['above', 'below', 'in']).isRequired,
|
|
115
|
-
sidebarOpen: _propTypes.default.bool
|
|
120
|
+
sidebarOpen: _propTypes.default.bool,
|
|
121
|
+
makeStyles: _propTypes.default.func,
|
|
122
|
+
styles: _propTypes.default.object
|
|
116
123
|
}, _class2.defaultProps = {
|
|
117
124
|
draggingAboveHalf: false,
|
|
118
125
|
draggingOver: false,
|
|
@@ -0,0 +1,51 @@
|
|
|
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 generateStyle = function generateStyle(componentTheme, props, state) {
|
|
13
|
+
return {
|
|
14
|
+
dropZoneStyle: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, !props.inSidebar && {
|
|
15
|
+
border: "".concat(componentTheme.DnDZoneBorderWidth, " dashed ").concat(componentTheme.DnDZoneBorderColor),
|
|
16
|
+
backgroundColor: componentTheme.DnDZoneBackgroundColor,
|
|
17
|
+
padding: componentTheme.DnDZonePadding,
|
|
18
|
+
display: 'flex',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
width: '100%'
|
|
21
|
+
}), props.inSidebar && {
|
|
22
|
+
border: "".concat(componentTheme.sidebarDnDZoneBorderWidth, " dashed ").concat(componentTheme.sidebarDnDZoneBorderColor),
|
|
23
|
+
backgroundColor: componentTheme.sidebarDnDZoneBackgroundColor,
|
|
24
|
+
padding: componentTheme.sidebarDnDZonePadding,
|
|
25
|
+
margin: componentTheme.sidebarDnDZoneMargin,
|
|
26
|
+
color: componentTheme.sidebarDnDZoneColor,
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
textAlign: 'center',
|
|
29
|
+
width: '100%',
|
|
30
|
+
'&.inSidebarStimulus': {
|
|
31
|
+
marginLeft: '10%',
|
|
32
|
+
width: '90%'
|
|
33
|
+
}
|
|
34
|
+
}), props.inSidebar && props.inStimulus && {
|
|
35
|
+
marginLeft: '10%',
|
|
36
|
+
width: '90%'
|
|
37
|
+
}),
|
|
38
|
+
wrapper: (0, _objectSpread2.default)({
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flex: '1 0 100%',
|
|
42
|
+
width: '100%'
|
|
43
|
+
}, !state.toRender && {
|
|
44
|
+
display: 'none',
|
|
45
|
+
width: '100%'
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
var _default = generateStyle;
|
|
51
|
+
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
|
borders = _ref.borders;
|
|
@@ -22,4 +22,7 @@ function generator(_ref) {
|
|
|
22
22
|
sidebarDnDZoneMargin: spacing.xSmall,
|
|
23
23
|
sidebarDnDZoneColor: colors.licorice
|
|
24
24
|
};
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var _default = generateComponentTheme;
|
|
28
|
+
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
|
});
|
|
@@ -21,26 +19,21 @@ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
21
19
|
|
|
22
20
|
var _immutable = require("immutable");
|
|
23
21
|
|
|
24
|
-
var _react =
|
|
22
|
+
var _react = require("react");
|
|
25
23
|
|
|
26
24
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
25
|
|
|
28
26
|
var _reactDropzone = _interopRequireDefault(require("react-dropzone"));
|
|
29
27
|
|
|
30
|
-
var
|
|
28
|
+
var _emotion = require("@instructure/emotion");
|
|
29
|
+
|
|
30
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
31
31
|
|
|
32
32
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
33
33
|
|
|
34
34
|
var _dec, _class, _class2, _temp;
|
|
35
35
|
|
|
36
|
-
var
|
|
37
|
-
componentId: 'flcWS',
|
|
38
|
-
template: function template(theme) {
|
|
39
|
-
return "\n\n.flcWS_emRR{background-color:".concat(theme.dropzoneBackgroundColor || 'inherit', ";border:").concat(theme.dropzoneBorderWidth || 'inherit', " dashed ").concat(theme.dropzoneBorderColor || 'inherit', ";cursor:pointer;padding:").concat(theme.dropzonePadding || 'inherit', "}");
|
|
40
|
-
},
|
|
41
|
-
'dropzone': 'flcWS_emRR'
|
|
42
|
-
};
|
|
43
|
-
var FileSelector = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
36
|
+
var FileSelector = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
44
37
|
(0, _inherits2.default)(FileSelector, _Component);
|
|
45
38
|
|
|
46
39
|
var _super = (0, _createSuper2.default)(FileSelector);
|
|
@@ -67,8 +60,9 @@ var FileSelector = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
67
60
|
}, {
|
|
68
61
|
key: "render",
|
|
69
62
|
value: function render() {
|
|
70
|
-
return
|
|
71
|
-
|
|
63
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_reactDropzone.default, {
|
|
64
|
+
"data-testid": "file-dropzone",
|
|
65
|
+
css: this.props.styles.dropzone,
|
|
72
66
|
multiple: this.props.multiple,
|
|
73
67
|
onDrop: this.onDrop,
|
|
74
68
|
accept: this.props.acceptAttribute
|
|
@@ -81,7 +75,8 @@ var FileSelector = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
81
75
|
acceptAttribute: _propTypes.default.string.isRequired,
|
|
82
76
|
content: _propTypes.default.node.isRequired,
|
|
83
77
|
fileHandler: _propTypes.default.func.isRequired,
|
|
84
|
-
multiple: _propTypes.default.bool
|
|
78
|
+
multiple: _propTypes.default.bool,
|
|
79
|
+
styles: _propTypes.default.object
|
|
85
80
|
}, _class2.defaultProps = {
|
|
86
81
|
multiple: false
|
|
87
82
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
dropzone: {
|
|
11
|
+
backgroundColor: componentTheme.dropzoneBackgroundColor,
|
|
12
|
+
border: "".concat(componentTheme.dropzoneBorderWidth, " dashed ").concat(componentTheme.dropzoneBorderColor),
|
|
13
|
+
cursor: 'pointer',
|
|
14
|
+
padding: componentTheme.dropzonePadding
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var _default = generateStyle;
|
|
20
|
+
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
|
borders = _ref.borders;
|
|
@@ -15,4 +15,7 @@ function generator(_ref) {
|
|
|
15
15
|
dropzoneBorderColor: colors.ash,
|
|
16
16
|
dropzonePadding: spacing.medium
|
|
17
17
|
};
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var _default = generateComponentTheme;
|
|
21
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.9.
|
|
3
|
+
"version": "20.9.1-rc.1+43495385a",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@instructure/emotion": "^8.51.0",
|
|
45
45
|
"@instructure/grading-utils": "^1.0.0",
|
|
46
46
|
"@instructure/outcomes-ui": "^3.1.0",
|
|
47
|
-
"@instructure/quiz-common": "
|
|
48
|
-
"@instructure/quiz-i18n": "
|
|
49
|
-
"@instructure/quiz-interactions": "
|
|
50
|
-
"@instructure/quiz-number-input": "
|
|
51
|
-
"@instructure/quiz-rce": "
|
|
47
|
+
"@instructure/quiz-common": "20.9.1-rc.1+43495385a",
|
|
48
|
+
"@instructure/quiz-i18n": "20.9.1-rc.1+43495385a",
|
|
49
|
+
"@instructure/quiz-interactions": "20.9.1-rc.1+43495385a",
|
|
50
|
+
"@instructure/quiz-number-input": "20.9.1-rc.1+43495385a",
|
|
51
|
+
"@instructure/quiz-rce": "20.9.1-rc.1+43495385a",
|
|
52
52
|
"@instructure/ui-a11y-content": "^8.51.0",
|
|
53
53
|
"@instructure/ui-alerts": "^8.51.0",
|
|
54
54
|
"@instructure/ui-avatar": "^8.51.0",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"file-saver": "~2.0.5",
|
|
113
113
|
"humps": "^2.0.0",
|
|
114
114
|
"immutable": "^3.8.1",
|
|
115
|
-
"instructure-validations": "
|
|
115
|
+
"instructure-validations": "20.9.1-rc.1+43495385a",
|
|
116
116
|
"ipaddr.js": "^1.5.4",
|
|
117
117
|
"isomorphic-fetch": "^2.2.0",
|
|
118
118
|
"isuuid": "^0.1.0",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"uuid": "^3.2.1"
|
|
144
144
|
},
|
|
145
145
|
"devDependencies": {
|
|
146
|
-
"@instructure/quiz-scripts": "
|
|
146
|
+
"@instructure/quiz-scripts": "20.9.0",
|
|
147
147
|
"@instructure/ui-axe-check": "^8.51.0",
|
|
148
148
|
"@instructure/ui-babel-preset": "^7.22.1",
|
|
149
149
|
"@instructure/ui-karma-config": "^7.22.1",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"intl": "^1.2.4",
|
|
164
164
|
"jquery": "^2.2.3",
|
|
165
165
|
"most-subject": "^5.3.0",
|
|
166
|
-
"quiz-presets": "
|
|
166
|
+
"quiz-presets": "20.9.1-rc.1+43495385a",
|
|
167
167
|
"react": "^16.8.6",
|
|
168
168
|
"react-addons-test-utils": "^15.6.2",
|
|
169
169
|
"react-dom": "^16.8.6",
|
|
@@ -179,5 +179,5 @@
|
|
|
179
179
|
"publishConfig": {
|
|
180
180
|
"access": "public"
|
|
181
181
|
},
|
|
182
|
-
"gitHead": "
|
|
182
|
+
"gitHead": "43495385a24846a763daa202d18f41f644e0b6f7"
|
|
183
183
|
}
|