@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
|
@@ -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;
|
|
@@ -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,35 +5,49 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
5
|
|
|
7
6
|
var _dec, _class, _class2, _temp;
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import
|
|
12
|
-
import { themeable } from '@instructure/ui-themeable';
|
|
11
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
13
12
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
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%}");
|
|
18
|
-
},
|
|
19
|
-
'DnDZone': 'cSfbM_ffKt',
|
|
20
|
-
'sidebarDnDZone': 'cSfbM_dDZW',
|
|
21
|
-
'inSidebarStimulus': 'cSfbM_baAw',
|
|
22
|
-
'wrapper': 'cSfbM_gasz',
|
|
23
|
-
'hide': 'cSfbM_bBLs'
|
|
24
|
-
};
|
|
25
|
-
import theme from "./theme.js";
|
|
26
|
-
export var DragAndDropZone = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
13
|
+
import generateStyle from "./styles.js";
|
|
14
|
+
import generateComponentTheme from "./theme.js";
|
|
15
|
+
export var DragAndDropZone = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
27
16
|
_inherits(DragAndDropZone, _Component);
|
|
28
17
|
|
|
29
18
|
var _super = _createSuper(DragAndDropZone);
|
|
30
19
|
|
|
31
20
|
function DragAndDropZone() {
|
|
21
|
+
var _this;
|
|
22
|
+
|
|
32
23
|
_classCallCheck(this, DragAndDropZone);
|
|
33
24
|
|
|
34
|
-
|
|
25
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
+
args[_key] = arguments[_key];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
30
|
+
_this.state = {
|
|
31
|
+
toRender: false
|
|
32
|
+
};
|
|
33
|
+
return _this;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
_createClass(DragAndDropZone, [{
|
|
37
|
+
key: "componentDidMount",
|
|
38
|
+
value: function componentDidMount() {
|
|
39
|
+
this.props.makeStyles({
|
|
40
|
+
toRender: this.shouldRender()
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
key: "componentDidUpdate",
|
|
45
|
+
value: function componentDidUpdate() {
|
|
46
|
+
this.props.makeStyles({
|
|
47
|
+
toRender: this.shouldRender()
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
38
51
|
key: "shouldRender",
|
|
39
52
|
value: function shouldRender() {
|
|
40
53
|
var _this$props = this.props,
|
|
@@ -69,17 +82,12 @@ export var DragAndDropZone = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
69
82
|
}, {
|
|
70
83
|
key: "render",
|
|
71
84
|
value: function render() {
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var wrapper = classnames(styles.wrapper, _defineProperty({}, styles.hide, !this.shouldRender()));
|
|
79
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
80
|
-
className: wrapper
|
|
81
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
82
|
-
className: style
|
|
85
|
+
var wrapperClass = !this.shouldRender() ? 'wrapper hide' : 'wrapper';
|
|
86
|
+
return jsx("div", {
|
|
87
|
+
className: wrapperClass,
|
|
88
|
+
css: this.props.styles.wrapper
|
|
89
|
+
}, jsx("div", {
|
|
90
|
+
css: this.props.styles.dropZoneStyle
|
|
83
91
|
}, t('Drop Question Here')));
|
|
84
92
|
}
|
|
85
93
|
}]);
|
|
@@ -93,7 +101,9 @@ export var DragAndDropZone = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
93
101
|
inSidebar: PropTypes.bool,
|
|
94
102
|
inStimulus: PropTypes.bool,
|
|
95
103
|
location: PropTypes.oneOf(['above', 'below', 'in']).isRequired,
|
|
96
|
-
sidebarOpen: PropTypes.bool
|
|
104
|
+
sidebarOpen: PropTypes.bool,
|
|
105
|
+
makeStyles: PropTypes.func,
|
|
106
|
+
styles: PropTypes.object
|
|
97
107
|
}, _class2.defaultProps = {
|
|
98
108
|
draggingAboveHalf: false,
|
|
99
109
|
draggingOver: false,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme, props, state) {
|
|
4
|
+
return {
|
|
5
|
+
dropZoneStyle: _objectSpread(_objectSpread(_objectSpread({}, !props.inSidebar && {
|
|
6
|
+
border: "".concat(componentTheme.DnDZoneBorderWidth, " dashed ").concat(componentTheme.DnDZoneBorderColor),
|
|
7
|
+
backgroundColor: componentTheme.DnDZoneBackgroundColor,
|
|
8
|
+
padding: componentTheme.DnDZonePadding,
|
|
9
|
+
display: 'flex',
|
|
10
|
+
justifyContent: 'center',
|
|
11
|
+
width: '100%'
|
|
12
|
+
}), props.inSidebar && {
|
|
13
|
+
border: "".concat(componentTheme.sidebarDnDZoneBorderWidth, " dashed ").concat(componentTheme.sidebarDnDZoneBorderColor),
|
|
14
|
+
backgroundColor: componentTheme.sidebarDnDZoneBackgroundColor,
|
|
15
|
+
padding: componentTheme.sidebarDnDZonePadding,
|
|
16
|
+
margin: componentTheme.sidebarDnDZoneMargin,
|
|
17
|
+
color: componentTheme.sidebarDnDZoneColor,
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
textAlign: 'center',
|
|
20
|
+
width: '100%',
|
|
21
|
+
'&.inSidebarStimulus': {
|
|
22
|
+
marginLeft: '10%',
|
|
23
|
+
width: '90%'
|
|
24
|
+
}
|
|
25
|
+
}), props.inSidebar && props.inStimulus && {
|
|
26
|
+
marginLeft: '10%',
|
|
27
|
+
width: '90%'
|
|
28
|
+
}),
|
|
29
|
+
wrapper: _objectSpread({
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flex: '1 0 100%',
|
|
33
|
+
width: '100%'
|
|
34
|
+
}, !state.toRender && {
|
|
35
|
+
display: 'none',
|
|
36
|
+
width: '100%'
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
colors = _ref.colors,
|
|
4
4
|
borders = _ref.borders;
|
|
@@ -15,4 +15,6 @@ export default function generator(_ref) {
|
|
|
15
15
|
sidebarDnDZoneMargin: spacing.xSmall,
|
|
16
16
|
sidebarDnDZoneColor: colors.licorice
|
|
17
17
|
};
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
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,13 +15,13 @@ 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
|
|
|
24
22
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _emotion = require("@instructure/emotion");
|
|
27
25
|
|
|
28
26
|
var _dragAndDropUtils = require("../../../../../common/components/shared/drag_and_drop/dragAndDropUtils.js");
|
|
29
27
|
|
|
@@ -33,18 +31,13 @@ var _index2 = _interopRequireDefault(require("../../../../../common/components/s
|
|
|
33
31
|
|
|
34
32
|
var _index3 = _interopRequireDefault(require("../../../../../common/components/layout/sidebar/SidebarItem/index.js"));
|
|
35
33
|
|
|
34
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
35
|
+
|
|
36
36
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
37
37
|
|
|
38
38
|
var _dec, _class, _class2, _temp;
|
|
39
39
|
|
|
40
|
-
var
|
|
41
|
-
componentId: 'beYOg',
|
|
42
|
-
template: function template(theme) {
|
|
43
|
-
return "\n\n.beYOg_cpvQ{transform:translateZ(0)}";
|
|
44
|
-
},
|
|
45
|
-
'sidebarItemWrapper': 'beYOg_cpvQ'
|
|
46
|
-
};
|
|
47
|
-
var BuildingSidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
40
|
+
var BuildingSidebarItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
48
41
|
(0, _inherits2.default)(BuildingSidebarItem, _Component);
|
|
49
42
|
|
|
50
43
|
var _super = (0, _createSuper2.default)(BuildingSidebarItem);
|
|
@@ -67,10 +60,8 @@ var BuildingSidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, st
|
|
|
67
60
|
sidebarOpen = _this$props.sidebarOpen;
|
|
68
61
|
|
|
69
62
|
if (sidebarOpen) {
|
|
70
|
-
var dragHandle =
|
|
71
|
-
|
|
72
|
-
// This wrapper div is necessary for drag and drop
|
|
73
|
-
_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
63
|
+
var dragHandle = // This wrapper div is necessary for drag and drop
|
|
64
|
+
(0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_index.default, {
|
|
74
65
|
onSidebar: true,
|
|
75
66
|
displayPosition: this.props.displayPosition,
|
|
76
67
|
quizEntry: this.props.quizEntry,
|
|
@@ -103,11 +94,11 @@ var BuildingSidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, st
|
|
|
103
94
|
draggingOver: draggingOver,
|
|
104
95
|
draggingAboveHalf: draggingAboveHalf
|
|
105
96
|
};
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
},
|
|
97
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
98
|
+
css: this.props.styles.sidebarItemWrapper
|
|
99
|
+
}, (0, _emotion.jsx)(_index2.default, Object.assign({}, propsForDnDZone, {
|
|
109
100
|
location: "above"
|
|
110
|
-
})),
|
|
101
|
+
})), (0, _emotion.jsx)(_index3.default, {
|
|
111
102
|
itemId: this.props.itemId,
|
|
112
103
|
itemBody: this.props.itemBody,
|
|
113
104
|
itemName: this.props.itemName,
|
|
@@ -116,9 +107,9 @@ var BuildingSidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, st
|
|
|
116
107
|
pointsPossible: this.props.pointsPossible,
|
|
117
108
|
quizEntry: this.props.quizEntry,
|
|
118
109
|
sidebarOpen: this.props.sidebarOpen
|
|
119
|
-
}, this.renderDragHandle()),
|
|
110
|
+
}, this.renderDragHandle()), (0, _emotion.jsx)(_index2.default, Object.assign({}, propsForDnDZone, {
|
|
120
111
|
location: "below"
|
|
121
|
-
})));
|
|
112
|
+
}))));
|
|
122
113
|
}
|
|
123
114
|
}, {
|
|
124
115
|
key: "render",
|
|
@@ -160,7 +151,8 @@ var BuildingSidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, st
|
|
|
160
151
|
sidebarOpen: _propTypes.default.bool.isRequired,
|
|
161
152
|
// Passed in by connect
|
|
162
153
|
draggingOver: _propTypes.default.bool.isRequired,
|
|
163
|
-
draggingAboveHalf: _propTypes.default.bool.isRequired
|
|
154
|
+
draggingAboveHalf: _propTypes.default.bool.isRequired,
|
|
155
|
+
styles: _propTypes.default.object
|
|
164
156
|
}, _class2.defaultProps = {
|
|
165
157
|
disableDraggingOverride: false,
|
|
166
158
|
inStimulus: false,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
return {
|
|
10
|
+
sidebarItemWrapper: {
|
|
11
|
+
transform: 'translate3d(0, 0, 0)'
|
|
12
|
+
/* for drag and drop preview to work */
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var _default = generateStyle;
|
|
19
|
+
exports.default = _default;
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme() {
|
|
9
9
|
return {};
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
var _default = generateComponentTheme;
|
|
13
|
+
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,13 +15,13 @@ 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
|
|
|
24
22
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _emotion = require("@instructure/emotion");
|
|
27
25
|
|
|
28
26
|
var _dragAndDropUtils = require("../../../../../common/components/shared/drag_and_drop/dragAndDropUtils.js");
|
|
29
27
|
|
|
@@ -33,18 +31,13 @@ var _index2 = _interopRequireDefault(require("../../../../../common/components/s
|
|
|
33
31
|
|
|
34
32
|
var _index3 = _interopRequireDefault(require("../../../../../common/components/layout/sidebar/Stimulus/index.js"));
|
|
35
33
|
|
|
34
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
35
|
+
|
|
36
36
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
37
37
|
|
|
38
38
|
var _dec, _class, _class2, _temp;
|
|
39
39
|
|
|
40
|
-
var
|
|
41
|
-
componentId: 'fyovm',
|
|
42
|
-
template: function template(theme) {
|
|
43
|
-
return "\n\n.fyovm_drae{transform:translateZ(0)}";
|
|
44
|
-
},
|
|
45
|
-
'sidebarStimulusWrapper': 'fyovm_drae'
|
|
46
|
-
};
|
|
47
|
-
var BuildingStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
40
|
+
var BuildingStimulus = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
48
41
|
(0, _inherits2.default)(BuildingStimulus, _Component);
|
|
49
42
|
|
|
50
43
|
var _super = (0, _createSuper2.default)(BuildingStimulus);
|
|
@@ -70,10 +63,8 @@ var BuildingStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
70
63
|
sidebarOpen = _this$props2.sidebarOpen;
|
|
71
64
|
|
|
72
65
|
if (sidebarOpen) {
|
|
73
|
-
var dragHandle =
|
|
74
|
-
|
|
75
|
-
// This wrapper div is necessary for drag and drop
|
|
76
|
-
_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
66
|
+
var dragHandle = // This wrapper div is necessary for drag and drop
|
|
67
|
+
(0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_index.default, {
|
|
77
68
|
disabled: this.shouldDisableDragHandle(),
|
|
78
69
|
displayPosition: this.props.displayPosition,
|
|
79
70
|
onSidebar: true,
|
|
@@ -94,7 +85,7 @@ var BuildingStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
94
85
|
}, {
|
|
95
86
|
key: "renderStimulus",
|
|
96
87
|
value: function renderStimulus() {
|
|
97
|
-
return
|
|
88
|
+
return (0, _emotion.jsx)(_index3.default, {
|
|
98
89
|
displayPosition: this.props.displayPosition,
|
|
99
90
|
draggingOver: this.props.draggingOver,
|
|
100
91
|
draggingAboveHalf: this.props.draggingAboveHalf,
|
|
@@ -118,15 +109,15 @@ var BuildingStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
118
109
|
draggingAboveHalf: this.props.draggingAboveHalf,
|
|
119
110
|
dropIntoEmptyStimulus: this.props.dropIntoEmptyStimulus
|
|
120
111
|
};
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
},
|
|
112
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
113
|
+
css: this.props.styles.sidebarStimulusWrapper
|
|
114
|
+
}, (0, _emotion.jsx)(_index2.default, Object.assign({}, propsForDnDZone, {
|
|
124
115
|
location: "above"
|
|
125
|
-
})), this.renderStimulus(),
|
|
116
|
+
})), this.renderStimulus(), (0, _emotion.jsx)(_index2.default, Object.assign({}, propsForDnDZone, {
|
|
126
117
|
location: "in"
|
|
127
|
-
})),
|
|
118
|
+
})), (0, _emotion.jsx)(_index2.default, Object.assign({}, propsForDnDZone, {
|
|
128
119
|
location: "below"
|
|
129
|
-
})));
|
|
120
|
+
}))));
|
|
130
121
|
}
|
|
131
122
|
}, {
|
|
132
123
|
key: "render",
|
|
@@ -168,7 +159,8 @@ var BuildingStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
168
159
|
// Passed in by connect
|
|
169
160
|
draggingAboveHalf: _propTypes.default.bool.isRequired,
|
|
170
161
|
draggingOver: _propTypes.default.bool.isRequired,
|
|
171
|
-
dropIntoEmptyStimulus: _propTypes.default.bool
|
|
162
|
+
dropIntoEmptyStimulus: _propTypes.default.bool,
|
|
163
|
+
styles: _propTypes.default.object
|
|
172
164
|
}, _class2.defaultProps = {
|
|
173
165
|
draggingAboveHalf: false,
|
|
174
166
|
dropIntoEmptyStimulus: false,
|