@instructure/quiz-core 20.9.1-rc.0 → 20.9.1-rc.2
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/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/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/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/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/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/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 +9 -9
|
@@ -5,7 +5,8 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import partial from 'lodash/partial';
|
|
11
12
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
@@ -13,27 +14,18 @@ import { IconClockLine, IconClockSolid, IconArrowOpenStartLine } from '@instruct
|
|
|
13
14
|
import { Button } from '@instructure/ui-buttons';
|
|
14
15
|
import { TopNavBar } from '@instructure/ui-top-nav-bar';
|
|
15
16
|
import { View } from '@instructure/ui-view';
|
|
16
|
-
import {
|
|
17
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
17
18
|
import FormattedDuration from "../../../shared/FormattedDuration/index.js";
|
|
18
19
|
import { formatTime } from "../../../../util/formatTimespan.js";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
template: function template(theme) {
|
|
22
|
-
return "\n\n.fBhoO_dAhe{flex-direction:row;font-size:".concat(theme.timerFontSize || 'inherit', ";justify-content:center;line-height:1rem}\n\n.fBhoO_dAhe,.fBhoO_Swlx{align-items:center;display:flex}\n\n.fBhoO_Swlx{flex-direction:column-reverse}\n\n.fBhoO_dkDW{padding:").concat(theme.timerRightPadding || 'inherit', "}\n\n.fBhoO_bYJj{font-size:").concat(theme.timeRemainingLabelFontSize || 'inherit', ";text-align:center;width:100%}\n\n[dir=ltr] .fBhoO_bYJj,[dir=rtl] .fBhoO_bYJj{text-align:center}");
|
|
23
|
-
},
|
|
24
|
-
'timer': 'fBhoO_dAhe',
|
|
25
|
-
'timerLeft': 'fBhoO_Swlx',
|
|
26
|
-
'timerRight': 'fBhoO_dkDW',
|
|
27
|
-
'timeRemainingLabel': 'fBhoO_bYJj'
|
|
28
|
-
};
|
|
29
|
-
import theme from "./theme.js";
|
|
20
|
+
import generateStyle from "./styles.js";
|
|
21
|
+
import generateComponentTheme from "./theme.js";
|
|
30
22
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
31
23
|
|
|
32
|
-
var _ref =
|
|
24
|
+
var _ref = jsx(IconClockLine, null);
|
|
33
25
|
|
|
34
|
-
var _ref2 =
|
|
26
|
+
var _ref2 = jsx(IconClockSolid, null);
|
|
35
27
|
|
|
36
|
-
export var Timer = (_dec =
|
|
28
|
+
export var Timer = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
37
29
|
_inherits(Timer, _Component);
|
|
38
30
|
|
|
39
31
|
var _super = _createSuper(Timer);
|
|
@@ -119,13 +111,13 @@ export var Timer = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
119
111
|
}, {
|
|
120
112
|
key: "renderHelpScreenreaderText",
|
|
121
113
|
value: function renderHelpScreenreaderText() {
|
|
122
|
-
return
|
|
114
|
+
return jsx(ScreenReaderContent, null, t('During the quiz, press Alt+Shift+T to have the remaining time read'));
|
|
123
115
|
}
|
|
124
116
|
}, {
|
|
125
117
|
key: "renderMinimizedTimer",
|
|
126
118
|
value: function renderMinimizedTimer() {
|
|
127
119
|
if (this.props.iceTopNavBarEnabled) {
|
|
128
|
-
return
|
|
120
|
+
return jsx(TopNavBar.Item, {
|
|
129
121
|
id: "TimerButton",
|
|
130
122
|
onClick: partial(this.props.updateTimerMinimized, false),
|
|
131
123
|
variant: "icon",
|
|
@@ -136,20 +128,20 @@ export var Timer = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
136
128
|
}, t('Show Timer'));
|
|
137
129
|
}
|
|
138
130
|
|
|
139
|
-
return
|
|
140
|
-
|
|
141
|
-
}, this.renderHelpScreenreaderText(),
|
|
131
|
+
return jsx("div", {
|
|
132
|
+
css: this.props.styles.timer
|
|
133
|
+
}, this.renderHelpScreenreaderText(), jsx(Button, {
|
|
142
134
|
"aria-expanded": "false",
|
|
143
135
|
ref: this.showTimerRef,
|
|
144
136
|
renderIcon: IconClockLine,
|
|
145
137
|
onClick: partial(this.props.updateTimerMinimized, false)
|
|
146
|
-
},
|
|
138
|
+
}, jsx(ScreenReaderContent, null, t('Show Timer'))));
|
|
147
139
|
}
|
|
148
140
|
}, {
|
|
149
141
|
key: "renderMaximizedTimer",
|
|
150
142
|
value: function renderMaximizedTimer() {
|
|
151
143
|
if (this.props.iceTopNavBarEnabled) {
|
|
152
|
-
return
|
|
144
|
+
return jsx(TopNavBar.Item, {
|
|
153
145
|
id: "TimerButton",
|
|
154
146
|
onClick: partial(this.props.updateTimerMinimized, true),
|
|
155
147
|
variant: "forceIconWithLabel",
|
|
@@ -157,29 +149,29 @@ export var Timer = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
157
149
|
tooltip: t('Hide Timer'),
|
|
158
150
|
"aria-expanded": "true",
|
|
159
151
|
itemRef: this.hideTimerRef
|
|
160
|
-
},
|
|
152
|
+
}, jsx(FormattedDuration, {
|
|
161
153
|
seconds: this.props.timeLeftInSeconds
|
|
162
154
|
}));
|
|
163
155
|
}
|
|
164
156
|
|
|
165
|
-
return
|
|
166
|
-
|
|
167
|
-
}, this.renderHelpScreenreaderText(),
|
|
157
|
+
return jsx("div", {
|
|
158
|
+
css: this.props.styles.timer
|
|
159
|
+
}, this.renderHelpScreenreaderText(), jsx(View, {
|
|
168
160
|
as: "div"
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
}, t('Time Remaining')),
|
|
161
|
+
}, jsx("div", {
|
|
162
|
+
css: this.props.styles.timerLeft
|
|
163
|
+
}, jsx("div", {
|
|
164
|
+
css: this.props.styles.timeRemainingLabel
|
|
165
|
+
}, t('Time Remaining')), jsx(FormattedDuration, {
|
|
174
166
|
seconds: this.props.timeLeftInSeconds
|
|
175
|
-
}))),
|
|
176
|
-
|
|
177
|
-
},
|
|
167
|
+
}))), jsx("div", {
|
|
168
|
+
css: this.props.styles.timerRight
|
|
169
|
+
}, jsx(Button, {
|
|
178
170
|
"aria-expanded": "true",
|
|
179
171
|
ref: this.hideTimerRef,
|
|
180
172
|
renderIcon: IconArrowOpenStartLine,
|
|
181
173
|
onClick: partial(this.props.updateTimerMinimized, true)
|
|
182
|
-
},
|
|
174
|
+
}, jsx(ScreenReaderContent, null, t('Hide Timer')))));
|
|
183
175
|
}
|
|
184
176
|
}, {
|
|
185
177
|
key: "render",
|
|
@@ -204,7 +196,8 @@ export var Timer = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
204
196
|
timerRunning: PropTypes.bool,
|
|
205
197
|
updateTimerMinimized: PropTypes.func.isRequired,
|
|
206
198
|
iceTopNavBarEnabled: PropTypes.bool,
|
|
207
|
-
setTimerEnabled: PropTypes.func
|
|
199
|
+
setTimerEnabled: PropTypes.func,
|
|
200
|
+
styles: PropTypes.object
|
|
208
201
|
}, _class2.defaultProps = {
|
|
209
202
|
timerRunning: false,
|
|
210
203
|
timeLeftInSeconds: 0,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
timer: {
|
|
4
|
+
lineHeight: '1rem',
|
|
5
|
+
fontSize: componentTheme.timerFontSize,
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
justifyContent: 'center'
|
|
10
|
+
},
|
|
11
|
+
timerLeft: {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexDirection: 'column-reverse',
|
|
14
|
+
alignItems: 'center'
|
|
15
|
+
},
|
|
16
|
+
timerRight: {
|
|
17
|
+
padding: componentTheme.timerRightPadding
|
|
18
|
+
},
|
|
19
|
+
timeRemainingLabel: {
|
|
20
|
+
fontSize: componentTheme.timeRemainingLabelFontSize,
|
|
21
|
+
width: '100%',
|
|
22
|
+
textAlign: 'center'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
borders = _ref.borders,
|
|
4
4
|
colors = _ref.colors,
|
|
@@ -15,4 +15,6 @@ export default function generator(_ref) {
|
|
|
15
15
|
timerRightPadding: spacing.xxSmall,
|
|
16
16
|
timeRemainingLabelFontSize: typography.fontSizeXSmall
|
|
17
17
|
};
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default generateComponentTheme;
|
|
@@ -5,12 +5,13 @@ 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
12
|
import partial from 'lodash/partial';
|
|
12
13
|
import { List } from 'immutable';
|
|
13
|
-
import {
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
14
15
|
import { Button } from '@instructure/ui-buttons';
|
|
15
16
|
import { Text } from '@instructure/ui-text';
|
|
16
17
|
import { IconPlusLine } from '@instructure/ui-icons';
|
|
@@ -18,17 +19,9 @@ import { Grid } from '@instructure/ui-grid';
|
|
|
18
19
|
import { PresentationContent } from '@instructure/ui-a11y-content';
|
|
19
20
|
import { interactionTypeMetadata } from "../../../util/interactionTypeMetadata.js";
|
|
20
21
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
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', "}");
|
|
25
|
-
},
|
|
26
|
-
'iconWrapper': 'bLlES_cvRx',
|
|
27
|
-
'textWrapper': 'bLlES_dsOT',
|
|
28
|
-
'stimulusDivider': 'bLlES_cFIX'
|
|
29
|
-
};
|
|
30
|
-
import theme from "./theme.js";
|
|
31
|
-
export var InteractionTypes = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
22
|
+
import generateStyle from "./styles.js";
|
|
23
|
+
import generateComponentTheme from "./theme.js";
|
|
24
|
+
export var InteractionTypes = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
32
25
|
_inherits(InteractionTypes, _Component);
|
|
33
26
|
|
|
34
27
|
var _super = _createSuper(InteractionTypes);
|
|
@@ -64,7 +57,7 @@ export var InteractionTypes = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
64
57
|
automation = "sdk-interaction-button-".concat(intType.slug);
|
|
65
58
|
}
|
|
66
59
|
|
|
67
|
-
return
|
|
60
|
+
return jsx(Button, {
|
|
68
61
|
key: intType.slug,
|
|
69
62
|
margin: "0 0 xx-small",
|
|
70
63
|
onClick: onClick,
|
|
@@ -72,20 +65,20 @@ export var InteractionTypes = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
72
65
|
"data-automation": automation,
|
|
73
66
|
display: "block",
|
|
74
67
|
textAlign: "start"
|
|
75
|
-
},
|
|
68
|
+
}, jsx(Grid, {
|
|
76
69
|
colSpacing: "none",
|
|
77
70
|
vAlign: "middle"
|
|
78
|
-
},
|
|
71
|
+
}, jsx(Grid.Row, {
|
|
79
72
|
key: "iconrow"
|
|
80
|
-
},
|
|
73
|
+
}, jsx(Grid.Col, {
|
|
81
74
|
width: "auto"
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
},
|
|
75
|
+
}, jsx("div", {
|
|
76
|
+
css: _this.props.styles.iconWrapper
|
|
77
|
+
}, jsx(Icon, {
|
|
85
78
|
title: title
|
|
86
|
-
}))),
|
|
87
|
-
|
|
88
|
-
},
|
|
79
|
+
}))), jsx(Grid.Col, null, jsx("div", {
|
|
80
|
+
css: _this.props.styles.textWrapper
|
|
81
|
+
}, jsx(PresentationContent, null, jsx(Text, {
|
|
89
82
|
color: "primary"
|
|
90
83
|
}, name)))))));
|
|
91
84
|
};
|
|
@@ -103,7 +96,7 @@ export var InteractionTypes = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
103
96
|
buttons[Math.floor(i / _this.props.columns)] = [];
|
|
104
97
|
}
|
|
105
98
|
|
|
106
|
-
buttons[Math.floor(i / _this.props.columns)].push(
|
|
99
|
+
buttons[Math.floor(i / _this.props.columns)].push(jsx(Grid.Col, {
|
|
107
100
|
width: 12 / _this.props.columns,
|
|
108
101
|
key: intType.slug
|
|
109
102
|
}, button));
|
|
@@ -112,7 +105,7 @@ export var InteractionTypes = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
112
105
|
var key = gridCols.map(function (gridCol) {
|
|
113
106
|
return gridCol.key;
|
|
114
107
|
}).join('-');
|
|
115
|
-
return
|
|
108
|
+
return jsx(Grid.Row, {
|
|
116
109
|
key: key
|
|
117
110
|
}, gridCols);
|
|
118
111
|
});
|
|
@@ -120,16 +113,16 @@ export var InteractionTypes = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
120
113
|
|
|
121
114
|
_this.renderStimulusTypeButton = function () {
|
|
122
115
|
if (_this.props.allowStimulusCreation) {
|
|
123
|
-
var dividerRow =
|
|
116
|
+
var dividerRow = jsx(Grid.Row, {
|
|
124
117
|
key: "divider"
|
|
125
|
-
},
|
|
118
|
+
}, jsx(Grid.Col, {
|
|
126
119
|
key: "divider"
|
|
127
|
-
},
|
|
128
|
-
|
|
120
|
+
}, jsx("div", {
|
|
121
|
+
css: _this.props.styles.stimulusDivider
|
|
129
122
|
})));
|
|
130
|
-
var stimulusRow =
|
|
123
|
+
var stimulusRow = jsx(Grid.Row, {
|
|
131
124
|
key: "stimulus"
|
|
132
|
-
},
|
|
125
|
+
}, jsx(Grid.Col, {
|
|
133
126
|
width: 12 / _this.props.columns,
|
|
134
127
|
key: "stimulus"
|
|
135
128
|
}, _this.renderInteractionTypeButton({
|
|
@@ -146,7 +139,7 @@ export var InteractionTypes = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
146
139
|
_createClass(InteractionTypes, [{
|
|
147
140
|
key: "render",
|
|
148
141
|
value: function render() {
|
|
149
|
-
return
|
|
142
|
+
return jsx(Grid, {
|
|
150
143
|
rowSpacing: "none",
|
|
151
144
|
colSpacing: "small",
|
|
152
145
|
startAt: "medium"
|
|
@@ -161,7 +154,8 @@ export var InteractionTypes = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
161
154
|
addItem: PropTypes.func.isRequired,
|
|
162
155
|
addStimulus: PropTypes.func.isRequired,
|
|
163
156
|
allowStimulusCreation: PropTypes.bool,
|
|
164
|
-
types: ImmutablePropTypes.list
|
|
157
|
+
types: ImmutablePropTypes.list,
|
|
158
|
+
styles: PropTypes.object
|
|
165
159
|
}, _class2.defaultProps = {
|
|
166
160
|
allowStimulusCreation: true,
|
|
167
161
|
types: List()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
iconWrapper: {
|
|
4
|
+
paddingRight: '0.25rem'
|
|
5
|
+
},
|
|
6
|
+
textWrapper: {
|
|
7
|
+
width: '10rem'
|
|
8
|
+
},
|
|
9
|
+
stimulusDivider: {
|
|
10
|
+
borderTop: "".concat(componentTheme.stimulusDividerBorderWidth, " solid ").concat(componentTheme.stimulusDividerBorderColor),
|
|
11
|
+
marginTop: componentTheme.stimulusDividerMarginTop,
|
|
12
|
+
marginBottom: componentTheme.stimulusDividerMarginBottom
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var colors = _ref.colors,
|
|
3
3
|
borders = _ref.borders,
|
|
4
4
|
spacing = _ref.spacing;
|
|
@@ -8,4 +8,6 @@ export default function generator(_ref) {
|
|
|
8
8
|
stimulusDividerMarginTop: spacing.xSmall,
|
|
9
9
|
stimulusDividerMarginBottom: spacing.small
|
|
10
10
|
};
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default generateComponentTheme;
|
|
@@ -6,20 +6,15 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
6
|
|
|
7
7
|
var _dec, _class, _class2, _temp;
|
|
8
8
|
|
|
9
|
+
/** @jsx jsx */
|
|
9
10
|
import { List } from 'immutable';
|
|
10
|
-
import
|
|
11
|
+
import { Component } from 'react';
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
12
13
|
import Dropzone from 'react-dropzone';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
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', "}");
|
|
18
|
-
},
|
|
19
|
-
'dropzone': 'flcWS_emRR'
|
|
20
|
-
};
|
|
21
|
-
import theme from "./theme.js";
|
|
22
|
-
export var FileSelector = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
15
|
+
import generateStyle from "./styles.js";
|
|
16
|
+
import generateComponentTheme from "./theme.js";
|
|
17
|
+
export var FileSelector = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
23
18
|
_inherits(FileSelector, _Component);
|
|
24
19
|
|
|
25
20
|
var _super = _createSuper(FileSelector);
|
|
@@ -47,8 +42,9 @@ export var FileSelector = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
47
42
|
}, {
|
|
48
43
|
key: "render",
|
|
49
44
|
value: function render() {
|
|
50
|
-
return
|
|
51
|
-
|
|
45
|
+
return jsx("div", null, jsx(Dropzone, {
|
|
46
|
+
"data-testid": "file-dropzone",
|
|
47
|
+
css: this.props.styles.dropzone,
|
|
52
48
|
multiple: this.props.multiple,
|
|
53
49
|
onDrop: this.onDrop,
|
|
54
50
|
accept: this.props.acceptAttribute
|
|
@@ -62,7 +58,8 @@ export var FileSelector = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
62
58
|
acceptAttribute: PropTypes.string.isRequired,
|
|
63
59
|
content: PropTypes.node.isRequired,
|
|
64
60
|
fileHandler: PropTypes.func.isRequired,
|
|
65
|
-
multiple: PropTypes.bool
|
|
61
|
+
multiple: PropTypes.bool,
|
|
62
|
+
styles: PropTypes.object
|
|
66
63
|
}, _class2.defaultProps = {
|
|
67
64
|
multiple: false
|
|
68
65
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
dropzone: {
|
|
4
|
+
backgroundColor: componentTheme.dropzoneBackgroundColor,
|
|
5
|
+
border: "".concat(componentTheme.dropzoneBorderWidth, " dashed ").concat(componentTheme.dropzoneBorderColor),
|
|
6
|
+
cursor: 'pointer',
|
|
7
|
+
padding: componentTheme.dropzonePadding
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var colors = _ref.colors,
|
|
3
3
|
spacing = _ref.spacing,
|
|
4
4
|
borders = _ref.borders;
|
|
@@ -8,4 +8,6 @@ export default function generator(_ref) {
|
|
|
8
8
|
dropzoneBorderColor: colors.ash,
|
|
9
9
|
dropzonePadding: spacing.medium
|
|
10
10
|
};
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default generateComponentTheme;
|
|
@@ -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
|
|
|
@@ -33,34 +31,25 @@ var _uiTopNavBar = require("@instructure/ui-top-nav-bar");
|
|
|
33
31
|
|
|
34
32
|
var _uiView = require("@instructure/ui-view");
|
|
35
33
|
|
|
36
|
-
var
|
|
34
|
+
var _emotion = require("@instructure/emotion");
|
|
37
35
|
|
|
38
36
|
var _index = _interopRequireDefault(require("../../../shared/FormattedDuration/index.js"));
|
|
39
37
|
|
|
40
38
|
var _formatTimespan = require("../../../../util/formatTimespan.js");
|
|
41
39
|
|
|
40
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
41
|
+
|
|
42
42
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
43
43
|
|
|
44
44
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
45
45
|
|
|
46
46
|
var _dec, _class, _class2, _temp;
|
|
47
47
|
|
|
48
|
-
var
|
|
49
|
-
componentId: 'fBhoO',
|
|
50
|
-
template: function template(theme) {
|
|
51
|
-
return "\n\n.fBhoO_dAhe{flex-direction:row;font-size:".concat(theme.timerFontSize || 'inherit', ";justify-content:center;line-height:1rem}\n\n.fBhoO_dAhe,.fBhoO_Swlx{align-items:center;display:flex}\n\n.fBhoO_Swlx{flex-direction:column-reverse}\n\n.fBhoO_dkDW{padding:").concat(theme.timerRightPadding || 'inherit', "}\n\n.fBhoO_bYJj{font-size:").concat(theme.timeRemainingLabelFontSize || 'inherit', ";text-align:center;width:100%}\n\n[dir=ltr] .fBhoO_bYJj,[dir=rtl] .fBhoO_bYJj{text-align:center}");
|
|
52
|
-
},
|
|
53
|
-
'timer': 'fBhoO_dAhe',
|
|
54
|
-
'timerLeft': 'fBhoO_Swlx',
|
|
55
|
-
'timerRight': 'fBhoO_dkDW',
|
|
56
|
-
'timeRemainingLabel': 'fBhoO_bYJj'
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
var _ref = /*#__PURE__*/_react.default.createElement(_uiIcons.IconClockLine, null);
|
|
48
|
+
var _ref = (0, _emotion.jsx)(_uiIcons.IconClockLine, null);
|
|
60
49
|
|
|
61
|
-
var _ref2 =
|
|
50
|
+
var _ref2 = (0, _emotion.jsx)(_uiIcons.IconClockSolid, null);
|
|
62
51
|
|
|
63
|
-
var Timer = (_dec = (0,
|
|
52
|
+
var Timer = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
64
53
|
(0, _inherits2.default)(Timer, _Component);
|
|
65
54
|
|
|
66
55
|
var _super = (0, _createSuper2.default)(Timer);
|
|
@@ -146,13 +135,13 @@ var Timer = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
146
135
|
}, {
|
|
147
136
|
key: "renderHelpScreenreaderText",
|
|
148
137
|
value: function renderHelpScreenreaderText() {
|
|
149
|
-
return
|
|
138
|
+
return (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('During the quiz, press Alt+Shift+T to have the remaining time read'));
|
|
150
139
|
}
|
|
151
140
|
}, {
|
|
152
141
|
key: "renderMinimizedTimer",
|
|
153
142
|
value: function renderMinimizedTimer() {
|
|
154
143
|
if (this.props.iceTopNavBarEnabled) {
|
|
155
|
-
return
|
|
144
|
+
return (0, _emotion.jsx)(_uiTopNavBar.TopNavBar.Item, {
|
|
156
145
|
id: "TimerButton",
|
|
157
146
|
onClick: (0, _partial.default)(this.props.updateTimerMinimized, false),
|
|
158
147
|
variant: "icon",
|
|
@@ -163,20 +152,20 @@ var Timer = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
163
152
|
}, (0, _formatMessage.default)('Show Timer'));
|
|
164
153
|
}
|
|
165
154
|
|
|
166
|
-
return
|
|
167
|
-
|
|
168
|
-
}, this.renderHelpScreenreaderText(),
|
|
155
|
+
return (0, _emotion.jsx)("div", {
|
|
156
|
+
css: this.props.styles.timer
|
|
157
|
+
}, this.renderHelpScreenreaderText(), (0, _emotion.jsx)(_uiButtons.Button, {
|
|
169
158
|
"aria-expanded": "false",
|
|
170
159
|
ref: this.showTimerRef,
|
|
171
160
|
renderIcon: _uiIcons.IconClockLine,
|
|
172
161
|
onClick: (0, _partial.default)(this.props.updateTimerMinimized, false)
|
|
173
|
-
},
|
|
162
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Show Timer'))));
|
|
174
163
|
}
|
|
175
164
|
}, {
|
|
176
165
|
key: "renderMaximizedTimer",
|
|
177
166
|
value: function renderMaximizedTimer() {
|
|
178
167
|
if (this.props.iceTopNavBarEnabled) {
|
|
179
|
-
return
|
|
168
|
+
return (0, _emotion.jsx)(_uiTopNavBar.TopNavBar.Item, {
|
|
180
169
|
id: "TimerButton",
|
|
181
170
|
onClick: (0, _partial.default)(this.props.updateTimerMinimized, true),
|
|
182
171
|
variant: "forceIconWithLabel",
|
|
@@ -184,29 +173,29 @@ var Timer = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
184
173
|
tooltip: (0, _formatMessage.default)('Hide Timer'),
|
|
185
174
|
"aria-expanded": "true",
|
|
186
175
|
itemRef: this.hideTimerRef
|
|
187
|
-
},
|
|
176
|
+
}, (0, _emotion.jsx)(_index.default, {
|
|
188
177
|
seconds: this.props.timeLeftInSeconds
|
|
189
178
|
}));
|
|
190
179
|
}
|
|
191
180
|
|
|
192
|
-
return
|
|
193
|
-
|
|
194
|
-
}, this.renderHelpScreenreaderText(),
|
|
181
|
+
return (0, _emotion.jsx)("div", {
|
|
182
|
+
css: this.props.styles.timer
|
|
183
|
+
}, this.renderHelpScreenreaderText(), (0, _emotion.jsx)(_uiView.View, {
|
|
195
184
|
as: "div"
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
},
|
|
199
|
-
|
|
200
|
-
}, (0, _formatMessage.default)('Time Remaining')),
|
|
185
|
+
}, (0, _emotion.jsx)("div", {
|
|
186
|
+
css: this.props.styles.timerLeft
|
|
187
|
+
}, (0, _emotion.jsx)("div", {
|
|
188
|
+
css: this.props.styles.timeRemainingLabel
|
|
189
|
+
}, (0, _formatMessage.default)('Time Remaining')), (0, _emotion.jsx)(_index.default, {
|
|
201
190
|
seconds: this.props.timeLeftInSeconds
|
|
202
|
-
}))),
|
|
203
|
-
|
|
204
|
-
},
|
|
191
|
+
}))), (0, _emotion.jsx)("div", {
|
|
192
|
+
css: this.props.styles.timerRight
|
|
193
|
+
}, (0, _emotion.jsx)(_uiButtons.Button, {
|
|
205
194
|
"aria-expanded": "true",
|
|
206
195
|
ref: this.hideTimerRef,
|
|
207
196
|
renderIcon: _uiIcons.IconArrowOpenStartLine,
|
|
208
197
|
onClick: (0, _partial.default)(this.props.updateTimerMinimized, true)
|
|
209
|
-
},
|
|
198
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Hide Timer')))));
|
|
210
199
|
}
|
|
211
200
|
}, {
|
|
212
201
|
key: "render",
|
|
@@ -230,7 +219,8 @@ var Timer = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
230
219
|
timerRunning: _propTypes.default.bool,
|
|
231
220
|
updateTimerMinimized: _propTypes.default.func.isRequired,
|
|
232
221
|
iceTopNavBarEnabled: _propTypes.default.bool,
|
|
233
|
-
setTimerEnabled: _propTypes.default.func
|
|
222
|
+
setTimerEnabled: _propTypes.default.func,
|
|
223
|
+
styles: _propTypes.default.object
|
|
234
224
|
}, _class2.defaultProps = {
|
|
235
225
|
timerRunning: false,
|
|
236
226
|
timeLeftInSeconds: 0,
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
timer: {
|
|
11
|
+
lineHeight: '1rem',
|
|
12
|
+
fontSize: componentTheme.timerFontSize,
|
|
13
|
+
display: 'flex',
|
|
14
|
+
flexDirection: 'row',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
justifyContent: 'center'
|
|
17
|
+
},
|
|
18
|
+
timerLeft: {
|
|
19
|
+
display: 'flex',
|
|
20
|
+
flexDirection: 'column-reverse',
|
|
21
|
+
alignItems: 'center'
|
|
22
|
+
},
|
|
23
|
+
timerRight: {
|
|
24
|
+
padding: componentTheme.timerRightPadding
|
|
25
|
+
},
|
|
26
|
+
timeRemainingLabel: {
|
|
27
|
+
fontSize: componentTheme.timeRemainingLabelFontSize,
|
|
28
|
+
width: '100%',
|
|
29
|
+
textAlign: 'center'
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var _default = generateStyle;
|
|
35
|
+
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
|
borders = _ref.borders,
|
|
11
11
|
colors = _ref.colors,
|
|
@@ -22,4 +22,7 @@ function generator(_ref) {
|
|
|
22
22
|
timerRightPadding: spacing.xxSmall,
|
|
23
23
|
timeRemainingLabelFontSize: typography.fontSizeXSmall
|
|
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
|
});
|
|
@@ -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,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.1-rc.
|
|
3
|
+
"version": "20.9.1-rc.2+8bde7436e",
|
|
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": "20.9.1-rc.
|
|
48
|
-
"@instructure/quiz-i18n": "20.9.1-rc.
|
|
49
|
-
"@instructure/quiz-interactions": "20.9.1-rc.
|
|
50
|
-
"@instructure/quiz-number-input": "20.9.1-rc.
|
|
51
|
-
"@instructure/quiz-rce": "20.9.1-rc.
|
|
47
|
+
"@instructure/quiz-common": "20.9.1-rc.2+8bde7436e",
|
|
48
|
+
"@instructure/quiz-i18n": "20.9.1-rc.2+8bde7436e",
|
|
49
|
+
"@instructure/quiz-interactions": "20.9.1-rc.2+8bde7436e",
|
|
50
|
+
"@instructure/quiz-number-input": "20.9.1-rc.2+8bde7436e",
|
|
51
|
+
"@instructure/quiz-rce": "20.9.1-rc.2+8bde7436e",
|
|
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": "20.9.1-rc.
|
|
115
|
+
"instructure-validations": "20.9.1-rc.2+8bde7436e",
|
|
116
116
|
"ipaddr.js": "^1.5.4",
|
|
117
117
|
"isomorphic-fetch": "^2.2.0",
|
|
118
118
|
"isuuid": "^0.1.0",
|
|
@@ -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": "20.9.1-rc.
|
|
166
|
+
"quiz-presets": "20.9.1-rc.2+8bde7436e",
|
|
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": "8bde7436e92e7b7a7050d0383999bc8702ad9905"
|
|
183
183
|
}
|